build nix-darwin in ci
Jörg Thalheim committed
Sep 14, 2024 at 17:30 UTC
4d676c5453fe4b1f41a01f0f7d76fb1787421b4e
6 files changed
+73
-78
.github/workflows/ci.yml
+11
@@ -34,3 +34,14 @@ jobs:
34
- uses: cachix/install-nix-action@v27
35
- uses: DeterminateSystems/magic-nix-cache-action@v8
36
- run: nix build '.#nixosConfigurations."${{ matrix.machine }}.nixos.org".config.system.build.toplevel'
37
+ nix-darwin:
38
+ runs-on: macos-latest
39
+ strategy:
40
+ matrix:
41
+ # Doesn't seem that x86_64 is still in use?
42
+ machine: [arm64]
43
+ steps:
44
+ - uses: actions/checkout@v4
45
+ - uses: cachix/install-nix-action@v27
46
+ - uses: DeterminateSystems/magic-nix-cache-action@v8
47
+ - run: nix build '.#darwinConfigurations."${{ matrix.machine }}".config.system.build.toplevel'
flake.lock
+38
@@ -27,6 +27,26 @@
27
"type": "github"
28
}
29
},
30
+ "darwin": {
31
+ "inputs": {
32
+ "nixpkgs": [
33
+ "nixpkgs"
34
+ ]
35
+ },
36
+ "locked": {
37
+ "lastModified": 1726188813,
38
+ "narHash": "sha256-Vop/VRi6uCiScg/Ic+YlwsdIrLabWUJc57dNczp0eBc=",
39
+ "owner": "LnL7",
40
+ "repo": "nix-darwin",
41
+ "rev": "21fe31f26473c180390cfa81e3ea81aca0204c80",
42
+ "type": "github"
43
+ },
44
+ "original": {
45
+ "owner": "LnL7",
46
+ "repo": "nix-darwin",
47
+ "type": "github"
48
+ }
49
+ },
50
"disko": {
51
"inputs": {
52
"nixpkgs": [
@@ -179,6 +199,22 @@
199
"type": "github"
200
}
201
},
202
+ "nixpkgs-unstable": {
203
+ "locked": {
204
+ "lastModified": 1726206720,
205
+ "narHash": "sha256-tI7141IHDABMNgz4iXDo8agCp0SeTLbaIZ2DRndwcmk=",
206
+ "owner": "nixos",
207
+ "repo": "nixpkgs",
208
+ "rev": "673d99f1406cb09b8eb6feab4743ebdf70046557",
209
+ "type": "github"
210
+ },
211
+ "original": {
212
+ "owner": "nixos",
213
+ "ref": "nixpkgs-unstable",
214
+ "repo": "nixpkgs",
215
+ "type": "github"
216
+ }
217
+ },
218
"nixpkgs_2": {
219
"locked": {
220
"lastModified": 1725103162,
@@ -228,11 +264,13 @@
264
"root": {
265
"inputs": {
266
"colmena": "colmena",
267
+ "darwin": "darwin",
268
"disko": "disko",
269
"first-time-contribution-tagger": "first-time-contribution-tagger",
270
"flake-parts": "flake-parts",
271
"flake-utils": "flake-utils",
272
"nixpkgs": "nixpkgs",
273
+ "nixpkgs-unstable": "nixpkgs-unstable",
274
"sops-nix": "sops-nix",
275
"srvos": "srvos",
276
"treefmt-nix": "treefmt-nix"
flake.nix
+7
@@ -3,9 +3,15 @@
3
4
inputs = {
5
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
6
+ nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
7
flake-parts.url = "github:hercules-ci/flake-parts";
8
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
9
10
+ darwin = {
11
+ url = "github:LnL7/nix-darwin";
12
+ inputs.nixpkgs.follows = "nixpkgs";
13
+ };
14
+
15
flake-utils.url = "github:numtide/flake-utils";
16
treefmt-nix.url = "github:numtide/treefmt-nix";
17
@@ -54,6 +60,7 @@
60
./checks/flake-module.nix
61
./terraform/flake-module.nix
62
./non-critical-infra/flake-module.nix
63
+ ./macs/flake-module.nix
64
];
65
};
66
}
macs/flake-module.nix
new
+17
@@ -0,0 +1,17 @@
1
+{ inputs, ... }:
2
+{
3
+ flake.darwinConfigurations =
4
+ let
5
+ mac =
6
+ system:
7
+ inputs.darwin.lib.darwinSystem {
8
+ inherit system;
9
+
10
+ modules = [ ./nix-darwin.nix ];
11
+ };
12
+ in
13
+ {
14
+ arm64 = mac "aarch64-darwin";
15
+ x86_64 = mac "x86_64-darwin";
16
+ };
17
+}
macs/flake.lock
deleted
-48
@@ -1,48 +0,0 @@
1
-{
2
- "nodes": {
3
- "darwin": {
4
- "inputs": {
5
- "nixpkgs": [
6
- "nixpkgs"
7
- ]
8
- },
9
- "locked": {
10
- "lastModified": 1726188813,
11
- "narHash": "sha256-Vop/VRi6uCiScg/Ic+YlwsdIrLabWUJc57dNczp0eBc=",
12
- "owner": "LnL7",
13
- "repo": "nix-darwin",
14
- "rev": "21fe31f26473c180390cfa81e3ea81aca0204c80",
15
- "type": "github"
16
- },
17
- "original": {
18
- "owner": "LnL7",
19
- "repo": "nix-darwin",
20
- "type": "github"
21
- }
22
- },
23
- "nixpkgs": {
24
- "locked": {
25
- "lastModified": 1726396940,
26
- "narHash": "sha256-EpiSl9nSINTmIW6MG6CulGwNAa6sHrBt8gQdyHUXzR4=",
27
- "owner": "nixos",
28
- "repo": "nixpkgs",
29
- "rev": "76d7694a3f681b0b750c01783df5d2177ef39fe7",
30
- "type": "github"
31
- },
32
- "original": {
33
- "owner": "nixos",
34
- "ref": "nixpkgs-unstable",
35
- "repo": "nixpkgs",
36
- "type": "github"
37
- }
38
- },
39
- "root": {
40
- "inputs": {
41
- "darwin": "darwin",
42
- "nixpkgs": "nixpkgs"
43
- }
44
- }
45
- },
46
- "root": "root",
47
- "version": 7
48
-}
macs/flake.nix
deleted
-30
@@ -1,30 +0,0 @@
1
-{
2
- description = "nixos-org-configurations macs";
3
-
4
- inputs = {
5
- nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
6
- darwin = {
7
- url = "github:LnL7/nix-darwin";
8
- inputs.nixpkgs.follows = "nixpkgs";
9
- };
10
- };
11
-
12
- outputs =
13
- { darwin, ... }:
14
- {
15
- darwinConfigurations =
16
- let
17
- mac =
18
- system:
19
- darwin.lib.darwinSystem {
20
- inherit system;
21
-
22
- modules = [ ./nix-darwin.nix ];
23
- };
24
- in
25
- {
26
- arm64 = mac "aarch64-darwin";
27
- x86_64 = mac "x86_64-darwin";
28
- };
29
- };
30
-}