use btrfs again

This commit is contained in:
Christoph Cullmann 2024-03-25 20:03:49 +01:00
parent f6503be173
commit 4464c66386
3 changed files with 30 additions and 21 deletions

View file

@ -162,10 +162,11 @@ in
options = "--delete-older-than 7d"; options = "--delete-older-than 7d";
}; };
# avoid that nix hogs all CPUs # avoid that nix hogs all CPUs and enable new stuff
settings = { settings = {
max-jobs = 1; max-jobs = 1;
cores = 4; cores = 4;
experimental-features = "nix-command flakes";
}; };
# https://github.com/nix-community/nix-direnv # https://github.com/nix-community/nix-direnv

View file

@ -10,11 +10,17 @@
boot.initrd.kernelModules = [ "amdgpu" ]; boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
# system
boot.initrd.luks.devices."crypt-system".device = "/dev/disk/by-id/nvme-CT4000P3PSSD8_2325E6E63746-part2";
# vms
#boot.initrd.luks.devices."crypt-vms".device = "/dev/disk/by-id/ata-CT2000MX500SSD1_2138E5D5061F";
fileSystems."/" = fileSystems."/" =
{ device = "none"; { device = "/dev/mapper/crypt-system";
fsType = "tmpfs"; fsType = "btrfs";
neededForBoot = true; neededForBoot = true;
options = [ "defaults" "size=8G" "mode=755" ]; options = [ "subvol=root" "noatime" "nodiratime" ];
}; };
fileSystems."/boot" = fileSystems."/boot" =
@ -24,17 +30,17 @@
}; };
fileSystems."/nix" = fileSystems."/nix" =
{ device = "/dev/disk/by-id/nvme-CT4000P3PSSD8_2325E6E63746-part2"; { device = "/dev/mapper/crypt-system";
fsType = "bcachefs"; fsType = "btrfs";
neededForBoot = true; neededForBoot = true;
options = [ "noatime" "nodiratime" ]; options = [ "subvol=nix" "noatime" "nodiratime" ];
}; };
fileSystems."/data" = fileSystems."/data" =
{ device = "/dev/disk/by-id/nvme-CT4000P3PSSD8_2325E6E63746-part3"; { device = "/dev/mapper/crypt-system";
fsType = "bcachefs"; fsType = "btrfs";
neededForBoot = true; neededForBoot = true;
options = [ "noatime" "nodiratime" ]; options = [ "subvol=data" "noatime" "nodiratime" ];
}; };
fileSystems."/home" = fileSystems."/home" =
@ -61,13 +67,13 @@
depends = [ "/data" ]; depends = [ "/data" ];
}; };
fileSystems."/home/cullmann/vms" = # fileSystems."/home/cullmann/vms" =
{ device = "/dev/disk/by-id/ata-CT2000MX500SSD1_2138E5D5061F"; # { device = "/dev/disk/by-id/ata-CT2000MX500SSD1_2138E5D5061F";
fsType = "bcachefs"; # fsType = "bcachefs";
neededForBoot = true; # neededForBoot = true;
options = [ "noatime" "nodiratime" ]; # options = [ "noatime" "nodiratime" ];
depends = [ "/home" ]; # depends = [ "/home" ];
}; # };
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;

View file

@ -124,6 +124,10 @@ mount --bind /mnt/data/home /mnt/home
mount --bind /mnt/data/root /mnt/root mount --bind /mnt/data/root /mnt/root
mount --bind /mnt/data/nixos/$HOST /mnt/etc/nixos mount --bind /mnt/data/nixos/$HOST /mnt/etc/nixos
# create fake /data to have the right paths
mkdir -p /data
mount --bind /mnt/data /data
# take a look # take a look
mount mount
@ -137,17 +141,15 @@ cp /mnt/etc/nixos/configuration.nix /tmp
# copy config data # copy config data
# patch some paths there
sudo scp -r /data/nixos root@192.168.13.100:/mnt/data sudo scp -r /data/nixos root@192.168.13.100:/mnt/data
# install # install
nixos-install --no-root-passwd --root /mnt nixos-install --option experimental-features 'nix-command flakes' --no-root-passwd --root /mnt
# unmount all stuff # unmount all stuff
umount -Rl /mnt umount -Rl /data /mnt
cryptsetup luksClose crypt-system cryptsetup luksClose crypt-system
# sync all /data after the install # sync all /data after the install