Don't import impure overlays if meta.nixpkgs is a path

Also update documentations to recommend specifying `overlays = []`
explicitly.

Fixes #39.
This commit is contained in:
Zhaofeng Li 2022-06-03 23:51:32 -07:00
parent ca12be27ed
commit b87da69558
3 changed files with 4 additions and 1 deletions

View file

@ -5,6 +5,7 @@
- `--reboot` is added to trigger a reboot and wait for the node to come back up. - `--reboot` is added to trigger a reboot and wait for the node to come back up.
- The target user is no longer explicitly set when `deployment.targetUser` is null ([#91](https://github.com/zhaofengli/colmena/pull/91)). - The target user is no longer explicitly set when `deployment.targetUser` is null ([#91](https://github.com/zhaofengli/colmena/pull/91)).
- In `apply-local`, we now only escalate privileges during activation ([#85](https://github.com/zhaofengli/colmena/issues/85)). - In `apply-local`, we now only escalate privileges during activation ([#85](https://github.com/zhaofengli/colmena/issues/85)).
- Impure overlays are no longer imported by default if a path is specified in `meta.nixpkgs` ([#39](https://github.com/zhaofengli/colmena/issues/39))
## [Release 0.3.0](https://github.com/zhaofengli/colmena/releases/tag/v0.3.0) (2022/04/27) ## [Release 0.3.0](https://github.com/zhaofengli/colmena/releases/tag/v0.3.0) (2022/04/27)

View file

@ -53,6 +53,7 @@ Here is a short example:
meta = { meta = {
nixpkgs = import nixpkgs { nixpkgs = import nixpkgs {
system = "x86_64-linux"; system = "x86_64-linux";
overlays = [];
}; };
}; };

View file

@ -73,6 +73,7 @@ let
colmena = { colmena = {
${configName} = import nixpkgs { ${configName} = import nixpkgs {
system = "${currentSystem}"; system = "${currentSystem}";
overlays = [];
}; };
}; };
}; };
@ -85,7 +86,7 @@ let
else mkNixpkgs configName (import pkgConf) else mkNixpkgs configName (import pkgConf)
else if typeOf pkgConf == "lambda" then else if typeOf pkgConf == "lambda" then
if hermetic then throw (uninitializedError "a Nixpkgs lambda") if hermetic then throw (uninitializedError "a Nixpkgs lambda")
else pkgConf {} else pkgConf { overlays = []; }
else if typeOf pkgConf == "set" then else if typeOf pkgConf == "set" then
if pkgConf ? outputs then throw (uninitializedError "an uninitialized Nixpkgs input") if pkgConf ? outputs then throw (uninitializedError "an uninitialized Nixpkgs input")
else pkgConf else pkgConf