-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacos.nix
54 lines (52 loc) · 1.37 KB
/
macos.nix
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
{
inputs,
self,
withSystem,
...
}:
let
inherit (inputs) darwin;
# Utility function to construct a macOS system config.
mkMacOSConfig =
hostname: system:
withSystem system (
{
pkgsets,
pkgs,
unstable,
homeManager,
...
}:
darwin.lib.darwinSystem rec {
specialArgs = {
inherit pkgsets pkgs unstable;
# XXX: `nix-darwin` requires that `inputs` have a `nixpkgs` attribute.
inputs = inputs // {
inherit (pkgsets) nixpkgs;
};
};
modules = [
homeManager.darwinModules.home-manager
{
home-manager.extraSpecialArgs = specialArgs;
networking.hostName = hostname;
}
../modules/macos/primary-user.nix
(../hosts + "/${hostname}/system.nix")
{ primary-user.home-manager = import (../hosts + "/${hostname}/user.nix"); }
];
}
);
in
{
flake = {
darwinConfigurations = {
crazy-diamond = mkMacOSConfig "crazy-diamond" "aarch64-darwin";
};
# Expose the activation package created by `nix-darwin`, so it can be
# realized (and possibly applied) directly from the command line.
packages = with self.outputs.darwinConfigurations; {
aarch64-darwin.crazy-diamond-system = crazy-diamond.config.system.build.toplevel;
};
};
}