Skip to content

Commit

Permalink
Set always-allow-substitutes to true in nix.conf (#977)
Browse files Browse the repository at this point in the history
* Set always-allow-substitutes to true in nix.conf

* Add setting to JSON fixtures

* Change Booleans to strings in JSON fixtures
  • Loading branch information
lucperkins authored May 27, 2024
1 parent 1f214d9 commit 6986003
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions src/action/common/place_nix_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/linux/linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/linux/steam-deck.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/macos/macos.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 6986003

Please sign in to comment.