From 42233d6439663f073d745ff1a0065d2e9a0d2912 Mon Sep 17 00:00:00 2001 From: Superredstone Date: Sat, 25 Apr 2026 20:58:14 +0200 Subject: [PATCH] feat(de): add niri --- flake.lock | 82 ++++++++++++++++++++++++++++++++++ flake.nix | 8 +++- lib/mksystem.nix | 2 + modules/nix-config/caches.nix | 2 + modules/nix-config/de.nix | 40 ++++++++++++++--- modules/nix-config/default.nix | 21 +++++++++ modules/nix-config/sound.nix | 1 + modules/packages.nix | 5 +++ 8 files changed, 154 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index f5c25a9..138b5ff 100644 --- a/flake.lock +++ b/flake.lock @@ -674,6 +674,50 @@ "type": "github" } }, + "noctalia": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "noctalia-qs": "noctalia-qs" + }, + "locked": { + "lastModified": 1776888984, + "narHash": "sha256-Up2F/eoMuPUsZnPVYdH5TMHe1TBP2Ue1QuWd0vWZoxY=", + "owner": "noctalia-dev", + "repo": "noctalia-shell", + "rev": "2c1808f9f8937fc0b82c54af513f7620fec56d71", + "type": "github" + }, + "original": { + "owner": "noctalia-dev", + "repo": "noctalia-shell", + "type": "github" + } + }, + "noctalia-qs": { + "inputs": { + "nixpkgs": [ + "noctalia", + "nixpkgs" + ], + "systems": "systems_4", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1776585574, + "narHash": "sha256-j35EWhKoGhKrfcXcAOpoRVgXEPQt41Eukji/h59cnjk=", + "owner": "noctalia-dev", + "repo": "noctalia-qs", + "rev": "75d180c28a9ab4470e980f3d6f706ad6c5213add", + "type": "github" + }, + "original": { + "owner": "noctalia-dev", + "repo": "noctalia-qs", + "type": "github" + } + }, "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat", @@ -704,6 +748,7 @@ "nix-cachyos-kernel": "nix-cachyos-kernel", "nixpkgs": "nixpkgs_3", "nixvim": "nixvim", + "noctalia": "noctalia", "sops-nix": "sops-nix", "spotiflac-cli": "spotiflac-cli" } @@ -791,6 +836,43 @@ "type": "github" } }, + "systems_4": { + "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" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "noctalia", + "noctalia-qs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775636079, + "narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "xdph": { "inputs": { "hyprland-protocols": [ diff --git a/flake.nix b/flake.nix index ab2f9ab..c5042ed 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,10 @@ url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + noctalia = { + url = "github:noctalia-dev/noctalia-shell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nix-cachyos-kernel.url = "github:xddxdd/nix-cachyos-kernel/release"; hyprland.url = "github:hyprwm/Hyprland"; spotiflac-cli.url = "github:Superredstone/spotiflac-cli"; @@ -26,11 +30,12 @@ spotiflac-cli, sops-nix, nix-cachyos-kernel, + noctalia, ... }@inputs: let overlays = [ - nix-cachyos-kernel.overlays.pinned + nix-cachyos-kernel.overlays.pinned ]; personalEmail = "patrickcanal3@gmail.com"; username = "r3ddy"; @@ -40,6 +45,7 @@ nixvim spotiflac-cli sops-nix + noctalia inputs nixpkgs home-manager diff --git a/lib/mksystem.nix b/lib/mksystem.nix index 4c88b1d..a1ed003 100644 --- a/lib/mksystem.nix +++ b/lib/mksystem.nix @@ -4,6 +4,7 @@ nixvim, spotiflac-cli, sops-nix, + noctalia, inputs, nixpkgs, home-manager, @@ -40,6 +41,7 @@ let nixvim = nixvim; spotiflac-cli = spotiflac-cli; sops-nix = sops-nix; + noctalia = noctalia; inputs = inputs; additionalModules = additionalModules; }; diff --git a/modules/nix-config/caches.nix b/modules/nix-config/caches.nix index 0b817a2..50c348b 100644 --- a/modules/nix-config/caches.nix +++ b/modules/nix-config/caches.nix @@ -6,12 +6,14 @@ "https://nixvim-superredstone.cachix.org" "https://spotiflac-cli.cachix.org" "https://attic.xuyh0120.win/lantian" + "https://noctalia.cachix.org" ]; trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "nixvim-superredstone.cachix.org-1:mEXHVxEv5dKka3FOxTMFDfdk/DJ0baydsahi+zZIcQE=" "spotiflac-cli.cachix.org-1:UgpE8P0TO8NuF03vF117r/vgTkjq13Z3JqGzaQdC7xE=" "lantian:EeAUQ+W+6r7EtwnmYjeVwx5kOGEBpjlBfPlzGlTNvHc=" + "noctalia.cachix.org-1:pCOR47nnMEo5thcxNDtzWpOxNFQsBRglJzxWPp3dkU4=" ]; trusted-users = [ "root" diff --git a/modules/nix-config/de.nix b/modules/nix-config/de.nix index 7cd0a91..f488cd8 100644 --- a/modules/nix-config/de.nix +++ b/modules/nix-config/de.nix @@ -1,6 +1,7 @@ { pkgs, lib, + config, currentSystemDe, ... }: @@ -10,6 +11,31 @@ let }; in { + programs.niri.enable = true; + services.dbus.packages = [ pkgs.nautilus ]; + services.dbus.implementation = "broker"; + services.xserver.desktopManager.runXdgAutostartIfNone = true; + + # For god's sake, never touch this code again, so much pain has been released on the following lines. + xdg.portal = { + enable = true; + xdgOpenUsePortal = true; + extraPortals = lib.mkForce [ + pkgs.xdg-desktop-portal-wlr + pkgs.xdg-desktop-portal-gtk + ]; + config = { + niri = { + default = lib.mkForce [ + "wlr" + "gtk" + ]; + "org.freedesktop.impl.portal.ScreenCast" = [ "wlr" ]; + "org.freedesktop.impl.portal.Screenshot" = [ "wlr" ]; + }; + }; + }; + services = { xserver.enable = true; xserver.excludePackages = with pkgs; [ @@ -31,8 +57,15 @@ in gnome.enable = libDe.ifGnome true; }; - gnome.gnome-keyring.enable = libDe.ifGnome true; + gnome.gnome-keyring.enable = true; }; + environment.etc."xdg/autostart/niri.desktop".text = '' + [Desktop Entry] + Name=Niri + Exec=${config.programs.niri.package}/bin/niri-session + Type=Application + X-GDM-SessionRegisters=true + ''; environment.plasma6.excludePackages = with pkgs.kdePackages; [ elisa konsole @@ -54,11 +87,6 @@ in yelp ]; - xdg = { - autostart.enable = true; - portal.enable = true; - }; - programs.kdeconnect = libDe.ifNotNone { enable = true; package = diff --git a/modules/nix-config/default.nix b/modules/nix-config/default.nix index 5756d0c..00ec9cd 100644 --- a/modules/nix-config/default.nix +++ b/modules/nix-config/default.nix @@ -24,6 +24,27 @@ [ ] ); + xdg.portal = { + enable = true; + config = { + common = { + default = [ + "gnome" + "gtk" + ]; + "org.freedesktop.impl.portal.ScreenCast" = "gnome"; + "org.freedesktop.impl.portal.Screenshot" = "gnome"; + "org.freedesktop.impl.portal.RemoteDesktop" = "gnome"; + }; + }; + xdgOpenUsePortal = true; + extraPortals = with pkgs; [ + xdg-desktop-portal + xdg-desktop-portal-gtk + xdg-desktop-portal-gnome + ]; + }; + time.timeZone = "Europe/Rome"; # Select internationalisation properties. diff --git a/modules/nix-config/sound.nix b/modules/nix-config/sound.nix index 89c81eb..ca3e05e 100644 --- a/modules/nix-config/sound.nix +++ b/modules/nix-config/sound.nix @@ -7,6 +7,7 @@ alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; + wireplumber.enable = true; }; pulseaudio.enable = false; }; diff --git a/modules/packages.nix b/modules/packages.nix index 1b49464..927dfb3 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -49,6 +49,7 @@ unzip wget wl-clipboard + xwayland-satellite zip zoxide zulu @@ -60,6 +61,9 @@ inputs.nixvim.packages.${stdenv.hostPlatform.system}.default # The only and one great editor improved even further inputs.spotiflac-cli.packages.${stdenv.hostPlatform.system}.default + + inputs.noctalia.packages.${pkgs.stdenv.hostPlatform.system}.default + gnome-keyring ] ++ ( if currentSystemDe != "none" then @@ -76,6 +80,7 @@ gapless gnome-boxes mpv + nautilus nextcloud-client obs-studio piper