diff --git a/flake.lock b/flake.lock index 03ac8a2..fbea851 100644 --- a/flake.lock +++ b/flake.lock @@ -20,6 +20,64 @@ "type": "github" } }, + "niri": { + "inputs": { + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable", + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1736744067, + "narHash": "sha256-GCXo4gFj51atVQBpr0I+1lHoEDhPudNBqAbAtm9R+mA=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "c4de2cecb5ff96f43366dbeb90524ad2473bcd1a", + "type": "github" + }, + "original": { + "owner": "sodiboo", + "repo": "niri-flake", + "type": "github" + } + }, + "niri-stable": { + "flake": false, + "locked": { + "lastModified": 1736614405, + "narHash": "sha256-AJ1rlgNOPb3/+DbS5hkhm21t6Oz8IgqLllwmZt0lyzk=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "e05bc269e678ecf828b96ae79c991c13b00b38a5", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "ref": "v25.01", + "repo": "niri", + "type": "github" + } + }, + "niri-unstable": { + "flake": false, + "locked": { + "lastModified": 1736740761, + "narHash": "sha256-iAn611qpe6UNhuCiKNTe+N0R/d+hyto0DqiIXIkvac0=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "0bd6df507ba7ef13e3d74545b8304e244e833a7a", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1735388221, @@ -51,12 +109,62 @@ "type": "indirect" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1736549401, + "narHash": "sha256-ibkQrMHxF/7TqAYcQE+tOnIsSEzXmMegzyBWza6uHKM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1dab772dd4a68a7bba5d9460685547ff8e17d899", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", + "niri": "niri", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs" } + }, + "xwayland-satellite-stable": { + "flake": false, + "locked": { + "lastModified": 1730166465, + "narHash": "sha256-nq7bouXQXaaPPo/E+Jbq+wNHnatD4dY8OxSrRqzvy6s=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "a713cf46cb7db84a0d1b57c3a397c610cad3cf98", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "ref": "v0.5", + "repo": "xwayland-satellite", + "type": "github" + } + }, + "xwayland-satellite-unstable": { + "flake": false, + "locked": { + "lastModified": 1736487362, + "narHash": "sha256-4kGoOA7FgK9N2mzS+TFEn41kUUNY6KwdiA/0rqlr868=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "8f55e27f63a749881c4bbfbb6b1da028342a91d1", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 3b9dc42..711dab7 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,10 @@ inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; + niri = { + url = "github:sodiboo/niri-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; @@ -10,7 +14,7 @@ nixos-hardware.url = "github:NixOS/nixos-hardware/master"; }; - outputs = { self, nixpkgs, home-manager, nixos-hardware }@attrs: + outputs = { self, nixpkgs, niri, home-manager, nixos-hardware }@attrs: let system = "x86_64-linux"; homeManagerSharedModule = { @@ -36,6 +40,82 @@ Install.WantedBy = [ "default.target" ]; }; + programs.niri.settings = { + prefer-no-csd = true; + input.keyboard.xkb = { + options = "ctrl:nocaps"; + }; + binds = with config.lib.niri.actions; { + "Alt+P".action = spawn "bemenu-run"; + "Alt+Return".action = spawn "ghostty"; + "Alt+Shift+Return".action = spawn "foot"; + "Alt+Shift+Slash".action = show-hotkey-overlay; + + "Alt+Q".action = close-window; + + "Alt+Left" .action = focus-column-left; + "Alt+Down" .action = focus-window-down; + "Alt+Up" .action = focus-window-up; + "Alt+Right" .action = focus-column-right; + "Alt+H" .action = focus-column-left; + "Alt+J" .action = focus-window-down; + "Alt+K" .action = focus-window-up; + "Alt+L" .action = focus-column-right; + + "Alt+Shift+Left" .action = move-column-left; + "Alt+Shift+Down" .action = move-window-down; + "Alt+Shift+Up" .action = move-window-up; + "Alt+Shift+Right" .action = move-column-right; + "Alt+Shift+H" .action = move-column-left; + "Alt+Shift+J" .action = move-window-down; + "Alt+Shift+K" .action = move-window-up; + "Alt+Shift+L" .action = move-column-right; + + #... + "Alt+1".action = focus-workspace 1; + "Alt+2".action = focus-workspace 2; + "Alt+3".action = focus-workspace 3; + "Alt+4".action = focus-workspace 4; + "Alt+5".action = focus-workspace 5; + "Alt+6".action = focus-workspace 6; + "Alt+7".action = focus-workspace 7; + "Alt+8".action = focus-workspace 8; + "Alt+9".action = focus-workspace 9; + "Alt+Shift+1".action = move-column-to-workspace 1; + "Alt+Shift+2".action = move-column-to-workspace 2; + "Alt+Shift+3".action = move-column-to-workspace 3; + "Alt+Shift+4".action = move-column-to-workspace 4; + "Alt+Shift+5".action = move-column-to-workspace 5; + "Alt+Shift+6".action = move-column-to-workspace 6; + "Alt+Shift+7".action = move-column-to-workspace 7; + "Alt+Shift+8".action = move-column-to-workspace 8; + "Alt+Shift+9".action = move-column-to-workspace 9; + + + "Alt+R".action = switch-preset-column-width; + "Alt+Shift+R".action = switch-preset-window-height; + "Alt+Ctrl+R".action = reset-window-height; + "Alt+F".action = maximize-column; + "Alt+Shift+F".action = fullscreen-window; + "Alt+C".action = center-column; + + "Alt+Minus".action = set-column-width "-10%"; + "Alt+Equal".action = set-column-width "+10%"; + + "Alt+Shift+Minus".action = set-window-height "-10%"; + "Alt+Shift+Equal".action = set-window-height "+10%"; + + #"Print".action = screenshot; + #"Ctrl+Print".aciton = screenshot-screen; + #"Alt+Print".action = screenshot-window; + + "Alt+Shift+E".action = quit; + "Ctrl+Alt+Delete".action = quit; + + "Alt+Shift+P".action = power-off-monitors; + }; + }; + programs.ghostty = { enable = true; settings = { @@ -334,6 +414,10 @@ services.printing.enable = true; services.printing.drivers = [ pkgs.brlaser ]; + programs.niri = { + enable = true; + package = pkgs.niri; + }; programs.sway = { enable = true; wrapperFeatures.gtk = true; @@ -429,6 +513,7 @@ specialArgs = attrs; modules = [ nixos-hardware.nixosModules.framework-13-7040-amd + niri.nixosModules.niri home-manager.nixosModules.home-manager homeManagerSharedModule ({ config, lib, pkgs, modulesPath, ... }@innerArgs: (lib.recursiveUpdate (commonConfigFunc innerArgs [ pkgs.light pkgs.gpodder pkgs.evince pkgs.wezterm pkgs.vulkan-tools pkgs.discord]) { @@ -487,6 +572,7 @@ inherit system; specialArgs = attrs; modules = [ + niri.nixosModules.niri home-manager.nixosModules.home-manager homeManagerSharedModule ({ config, lib, pkgs, modulesPath, ... }@innerArgs: (lib.recursiveUpdate (commonConfigFunc innerArgs [ pkgs.light pkgs.gpodder pkgs.evince ]) { @@ -537,6 +623,7 @@ inherit system; specialArgs = attrs; modules = [ + niri.nixosModules.niri home-manager.nixosModules.home-manager homeManagerSharedModule ({ config, lib, pkgs, modulesPath, ... }@innerArgs: (lib.recursiveUpdate (commonConfigFunc innerArgs []) { @@ -571,6 +658,7 @@ inherit system; specialArgs = attrs; modules = [ + niri.nixosModules.niri home-manager.nixosModules.home-manager homeManagerSharedModule ({ config, lib, pkgs, modulesPath, ... }@innerArgs: (lib.recursiveUpdate (commonConfigFunc innerArgs []) {