mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-11 07:10:39 +02:00
wip: remove very specific special args and unify library functions
This commit is contained in:
parent
dfc3084fe9
commit
68bb9731d3
28 changed files with 594 additions and 644 deletions
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
config,
|
||||
extraLib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
|
@ -9,7 +8,7 @@
|
|||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/disk/by-id/${config.repo.secrets.local.disk.main}";
|
||||
content = with extraLib.disko.gpt; {
|
||||
content = with config.lib.disko.gpt; {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
|
@ -20,27 +19,11 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
zpool = with extraLib.disko.zfs; {
|
||||
zpool = with config.lib.disko.zfs; {
|
||||
rpool = defaultZpoolOptions // {datasets = defaultZfsDatasets;};
|
||||
};
|
||||
};
|
||||
|
||||
boot.loader.grub.devices = ["/dev/disk/by-id/${config.repo.secrets.local.disk.main}"];
|
||||
boot.initrd.luks.devices.enc-rpool.allowDiscards = true;
|
||||
# TODO remove once this is upstreamed
|
||||
boot.initrd.systemd.services."zfs-import-rpool".after = ["cryptsetup.target"];
|
||||
fileSystems."/state".neededForBoot = true;
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
|
||||
# After importing the rpool, rollback the root system to be empty.
|
||||
boot.initrd.systemd.services.impermanence-root = {
|
||||
wantedBy = ["initrd.target"];
|
||||
after = ["zfs-import-rpool.service"];
|
||||
before = ["sysroot.mount"];
|
||||
unitConfig.DefaultDependencies = "no";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.zfs}/bin/zfs rollback -r rpool/local/root@blank";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue