diff --git a/flake.lock b/flake.lock index d61d946..7508da7 100644 --- a/flake.lock +++ b/flake.lock @@ -161,6 +161,27 @@ "type": "github" } }, + "flake-utils": { + "inputs": { + "systems": [ + "swayfx", + "systems" + ] + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -793,10 +814,60 @@ "nixos-cli": "nixos-cli", "nixpkgs": "nixpkgs_6", "noctalia": "noctalia", + "swayfx": "swayfx", "walker": "walker", "zen-browser": "zen-browser" } }, + "scenefx": { + "inputs": { + "flake-utils": [ + "swayfx", + "flake-utils" + ], + "nixpkgs": [ + "swayfx", + "nixpkgs" + ], + "systems": "systems_4" + }, + "locked": { + "lastModified": 1768403764, + "narHash": "sha256-1RVLChp1WUcjnDu30jG2DTXW0A6K3lkezEip3KTf/gE=", + "owner": "wlrfx", + "repo": "scenefx", + "rev": "05a5e7a9177de04bc398e25821c0898c2a284c9f", + "type": "github" + }, + "original": { + "owner": "wlrfx", + "repo": "scenefx", + "type": "github" + } + }, + "swayfx": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ], + "scenefx": "scenefx", + "systems": "systems_5" + }, + "locked": { + "lastModified": 1769467630, + "narHash": "sha256-SufN5nd0+BojwTpe2tPuFIXswpLGo4syG/OwBF2Glzs=", + "owner": "WillPower3309", + "repo": "swayfx", + "rev": "c4ce2331c90120fafc12ba86200591255e836caf", + "type": "github" + }, + "original": { + "owner": "WillPower3309", + "repo": "swayfx", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, @@ -857,13 +928,43 @@ "type": "github" } }, + "systems_5": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_6": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, "walker": { "inputs": { "elephant": [ "elephant" ], "nixpkgs": "nixpkgs_7", - "systems": "systems_4" + "systems": "systems_6" }, "locked": { "lastModified": 1769016454, diff --git a/flake.nix b/flake.nix index 3d2d0ae..1121187 100644 --- a/flake.nix +++ b/flake.nix @@ -23,6 +23,10 @@ url = "github:hyprwm/hyprland-plugins"; inputs.hyprland.follows = "hyprland"; }; + swayfx = { + url = "github:WillPower3309/swayfx"; + inputs.nixpkgs.follows = "nixpkgs"; + }; agenix = { url = "github:ryantm/agenix"; }; @@ -41,6 +45,7 @@ nixos-cli, zen-browser, agenix, + swayfx, ... }: let @@ -59,6 +64,17 @@ agenix.nixosModules.default ]; }; + marty-thinkpad = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./hosts/marty-thinkpad + ./configuration.nix + home-manager.nixosModules.home-manager + nixos-cli.nixosModules.nixos-cli + agenix.nixosModules.default + ]; + }; marty-pc = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs; }; diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 0000000..0f4a582 --- /dev/null +++ b/home/default.nix @@ -0,0 +1,12 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + imports = [ + ./sway.nix + ]; +} diff --git a/home/niri.nix b/home/niri.nix new file mode 100644 index 0000000..2a93853 --- /dev/null +++ b/home/niri.nix @@ -0,0 +1,22 @@ +{ + config, + pkgs, + lib, + inputs, + ... +}: + +{ + options = { + desktop = { + sway = { + enable = lib.mkEnableOption "enable sway"; + }; + }; + + }; + config = { + wayland.windowManager.niri = { + }; + }; +}; \ No newline at end of file diff --git a/home/sway.nix b/home/sway.nix new file mode 100644 index 0000000..cf6c568 --- /dev/null +++ b/home/sway.nix @@ -0,0 +1,75 @@ +{ + config, + pkgs, + lib, + inputs, + ... +}: + +{ + options = { + desktop = { + sway = { + enable = lib.mkEnableOption "enable sway"; + }; + }; + + }; + config = { + wayland.windowManager.sway = { + enable = true; + package = pkgs.swayfx; + config = { + modifier = "Mod4"; + startup = [ + { command = "elephant"; } + ]; + keybindings = + let + modifier = config.wayland.windowManager.sway.config.modifier; + in + { + "${modifier}+Return" = "exec ${config.wayland.windowManager.sway.config.terminal}"; + "${modifier}+Shift+q" = "kill"; + "${modifier}+d" = "exec walker"; + "${modifier}+o" = "exec zen"; + "${modifier}+Control+right" = "exec /home/marty/.config/sway/scripts/workspaceswitcher right"; + "${modifier}+Control+left" = "exec /home/marty/.config/sway/scripts/workspaceswitcher left"; + "${modifier}+f" = "fullscreen"; + + + "${modifier}+1" = "workspace number 1"; + "${modifier}+2" = "workspace number 2"; + "${modifier}+3" = "workspace number 3"; + "${modifier}+4" = "workspace number 4"; + "${modifier}+5" = "workspace number 5"; + "${modifier}+6" = "workspace number 6"; + "${modifier}+7" = "workspace number 7"; + "${modifier}+8" = "workspace number 8"; + "${modifier}+9" = "workspace number 9"; + "${modifier}+s" = "workspace number 0"; + + + "${modifier}+Shift+1" = "move container to workspace number 1"; + "${modifier}+Shift+2" = "move container to workspace number 2"; + "${modifier}+Shift+3" = "move container to workspace number 3"; + "${modifier}+Shift+4" = "move container to workspace number 4"; + "${modifier}+Shift+5" = "move container to workspace number 5"; + "${modifier}+Shift+6" = "move container to workspace number 6"; + "${modifier}+Shift+7" = "move container to workspace number 7"; + "${modifier}+Shift+8" = "move container to workspace number 8"; + "${modifier}+Shift+9" = "move container to workspace number 9"; + "${modifier}+Shift+s" = "move container to workspace number 0"; + }; + input = { + "*" = { + xkb_layout = "de"; + }; + }; + defaultWorkspace = "workspace number 1"; + terminal = "${pkgs.kitty}/bin/kitty"; + }; + checkConfig = false; + }; + }; +} diff --git a/hosts/marty-thinkpad/default.nix b/hosts/marty-thinkpad/default.nix index 0905ee9..f555d3f 100644 --- a/hosts/marty-thinkpad/default.nix +++ b/hosts/marty-thinkpad/default.nix @@ -28,12 +28,18 @@ imports = [ ./hardware.nix + ../../modules/desktop/niri.nix # ../../modules/server/nginx.nix ]; + desktop.niri.enable = true; + programs = { light.enable = true; }; services.flatpak.enable = true; + services.xserver.videoDrivers = [ "nvidia" ]; + hardware.nvidia.modesetting.enable = true; + hardware.nvidia.open = true; system.stateVersion = "24.11"; # Did you read the comment? } diff --git a/hosts/marty-thinkpad/home.nix b/hosts/marty-thinkpad/home.nix index 269e2af..34f7e05 100644 --- a/hosts/marty-thinkpad/home.nix +++ b/hosts/marty-thinkpad/home.nix @@ -19,7 +19,7 @@ # You should not change this value, even if you update Home Manager. If you do # want to update the value, then make sure to first check the Home Manager # release notes. - home.stateVersion = "25.11"; # Please read the comment before changing. + home.stateVersion = "24.11"; # Please read the comment before changing. # The home.packages option allows you to install Nix packages into your # environment. @@ -89,6 +89,7 @@ inputs.walker.homeManagerModules.default inputs.noctalia.homeModules.default ./../../modules + ./../../home ]; # Let Home Manager install and manage itself. diff --git a/modules/README.md b/modules/README.md new file mode 100644 index 0000000..6320a57 --- /dev/null +++ b/modules/README.md @@ -0,0 +1,7 @@ +# MODULES + +todo: +- [ ] move home-manager stuff to ../home +- [ ] add server stuff + +-> seperate home manager stuff from normal nix stuff, use home manager purely for dotfiles, use modules to install stuff \ No newline at end of file diff --git a/modules/desktop/README.md b/modules/desktop/README.md new file mode 100644 index 0000000..ef11780 --- /dev/null +++ b/modules/desktop/README.md @@ -0,0 +1,3 @@ +# HOME + +only for dotfiles, no longer installing stuff from here \ No newline at end of file diff --git a/modules/desktop/niri.nix b/modules/desktop/niri.nix new file mode 100644 index 0000000..80c92e4 --- /dev/null +++ b/modules/desktop/niri.nix @@ -0,0 +1,29 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + options = { + desktop = { + niri = { + enable = lib.mkEnableOption "enable niri"; + }; + }; + }; + config = lib.mkIf config.desktop.niri.enable { + + # Enable the gnome-keyring secrets vault. + # Will be exposed through DBus to programs willing to store secrets. + services.gnome.gnome-keyring.enable = true; + environment.systemPackages = with pkgs; [ +xwayland-satellite +niri +]; + programs.niri = { + enable = true; + }; + }; +} diff --git a/modules/desktop/sway.nix b/modules/desktop/sway.nix new file mode 100644 index 0000000..5b5384f --- /dev/null +++ b/modules/desktop/sway.nix @@ -0,0 +1,33 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + options = { + desktop = { + sway = { + enable = lib.mkEnableOption "enable sway"; + }; + }; + }; + config = lib.mkIf config.desktop.sway.enable { + environment.systemPackages = with pkgs; [ + grim # screenshot functionality + slurp # screenshot functionality + wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout + ]; + + # Enable the gnome-keyring secrets vault. + # Will be exposed through DBus to programs willing to store secrets. + services.gnome.gnome-keyring.enable = true; + + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + package = null; + }; + }; +} diff --git a/modules/terminal/kitty.nix b/modules/terminal/kitty.nix index 49a2716..0df21bf 100644 --- a/modules/terminal/kitty.nix +++ b/modules/terminal/kitty.nix @@ -62,7 +62,6 @@ inactive_text_alpha = 0.5; hide_window_decorations = "no"; - themeFile = "Catppuccin-Mocha"; # tab bar