diff --git a/configuration.nix b/configuration.nix index 4b6ae41..5350758 100644 --- a/configuration.nix +++ b/configuration.nix @@ -44,15 +44,15 @@ LC_TIME = "de_DE.UTF-8"; }; - services.displayManager.defaultSession = "none+i3"; - imports = [ ./programm_configs/yubikey-gpg.nix ./printing/config.nix ] ++ (if inputs.x11mode then [ ./programm_configs/x11.nix ] - else [ ]); + else [ + ./programm_configs/wayland.nix + ]); services.gvfs.enable = true; @@ -118,6 +118,9 @@ x11mode = inputs.x11mode; }); + # enable polkit + security.polkit.enable = true; + # Allow unfree packages nixpkgs.config.allowUnfree = true; diff --git a/home.nix b/home.nix index 215daf0..6f4df62 100644 --- a/home.nix +++ b/home.nix @@ -19,17 +19,23 @@ in # release notes. home.stateVersion = "24.05"; # Please read the comment before changing. + imports = [ ./programm_configs/git.nix ./programm_configs/vscode.nix ./programm_configs/rofi.nix - ./programm_configs/picom.nix ./programm_configs/zsh.nix ./programm_configs/gnome.nix ./programm_configs/autorandr.nix ./programm_configs/polybar.nix ./programm_configs/redshift.nix - ] ++ (if x11mode then [ ./programm_configs/i3.nix ] else [ ]); + ] ++ (if x11mode then [ + ./programm_configs/i3.nix + ./programm_configs/picom.nix + ] else [ + ./programm_configs/sway.nix + ./programm_configs/waybar.nix + ]); # The home.packages option allows you to install Nix packages into your # environment. @@ -42,7 +48,6 @@ in firefox tex jetbrains.idea-ultimate - arandr thunderbird signal-desktop nextcloud-client @@ -62,7 +67,7 @@ in samba unzip direnv - ]; + ] ++ (if x11mode then [ arandr ] else [ wdisplays ]); fonts.fontconfig.enable = true; diff --git a/programm_configs/sway.nix b/programm_configs/sway.nix new file mode 100644 index 0000000..a8b87d9 --- /dev/null +++ b/programm_configs/sway.nix @@ -0,0 +1,121 @@ +{ config, lib, pkgs, ... }: +{ + wayland.windowManager.sway = let mod = "Mod4"; in { + enable = true; + systemd = { + enable = true; + }; + config = rec { + fonts = { names = [ "DejaVu Sans Mono" "FontAwesome 6" ]; }; + terminal = "alacritty"; + bars = [ ]; + input = { + "*" = { + xkb_layout = "de"; + }; + }; + menu = "${pkgs.rofi}/bin/rofi -show combi -config ~/.config/rofi/config.rasi"; + modifier = mod; # Super key + gaps = { + inner = 10; + outer = 0; + }; + + keybindings = { + # screenlock + "${mod}+shift+l" = "exec --no-startup-id ~/.config/i3/lock.sh"; + + # audio control fluff + "XF86AudioRaiseVolume" = "exec --no-startup-id wpctl set-volume @DEFAULT_SINK@ 5%+ && $refresh_i3status"; + "XF86AudioLowerVolume" = "exec --no-startup-id wpctl set-volume @DEFAULT_SINK@ 5%- && $refresh_i3status"; + "XF86AudioMute" = "exec --no-startup-id wpctl set-mute @DEFAULT_SINK@ toggle && $refresh_i3status"; + + # Terminal + "${mod}+Return" = "exec alacritty"; + "${mod}+Shift+q" = "kill"; + "${mod}+d" = "exec ${pkgs.rofi}/bin/rofi -show combi -config ~/.config/rofi/config.rasi"; + + "${mod}+Left" = "focus left"; + "${mod}+Down" = "focus down"; + "${mod}+Up" = "focus up"; + "${mod}+Right" = "focus right"; + + "${mod}+Shift+Left" = "move left"; + "${mod}+Shift+Down" = "move down"; + "${mod}+Shift+Up" = "move up"; + "${mod}+Shift+Right" = "move right"; + + "${mod}+h" = "splith"; + "${mod}+v" = "splitv"; + "${mod}+f" = "fullscreen toggle"; + + "${mod}+s" = "layout stacking"; + "${mod}+w" = "layout tabbed"; + "${mod}+e" = "layout toggle split"; + + "${mod}+Shift+space" = "floating toggle"; + "${mod}+space" = "focus mode_toggle"; + + "${mod}+1" = "workspace number 1"; + "${mod}+2" = "workspace number 2"; + "${mod}+3" = "workspace number 3"; + "${mod}+4" = "workspace number 4"; + "${mod}+5" = "workspace number 5"; + "${mod}+6" = "workspace number 6"; + "${mod}+7" = "workspace number 7"; + "${mod}+8" = "workspace number 8"; + "${mod}+9" = "workspace number 9"; + "${mod}+0" = "workspace number 10"; + + "${mod}+Shift+1" = + "move container to workspace number 1"; + "${mod}+Shift+2" = + "move container to workspace number 2"; + "${mod}+Shift+3" = + "move container to workspace number 3"; + "${mod}+Shift+4" = + "move container to workspace number 4"; + "${mod}+Shift+5" = + "move container to workspace number 5"; + "${mod}+Shift+6" = + "move container to workspace number 6"; + "${mod}+Shift+7" = + "move container to workspace number 7"; + "${mod}+Shift+8" = + "move container to workspace number 8"; + "${mod}+Shift+9" = + "move container to workspace number 9"; + "${mod}+Shift+0" = + "move container to workspace number 10"; + + "${mod}+Shift+r" = "reload"; + "${mod}+Shift+e" = + "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; + + "${mod}+r" = "mode resize"; + }; + startup = [ + { + command = "systemctl --user restart waybar"; + always = true; + } + { + command = "nextcloud"; + always = true; + } + { + command = "systemctl --user restart redshift"; + always = true; + } + { + command = "systemctl --user restart xfce4-notifyd.service"; + always = true; + } + { + command = "blueman-applet"; + always = true; + } + ]; + }; + }; +} diff --git a/programm_configs/waybar.nix b/programm_configs/waybar.nix new file mode 100644 index 0000000..d9c4ef7 --- /dev/null +++ b/programm_configs/waybar.nix @@ -0,0 +1,24 @@ +{ pkgs, ... }: +let + colors = { + background = "#222"; + background-alt = "#444"; + foreground = "#dfdfdf"; + foreground-alt = "#555"; + primary = "#ffb52a"; + secondary = "#e60053"; + alert = "#bd2c40"; + accent = "#ffbb00"; + }; +in +{ + programs.waybar = { + enable = true; + systemd = { + enable = true; + }; + settings = [ + + ]; + }; +} diff --git a/programm_configs/wayland.nix b/programm_configs/wayland.nix new file mode 100644 index 0000000..c47d23d --- /dev/null +++ b/programm_configs/wayland.nix @@ -0,0 +1,27 @@ +{ config, pkgs, ... }: +let + swayconf = '' + input * { + xkb_layout "de" + } + output eDP-2 mode 3840x2160 + exec "regreet; swaymsg exit" + include /etc/sway/config.d/* + ''; +in +{ + # greeter for wayland + hardware.opengl.enable = true; + + services.greetd.enable = true; + + programs.regreet = { + enable = true; + settings = { + default_session = { + command = "${pkgs.sway}/bin/sway --config ${swayconf}"; + }; + }; + }; + +} diff --git a/programm_configs/x11.nix b/programm_configs/x11.nix index 14433a2..228c680 100644 --- a/programm_configs/x11.nix +++ b/programm_configs/x11.nix @@ -1,5 +1,6 @@ { config, pkgs, ... }: { + services.displayManager.defaultSession = "none+i3"; services.xserver = { xkb.layout = "de"; xkb.variant = "";