From bac7236d923631a31fdea40a63d19676ae63667e Mon Sep 17 00:00:00 2001 From: teesh3rt Date: Sun, 1 Feb 2026 15:30:14 +0200 Subject: [PATCH] feat: add niri, the scrolling wc! --- flake.lock | 145 ++++++++++++++++++- flake.nix | 7 + modules/desktop/{ => environments}/gnome.nix | 0 modules/desktop/environments/niri.nix | 90 ++++++++++++ modules/desktop/noctalia.nix | 53 +++++++ 5 files changed, 294 insertions(+), 1 deletion(-) rename modules/desktop/{ => environments}/gnome.nix (100%) create mode 100644 modules/desktop/environments/niri.nix create mode 100644 modules/desktop/noctalia.nix diff --git a/flake.lock b/flake.lock index 860f58b..07eedd4 100644 --- a/flake.lock +++ b/flake.lock @@ -255,6 +255,62 @@ "type": "github" } }, + "niri-flake": { + "inputs": { + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": "nixpkgs_2", + "nixpkgs-stable": "nixpkgs-stable", + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1769714858, + "narHash": "sha256-IHHAKi8yMonZZmVHUQxew1V9UfLBG8Um9PLbNPx3OA4=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "dfbb02586582d5332d0c06653583b9d743bce081", + "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": 1769577126, + "narHash": "sha256-v9vz9Rj4MGwPuhGELdvpRKl2HH+xvkgat6VwL0L86Fg=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "f30db163b5748e8cf95c05aba77d0d3736f40543", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1752480373, @@ -271,7 +327,39 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1769598131, + "narHash": "sha256-e7VO/kGLgRMbWtpBqdWl0uFg8Y2XWFMdz0uUJvlML8o=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fa83fd837f3098e3e678e6cf017b2b36102c7211", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { + "locked": { + "lastModified": 1769461804, + "narHash": "sha256-msG8SU5WsBUfVVa/9RPLaymvi5bI8edTavbIq3vRlhI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "bfc1b8a4574108ceef22f02bafcf6611380c100d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1769598131, "narHash": "sha256-e7VO/kGLgRMbWtpBqdWl0uFg8Y2XWFMdz0uUJvlML8o=", @@ -287,6 +375,26 @@ "type": "github" } }, + "noctalia": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1769941423, + "narHash": "sha256-0XUE2RBowHku+bsthHkE+GUZRcCqHGMYOnBCMa+AdPo=", + "owner": "noctalia-dev", + "repo": "noctalia-shell", + "rev": "7fef62741591053818ee0b94cf45f64967ce5bbe", + "type": "github" + }, + "original": { + "owner": "noctalia-dev", + "repo": "noctalia-shell", + "type": "github" + } + }, "nur": { "inputs": { "flake-parts": [ @@ -319,7 +427,9 @@ "home-manager": "home-manager", "import-tree": "import-tree", "lazyvim": "lazyvim", - "nixpkgs": "nixpkgs_2", + "niri-flake": "niri-flake", + "nixpkgs": "nixpkgs_3", + "noctalia": "noctalia", "stylix": "stylix" } }, @@ -468,6 +578,39 @@ "repo": "base16-zed", "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": 1769713942, + "narHash": "sha256-0BtCSO2qzYK/akRDsERqRVLknCYD3FYErc+szreSHUo=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "37ec78ee26e158b71f42e113e0e7dd9d5eb6bdb0", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 8b46fae..8a2735c 100644 --- a/flake.nix +++ b/flake.nix @@ -23,6 +23,13 @@ url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs.nixpkgs.follows = "nixpkgs"; }; + + niri-flake.url = "github:sodiboo/niri-flake"; + + noctalia = { + url = "github:noctalia-dev/noctalia-shell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = inputs@{ flake-parts, ... }: diff --git a/modules/desktop/gnome.nix b/modules/desktop/environments/gnome.nix similarity index 100% rename from modules/desktop/gnome.nix rename to modules/desktop/environments/gnome.nix diff --git a/modules/desktop/environments/niri.nix b/modules/desktop/environments/niri.nix new file mode 100644 index 0000000..a2d7027 --- /dev/null +++ b/modules/desktop/environments/niri.nix @@ -0,0 +1,90 @@ +{ inputs, ... }: + +{ + flake.modules.nixos.desktop = { pkgs, ... }: let + niri-unstable = inputs.niri-flake.packages.${pkgs.stdenv.hostPlatform.system}.niri-unstable; + in { + imports = [ + inputs.niri-flake.nixosModules.niri + ]; + + programs.niri.enable = true; + programs.niri.package = niri-unstable; + environment.systemPackages = with pkgs; [ + wl-clipboard + wayland-utils + ]; + }; + + flake.modules.homeManager.desktop = { pkgs, lib, ... }: let + noctalia-pkg = inputs.noctalia.packages.${pkgs.stdenv.hostPlatform.system}.default; + noctalia-shell = "${noctalia-pkg}/bin/noctalia-shell"; + ghostty = "${pkgs.ghostty}/bin/ghostty"; + playerctl = "${pkgs.playerctl}/bin/playerctl"; + noctalia = cmd: [ noctalia-shell "ipc" "call" ] ++ (pkgs.lib.splitString " " cmd); + xws-unstable = inputs.niri-flake.packages.${pkgs.stdenv.hostPlatform.system}.xwayland-satellite-unstable; + in { + programs.niri.settings.xwayland-satellite.enable = true; + programs.niri.settings.xwayland-satellite.path = lib.getExe xws-unstable; + programs.niri.settings = { + environment."NIXOS_OZONE_WL" = "1"; + prefer-no-csd = true; + input.keyboard.numlock = true; + binds = { + "Mod+Shift+Q".action.quit.skip-confirmation = true; + + "Mod+Return".action.spawn = ghostty; + "Mod+D".action.spawn = noctalia "launcher toggle"; + "Mod+L".action.spawn = noctalia "lockScreen lock"; + + "XF86AudioLowerVolume".action.spawn = noctalia "volume decrease"; + "XF86AudioRaiseVolume".action.spawn = noctalia "volume increase"; + "XF86AudioMute".action.spawn = noctalia "volume muteOutput"; + + "XF86AudioPlay".action.spawn-sh = "${playerctl} play-pause"; + "XF86AudioStop".action.spawn-sh = "${playerctl} stop"; + "XF86AudioPrev".action.spawn-sh = "${playerctl} previous"; + "XF86AudioNext".action.spawn-sh = "${playerctl} next"; + + "Mod+Q".action.close-window = []; + + "Mod+Left".action.focus-column-left = []; + "Mod+Down".action.focus-workspace-down = []; + "Mod+Up".action.focus-workspace-up = []; + "Mod+Right".action.focus-column-right = []; + + "Mod+Ctrl+Down".action.move-window-down = []; + "Mod+Ctrl+Up".action.move-window-up = []; + + "Mod+Shift+Left".action.move-column-left = []; + "Mod+Shift+Down".action.move-column-to-workspace-down = []; + "Mod+Shift+Up".action.move-column-to-workspace-up = []; + "Mod+Shift+Right".action.move-column-right = []; + + "Mod+BracketLeft".action.consume-or-expel-window-left = []; + "Mod+BracketRight".action.consume-or-expel-window-right = []; + + "Mod+Comma".action.consume-window-into-column = []; + "Mod+Period".action.expel-window-from-column = []; + + "Mod+F".action.maximize-column = []; + "Mod+Shift+F".action.fullscreen-window = []; + + "Mod+C".action.center-column = []; + "Mod+Ctrl+C".action.center-visible-columns = []; + + "Mod+Minus".action.set-column-width = "-10%"; + "Mod+Equal".action.set-column-width = "+10%"; + + "Mod+Shift+Minus".action.set-window-height = "-10%"; + "Mod+Shift+Equal".action.set-window-height = "+10%"; + + "Mod+O".action.toggle-overview = []; + }; + spawn-at-startup = [ + { command = [ noctalia-shell ]; } + ]; + hotkey-overlay.skip-at-startup = true; + }; + }; +} diff --git a/modules/desktop/noctalia.nix b/modules/desktop/noctalia.nix new file mode 100644 index 0000000..b6142e1 --- /dev/null +++ b/modules/desktop/noctalia.nix @@ -0,0 +1,53 @@ +{ config, inputs, ... }: + +{ + flake.modules.nixos.desktop = { pkgs, ... }: { + environment.systemPackages = [ + inputs.noctalia.packages.${pkgs.stdenv.hostPlatform.system}.default + ]; + }; + + flake.modules.homeManager.desktop = { + imports = [ + inputs.noctalia.homeModules.default + ]; + + programs.noctalia-shell = { + enable = true; + settings = { + location = { + monthBeforeDay = false; + name = "Tel Aviv, Israel"; + }; + bar = { + density = "compact"; + position = "bottom"; + widgets = { + left = [ + { id = "ControlCenter"; useDistroLogo = true; } + { id = "Network"; } + { id = "Bluetooth"; } + ]; + center = [ + { id = "Workspace"; hideUnoccupied = true; labelMode = "none"; } + ]; + right = [ + { + id = "Battery"; + alwaysShowPercentage = true; + warningThreshold = 20; + } + { + id = "Clock"; + formatHorizontal = "HH:mm"; + formatVertical = "HH mm"; + useMonospacedFont = true; + usePrimaryColor = true; + } + ]; + }; + }; + }; + }; + }; +}