From 260acdb7fd8b294fcb992f6f572a1fd06583c848 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Mon, 27 May 2024 14:28:18 -0300 Subject: [PATCH 1/3] Set always-allow-substitutes to true in nix.conf --- README.md | 1 + src/action/common/place_nix_configuration.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index d6a0a8d15..f595a8634 100644 --- a/README.md +++ b/README.md @@ -441,6 +441,7 @@ Differing from the upstream [Nix](https://github.com/NixOS/nix) installer script + the `nix-command` and `flakes` features are enabled + `bash-prompt-prefix` is set + `auto-optimise-store` is set to `true` (On Linux only) + * `always-allow-substitutes` is set to `true` * `extra-nix-path` is set to `nixpkgs=flake:nixpkgs` * `max-jobs` is set to `auto` * `upgrade-nix-store-path-url` is set to `https://install.determinate.systems/nix-upgrade/stable/universal`, to prevent unintentional downgrades. diff --git a/src/action/common/place_nix_configuration.rs b/src/action/common/place_nix_configuration.rs index fe91355eb..6226686f3 100644 --- a/src/action/common/place_nix_configuration.rs +++ b/src/action/common/place_nix_configuration.rs @@ -111,6 +111,9 @@ impl PlaceNixConfiguration { #[cfg(not(target_os = "macos"))] settings.insert("auto-optimise-store".to_string(), "true".to_string()); + // https://github.com/NixOS/nix/pull/8047 + settings.insert("always-allow-substitutes".to_string(), "true".to_string()); + settings.insert( "bash-prompt-prefix".to_string(), "(nix:$name)\\040".to_string(), From cf9a645fd5abbe0f56caa232c7348156b7d09467 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Mon, 27 May 2024 14:45:38 -0300 Subject: [PATCH 2/3] Add setting to JSON fixtures --- tests/fixtures/linux/linux.json | 1 + tests/fixtures/linux/steam-deck.json | 1 + tests/fixtures/macos/macos.json | 1 + 3 files changed, 3 insertions(+) diff --git a/tests/fixtures/linux/linux.json b/tests/fixtures/linux/linux.json index df06c477c..942ed248a 100644 --- a/tests/fixtures/linux/linux.json +++ b/tests/fixtures/linux/linux.json @@ -354,6 +354,7 @@ "path": "/etc/nix/nix.conf", "pending_nix_config": { "settings": { + "always-allow-substitutes": true, "experimental-features": "nix-command flakes auto-allocate-uids", "build-users-group": "nixbld", "auto-optimise-store": "true", diff --git a/tests/fixtures/linux/steam-deck.json b/tests/fixtures/linux/steam-deck.json index 373016b84..69c724559 100644 --- a/tests/fixtures/linux/steam-deck.json +++ b/tests/fixtures/linux/steam-deck.json @@ -341,6 +341,7 @@ "path": "/etc/nix/nix.conf", "pending_nix_config": { "settings": { + "always-allow-substitutes": true, "auto-optimise-store": "true", "bash-prompt-prefix": "(nix:$name)\\040", "build-users-group": "nixbld", diff --git a/tests/fixtures/macos/macos.json b/tests/fixtures/macos/macos.json index d839eca1e..abf7c4071 100644 --- a/tests/fixtures/macos/macos.json +++ b/tests/fixtures/macos/macos.json @@ -378,6 +378,7 @@ "path": "/etc/nix/nix.conf", "pending_nix_config": { "settings": { + "always-allow-substitutes": true, "extra-nix-path": "nixpkgs=flake:nixpkgs", "auto-allocate-uids": "true", "auto-optimise-store": "true", From 6985e3b22308e6b33028bd923b8c69ebd70c6edd Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Mon, 27 May 2024 14:55:58 -0300 Subject: [PATCH 3/3] Change Booleans to strings in JSON fixtures --- tests/fixtures/linux/linux.json | 2 +- tests/fixtures/linux/steam-deck.json | 2 +- tests/fixtures/macos/macos.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/fixtures/linux/linux.json b/tests/fixtures/linux/linux.json index 942ed248a..6264004db 100644 --- a/tests/fixtures/linux/linux.json +++ b/tests/fixtures/linux/linux.json @@ -354,7 +354,7 @@ "path": "/etc/nix/nix.conf", "pending_nix_config": { "settings": { - "always-allow-substitutes": true, + "always-allow-substitutes": "true", "experimental-features": "nix-command flakes auto-allocate-uids", "build-users-group": "nixbld", "auto-optimise-store": "true", diff --git a/tests/fixtures/linux/steam-deck.json b/tests/fixtures/linux/steam-deck.json index 69c724559..62addf44e 100644 --- a/tests/fixtures/linux/steam-deck.json +++ b/tests/fixtures/linux/steam-deck.json @@ -341,7 +341,7 @@ "path": "/etc/nix/nix.conf", "pending_nix_config": { "settings": { - "always-allow-substitutes": true, + "always-allow-substitutes": "true", "auto-optimise-store": "true", "bash-prompt-prefix": "(nix:$name)\\040", "build-users-group": "nixbld", diff --git a/tests/fixtures/macos/macos.json b/tests/fixtures/macos/macos.json index abf7c4071..4984f2094 100644 --- a/tests/fixtures/macos/macos.json +++ b/tests/fixtures/macos/macos.json @@ -378,7 +378,7 @@ "path": "/etc/nix/nix.conf", "pending_nix_config": { "settings": { - "always-allow-substitutes": true, + "always-allow-substitutes": "true", "extra-nix-path": "nixpkgs=flake:nixpkgs", "auto-allocate-uids": "true", "auto-optimise-store": "true",