forked from Fediversity/simple-nixos-fediverse
Nicolas Jeannerod
e9b5de893d
Co-authored-by: Taeer Bar-Yam <taeer.bar-yam@moduscreate.com> Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io> Reviewed-on: Fediversity/simple-nixos-fediverse#26 Co-authored-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com> Co-committed-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
14 lines
399 B
Nix
14 lines
399 B
Nix
{ writeShellApplication }:
|
|
name: config:
|
|
writeShellApplication {
|
|
name = "deploy";
|
|
text = ''
|
|
result="$(nix build --print-out-paths ${./.}#nixosConfigurations#${name} --eval-store auto --store ssh-ng://${name})"
|
|
# shellcheck disable=SC2087
|
|
ssh ${name} << EOF
|
|
nix-env -p /nix/var/nix/profiles/system --set "$result"
|
|
"$result"/bin/switch-to-configuration switch
|
|
EOF
|
|
'';
|
|
}
|