More disko and hardware changes
This commit is contained in:
parent
dca52b5676
commit
5f2fd98653
|
@ -19,7 +19,7 @@ let
|
||||||
];
|
];
|
||||||
in {
|
in {
|
||||||
boot = {
|
boot = {
|
||||||
# HAS to be unstable to get the newest NVIDIA drivers
|
# Must be unstable for newest NVIDIA drivers
|
||||||
kernelPackages = pkgs.unstable.linuxPackages_latest;
|
kernelPackages = pkgs.unstable.linuxPackages_latest;
|
||||||
blacklistedKernelModules = [ "pcspkr" ];
|
blacklistedKernelModules = [ "pcspkr" ];
|
||||||
kernel.sysctl."vm.max_map_count" = 2147483642;
|
kernel.sysctl."vm.max_map_count" = 2147483642;
|
||||||
|
@ -29,7 +29,7 @@ in {
|
||||||
systemd = {
|
systemd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
services.root-reset = {
|
services.root-reset = {
|
||||||
description = "Reset BTRFS root and snapshot last boot";
|
description = "Reset root and snapshot last boot";
|
||||||
wantedBy = [ "initrd.target" ];
|
wantedBy = [ "initrd.target" ];
|
||||||
after = [ "dev-nixos-root.device" ];
|
after = [ "dev-nixos-root.device" ];
|
||||||
before = [ "sysroot.mount" ];
|
before = [ "sysroot.mount" ];
|
||||||
|
@ -39,18 +39,18 @@ in {
|
||||||
mkdir -p /mnt
|
mkdir -p /mnt
|
||||||
mount /dev/nixos/root /mnt
|
mount /dev/nixos/root /mnt
|
||||||
|
|
||||||
if [[ -e /mnt/@prev ]]; then
|
if [[ -e /mnt/prev ]]; then
|
||||||
btrfs subvolume delete /mnt/@prev
|
btrfs subvolume delete /mnt/prev
|
||||||
fi
|
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"
|
btrfs subvolume delete "/mnt/$subvolume"
|
||||||
done
|
done
|
||||||
|
|
||||||
btrfs subvolume delete /mnt/@
|
btrfs subvolume delete /mnt/root
|
||||||
btrfs subvolume create /mnt/@
|
btrfs subvolume create /mnt/root
|
||||||
|
|
||||||
umount /mnt
|
umount /mnt
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -66,17 +66,13 @@
|
||||||
mountpoint = "/persist";
|
mountpoint = "/persist";
|
||||||
mountOptions = [ "compress=zstd" "noatime" ];
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
};
|
};
|
||||||
"/persist/.snapshots" = {
|
"/persist/.snapshots" = { };
|
||||||
mountOptions = [ "compress=zstd" "noatime" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
"/jimbo" = {
|
"/jimbo" = {
|
||||||
mountpoint = "/persist/home/jimbo";
|
mountpoint = "/persist/home/jimbo";
|
||||||
mountOptions = [ "compress=zstd" "noatime" ];
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
};
|
};
|
||||||
"/jimbo/.snapshots" = {
|
"/jimbo/.snapshots" = { };
|
||||||
mountOptions = [ "compress=zstd" "noatime" ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -63,10 +63,6 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [
|
|
||||||
{ device = "/dev/nixos/swap"; }
|
|
||||||
];
|
|
||||||
|
|
||||||
networking.useDHCP = lib.mkDefault true;
|
networking.useDHCP = lib.mkDefault true;
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
|
Loading…
Reference in a new issue