feat: erase your darlings
This commit is contained in:
parent
d8653015d5
commit
34e69262ff
4 changed files with 51 additions and 25 deletions
|
|
@ -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
|
||||
'';
|
||||
```
|
||||
|
|
@ -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
|
||||
|
|
@ -3,5 +3,6 @@
|
|||
./nix.nix
|
||||
./locale.nix
|
||||
./secrets.nix
|
||||
./erase-your-darlings.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
28
modules/base/erase-your-darlings.nix
Normal file
28
modules/base/erase-your-darlings.nix
Normal file
|
|
@ -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
|
||||
'';
|
||||
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue