summaryrefslogtreecommitdiff
path: root/darwinConfigurations/default.nix
blob: 0e19d26a54cab324eda48565e6a5d4f814cb8806 (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
inputs:
with inputs.self.lib;
let
  mkConfiguration =
    name:
    {
      modules ? [ ],
      configuration ? ./${name},
      this ? my.configurations.${name},
      extraSpecialArgs ? {
        localUsername = my.username;
        localHostname = this.hostname;
      },
    }:
    nameValuePair name (
      inputs.darwin.lib.darwinSystem {
        inherit (this) system;
        modules =
          modules
          ++ attrValues inputs.self.modules
          ++ attrValues inputs.self.darwinModules
          ++ optional (configuration != null) (import configuration);
        specialArgs = {
          inherit inputs this;
          inherit (inputs.self) lib;
        } // extraSpecialArgs;
      }
    );
in
mapAttrs' mkConfiguration {
  mairon.extraSpecialArgs = {
    # These values are managed by my employer.
    localUsername = "username";
    localHostname = "hostname";
  };
}