aboutsummaryrefslogtreecommitdiff
path: root/home/rices/finals/niri.nix
blob: 190eb300bd82390e15d76193c46397f58fe52920 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{
  pkgs,
  lib,
  ...
}: {
  home.packages = with pkgs; [
    swaybg
  ];

  xdg.configFile."niri/live.kdl".text = "";

  home.file."config" = let
    kdlfiles =
      lib.mapAttrsToList
      (filename: _value: "include \"${./niri/kdl}/${filename}\"")
      (lib.filterAttrs (key: value: value == "regular") (builtins.readDir ./niri/kdl));
    startups =
      map (it: "spawn-at-startup ${it}")
      (map (lib.concatStringsSep " ")
        (map (map (word: "\"${word}\""))
          [
            ["eww" "open" "clock"]
            ["touch" ".config/niri/live.kdl"]
          ]));
    other = [
      "include \"live.kdl\""
      "animations { window-open { duration-ms 3000; curve \"linear\"; custom-shader r\"\n${builtins.readFile ./niri/shaders/arc.frag}\";};}"
    ];
  in {
    target = ".config/niri/config.kdl";
    text = lib.concatLines (startups ++ kdlfiles ++ other);
  };
}