diff --git a/erase-your-darlings-todo.md b/erase-your-darlings-todo.md deleted file mode 100644 index 42e0303..0000000 --- a/erase-your-darlings-todo.md +++ /dev/null @@ -1,22 +0,0 @@ -# TO DO - -- Create option that enables the symlinks and such -- make default user have a hashedPasswordFile - - - -## Option - -```nix -# duh, nixos directory needs to be persistent -# and machine idrk why but the guide has it lmao -environment.etc = { - nixos.source = "/persist/etc/nixos"; - machine-id.source = "/persist/etc/machine-id"; -}; - -# This gets erased and it's really annoying to see the lecture everytime -security.sudo.extraConfig = '' - Defaults lecture = never -''; -``` diff --git a/erase-your-darlings-setup.sh b/misc/erase-your-darlings-setup.sh similarity index 76% rename from erase-your-darlings-setup.sh rename to misc/erase-your-darlings-setup.sh index b77c0ad..5694397 100644 --- a/erase-your-darlings-setup.sh +++ b/misc/erase-your-darlings-setup.sh @@ -1,5 +1,13 @@ +#!/bin/sh + DISK=/dev/null +set -e + +if [ $DISK == "/dev/null" ]; then + return 1 +fi + # Create two partitions here: p1 and p2 fdisk $DISK @@ -7,7 +15,7 @@ fdisk $DISK mkfs.vfat -n BOOT ${DISK}p1 mkfs.btrfs -L ROOT ${DISK}p2 -mount -t btrfs ${DISK}p2 +mount -t btrfs ${DISK}p2 /mnt # Creates btrfs subvolumes btrfs subvolume create /mnt/root @@ -50,6 +58,17 @@ nixos-generate-config --root /mnt # Add `neededForBoot = true;` to the logging subvolume nano /mnt/etc/nixos/hardware-configuration.nix -echo "Initial setup complete :D" -nixos-install +echo "Initial setup complete :D" && +echo "Installing in 5" && +sleep 1 && +echo "Installing in 4" && +sleep 1 && +echo "Installing in 3" && +sleep 1 && +echo "Installing in 2" && +sleep 1 && +echo "Installing in 1" && +sleep 1 && +echo "Installing now" +nixos-install && reboot diff --git a/modules/base/default.nix b/modules/base/default.nix index f1a01a5..0627d6d 100644 --- a/modules/base/default.nix +++ b/modules/base/default.nix @@ -3,5 +3,6 @@ ./nix.nix ./locale.nix ./secrets.nix + ./erase-your-darlings.nix ]; } diff --git a/modules/base/erase-your-darlings.nix b/modules/base/erase-your-darlings.nix new file mode 100644 index 0000000..1a43191 --- /dev/null +++ b/modules/base/erase-your-darlings.nix @@ -0,0 +1,28 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + cfg = config.horseman.base.erase-your-darlings; +in { + options = { + horseman.base.erase-your-darlings = { + enable = mkEnableOption "If set, assumes the machine has been set up as a Erase Your Darlings device"; + }; + }; + + config = mkIf cfg.enable { + environment.etc = { + nixos.source = "/persist/etc/nixos"; + machine-id.source = "/persist/etc/machine-id"; + }; + security.sudo.extraConfig = '' + Defaults lecture = never + ''; + + }; +}