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 { 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: '' command = targetPath: ''
set -fu set -xfu
outDir=$(mktemp -d) outDir=$(mktemp -d)
trap "rm -rf $outDir;" INT TERM EXIT trap "rm -rf $outDir;" INT TERM EXIT
nix build \ build=$(command -v nom-build || echo "nix-build")
$build \
-I "${targetPath}" \ -I "${targetPath}" \
-f '<nixpkgs/nixos>' config.system.build.toplevel \ '<nixpkgs/nixos>' -A config.system.build.toplevel \
-o "$outDir/out" -o "$outDir/out" \
${lib.optionalString offline "--option substitute false"} \
# -vvvvv --show-trace
nix-env -p /nix/var/nix/profiles/system --set "$outDir/out" nix-env -p /nix/var/nix/profiles/system --set "$outDir/out"