diff options
| author | Alejandro Soto <alejandro@34project.org> | 2024-07-14 17:53:13 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2024-07-15 09:34:00 -0600 |
| commit | 02abf4ed0131237c25e0a10db50fa4c41a902a50 (patch) | |
| tree | 20904894fc0952806e341cdaff5941e81b3ce51c /sys/fs/layout.nix | |
| parent | 08e746700341dda3e3bdf704332fc3c07053d3e7 (diff) | |
sys: final merge of dmz, hv into sys
Diffstat (limited to 'sys/fs/layout.nix')
| -rw-r--r-- | sys/fs/layout.nix | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/sys/fs/layout.nix b/sys/fs/layout.nix deleted file mode 100644 index 7e1ac2e..0000000 --- a/sys/fs/layout.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ lib, config, ... }: -with lib; let - cfg = config.local; -in -{ - options.local.fs.layout = with lib.types; { - sysHddBtrfs = mkOption { - default = null; - - type = nullOr (submodule { - options = { - sys = { - device = mkOption { - type = str; - }; - - ssd = mkOption { - type = bool; - }; - - root = mkOption { - type = str; - }; - - toplevel = mkOption { - type = str; - }; - }; - - hdd = { - device = mkOption { - type = str; - }; - - home = mkOption { - type = str; - }; - }; - }; - }); - }; - }; - - config = { - local.fs.btrfs = - let - sysHddBtrfs = layout: { - "/" = { - inherit (layout.sys) device ssd; - subvol = layout.sys.root; - }; - - "/toplevel" = { - inherit (layout.sys) device ssd; - subvol = layout.sys.toplevel; - }; - - "/hdd" = { - inherit (layout.hdd) device; - subvol = "/"; - ssd = false; - }; - - "/home" = { - inherit (layout.hdd) device; - subvol = layout.hdd.home; - ssd = false; - snapper = "home"; - }; - }; - - inherit (cfg.fs) layout; - - layoutMaps = [ sysHddBtrfs ]; - layoutOpts = [ layout.sysHddBtrfs ]; - valid = filter ({ snd, ... }: snd != null) (zipLists layoutMaps layoutOpts); - in - optionalAttrs (valid != [ ]) ((head valid).fst (head valid).snd); - - assertions = [ - { - assertion = length (filter (layout: layout != null) (attrValues cfg.fs.layout)) <= 1; - message = "Cannot enable more than one filesystem layout"; - } - ]; - }; -} |
