diff --git a/hosts/game-laptop/disko.nix b/hosts/game-laptop/disko.nix index 1653061..5e4e7f6 100644 --- a/hosts/game-laptop/disko.nix +++ b/hosts/game-laptop/disko.nix @@ -34,6 +34,6 @@ ]; }; }; - _file = ./disko.nix; }; + _file = ./disko.nix; } diff --git a/hosts/game-laptop/prime.nix b/hosts/game-laptop/prime.nix index db8c704..5620329 100644 --- a/hosts/game-laptop/prime.nix +++ b/hosts/game-laptop/prime.nix @@ -23,6 +23,6 @@ _: {config, ...}: { Option "OffTime" "0" Option "BlankTime" "0" ''; - _file = ./prime.nix; }; + _file = ./prime.nix; } diff --git a/hosts/gerg-desktop/containers/website.nix_ b/hosts/gerg-desktop/containers/website.nix similarity index 99% rename from hosts/gerg-desktop/containers/website.nix_ rename to hosts/gerg-desktop/containers/website.nix index 507c15e..c8733c6 100644 --- a/hosts/gerg-desktop/containers/website.nix_ +++ b/hosts/gerg-desktop/containers/website.nix @@ -22,7 +22,7 @@ _: { ephemeral = true; autoStart = true; privateNetwork = true; - hostBridge = "bridge0"; + hostBridge = "br0"; localAddress = "192.168.1.11/24"; bindMounts = { "/var" = { diff --git a/hosts/gerg-desktop/disko.nix b/hosts/gerg-desktop/disko.nix index 56a0fa5..6170169 100644 --- a/hosts/gerg-desktop/disko.nix +++ b/hosts/gerg-desktop/disko.nix @@ -31,7 +31,7 @@ }; } { - name = "zfsroot "; + name = "zfsroot"; start = "21G"; end = "100%"; content = { diff --git a/hosts/gerg-desktop/zfs.nix b/hosts/gerg-desktop/zfs.nix index be6d9f4..8651445 100644 --- a/hosts/gerg-desktop/zfs.nix +++ b/hosts/gerg-desktop/zfs.nix @@ -1,6 +1,7 @@ _: { config, lib, + pkgs, ... }: { #link some stuff @@ -21,6 +22,7 @@ _: { "/efi22".options = ["nofail"]; "/efi0E".options = ["nofail"]; }; + boot = { zfs = { devNodes = "/dev/disk/by-id/"; @@ -29,24 +31,34 @@ _: { kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; #disable hibernate and set cache max kernelParams = ["nohibernate" "zfs.zfs_arc_max=17179869184"]; - supportedFilesystems = ["zfs" "vfat"]; initrd = { + supportedFilesystems = ["zfs" "vfat"]; #module for multiple swap devices kernelModules = ["dm_mod"]; #keyboard module for zfs password availableKernelModules = ["hid_generic"]; - #wipe / and /var on boot - postDeviceCommands = lib.mkAfter '' - #wipe everything - zfs rollback -r rpool/root@empty - zfs rollback -r rpool/var@empty - ''; + systemd.services.rollback = { + path = [pkgs.zfs]; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + }; + unitConfig.DefaultDependencies = "no"; + wantedBy = ["initrd.target"]; + after = ["zfs-import.target"]; + before = ["sysroot.mount"]; + script = '' + zfs rollback -r rpool/root@empty + zfs rollback -r rpool/var@empty + ''; + }; }; plymouth.enable = false; loader = { generationsDir.copyKernels = true; #override default systemd-boot.enable = false; + efi.canTouchEfiVariables = false; grub = { enable = true; diff --git a/lib/default.nix b/lib/default.nix index 47b2052..a90210f 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -50,13 +50,13 @@ in { lib.genAttrs names ( name: lib.nixosSystem { - inherit system; modules = builtins.attrValues self.nixosModules ++ importAll "${self}/hosts/${name}" ++ [ { networking.hostName = name; + nixpkgs = {inherit system;}; } ]; } diff --git a/modules/boot/misc.nix b/modules/boot/misc.nix index 9cefdd4..0bd2ff6 100644 --- a/modules/boot/misc.nix +++ b/modules/boot/misc.nix @@ -70,7 +70,13 @@ }; }; systemd.services.efibootmgr = { - serviceConfig.Type = "oneshot"; + reloadIfChanged = false; + restartIfChanged = false; + stopIfChanged = false; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + }; path = [pkgs.efibootmgr]; wantedBy = ["default.target"]; script = ''