Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build nix-darwin in ci #476

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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