Add new script for install (untested)
This commit is contained in:
parent
d423ce4c0b
commit
69898664d4
2 changed files with 32 additions and 0 deletions
31
pkgs/install-nix/default.nix
Normal file
31
pkgs/install-nix/default.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
writeShellApplication,
|
||||
}:
|
||||
writeShellApplication
|
||||
{
|
||||
name = "install-nix";
|
||||
|
||||
runtimeInputs = [];
|
||||
|
||||
text = ''
|
||||
# An install script for NixOS installation to /tmp
|
||||
set -e
|
||||
hostname=$1
|
||||
if [[ "$1" == "" ]]; then
|
||||
echo "No hostname given, please specify a hostname"
|
||||
exit 2
|
||||
fi
|
||||
pushd /tmp
|
||||
git clone https://git.lillianviolet.dev/Lillian-Violet/NixOS-Config.git ./install
|
||||
pushd ./install
|
||||
echo "NixOS Installing..."
|
||||
sudo nixos-install --flake .#$1
|
||||
popd
|
||||
echo "Cleaning up repository in tmp..."
|
||||
rm -rf ./install
|
||||
popd
|
||||
notify-send -e "NixOS Install Succeeded!" --icon=software-update-available
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue