-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
124 lines (107 loc) · 3.07 KB
/
flake.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
{
description = "Darwin config by @nce";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
darwin = {
url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
homemanager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
mac-app-util.url = "github:hraban/mac-app-util";
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
};
outputs =
{
self,
darwin,
nixpkgs,
homemanager,
mac-app-util,
nix-homebrew,
...
}@inputs:
let
configuration =
{ config, pkgs, ... }:
{
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = [
#pkgs.neovim
];
services.nix-daemon.enable = true;
nix.settings.experimental-features = "nix-command flakes";
security.pam.enableSudoTouchIdAuth = true;
nixpkgs.hostPlatform = "aarch64-darwin";
# Create /etc/zshrc that loads the nix-darwin environment.
# don't remove... (or restore /run/current-system/sw/bin/darwin-rebuild switch --flake .#mbair22)
programs.zsh.enable = true;
};
username = "nce";
mkComputer =
configurationNix: systemName: extraModules:
darwin.lib.darwinSystem {
system = systemName;
modules = [
configuration
mac-app-util.darwinModules.default
homemanager.darwinModules.home-manager
nix-homebrew.darwinModules.nix-homebrew
configurationNix
] ++ extraModules;
specialArgs = {
inherit inputs;
inherit username;
};
};
in
{
darwinConfigurations = {
macminipro24 = mkComputer ./machines/macminipro24 "aarch64-darwin" [
./profiles/user.nix
{
home-manager = {
extraSpecialArgs = {
inherit inputs;
};
sharedModules = [
mac-app-util.homeManagerModules.default
];
users = {
${username} = {
imports = [
./profiles/home.nix
];
};
};
};
}
];
mbair22 = mkComputer ./machines/mbair22 "aarch64-darwin" [
./profiles/user.nix
{
home-manager = {
extraSpecialArgs = {
inherit inputs;
};
sharedModules = [
mac-app-util.homeManagerModules.default
];
users = {
${username} = {
imports = [
./profiles/home.nix
];
};
};
};
}
];
};
mbair22 = self.darwinConfigurations.mbair22.system;
macminipro24 = self.darwinConfigurations.macminipro24.system;
};
}