mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-25 18:28:41 +02:00
refactor: update niri, write config in kdl, remove niri-flake
• Updated input 'nixpkgs':
→ 'github:NixOS/nixpkgs/0254eab410b90ef2420c1059f908ae777e3b02f9?narHash=sha256-/US2Ei9JHXHVBAxV4FX49Q7H5s4UNBrIiOA6Xjzgq44%3D' (2025-12-06)
• Updated input 'home-manager':
'github:nix-community/home-manager/f4cb25928fafa9ae68660fe71f730fc820a59028?narHash=sha256-5xOuutXM7UPTUcn3uDAD8UlPQsXmqPrX81cXoDOAGcA%3D' (2025-11-26)
→ 'github:nix-community/home-manager/89c9508bbe9b40d36b3dc206c2483ef176f15173?narHash=sha256-rB45jv4uwC90vM9UZ70plfvY/2Kdygs%2BzlQ07dGQFk4%3D' (2025-12-17)
• Updated input 'nixpkgs-master':
'github:nixos/nixpkgs/6812bcfd614abedbdb3f68d7b6554eda6ca3e014?narHash=sha256-sNF/PZcuzYBHKRBkerEiPf5mkZM15A3fWD%2BlqpwKc60%3D' (2025-12-15)
→ 'github:nixos/nixpkgs/e50ab9bb181f9fb3ce00e7a6007c70ddaa007203?narHash=sha256-acPMRCAPgPykzkwATwD1EfF7xgmbraAvIJyCeR6bKxc%3D' (2025-12-18)
Signed-off-by: Ryan Yin <xiaoyin_c@qq.com>
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
niri,
|
||||
...
|
||||
}@args:
|
||||
let
|
||||
@@ -11,27 +10,6 @@ in
|
||||
{
|
||||
options.modules.desktop.niri = {
|
||||
enable = lib.mkEnableOption "niri compositor";
|
||||
settings = lib.mkOption {
|
||||
type =
|
||||
with lib.types;
|
||||
let
|
||||
valueType =
|
||||
nullOr (oneOf [
|
||||
bool
|
||||
int
|
||||
float
|
||||
str
|
||||
path
|
||||
(attrsOf valueType)
|
||||
(listOf valueType)
|
||||
])
|
||||
// {
|
||||
description = "niri configuration value";
|
||||
};
|
||||
in
|
||||
valueType;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable (
|
||||
@@ -42,7 +20,35 @@ in
|
||||
xwayland-satellite
|
||||
];
|
||||
|
||||
programs.niri.config = cfg.settings;
|
||||
xdg.configFile =
|
||||
let
|
||||
mkSymlink = config.lib.file.mkOutOfStoreSymlink;
|
||||
confPath = "${config.home.homeDirectory}/nix-config/home/linux/gui/niri/conf";
|
||||
in
|
||||
{
|
||||
"niri/config.kdl".source = mkSymlink "${confPath}/config.kdl";
|
||||
"niri/keybindings.kdl".source = mkSymlink "${confPath}/keybindings.kdl";
|
||||
"niri/spawn-at-startup.kdl".source = mkSymlink "${confPath}/spawn-at-startup.kdl";
|
||||
"niri/windowrules.kdl".source = mkSymlink "${confPath}/windowrules.kdl";
|
||||
};
|
||||
|
||||
systemd.user.services.niri-flake-polkit = {
|
||||
Unit = {
|
||||
Description = "PolicyKit Authentication Agent provided by niri-flake";
|
||||
After = [
|
||||
"graphical-session.target"
|
||||
];
|
||||
Wants = [ "graphical-session-pre.target" ];
|
||||
};
|
||||
Install.WantedBy = [ "niri.service" ];
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.kdePackages.polkit-kde-agent-1}/libexec/polkit-kde-authentication-agent-1";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 1;
|
||||
TimeoutStopSec = 10;
|
||||
};
|
||||
};
|
||||
|
||||
# NOTE: this executable is used by greetd to start a wayland session when system boot up
|
||||
# with such a vendor-no-locking script, we can switch to another wayland compositor without modifying greetd's config in NixOS module
|
||||
@@ -56,10 +62,6 @@ in
|
||||
executable = true;
|
||||
};
|
||||
}
|
||||
(import ./settings.nix niri)
|
||||
(import ./keybindings.nix niri)
|
||||
(import ./spawn-at-startup.nix niri)
|
||||
(import ./windowrules.nix niri)
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user