-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
152 lines (151 loc) · 4.36 KB
/
flake.nix
File metadata and controls
152 lines (151 loc) · 4.36 KB
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
{
description = "An example NixOS configuration";
inputs = {
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-filter.url = "github:numtide/nix-filter";
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.darwin.follows = "darwin";
inputs.home-manager.follows = "home-manager";
};
darwin.url = "github:lnl7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
claude-code.url = "github:sadjow/claude-code-nix";
};
outputs =
{
self,
home-manager,
nixpkgs,
deploy-rs,
disko,
nix-filter,
darwin,
claude-code,
...
}:
let
rev = if self ? rev then self.shortRev else "${self.dirtyShortRev}";
all-overlays = [
nix-filter.overlays.default
deploy-rs.overlays.default
claude-code.overlays.default
]
++ import ./overlays;
aarch64-linuxPkgs = import nixpkgs {
system = "aarch64-linux";
overlays = all-overlays;
};
_x86_64Pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = all-overlays;
};
CHARLIEPC = import ./machines/CHARLIEPC {
inherit
all-overlays
rev
disko
;
nixosModules = self.nixosModules;
home = home-manager;
};
UTM = (import ./machines/UTM) {
inherit
all-overlays
rev
disko
;
nixosModules = self.nixosModules;
home = home-manager;
};
in
{
nixosConfigurations = {
# UTM VM
UTM = nixpkgs.lib.nixosSystem UTM;
CHARLIEPC = nixpkgs.lib.nixosSystem CHARLIEPC;
};
darwinConfigurations =
let
makeDarwin =
darwin-config: username:
darwin.lib.darwinSystem {
system = "aarch64-darwin";
modules = [
(
{ ... }:
{
nixpkgs = {
overlays = all-overlays;
config.allowUnfree = true;
};
}
)
darwin-config
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users."${username}" = import ./modules/darwin/home.nix {
beth-home = self.nixosModules.home {
gitUserName = "Daniel Hines";
gitUserEmail = "d4hines@gmail.com";
};
};
}
];
};
in
{
malak = makeDarwin ./machines/MALAK "dhines";
yachal = makeDarwin ./machines/YACHAL "d4hines";
DARESH = makeDarwin ./machines/DARESH "d4hines";
};
nixosModules = import ./modules;
homeConfigurations = {
default = home-manager.lib.homeManagerConfiguration {
pkgs = aarch64-linuxPkgs;
modules = [
({
home = {
username = "d4hines";
homeDirectory = "/home/d4hines";
stateVersion = "23.05";
};
})
(import ./modules/home {
gitUserName = "Daniel Hines";
gitUserEmail = "d4hines@gmail.com";
})
];
};
};
overlays = {
default = nixpkgs.lib.composeManyExtensions (import ./overlays);
};
deploy.nodes = {
CHARLIEPC = {
hostname = "CHARLIEPC";
profiles.system = {
user = "root";
sshUser = "charlie";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.CHARLIEPC;
remoteBuild = true;
};
};
};
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
formatter.aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.nixfmt-rfc-style;
};
}