Skip to content

Commit

Permalink
Merge pull request #476 from NixOS/nix-darwin-ci
Browse files Browse the repository at this point in the history
build nix-darwin in ci
  • Loading branch information
Mic92 authored Sep 23, 2024
2 parents 51f1084 + 716df9f commit 721a42a
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 81 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,14 @@ jobs:
- uses: cachix/install-nix-action@v27
- uses: DeterminateSystems/magic-nix-cache-action@v8
- run: nix build '.#nixosConfigurations."${{ matrix.machine }}.nixos.org".config.system.build.toplevel'
nix-darwin:
runs-on: macos-latest
strategy:
matrix:
# Doesn't seem that x86_64 is still in use?
machine: [arm64]
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
- uses: DeterminateSystems/magic-nix-cache-action@v8
- run: nix build '.#darwinConfigurations."${{ matrix.machine }}".config.system.build.toplevel'
26 changes: 23 additions & 3 deletions docs/inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,33 @@ owner: Eelco and Rob, owned by the NixOS Foundation
monitoring:
**DataDog, accessible by Eelco (and Rob?) (Amine?) on the Infor account**

## Mac Minis
## Mac Minis at Hetzner Cloud

owner: the NixOS Foundation
access: Dan, Eelco, Rob, Graham
access: Cole-h & Hexa
role: build machines

Running at the Utrechs Infor office on a shelf somewhere
Current machine names:

- intense-heron.mac.nixos.org
- sweeping-filly.mac.nixos.org
- maximum-snail.mac.nixos.org
- growing-jennet.mac.nixos.org
- enormous-catfish.mac.nixos.org

## Mac Minis at Graham's house

owner: the NixOS Foundation
access: Cole-h
role: build machines

- arm64:
- cosmic-stud
- tight-bug
- quality-ram
- becoming-hyena

There are also x86_64 mac minis, but they are offline because they produce too much heat.

## Mac Stadium

Expand Down
38 changes: 38 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";

darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};

flake-utils.url = "github:numtide/flake-utils";
treefmt-nix.url = "github:numtide/treefmt-nix";

Expand Down Expand Up @@ -54,6 +60,7 @@
./checks/flake-module.nix
./terraform/flake-module.nix
./non-critical-infra/flake-module.nix
./macs/flake-module.nix
];
};
}
6 changes: 6 additions & 0 deletions macs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Deploying to darwin

See [inventory](../docs/inventory.md).
We have mac-mini's are in [Grahams](https://github.com/grahamc) house,
that only [@cole-h](https://github.com/cole-h) can deploy.
Furthermore we have builders at Hetzner online.
17 changes: 17 additions & 0 deletions macs/flake-module.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ inputs, ... }:
{
flake.darwinConfigurations =
let
mac =
system:
inputs.darwin.lib.darwinSystem {
inherit system;

modules = [ ./nix-darwin.nix ];
};
in
{
arm64 = mac "aarch64-darwin";
x86_64 = mac "x86_64-darwin";
};
}
48 changes: 0 additions & 48 deletions macs/flake.lock

This file was deleted.

30 changes: 0 additions & 30 deletions macs/flake.nix

This file was deleted.

2 changes: 2 additions & 0 deletions macs/nix-darwin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ in
environment.darwinConfig = "/nix/home/darwin-config/macs/nix-darwin.nix";
environment.systemPackages = [ config.nix.package ];

system.stateVersion = 5;

programs.zsh.enable = true;
programs.zsh.enableCompletion = false;
programs.bash.enable = true;
Expand Down

0 comments on commit 721a42a

Please sign in to comment.