-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nixos-container: avoid
substituteAll
- Loading branch information
1 parent
89f8cdb
commit c89f4ad
Showing
1 changed file
with
32 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,45 @@ | ||
{ substituteAll | ||
{ substitute | ||
, perl | ||
, shadow | ||
, util-linux | ||
, runtimeShell | ||
, configurationDirectory ? "/etc/nixos-containers" | ||
, stateDirectory ? "/var/lib/nixos-containers" | ||
, nixosTests | ||
}: | ||
|
||
substituteAll { | ||
name = "nixos-container"; | ||
dir = "bin"; | ||
isExecutable = true; | ||
src = ./nixos-container.pl; | ||
perl = perl.withPackages (p: [ p.FileSlurp ]); | ||
su = "${shadow.su}/bin/su"; | ||
utillinux = util-linux; | ||
substitute { | ||
name = "nixos-container"; | ||
dir = "bin"; | ||
isExecutable = true; | ||
src = ./nixos-container.pl; | ||
|
||
inherit configurationDirectory stateDirectory; | ||
substitutions = [ | ||
"--subst-var-by" "configurationDirectory" configurationDirectory | ||
"--subst-var-by" "perl" (perl.withPackages (p: [ p.FileSlurp ])) | ||
"--subst-var-by" "stateDirectory" stateDirectory | ||
"--subst-var-by" "su" "${shadow.su}/bin/su" | ||
"--subst-var-by" "utillinux" util-linux | ||
"--subst-var-by" "shell" runtimeShell | ||
]; | ||
|
||
passthru = { | ||
tests = { | ||
inherit (nixosTests) | ||
containers-imperative | ||
containers-ip | ||
containers-tmpfs | ||
containers-ephemeral | ||
containers-unified-hierarchy | ||
; | ||
}; | ||
passthru = { | ||
tests = { | ||
inherit (nixosTests) | ||
containers-imperative | ||
containers-ip | ||
containers-tmpfs | ||
containers-ephemeral | ||
containers-unified-hierarchy | ||
; | ||
}; | ||
}; | ||
|
||
postInstall = '' | ||
t=$out/share/bash-completion/completions | ||
mkdir -p $t | ||
cp ${./nixos-container-completion.sh} $t/nixos-container | ||
''; | ||
meta.mainProgram = "nixos-container"; | ||
postInstall = '' | ||
t=$out/share/bash-completion/completions | ||
mkdir -p $t | ||
cp ${./nixos-container-completion.sh} $t/nixos-container | ||
''; | ||
|
||
meta.mainProgram = "nixos-container"; | ||
} |