switch to facter for this too

This commit is contained in:
Mars 2024-11-07 01:27:11 -05:00
parent b32af9ddda
commit 76c1d36e5f
Signed by: pupbrained
GPG key ID: 0FF5B8826803F895
10 changed files with 6921 additions and 476 deletions

View file

@ -5,9 +5,77 @@
lib,
...
}: {
imports = [
./hardware.nix
];
# boot.initrd.systemd.services.wipe-root = {
# requires = ["dev-mapper-enc.device"];
# after = ["dev-mapper-enc.device"];
# wantedBy = ["initrd.target"];
# script = lib.mkAfter ''
# mkdir /btrfs_tmp
# mount /dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b /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 +30); do
# delete_subvolume_recursively "$i"
# done
#
# btrfs subvolume create /btrfs_tmp/root
# umount /btrfs_tmp
# '';
# };
facter.reportPath = ./facter.json;
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b";
fsType = "btrfs";
options = ["subvol=root"];
};
"/home" = {
device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b";
fsType = "btrfs";
options = ["subvol=home" "compress=zstd"];
};
"/nix" = {
device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b";
fsType = "btrfs";
options = ["subvol=nix" "compress=zstd" "noatime"];
};
"/persist" = {
device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b";
neededForBoot = true;
fsType = "btrfs";
options = ["subvol=persist" "compress=zstd"];
};
"/var/log" = {
device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b";
fsType = "btrfs";
options = ["subvol=log" "compress=zstd" "noatime"];
neededForBoot = true;
};
"/boot" = {
device = "/dev/disk/by-uuid/12CE-A600";
fsType = "vfat";
options = ["fmask=0022" "dmask=0022"];
};
};
security = {
rtkit.enable = true;
@ -67,10 +135,6 @@
console.catppuccin.enable = true;
systemd.tmpfiles.rules = [
"f /dev/shm/looking-glass 0660 marshall qemu-libvirtd -"
];
systemd.user.extraConfig = let
path = lib.concatStringsSep ":" [
"/run/wrappers/bin"
@ -88,24 +152,12 @@
};
chaotic.scx.enable = true;
chaotic.scx.package = pkgs.scx_git.rustland;
chaotic.scx.scheduler = "scx_rustland";
virtualisation = {
spiceUSBRedirection.enable = true;
libvirtd = {
enable = true;
onBoot = "ignore";
onShutdown = "shutdown";
qemu = {
package = pkgs.qemu_kvm;
swtpm.enable = true;
runAsRoot = false;
ovmf.enable = true;
ovmf.packages = [pkgs.OVMFFull.fd];
};
};
waydroid.enable = true;
podman = {
enable = true;
@ -131,6 +183,7 @@
snowfallorg.flake
sound-theme-freedesktop
virtio-win
qemu
(warp-terminal.override {waylandSupport = true;})
winetricks
wineWowPackages.staging
@ -158,6 +211,9 @@
kernelPackages = pkgs.linuxPackages_cachyos;
supportedFilesystems = ["btrfs" "ntfs"];
initrd.luks.devices."enc".device = "/dev/disk/by-uuid/9952fcd1-46eb-4c9c-ab7d-361d31fdb9a2";
tmp.useTmpfs = true;
# initrd.systemd = {
# enable = true;
# emergencyAccess = true; # No password needed because of LUKS
@ -194,11 +250,7 @@
};
};
nix = let
nixSuper = inputs.nix-super.packages.${pkgs.system}.default;
in {
package = lib.mkForce nixSuper;
nix = {
daemonCPUSchedPolicy = "batch";
daemonIOSchedClass = "idle";
daemonIOSchedPriority = 7;
@ -430,7 +482,6 @@
};
services = {
btrfs.autoScrub.enable = true;
ddccontrol.enable = true;
flatpak.enable = true;
getty.autologinUser = "marshall";
@ -439,6 +490,11 @@
spice-vdagentd.enable = true;
udisks2.enable = true;
btrfs.autoScrub = {
enable = true;
fileSystems = ["/dev/mapper/enc"];
};
displayManager.cosmic-greeter.enable = true;
desktopManager.cosmic.enable = true;

File diff suppressed because it is too large Load diff

View file

@ -1,93 +0,0 @@
{
config,
lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
boot.tmp.useTmpfs = true;
fileSystems."/" = {
device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b";
fsType = "btrfs";
options = ["subvol=root"];
};
# boot.initrd.systemd.services.wipe-root = {
# requires = ["dev-mapper-enc.device"];
# after = ["dev-mapper-enc.device"];
# wantedBy = ["initrd.target"];
# script = lib.mkAfter ''
# mkdir /btrfs_tmp
# mount /dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b /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 +30); do
# delete_subvolume_recursively "$i"
# done
#
# btrfs subvolume create /btrfs_tmp/root
# umount /btrfs_tmp
# '';
# };
boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/9952fcd1-46eb-4c9c-ab7d-361d31fdb9a2";
fileSystems."/home" = {
device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b";
fsType = "btrfs";
options = ["subvol=home" "compress=zstd"];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b";
fsType = "btrfs";
options = ["subvol=nix" "compress=zstd" "noatime"];
};
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b";
neededForBoot = true;
fsType = "btrfs";
options = ["subvol=persist" "compress=zstd"];
};
fileSystems."/var/log" = {
device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b";
fsType = "btrfs";
options = ["subvol=log" "compress=zstd" "noatime"];
neededForBoot = true;
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/12CE-A600";
fsType = "vfat";
options = ["fmask=0022" "dmask=0022"];
};
swapDevices = [];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}