deploy: replace devShell with defaultPackage

This commit is contained in:
Sean Buckley 2022-06-06 10:48:32 -04:00
parent 3c3a47244f
commit 06913e7134

View file

@ -31,8 +31,6 @@ let
StrictHostKeyChecking yes StrictHostKeyChecking yes
GlobalKnownHostsFile ${sshKnownHostsTxt} GlobalKnownHostsFile ${sshKnownHostsTxt}
${hostSshConfigs} ${hostSshConfigs}
Host *
User root
''; '';
livecd-deploy = pkgs.writeShellScript "livecd-deploy" '' livecd-deploy = pkgs.writeShellScript "livecd-deploy" ''
@ -53,7 +51,6 @@ let
check-updates = pkgs.writeShellScript "check-updates" '' check-updates = pkgs.writeShellScript "check-updates" ''
set -eu set -eu
export SSH_CONFIG_FILE=${sshConfig}
c="${pkgs.colmena}/bin/colmena" c="${pkgs.colmena}/bin/colmena"
j="$($c eval -E '{nodes,...}: builtins.mapAttrs (n: v: v.config.system.build.toplevel) nodes')" j="$($c eval -E '{nodes,...}: builtins.mapAttrs (n: v: v.config.system.build.toplevel) nodes')"
$c exec -- '[ "$(echo '"'$j'"' | jq -r .\"$(hostname)\")" = "$(readlink /run/current-system)" ]' $c exec -- '[ "$(echo '"'$j'"' | jq -r .\"$(hostname)\")" = "$(readlink /run/current-system)" ]'
@ -61,7 +58,6 @@ let
check-reboots = pkgs.writeShellScript "check-reboots" '' check-reboots = pkgs.writeShellScript "check-reboots" ''
set -eu set -eu
export SSH_CONFIG_FILE=${sshConfig}
c="${pkgs.colmena}/bin/colmena" c="${pkgs.colmena}/bin/colmena"
$c exec -- '[ "$(readlink /run/booted-system/kernel)" = "$(readlink /run/current-system/kernel)" ]' $c exec -- '[ "$(readlink /run/booted-system/kernel)" = "$(readlink /run/current-system/kernel)" ]'
''; '';
@ -71,19 +67,15 @@ let
in in
{ {
devShell = system: with helpers system; defaultPackage = system: with helpers system;
pkgs.mkShell { pkgs.writeShellScript "deploy-init" ''
buildInputs = [ pkgs.colmena ];
shellHook = ''
export SSH_CONFIG_FILE=${sshConfig} export SSH_CONFIG_FILE=${sshConfig}
alias ssh='ssh -F${sshConfig}' alias ssh='ssh -F${sshConfig}'
alias check-updates=${check-updates} alias check-updates=${check-updates}
alias check-reboots=${check-reboots} alias check-reboots=${check-reboots}
alias livecd-deploy=${livecd-deploy} alias livecd-deploy=${livecd-deploy}
alias c=colmena alias c=${pkgs.colmena}/bin/colmena
''; '';
};
colmena = colmena =
{ meta.nixpkgs = nixpkgs.legacyPackages."x86_64-linux"; } // { meta.nixpkgs = nixpkgs.legacyPackages."x86_64-linux"; } //