This commit is contained in:
TheCrazyInsanity
2025-12-18 14:26:37 -05:00
parent 1ec653af81
commit af861165e5
22 changed files with 109 additions and 25 deletions

0
README.md Normal file → Executable file
View File

0
flake.lock generated Normal file → Executable file
View File

0
flake.nix Normal file → Executable file
View File

0
global/default.nix Normal file → Executable file
View File

23
global/eraseyourdarlings.nix Normal file → Executable file
View File

@@ -1,7 +1,28 @@
{ lib, ... }: { lib, ... }:
{ {
boot.initrd.postResumeCommands = lib.mkAfter '' boot.initrd.postResumeCommands = lib.mkAfter ''
rm -rf /bin /etc /lib64 /srv /tmp /usr /var mkdir /btrfs_tmp
mount /dev/disk/by-label/BUTTER /btrfs_tmp
if [[ -e /btrfs_tmp/root ]]; then
mkdir -p /btrfs_tmp/old_roots
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
fi
delete_subvolume_recursively() {
IFS=$'\n'
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
delete_subvolume_recursively "/btrfs_tmp/$i"
done
btrfs subvolume delete "$1"
}
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +1); do
delete_subvolume_recursively "$i"
done
btrfs subvolume create /btrfs_tmp/root
umount /btrfs_tmp
''; '';
# impermanence # impermanence
environment.persistence."/persistent" = { environment.persistence."/persistent" = {

0
home/bash.nix Normal file → Executable file
View File

0
home/default.nix Normal file → Executable file
View File

0
home/git.nix Normal file → Executable file
View File

0
machines/homepc/configuration.nix Normal file → Executable file
View File

34
machines/homepc/hardware-configuration.nix Normal file → Executable file
View File

@@ -20,14 +20,40 @@
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
boot.supportedFileSystems = [ "btrfs" ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/2849654b-6c3c-4db7-9603-5fa96ce561aa"; device = "/dev/disk/by-uuid/3c89fa92-1d43-4c48-b228-e2725fa70ee9";
fsType = "ext4"; fsType = "btrfs";
options = [ "compress=zstd" ];
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/3c89fa92-1d43-4c48-b228-e2725fa70ee9";
fsType = "btrfs";
options = [ "compress=zstd" ];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/3c89fa92-1d43-4c48-b228-e2725fa70ee9";
fsType = "btrfs";
options = [ "compress=zstd" "noatime" ];
};
fileSystems."/swap" = {
device = "/dev/disk/by-uuid/3c89fa92-1d43-4c48-b228-e2725fa70ee9";
fsType = "btrfs";
options = [ "noatime" ];
};
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/3c89fa92-1d43-4c48-b228-e2725fa70ee9";
fsType = "btrfs";
options = [ "compress=zstd" ];
}; };
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/90C0-8767"; device = "/dev/disk/by-uuid/2260-4302";
fsType = "vfat"; fsType = "vfat";
options = [ options = [
"fmask=0077" "fmask=0077"
@@ -36,7 +62,7 @@
}; };
swapDevices = [ swapDevices = [
{ device = "/dev/disk/by-uuid/7762478c-1123-4a1f-9402-1bba3723e53d"; } { device = "/swap/swapfile"; }
]; ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";

0
machines/homepc/home.nix Normal file → Executable file
View File

4
machines/workstation/configuration.nix Normal file → Executable file
View File

@@ -20,12 +20,12 @@
../../modules/kde/default.nix ../../modules/kde/default.nix
../../modules/virtualization/default.nix ../../modules/virtualization/default.nix
# ../../modules/vr/default.nix # ../../modules/vr/default.nix
# ../../global/eraseyourdarlings.nix ../../global/eraseyourdarlings.nix
]; ];
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; # boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "workstation"; # Define your hostname. networking.hostName = "workstation"; # Define your hostname.

73
machines/workstation/hardware-configuration.nix Normal file → Executable file
View File

@@ -1,6 +1,3 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ {
config, config,
lib, lib,
@@ -8,7 +5,6 @@
modulesPath, modulesPath,
... ...
}: }:
{ {
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
@@ -16,24 +12,50 @@
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"xhci_pci" "xhci_pci"
"ehci_pci"
"ahci" "ahci"
"nvme"
"usbhid" "usbhid"
"usb_storage"
"sd_mod" "sd_mod"
"sr_mod" "btrfs"
]; ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ "btrfs" ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" "btrfs" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
boot.supportedFilesystems = [ "btrfs" ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/f111c9ae-2ac4-4b20-b46e-11d99552dfdd"; device = "/dev/disk/by-label/BUTTER";
fsType = "ext4"; fsType = "btrfs";
options = [ "compress=zstd" "subvol=root" ];
};
fileSystems."/home" = {
device = "/dev/disk/by-label/BUTTER";
fsType = "btrfs";
options = [ "compress=zstd" "subvol=home" ];
};
fileSystems."/nix" = {
# device = "/dev/disk/by-uuid/3c89fa92-1d43-4c48-b228-e2725fa70ee9";
device = "/dev/disk/by-label/BUTTER";
fsType = "btrfs";
options = [ "compress=zstd" "noatime" "subvol=nix" ];
};
# fileSystems."/swap" = {
# device = "/dev/disk/by-label/BUTTER";
# fsType = "btrfs";
# options = [ "noatime" "subvol=swap" ];
# };
fileSystems."/persistent" = {
device = "/dev/disk/by-label/BUTTER";
fsType = "btrfs";
options = [ "compress=zstd" "subvol=persist" ];
}; };
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/191D-6D31"; device = "/dev/disk/by-label/BOOT";
fsType = "vfat"; fsType = "vfat";
options = [ options = [
"fmask=0077" "fmask=0077"
@@ -41,14 +63,29 @@
]; ];
}; };
swapDevices = [ # fileSystems = {
{ device = "/dev/disk/by-uuid/11c4c704-87bc-4c76-b3e2-2166ef53dcaf"; } # "/".options = [ "compress=zstd" ];
]; # "/home".options = [ "compress=zstd" ];
# "/persist".options = [ "compress=zstd" ];
# "/nix".options = [ "compress=zstd" "noatime" ];
# "/swap".options = [ "noatime" ];
# };
# swapDevices = [
# { device = "/swap/swapfile"; }
# ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.graphics.enable = true; boot.loader.systemd-boot.enable = true;
services.xserver.videoDrivers = [ "nvidia" ]; boot.loader.efi.canTouchEfiVariables = false;
hardware.nvidia.open = false; # boot.loader.efiInstallAsRemovable = true;
networking.networkmanager.enable = true;
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true; # Fine since it's not a laptop.
system.stateVersion = "25.11"; # No touchy
} }

0
machines/workstation/home.nix Normal file → Executable file
View File

0
modules/communication/default.nix Normal file → Executable file
View File

0
modules/creative/default.nix Normal file → Executable file
View File

0
modules/development/default.nix Normal file → Executable file
View File

0
modules/fabrication/default.nix Normal file → Executable file
View File

0
modules/gaming/default.nix Normal file → Executable file
View File

0
modules/kde/default.nix Normal file → Executable file
View File

0
modules/virtualization/default.nix Normal file → Executable file
View File

0
modules/vr/default.nix Normal file → Executable file
View File