diff --git a/machines/lisa/default.nix b/machines/lisa/default.nix index edcc989..7d5e1f2 100644 --- a/machines/lisa/default.nix +++ b/machines/lisa/default.nix @@ -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"; } diff --git a/machines/lisa/hardware.nix b/machines/lisa/hardware.nix index ca680f6..beffa57 100644 --- a/machines/lisa/hardware.nix +++ b/machines/lisa/hardware.nix @@ -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"; }];