aboutsummaryrefslogtreecommitdiffstats
path: root/krops.nix
blob: 2cf401c8cd43ab41c73255b40c6a14814fe5cf67 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
let
  inherit (import <fysiweb>) lib pkgs;
in

rec {
  source = system-name: pkgs.krops.lib.evalSource [
    {
      fysiweb.file = {
        path = toString <fysiweb>;
        filters = [
          { type = "exclude"; pattern = "/.git"; }
        ]
        ++
        map
          (pattern: { type = "exclude"; inherit pattern; })
          (lib.filter
            (lib.hasPrefix "/")
            (lib.splitString "\n"
              (builtins.readFile <fysiweb/.gitignore>)))
        ;
      };
      overlay.file = {
        path = toString ./.;
        filters = [
          { type = "exclude"; pattern = "/.git"; }
        ]
        ++
        map
          (pattern: { type = "exclude"; inherit pattern; })
          (lib.filter
            (lib.hasPrefix "/")
            (lib.splitString "\n"
              (builtins.readFile ./.gitignore)))
        ;
      };
      nixos-config.symlink = "overlay/systems/${system-name}/configuration.nix";
      nixpkgs.git = {
        url = "https://github.com/NixOS/nixpkgs";
        ref = (lib.importJSON <fysiweb/nixpkgs.json>).rev;
        shallow = true;
      };
      system-secrets =
        let
          path = ./secrets/per-system + "/${system-name}";
        in
        if builtins.pathExists path then
          {
            pass.dir = toString path;
            pass.name = ".";
          }
        else
          { file = "/var/empty"; };
    }
  ];
}