new nixre.... that builds locally and can then copy and activate to/on another machine

This commit is contained in:
Sebastian Moser
2023-11-01 19:34:06 +01:00
parent 83df7ae4da
commit d42984f249
2 changed files with 65 additions and 17 deletions

View File

@@ -259,23 +259,6 @@
ip -json addr show $1 | jq -r '.[] | .addr_info[] | select(.family == "inet") | .local'
}
# my nixos rebuild
function nixre(){
nix flake prefetch --refresh github:c2vi/nixos
if [ "$1" == "boot" ]
then
nix build github:c2vi/nixos#nixosConfigurations.c2vi-main.config.system.build.toplevel --impure ''${@:2} \
&& sudo ./result/bin/switch-to-configuration boot \
&& rm ./result
else
nix build github:c2vi/nixos#nixosConfigurations.c2vi-main.config.system.build.toplevel --impure $@ \
&& sudo ./result/bin/switch-to-configuration switch \
&& rm ./result
fi
}
#################### completions ####################
complete -cf sudo
complete -cf sd