nix: patch nix directly for experimental features
The bash wrapper was causing issues with deploy-rs and the experimental-features option in the config was causing hercules-ci to spit out a bunch of junk in the logs. Patching nix with the default values required for flakes fixes both of these issues.
This commit is contained in:
parent
b41c738f39
commit
4f44e0dd13
5 changed files with 48 additions and 11 deletions
8
overlays/nixFlakes.nix
Normal file
8
overlays/nixFlakes.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
final: prev: {
|
||||||
|
nixFlakes = prev.nixFlakes.overrideAttrs
|
||||||
|
(self: {
|
||||||
|
patches = [
|
||||||
|
../pkgs/tools/package-management/nix/0001-nix-command-and-flakes-by-default.patch
|
||||||
|
];
|
||||||
|
});
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
From a47bbae869ff35095eb2fe4d4d5145054ea81049 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Timothy DeHerrera <tim.deh@pm.me>
|
||||||
|
Date: Wed, 17 Feb 2021 12:26:48 -0700
|
||||||
|
Subject: [PATCH] nix-command and flakes by default
|
||||||
|
|
||||||
|
---
|
||||||
|
src/libstore/globals.hh | 5 ++++-
|
||||||
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
|
||||||
|
index eabd83e3f..e851e2a79 100644
|
||||||
|
--- a/src/libstore/globals.hh
|
||||||
|
+++ b/src/libstore/globals.hh
|
||||||
|
@@ -889,7 +889,10 @@ public:
|
||||||
|
value.
|
||||||
|
)"};
|
||||||
|
|
||||||
|
- Setting<Strings> experimentalFeatures{this, {}, "experimental-features",
|
||||||
|
+ Setting<Strings> experimentalFeatures{
|
||||||
|
+ this,
|
||||||
|
+ {"nix-command", "flakes", "ca-references"},
|
||||||
|
+ "experimental-features",
|
||||||
|
"Experimental Nix features to enable."};
|
||||||
|
|
||||||
|
bool isExperimentalFeatureEnabled(const std::string & name);
|
||||||
|
--
|
||||||
|
2.28.0
|
||||||
|
|
|
@ -138,10 +138,10 @@ in
|
||||||
trustedUsers = [ "root" "@wheel" ];
|
trustedUsers = [ "root" "@wheel" ];
|
||||||
|
|
||||||
extraOptions = ''
|
extraOptions = ''
|
||||||
experimental-features = nix-command flakes ca-references
|
|
||||||
min-free = 536870912
|
min-free = 536870912
|
||||||
keep-outputs = true
|
keep-outputs = true
|
||||||
keep-derivations = true
|
keep-derivations = true
|
||||||
|
fallback = true
|
||||||
'';
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,7 +22,7 @@ pkgs.devshell.mkShell
|
||||||
nixos-install
|
nixos-install
|
||||||
nixos-generate-config
|
nixos-generate-config
|
||||||
nixos-enter
|
nixos-enter
|
||||||
] ++ lib.optional (system == "x86_64-linux") pkgs.deploy-rs;
|
];
|
||||||
|
|
||||||
git.hooks = {
|
git.hooks = {
|
||||||
pre-commit.text = lib.fileContents ./pre-commit.sh;
|
pre-commit.text = lib.fileContents ./pre-commit.sh;
|
||||||
|
@ -32,13 +32,11 @@ pkgs.devshell.mkShell
|
||||||
{
|
{
|
||||||
package = flk;
|
package = flk;
|
||||||
}
|
}
|
||||||
{
|
]
|
||||||
name = "nix";
|
++ lib.optional (system != "i686-linux") { package = cachix; }
|
||||||
help = nixFlakes.meta.description;
|
++ lib.optional (system == "x86_64-linux") {
|
||||||
command = ''
|
name = "deploy";
|
||||||
${nixFlakes}/bin/nix --option experimental-features \
|
package = deploy-rs;
|
||||||
"nix-command flakes ca-references" "$@"
|
help = "A simple multi-profile Nix-flake deploy tool.";
|
||||||
'';
|
};
|
||||||
}
|
|
||||||
] ++ lib.optional (system != "i686-linux") { package = cachix; };
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,5 +25,8 @@ category = "documentation"
|
||||||
package = "mdbook"
|
package = "mdbook"
|
||||||
category = "documentation"
|
category = "documentation"
|
||||||
|
|
||||||
|
[[commands]]
|
||||||
|
package = "nixFlakes"
|
||||||
|
|
||||||
[git.hooks]
|
[git.hooks]
|
||||||
enable = true
|
enable = true
|
||||||
|
|
Loading…
Reference in a new issue