forked from DGNum/liminix
add liminix-rebuild command
This commit is contained in:
parent
b0a0fdcfcc
commit
b1f4db00a0
3 changed files with 17 additions and 0 deletions
|
@ -11,5 +11,6 @@
|
|||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp min-copy-closure.sh $out/bin/min-copy-closure
|
||||
cp liminix-rebuild.sh $out/bin/liminix-rebuild
|
||||
'';
|
||||
}
|
||||
|
|
14
pkgs/min-copy-closure/liminix-rebuild.sh
Executable file
14
pkgs/min-copy-closure/liminix-rebuild.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
target_host=$1
|
||||
shift
|
||||
|
||||
if [ -z "$target_host" ] ; then
|
||||
echo Usage: liminix-rebuild target-host params
|
||||
exit 1
|
||||
fi
|
||||
|
||||
toplevel=$(nix-build "$@" -A outputs.systemConfiguration --no-out-link)
|
||||
min-copy-closure $target_host $toplevel
|
||||
ssh $target_host cp -P $toplevel/bin/\* /
|
||||
ssh $target_host reboot
|
|
@ -7,6 +7,7 @@
|
|||
{
|
||||
writeText
|
||||
, lib
|
||||
, s6-init-bin
|
||||
, stdenv
|
||||
}:
|
||||
let
|
||||
|
@ -74,5 +75,6 @@ in attrset:
|
|||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
$STRIP --remove-section=.note --remove-section=.comment --strip-all makedevs -o $out/bin/activate
|
||||
ln -s ${s6-init-bin}/bin/init $out/bin/init
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue