From 474198f808502a76f636bb677a5d028d2ca5a5c9 Mon Sep 17 00:00:00 2001 From: Gabriella Gonzalez Date: Mon, 26 Dec 2022 20:25:56 -0600 Subject: [PATCH] darwin.builder: Fix gratuitous rebuilds See the discussion starting here: https://github.com/NixOS/nixpkgs/pull/206951#issuecomment-1364760917 The `darwin.builder` derivation had a gratuitous dependency on the current Nixpkgs revision due to `config.system.nixos.revision`. Setting the revision explicitly to null fixes this problem and prevents the derivation from being rebuilt on every change to Nixpkgs. --- nixos/modules/profiles/macos-builder.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nixos/modules/profiles/macos-builder.nix b/nixos/modules/profiles/macos-builder.nix index 0cbac3bd61fe..15fad007bd3e 100644 --- a/nixos/modules/profiles/macos-builder.nix +++ b/nixos/modules/profiles/macos-builder.nix @@ -93,7 +93,12 @@ in }; }); - system.stateVersion = "22.05"; + system = { + # To prevent gratuitous rebuilds on each change to Nixpkgs + nixos.revision = null; + + stateVersion = "22.05"; + }; users.users."${user}"= { isNormalUser = true;