diff options
author | Preston Pan <ret2pop@gmail.com> | 2025-01-09 14:49:49 -0800 |
---|---|---|
committer | Preston Pan <ret2pop@gmail.com> | 2025-01-09 14:49:49 -0800 |
commit | a410a402a5dc5c68208ab8d6610fade60c8639c0 (patch) | |
tree | ad1a15f899ba2ca397c0919f74e2c3634502d6c9 | |
parent | 87ce8be7319fa8612a7edcb9261272688ab099bb (diff) |
use disko instead of rolling my own scripts and fixes
-rw-r--r-- | desktop/configuration.nix (renamed from configuration.nix) | 5 | ||||
-rw-r--r-- | desktop/home.nix (renamed from home.nix) | 0 | ||||
-rw-r--r-- | desktop/vars.nix (renamed from vars.nix) | 0 | ||||
-rw-r--r-- | flake.nix | 8 | ||||
-rwxr-xr-x | initial-deploy.sh | 11 | ||||
-rw-r--r-- | install.sh | 15 | ||||
-rw-r--r-- | live/iso.nix (renamed from iso.nix) | 17 | ||||
-rw-r--r-- | sda/disk-config.nix (renamed from disk-config.nix) | 21 | ||||
-rwxr-xr-x | stg2.sh | 5 | ||||
-rwxr-xr-x | stg3.sh | 15 | ||||
-rwxr-xr-x | system-build.sh | 16 |
11 files changed, 24 insertions, 89 deletions
diff --git a/configuration.nix b/desktop/configuration.nix index 2790b66..7a09d9c 100644 --- a/configuration.nix +++ b/desktop/configuration.nix @@ -3,10 +3,7 @@ let vars = import ./vars.nix; in { - imports = - [ - ./hardware-configuration.nix - ]; + imports = []; documentation = { enable = true; diff --git a/home.nix b/desktop/home.nix index c3c48b4..c3c48b4 100644 --- a/home.nix +++ b/desktop/home.nix diff --git a/vars.nix b/desktop/vars.nix index d221dd2..d221dd2 100644 --- a/vars.nix +++ b/desktop/vars.nix @@ -34,7 +34,7 @@ ({pkgs, modulesPath, ...}: { imports = [(modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix")]; }) - ./iso.nix + ./live/iso.nix ]; }; @@ -54,16 +54,16 @@ imports = [ ]; }) lanzaboote.nixosModules.lanzaboote - ./configuration.nix + ./desktop/configuration.nix disko.nixosModules.disko - ./disk-config.nix + ./sda/disk-config.nix home-manager.nixosModules.home-manager { home-manager = { useGlobalPkgs = true; extraSpecialArgs = attrs; useUserPackages = true; - users.preston = import ./home.nix; + users.preston = import ./desktop/home.nix; }; } ]; diff --git a/initial-deploy.sh b/initial-deploy.sh deleted file mode 100755 index ac71dd2..0000000 --- a/initial-deploy.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Install git first, and you'd probably want vim to make changes. -# You'll also need an ssh key to my server. You can change the -# sources if you don't have access to my server. -sudo mv /etc/nixos/configuration.nix /etc/nixos/configuration.nix.old -sudo ln $HOME/src/toughnix/flake.nix /etc/nixos/ -sudo ln $HOME/src/toughnix/flake.lock /etc/nixos/ -sudo ln $HOME/src/toughnix/configuration.nix /etc/nixos/ -sudo ln $HOME/src/toughnix/home.nix /etc/nixos/ -sudo cp $HOME/src/toughnix/vars.nix /etc/nixos/ diff --git a/install.sh b/install.sh deleted file mode 100644 index 5e9dbf0..0000000 --- a/install.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -gum input --placeholder "Host Name" -clear; -gum input --placeholder "Host Name" -clear; -gum input --placeholder "Full Name" -clear; -gum input --placeholder "Website Remote (rsync)" -clear; -echo "" -gum input --placeholder "email" -gum input --placeholder "Username" -gum input --placeholder "Username" -gum input --placeholder "Username" @@ -123,8 +123,10 @@ curl gum (writeShellScriptBin "nix_installer" - ''#!/usr/bin/env bash + '' +#!/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 @@ -134,19 +136,14 @@ if [ ! -d "$HOME/toughnix/" ]; then cd $HOME git clone https://git.nullring.xyz/toughnix.git fi - -sudo nixos-generate-config -sudo cp /etc/nixos/hardware-configuration.nix ~/toughnix/ -sudo chown -R nixos:users "$HOME/toughnix" cd "$HOME/toughnix" git add . cd "$HOME" -vim "$HOME/toughnix/vars.nix" +vim "$HOME/toughnix/desktop/vars.nix" gum confirm --default=false \ - "🔥 🔥 🔥 WARNING!!!! This will ERASE ALL DATA on the disk $DISK. Are you sure you want to continue?" -sudo nix run 'github:nix-community/disko/latest#disko-install' -- --write-efi-boot-entries --flake './toughnix#continuity-dell' --disk main "$DISK" - '' - ) + "🔥 🔥 🔥 WARNING!!!! This will ERASE ALL DATA on the disk. Are you sure you want to continue?" +sudo nix run 'github:nix-community/disko/latest#disko-install' -- --write-efi-boot-entries --flake './toughnix#continuity-dell' +'') ]; }; }; diff --git a/disk-config.nix b/sda/disk-config.nix index ca67b19..7e275e5 100644 --- a/disk-config.nix +++ b/sda/disk-config.nix @@ -3,15 +3,12 @@ disk = { main = { type = "disk"; + device = "/dev/sda"; content = { type = "gpt"; partitions = { - boot = { - size = "1M"; - type = "EF02"; # for grub MBR - }; ESP = { - size = "1G"; + size = "500M"; type = "EF00"; content = { type = "filesystem"; @@ -20,12 +17,18 @@ mountOptions = [ "umask=0077" ]; }; }; - root = { + luks = { size = "100%"; content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; + type = "luks"; + name = "crypted"; + settings.allowDiscards = true; + passwordFile = "/tmp/secret.key"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; }; }; }; diff --git a/stg2.sh b/stg2.sh deleted file mode 100755 index bfabeac..0000000 --- a/stg2.sh +++ /dev/null @@ -1,5 +0,0 @@ -cd /etc/nixos -sudo nix --extra-experimental-features nix-command --extra-experimental-features flakes flake update -sudo nixos-rebuild switch --flake .#continuity-dell -# home manager weirdness -doas nixos-rebuild switch diff --git a/stg3.sh b/stg3.sh deleted file mode 100755 index fde932a..0000000 --- a/stg3.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -chmod 644 ~/src/toughnix/configuration.nix -chmod 644 ~/src/toughnix/home.nix -chmod 644 ~/src/toughnix/vars.nix -chmod 644 ~/src/toughnix/flake.lock -chmod 644 ~/src/toughnix/flake.nix - -doas chmod 644 /etc/nixos/configuration.nix -doas chmod 644 /etc/nixos/home.nix -doas chmod 644 /etc/nixos/vars.nix -doas chmod 644 /etc/nixos/flake.lock -doas chmod 644 /etc/nixos/flake.nix - -emacs --eval '(nerd-icons-install-fonts)' -emacs --eval '(all-the-icons-install-fonts)' diff --git a/system-build.sh b/system-build.sh deleted file mode 100755 index 986a3e4..0000000 --- a/system-build.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -sudo nixos-rebuild switch -cd /home/preston/src/hyprnixmacs -git add "./" -git commit -m "$1" -git push origin main -cd /home/preston/org/website -git add "./" -git commit -m "$2" -git push origin main -rsync -azvP ~/website_html/ root@nullring.xyz:/usr/share/nginx/ret2pop/ -aspell -d en dump master | aspell -l en expand > ~/.local/share/my.dict -#cd /home/preston/org/website/ -#git add . -#git commit "$2" -#git push origin main |