Transitionning lisa to uncrypted zfs

This commit is contained in:
Julien Malka 2022-01-12 23:40:17 +01:00
parent 33971396f3
commit 5e1fe991c1
No known key found for this signature in database
GPG key ID: 3C68E13964FEA07F
8 changed files with 88 additions and 62 deletions

View file

@ -36,7 +36,6 @@
networking.hostName = "lisa";
networking.interfaces.ens20.useDHCP = false;
networking.interfaces.ens20.ipv4.addresses = [{ address = "212.129.40.11"; prefixLength = 32; }];
#networking.defaultGateway = { interface = "ens20"; };
networking.localCommands = ''
ip r del default || ip r add default dev ens20
'';
@ -46,5 +45,11 @@
address = "2a01:e0a:5f9:9681:5880:c9ff:fe9f:3dfb";
prefixLength = 120;
}];
system.stateVersion = "20.09";
networking.hostId = "fbb334ae";
services.zfs.autoSnapshot.enable = true;
services.zfs.autoScrub.enable = true;
system.stateVersion = "21.11";
}

View file

@ -1,6 +1,8 @@
{ pkgs, config, lib, ... }:
{
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sd_mod" "sr_mod" ];
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
@ -8,18 +10,37 @@
boot.loader.efi.canTouchEfiVariables = true;
fileSystems."/" =
{
device = "/dev/disk/by-uuid/eaec3978-f462-4634-95e6-06d59512deb8";
fsType = "ext4";
device = "zroot/root";
fsType = "zfs";
};
fileSystems."/boot" =
{
device = "/dev/disk/by-uuid/EAD2-51DB";
device = "/dev/disk/by-uuid/F8EA-A684";
fsType = "vfat";
};
swapDevices = [];
boot.initrd.network = {
enable = true;
ssh = {
enable = true;
port = 2222;
hostKeys = [ /boot/initrd-ssh-key ];
authorizedKeys = lib.splitString "\n"
(builtins.readFile (pkgs.fetchurl {
url = "https://github.com/JulienMalka.keys";
sha256 = "sha256-nBgn7jOqi/nPHhTy3x/oirL+A4X2gbmwy1NXLZhV99M=";
}));
};
postCommands = ''
zpool import zroot
echo "zfs load-key -a; killall zfs" >> /root/.profile
'';
};
swapDevices =
[{ device = "/dev/disk/by-uuid/c19ec918-ba8c-4bab-9ee0-831465cb432e"; }];