niri: move config to nix
Signed-off-by: faukah <fau@faukah.com> Change-Id: I6a6a6964cffaba7ce75488a48739398758d49363
This commit is contained in:
parent
0c995da8af
commit
c5915e1d24
4 changed files with 690 additions and 434 deletions
|
@ -102,6 +102,48 @@ let
|
|||
|
||||
}
|
||||
) { };
|
||||
|
||||
kdl = pkgs.callPackage ./kdl.nix { };
|
||||
|
||||
node = name: args: children: {
|
||||
inherit name;
|
||||
inherit
|
||||
(lib.foldl
|
||||
(
|
||||
self: arg:
|
||||
if lib.isAttrs arg then
|
||||
self // { properties = self.properties // arg; }
|
||||
else
|
||||
self // { arguments = self.arguments ++ [ arg ]; }
|
||||
)
|
||||
{
|
||||
arguments = [ ];
|
||||
properties = { };
|
||||
}
|
||||
(lib.toList args)
|
||||
)
|
||||
arguments
|
||||
properties
|
||||
;
|
||||
inherit children;
|
||||
};
|
||||
|
||||
plain = name: node name [ ];
|
||||
leaf = name: args: node name args [ ];
|
||||
flag = name: node name [ ] [ ];
|
||||
|
||||
niri-config = kdl.generate "niri-config.kdl" (
|
||||
import ./config.nix {
|
||||
inherit
|
||||
node
|
||||
plain
|
||||
leaf
|
||||
flag
|
||||
lib
|
||||
pkgs
|
||||
;
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
options.modules.desktops.niri.enable = mkEnableOption "Niri, a scolling tiling wayland compositor";
|
||||
|
@ -115,7 +157,7 @@ in
|
|||
# which is something I direly want to avoid.
|
||||
services.gnome.gnome-keyring.enable = mkForce false;
|
||||
|
||||
hjem.users.${username}.files.".config/niri/config.kdl".source = ./config.kdl;
|
||||
hjem.users.${username}.files.".config/niri/config.kdl".source = niri-config;
|
||||
|
||||
environment.systemPackages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue