l krops: use nom for build

This commit is contained in:
lassulus 2022-06-21 23:39:33 +02:00
parent 500aa05de7
commit 4ef26cd0f6

View File

@ -37,18 +37,22 @@
in {
deploy = { target ? "root@${name}/var/src" }: pkgs.krops.writeCommand "deploy" {
deploy = { target ? "root@${name}/var/src", offline ? false }: pkgs.krops.writeCommand "deploy" {
command = targetPath: ''
set -fu
set -xfu
outDir=$(mktemp -d)
trap "rm -rf $outDir;" INT TERM EXIT
nix build \
build=$(command -v nom-build || echo "nix-build")
$build \
-I "${targetPath}" \
-f '<nixpkgs/nixos>' config.system.build.toplevel \
-o "$outDir/out"
'<nixpkgs/nixos>' -A config.system.build.toplevel \
-o "$outDir/out" \
${lib.optionalString offline "--option substitute false"} \
# -vvvvv --show-trace
nix-env -p /nix/var/nix/profiles/system --set "$outDir/out"