More disko and hardware changes

This commit is contained in:
Jimbo 2024-11-05 02:58:39 -05:00
parent dca52b5676
commit 5f2fd98653
3 changed files with 10 additions and 18 deletions

View file

@ -19,7 +19,7 @@ let
];
in {
boot = {
# HAS to be unstable to get the newest NVIDIA drivers
# Must be unstable for newest NVIDIA drivers
kernelPackages = pkgs.unstable.linuxPackages_latest;
blacklistedKernelModules = [ "pcspkr" ];
kernel.sysctl."vm.max_map_count" = 2147483642;
@ -29,7 +29,7 @@ in {
systemd = {
enable = true;
services.root-reset = {
description = "Reset BTRFS root and snapshot last boot";
description = "Reset root and snapshot last boot";
wantedBy = [ "initrd.target" ];
after = [ "dev-nixos-root.device" ];
before = [ "sysroot.mount" ];
@ -39,18 +39,18 @@ in {
mkdir -p /mnt
mount /dev/nixos/root /mnt
if [[ -e /mnt/@prev ]]; then
btrfs subvolume delete /mnt/@prev
if [[ -e /mnt/prev ]]; then
btrfs subvolume delete /mnt/prev
fi
btrfs subvolume snapshot /mnt/@ /mnt/@prev
btrfs subvolume snapshot /mnt/root /mnt/prev
btrfs subvolume list -o /mnt/@ | cut -f9 -d' ' | while read subvolume; do
btrfs subvolume list -o /mnt/root | cut -f9 -d' ' | while read subvolume; do
btrfs subvolume delete "/mnt/$subvolume"
done
btrfs subvolume delete /mnt/@
btrfs subvolume create /mnt/@
btrfs subvolume delete /mnt/root
btrfs subvolume create /mnt/root
umount /mnt
'';

View file

@ -66,17 +66,13 @@
mountpoint = "/persist";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/persist/.snapshots" = {
mountOptions = [ "compress=zstd" "noatime" ];
};
"/persist/.snapshots" = { };
"/jimbo" = {
mountpoint = "/persist/home/jimbo";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/jimbo/.snapshots" = {
mountOptions = [ "compress=zstd" "noatime" ];
};
"/jimbo/.snapshots" = { };
};
};
};

View file

@ -63,10 +63,6 @@
};
};
swapDevices = [
{ device = "/dev/nixos/swap"; }
];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;