From 88995ff8f567f913b184a0ff042d10cb9128625d Mon Sep 17 00:00:00 2001 From: Doloro1978 Date: Sun, 25 Jan 2026 12:12:19 +0000 Subject: [PATCH] added: niri --- flake.lock | 180 ++++++++++++++++++++++++++++++++------ flake.nix | 1 + hosts/doloro/home.nix | 1 + hosts/doloro/nixos.nix | 4 + modules/hyprland/home.nix | 42 --------- modules/niri/default.nix | 4 + modules/niri/home.nix | 158 +++++++++++++++++++++++++++++++++ modules/niri/nixos.nix | 20 +++++ 8 files changed, 339 insertions(+), 71 deletions(-) create mode 100644 modules/niri/default.nix create mode 100644 modules/niri/home.nix create mode 100644 modules/niri/nixos.nix diff --git a/flake.lock b/flake.lock index 84e69bf..7daf12b 100644 --- a/flake.lock +++ b/flake.lock @@ -876,6 +876,62 @@ "url": "https://git.scug.io/nikkuss/pkgs" } }, + "niri-flake": { + "inputs": { + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": "nixpkgs_6", + "nixpkgs-stable": "nixpkgs-stable", + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1769323919, + "narHash": "sha256-sp9gOHOtXjVzQVv7+xlfLFicK6R3OVkwH90Kb28JsNw=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "e62a66d8a81bc0c23e86c36ed16e733b38ca2d5d", + "type": "github" + }, + "original": { + "owner": "sodiboo", + "repo": "niri-flake", + "type": "github" + } + }, + "niri-stable": { + "flake": false, + "locked": { + "lastModified": 1756556321, + "narHash": "sha256-RLD89dfjN0RVO86C/Mot0T7aduCygPGaYbog566F0Qo=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "01be0e65f4eb91a9cd624ac0b76aaeab765c7294", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "ref": "v25.08", + "repo": "niri", + "type": "github" + } + }, + "niri-unstable": { + "flake": false, + "locked": { + "lastModified": 1768678265, + "narHash": "sha256-Ub8eed4DsfIDWyg30xEe+8bSxL/z5Af/gCjmvJ0V/Hs=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "d7184a04b904e07113f4623610775ae78d32394c", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, "nix-meow": { "locked": { "lastModified": 1769024298, @@ -894,7 +950,7 @@ }, "nix-warez": { "inputs": { - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_7" }, "locked": { "dir": "blender", @@ -943,7 +999,7 @@ "argononed": "argononed", "flake-compat": "flake-compat_2", "nixos-images": "nixos-images", - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_8" }, "locked": { "lastModified": 1768599442, @@ -963,7 +1019,7 @@ "nixos-wsl": { "inputs": { "flake-compat": "flake-compat_3", - "nixpkgs": "nixpkgs_8" + "nixpkgs": "nixpkgs_9" }, "locked": { "lastModified": 1768404695, @@ -1009,7 +1065,39 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1769089682, + "narHash": "sha256-9yA/LIuAVQq0lXelrZPjLuLVuZdm03p8tfmHhnDIkms=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "078d69f03934859a181e81ba987c2bb033eebfc5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_10": { + "locked": { + "lastModified": 1768886240, + "narHash": "sha256-C2TjvwYZ2VDxYWeqvvJ5XPPp6U7H66zeJlRaErJKoEM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "80e4adbcf8992d3fd27ad4964fbb84907f9478b0", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_11": { "locked": { "lastModified": 1762977756, "narHash": "sha256-4PqRErxfe+2toFJFgcRKZ0UI9NSIOJa+7RXVtBhy4KE=", @@ -1025,7 +1113,7 @@ "type": "github" } }, - "nixpkgs_11": { + "nixpkgs_12": { "locked": { "lastModified": 1736061677, "narHash": "sha256-DjkQPnkAfd7eB522PwnkGhOMuT9QVCZspDpJJYyOj60=", @@ -1041,7 +1129,7 @@ "type": "github" } }, - "nixpkgs_12": { + "nixpkgs_13": { "locked": { "lastModified": 1765472234, "narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=", @@ -1057,7 +1145,7 @@ "type": "github" } }, - "nixpkgs_13": { + "nixpkgs_14": { "locked": { "lastModified": 1768564909, "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=", @@ -1138,6 +1226,22 @@ } }, "nixpkgs_6": { + "locked": { + "lastModified": 1769170682, + "narHash": "sha256-oMmN1lVQU0F0W2k6OI3bgdzp2YOHWYUAw79qzDSjenU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c5296fdd05cfa2c187990dd909864da9658df755", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_7": { "locked": { "lastModified": 1733808091, "narHash": "sha256-KWwINTQelKOoQgrXftxoqxmKFZb9pLVfnRvK270nkVk=", @@ -1152,7 +1256,7 @@ "type": "indirect" } }, - "nixpkgs_7": { + "nixpkgs_8": { "locked": { "lastModified": 1768599367, "narHash": "sha256-Wi4Wv7ltAAj7Ik8PGJkpUmpjO+K4eRZsWAEYrDd37YA=", @@ -1168,7 +1272,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { "lastModified": 1765472234, "narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=", @@ -1184,22 +1288,6 @@ "type": "github" } }, - "nixpkgs_9": { - "locked": { - "lastModified": 1768886240, - "narHash": "sha256-C2TjvwYZ2VDxYWeqvvJ5XPPp6U7H66zeJlRaErJKoEM=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "80e4adbcf8992d3fd27ad4964fbb84907f9478b0", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixvim": { "inputs": { "flake-parts": "flake-parts_2", @@ -1272,7 +1360,7 @@ }, "protonhax": { "inputs": { - "nixpkgs": "nixpkgs_10" + "nixpkgs": "nixpkgs_11" }, "locked": { "lastModified": 1763234812, @@ -1312,7 +1400,7 @@ "inputs": { "libcamera-src": "libcamera-src", "libpisp-src": "libpisp-src", - "nixpkgs": "nixpkgs_11", + "nixpkgs": "nixpkgs_12", "rpi-bluez-firmware-src": "rpi-bluez-firmware-src", "rpi-firmware-nonfree-src": "rpi-firmware-nonfree-src", "rpi-firmware-src": "rpi-firmware-src", @@ -1345,11 +1433,12 @@ "hytale-launcher": "hytale-launcher", "neovim-nightly-overlay": "neovim-nightly-overlay", "nikkuss-pkgs": "nikkuss-pkgs", + "niri-flake": "niri-flake", "nix-meow": "nix-meow", "nix-warez": "nix-warez", "nixos-raspberrypi": "nixos-raspberrypi", "nixos-wsl": "nixos-wsl", - "nixpkgs": "nixpkgs_9", + "nixpkgs": "nixpkgs_10", "nixpkgs-gamescope": "nixpkgs-gamescope", "nixvim": "nixvim", "protonhax": "protonhax", @@ -1502,7 +1591,7 @@ "inputs": { "crane": "crane", "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_12" + "nixpkgs": "nixpkgs_13" }, "locked": { "lastModified": 1765636609, @@ -1540,7 +1629,7 @@ }, "spicetify-nix": { "inputs": { - "nixpkgs": "nixpkgs_13", + "nixpkgs": "nixpkgs_14", "systems": "systems_7" }, "locked": { @@ -1851,6 +1940,39 @@ "type": "github" } }, + "xwayland-satellite-stable": { + "flake": false, + "locked": { + "lastModified": 1755491097, + "narHash": "sha256-m+9tUfsmBeF2Gn4HWa6vSITZ4Gz1eA1F5Kh62B0N4oE=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "388d291e82ffbc73be18169d39470f340707edaa", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "ref": "v0.7", + "repo": "xwayland-satellite", + "type": "github" + } + }, + "xwayland-satellite-unstable": { + "flake": false, + "locked": { + "lastModified": 1769279212, + "narHash": "sha256-LAd6DYp6bbnQqtzMm62BE/0IMy67A4CgyYVi4xvyD6s=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "3af3e3ab78d0eb96fb9b5161693811e050b90991", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" + } + }, "zen-browser": { "inputs": { "home-manager": [ diff --git a/flake.nix b/flake.nix index afa17f8..c0ecb73 100644 --- a/flake.nix +++ b/flake.nix @@ -66,6 +66,7 @@ font-patcher.url = "github:Doloro1978/nix-nerd-fonts-patcher"; nixos-raspberrypi.url = "github:nvmd/nixos-raspberrypi/develop"; raspberry-pi-nix.url = "github:nix-community/raspberry-pi-nix"; + niri-flake.url = "github:sodiboo/niri-flake"; }; outputs = inputs@{ diff --git a/hosts/doloro/home.nix b/hosts/doloro/home.nix index 9df25f7..2dad983 100644 --- a/hosts/doloro/home.nix +++ b/hosts/doloro/home.nix @@ -12,6 +12,7 @@ enable = true; suspend-on-hibernate = true; }; + niri.enable = false; quickshell.enable = true; # chromium.enable = true; wivrn.enable = true; diff --git a/hosts/doloro/nixos.nix b/hosts/doloro/nixos.nix index 6ade029..2c2c31b 100644 --- a/hosts/doloro/nixos.nix +++ b/hosts/doloro/nixos.nix @@ -23,6 +23,7 @@ in stylix.enable = true; steam.enable = true; Hyprland.enable = true; + niri.enable = false; wivrn.enable = true; remoteBuild.become-remote-builder = true; fonts.enable = true; @@ -45,11 +46,13 @@ in "https://cache.nixos.org/" "https://attic.scug.io/pkgs" "https://cache.nixos-cuda.org" + "https://niri.cachix.org" ]; trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "pkgs:+sRbfiZMMX5R3PuAPtIRz/emowDoGZNpozibrnrAvuc=" "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" + "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964=" ]; experimental-features = [ "flakes" @@ -248,6 +251,7 @@ in extraGroups = [ "wheel" "dialout" + "networkmanager" ]; # Enable ‘sudo’ for the user. packages = with pkgs; [ tree diff --git a/modules/hyprland/home.nix b/modules/hyprland/home.nix index c326e42..16722c7 100644 --- a/modules/hyprland/home.nix +++ b/modules/hyprland/home.nix @@ -45,48 +45,6 @@ in hyprlock = { enable = true; }; - wlogout = { - enable = true; - layout = [ - { - "label" = "lock"; - "action" = "hyprlock"; - "text" = "Lock"; - "keybind" = "l"; - } - { - "label" = "hibernate"; - "action" = "systemctl hibernate"; - "text" = "Hibernate"; - "keybind" = "h"; - } - { - "label" = "logout"; - "action" = "loginctl terminate-user $USER"; - "text" = "Logout"; - "keybind" = "e"; - } - { - # TODO add hypr shutdown - "label" = "shutdown"; - "action" = "systemctl poweroff"; - "text" = "Shutdown"; - "keybind" = "s"; - } - { - "label" = "suspend"; - "action" = "systemctl suspend"; - "text" = "Suspend"; - "keybind" = "u"; - } - { - "label" = "reboot"; - "action" = "systemctl reboot"; - "text" = "Reboot"; - "keybind" = "r"; - } - ]; - }; }; systemd.user.services."hyprland_suspend" = lib.mkIf cfg.suspend-on-hibernate { Unit = { diff --git a/modules/niri/default.nix b/modules/niri/default.nix new file mode 100644 index 0000000..1bc3bb6 --- /dev/null +++ b/modules/niri/default.nix @@ -0,0 +1,4 @@ +_: { + nixos = ./nixos.nix; + home = ./home.nix; +} diff --git a/modules/niri/home.nix b/modules/niri/home.nix new file mode 100644 index 0000000..1b322ad --- /dev/null +++ b/modules/niri/home.nix @@ -0,0 +1,158 @@ +{ + config, + lib, + inputs, + pkgs, + home, + system, + ... +}: +let + cfg = config.modules.niri; +in +{ + imports = [ inputs.niri-flake.homeModules.niri ]; + options.modules.niri = { + enable = lib.mkEnableOption "niri configuration module"; + }; + config = lib.mkIf cfg.enable { + # nixpkgs.overlays = [ inputs.niri-flake.overlays.niri ]; + gtk.enable = lib.mkForce false; + home.packages = with pkgs; [ kickoff ]; + programs = { + niri = { + enable = true; + # package = pkgs.niri-unstable; + settings = { + input = { + keyboard = { + xkb = { + layout = "gb"; + }; + numlock = true; + }; + }; + outputs = { + DP-3 = { + # Philips Consumer Electronics Company PHL 272E1GZ UK02101011104 + mode = { + width = 1920; + height = 1080; + refresh = 165.0; + }; + focus-at-startup = true; + variable-refresh-rate = true; + }; + HDMI-A-1 = { + position = { + x = -1920; + y = 0; + }; + scale = 1; + }; + }; + binds = { + # Navigation + "Mod+Shift+WheelScrollDown" = { + hotkey-overlay.title = "Workspace Down"; + cooldown-ms = 150; + action.focus-workspace-down = [ ]; + }; + "Mod+Shift+WheelScrollUp" = { + hotkey-overlay.title = "Workspace Up"; + cooldown-ms = 150; + action.focus-workspace-up = [ ]; + }; + "Mod+WheelScrollUp" = { + hotkey-overlay.title = "Workspace Left"; + action.focus-column-right = [ ]; + }; + "Mod+WheelScrollDown" = { + hotkey-overlay.title = "Workspace Right"; + action.focus-column-left = [ ]; + }; + "Super+Tab" = { + hotkey-overlay.title = "Overview"; + action.toggle-overview = [ ]; + }; + # -- + # Utility + "Super+S" = { + action.screenshot = [ ]; + }; + "Super+C" = { + action.close-window = [ ]; + }; + "Super+L" = { + action.spawn = "wlogout"; + }; + # Program Spawning + "Mod+T".action.spawn = "helium"; + "Mod+R".action.spawn = "kickoff"; + "Mod+Q".action.spawn = "kitty"; + # -- + }; + window-rules = [ + { + matches = [ ]; + geometry-corner-radius = { + bottom-left = 3.0; + bottom-right = 3.0; + top-left = 3.0; + top-right = 3.0; + }; + clip-to-geometry = true; + draw-border-with-background = false; + focus-ring.width = 2; + } + ]; + xwayland-satellite = { + enable = true; + }; + }; + }; + wlogout = { + enable = true; + layout = [ + { + "label" = "lock"; + "action" = "hyprlock"; + "text" = "Lock"; + "keybind" = "l"; + } + { + "label" = "hibernate"; + "action" = "systemctl hibernate"; + "text" = "Hibernate"; + "keybind" = "h"; + } + { + "label" = "logout"; + "action" = "loginctl terminate-user $USER"; + "text" = "Logout"; + "keybind" = "e"; + } + { + # TODO add hypr shutdown + "label" = "shutdown"; + "action" = "systemctl poweroff"; + "text" = "Shutdown"; + "keybind" = "s"; + } + { + "label" = "suspend"; + "action" = "systemctl suspend"; + "text" = "Suspend"; + "keybind" = "u"; + } + { + "label" = "reboot"; + "action" = "systemctl reboot"; + "text" = "Reboot"; + "keybind" = "r"; + } + ]; + }; + }; + }; +} diff --git a/modules/niri/nixos.nix b/modules/niri/nixos.nix new file mode 100644 index 0000000..446bc81 --- /dev/null +++ b/modules/niri/nixos.nix @@ -0,0 +1,20 @@ +{ + config, + lib, + inputs, + pkgs, + home, + system, + ... +}: +let + cfg = config.modules.niri; +in +{ + imports = [ inputs.niri-flake.nixosModules.niri ]; + options.modules.niri = { + enable = lib.mkEnableOption "niri configuration module"; + }; + config = lib.mkIf cfg.enable { + }; +}