summaryrefslogtreecommitdiff
path: root/darwinConfigurations/default.nix
blob: 612c8b0dbba5a7476d617bdfded7b9e5ee60b082 (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
{
  inputs,
  lib,
}:
with 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 lib this;
        }
        // extraSpecialArgs;
    });
in
  mapAttrs' mkConfiguration {
    mairon.extraSpecialArgs = {
      # These values are managed by my employer.
      localUsername = "username";
      localHostname = "hostname";
    };
  }