diff --git a/users/common/utils.nix b/users/common/utils.nix index 5595f71..0580a4c 100644 --- a/users/common/utils.nix +++ b/users/common/utils.nix @@ -6,6 +6,7 @@ fd file hexyl + ncdu neofetch rage rclone diff --git a/users/myuser/default.nix b/users/myuser/default.nix index ac5cd9b..4bfe1fe 100644 --- a/users/myuser/default.nix +++ b/users/myuser/default.nix @@ -35,33 +35,29 @@ in { # TODO numlock default on in sway and kernel console # TODO make dataset for safe/persist/ and automount it # TODO modularized based on hmConfig - environment.persistence."/state".users.${myuser}.directories = - mkUserDirs - [ - ".cache/fontconfig" - ".cache/mozilla" - ".cache/nix" # nix eval cache - ".cache/nix-index" - ".cache/nvidia" # GLCache - ".cache/nvim" - ".local/share/nvim" - ".local/state/direnv" - ".local/state/nix" - ".local/state/nvim" - ".local/state/wireplumber" - "Downloads" - ]; + environment.persistence."/state".users.${myuser}.directories = mkUserDirs [ + ".cache/fontconfig" + ".cache/mozilla" + ".cache/nix" # nix eval cache + ".cache/nix-index" + ".cache/nvidia" # GLCache + ".cache/nvim" + ".local/share/nvim" + ".local/state/direnv" + ".local/state/nix" + ".local/state/nvim" + ".local/state/wireplumber" + "Downloads" + ]; - environment.persistence."/persist".users.${myuser}.directories = - mkUserDirs - [ - ".mozilla" - ".config/discord" # Bad Discord! BAD! Saves state in ,config tststs - ".config/Signal" # L take, electron. - ".local/share/atuin" - ".local/share/nix" # Repl history - "projects" - ]; + environment.persistence."/persist".users.${myuser}.directories = mkUserDirs [ + ".mozilla" + ".config/discord" # Bad Discord! BAD! Saves state in ,config tststs + ".config/Signal" # L take, electron. + ".local/share/atuin" + ".local/share/nix" # Repl history + "projects" + ]; home-manager.users.${myuser} = { imports = [ diff --git a/users/myuser/graphical/default.nix b/users/myuser/graphical/default.nix index 553df7e..37091e0 100644 --- a/users/myuser/graphical/default.nix +++ b/users/myuser/graphical/default.nix @@ -1,32 +1,10 @@ {pkgs, ...}: { imports = [ ./kitty.nix + ./sway.nix ]; - wayland.windowManager.sway = { - enable = true; - config = rec { - modifier = "Mod4"; - terminal = "kitty"; - - focus.followMouse = false; - input = { - "*" = { - xkb_layout = "de"; - repeat_delay = "235"; - repeat_rate = "60"; - }; - }; - }; - }; - home.packages = with pkgs; [ - xdg-utils - wdisplays - wl-clipboard - pinentry - xdragon - discord firefox thunderbird @@ -35,26 +13,12 @@ zathura feh ]; - home.sessionVariables.NIXOS_OZONE_WL = 1; - home.sessionVariables.WLR_NO_HARDWARE_CURSORS = 1; - home.sessionVariables.WLR_RENDERER = "vulkan"; + # TODO VP9 hardware video decoding blocklisted - # TODO xdg-open - # TODO gpg orswitch to sk - # TODO mouse speed - # TODO persist tmp malte ddelete. - # TODO ncdu + # TODO gpg switch to sk + home.shellAliases = { p = "cd ~/projects"; zf = "zathura --fork"; }; - - # Needed to fix cursors in firefox under wayland, see https://github.com/NixOS/nixpkgs/issues/207339#issuecomment-1374497558 - gtk = { - enable = true; - theme = { - package = pkgs.gnome.gnome-themes-extra; - name = "Adwaita-dark"; - }; - }; } diff --git a/users/myuser/graphical/sway.nix b/users/myuser/graphical/sway.nix new file mode 100644 index 0000000..bcef00a --- /dev/null +++ b/users/myuser/graphical/sway.nix @@ -0,0 +1,104 @@ +{ + pkgs, + nixosConfig, + ... +}: { + imports = [ + ./kitty.nix + ]; + + wayland.windowManager.sway = { + enable = true; + config = + { + modifier = "Mod4"; + terminal = "kitty"; + + focus.followMouse = false; + window.titlebar = false; + input = { + "type:keyboard" = { + xkb_layout = "de"; + repeat_delay = "235"; + repeat_rate = "60"; + }; + "type:mouse" = { + accel_profile = "flat"; + pointer_accel = "0.5"; + }; + }; + assigns = { + "9" = [ + {class = "^steam_app_";} + {app_id = "^Steam$";} + {class = "^steam$";} + ]; + }; + # TODO eww -> bars = [ ]; + } + # Extra configuration based on which system we are on. It's not ideal to + # distinguish by node name here, but at least this way it can stay in the + # sway related config file. + // { + potksed = let + monitorMain = "LG Electronics 27GN950 111NTGYLB719"; + monitorLeft = "LG Electronics LG Ultra HD 0x00007F39"; + in { + output = { + # TODO "*" = { background = background; }; + ${monitorLeft} = { + mode = "3840x2160@60Hz"; + pos = "0 0"; + adaptive_sync = "enable"; + subpixel = "rgb"; + }; + ${monitorMain} = { + mode = "3840x2160@144Hz"; + pos = "3840 0"; + adaptive_sync = "enable"; + subpixel = "rgb"; + render_bit_depth = "10"; + }; + }; + workspaceOutputAssign = [ + { + workspace = "1"; + output = monitorMain; + } + { + workspace = "7"; + output = monitorLeft; + } + ]; + }; + } + .${nixosConfig.node.name} + or {}; + }; + + home.sessionVariables = { + # Let nixos electron wrappers enable wayland + NIXOS_OZONE_WL = 1; + # Cursor invisible, TODO retest with vulkan + WLR_NO_HARDWARE_CURSORS = 1; + # opengl backend flickers, also vulkan is love. + WLR_RENDERER = "vulkan"; + }; + + home.packages = with pkgs; [ + xdg-utils + wdisplays + wl-clipboard + pinentry # For yubikey + xdragon + ]; + + # Needed to fix cursors in firefox under wayland, see https://github.com/NixOS/nixpkgs/issues/207339#issuecomment-1374497558 + gtk = { + enable = true; + theme = { + package = pkgs.gnome.gnome-themes-extra; + name = "Adwaita-dark"; + }; + }; +}