aboutsummaryrefslogtreecommitdiff
path: root/installer/iso.nix
diff options
context:
space:
mode:
authorPreston Pan <ret2pop@gmail.com>2025-01-10 20:36:05 -0800
committerPreston Pan <ret2pop@gmail.com>2025-01-10 20:36:05 -0800
commiteb8681997217668dd6e292f20b4198613d500f74 (patch)
treea434c45e8182d366e68508f6842a85ddcf59982c /installer/iso.nix
parentc9dc4923318e60b7440de972570be8dcedb02b41 (diff)
sops-nix
Diffstat (limited to 'installer/iso.nix')
-rw-r--r--installer/iso.nix17
1 files changed, 16 insertions, 1 deletions
diff --git a/installer/iso.nix b/installer/iso.nix
index cb92f14..1b84bf5 100644
--- a/installer/iso.nix
+++ b/installer/iso.nix
@@ -1,4 +1,7 @@
{ pkgs, lib, ... }:
+let
+ commits = ./commits.nix;
+in
{
documentation = {
enable = true;
@@ -126,20 +129,32 @@
''
#!/usr/bin/env bash
set -euo pipefail
+
if [ "$(id -u)" -eq 0 ]; then
echo "ERROR! $(basename "$0") should be run as a regular user"
exit 1
fi
+
+ping -q -c1 google.com &>/dev/null && echo "online! Proceeding with the installation..." || nmtui
+
if [ ! -d "$HOME/toughnix/" ]; then
cd $HOME
git clone https://git.nullring.xyz/toughnix.git
+ cd toughnix
+ git checkout "${commits.toughnixCommitHash}"
+ cd $HOME
fi
+
vim "$HOME/toughnix/desktop/vars.nix"
vim "$HOME/toughnix/desktop/sda-simple.nix"
-sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --mode destroy,format,mount "$HOME/toughnix/desktop/sda-simple.nix"
+sudo nix --experimental-features "nix-command flakes" run "github:nix-community/disko/${commits.diskoCommitHash}" -- --mode destroy,format,mount "$HOME/toughnix/desktop/sda-simple.nix"
cd /mnt
sudo nixos-install --flake $HOME/toughnix#continuity
+sudo cp $HOME/toughnix "/mnt/home/$(ls /mnt/home/)/"
+echo "Installation complete! Rebooting..."
+sleep 3
+reboot
'')
];
};