mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
messed with initrd and got zfs rollback working again
This commit is contained in:
parent
fd87459163
commit
8694fbce19
7 changed files with 31 additions and 13 deletions
|
|
@ -34,6 +34,6 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
_file = ./disko.nix;
|
||||
};
|
||||
_file = ./disko.nix;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,6 @@ _: {config, ...}: {
|
|||
Option "OffTime" "0"
|
||||
Option "BlankTime" "0"
|
||||
'';
|
||||
_file = ./prime.nix;
|
||||
};
|
||||
_file = ./prime.nix;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ _: {
|
|||
ephemeral = true;
|
||||
autoStart = true;
|
||||
privateNetwork = true;
|
||||
hostBridge = "bridge0";
|
||||
hostBridge = "br0";
|
||||
localAddress = "192.168.1.11/24";
|
||||
bindMounts = {
|
||||
"/var" = {
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
};
|
||||
}
|
||||
{
|
||||
name = "zfsroot ";
|
||||
name = "zfsroot";
|
||||
start = "21G";
|
||||
end = "100%";
|
||||
content = {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue