better install process

This commit is contained in:
Daniella / Tove 2024-10-19 02:39:35 +02:00
parent fd24b82583
commit fff236b4ea
3 changed files with 39 additions and 0 deletions

View file

@ -18,6 +18,13 @@ nix-shell -p git
rm configuration.nix
cd /mnt/etc/nixos
git clone https://git.tudbut.de/tudbut/nix-setup
pushd nix-setup ; mv $(ls -a) .. ; popd
exit
bash init.sh
nixos-install
```
on the install:
```sh
nixos-edit init
```

26
init.sh Normal file
View file

@ -0,0 +1,26 @@
#!/bin/sh
echo this is meant to be run from the iso!!!
if [ -e "/mnt/etc/nixos" ] ; then
echo "iso detected. continue!"
else
echo "you don't appear to be in the install iso."
echo -n "are you SURE??? (y/N) "
read sure
if ! [ "$sure" = "y" ] ; then
echo "ok. exiting."
exit 0
fi
echo "i will continue."
fi
echo "setting up channels:"
echo deleting old
nix-channel --remove nixos
echo adding os channel
nix-channel --add "https://channels.nixos.org/nixos-unstable" nixos
echo adding pkgs channel
nix-channel --add "https://channels.nixos.org/nixpkgs-unstable" nixpkgs
echo updating
nix-channel --update
echo "all set."

View file

@ -3,6 +3,12 @@ with import <nixpkgs> {};
pkgs.writeShellScriptBin "nixos-edit" ''
#!/bin/sh
if [ "$1" = "init" ] ; then
sudo chown -R tudbut: /etc/nixos
echo dir setup done
exit 0
fi
cd /etc/nixos
if [ "$1" = "pull" ] ; then
git pull