Working mounted encrypted file system! Neat.
This commit is contained in:
parent
eef580d596
commit
3d5d7e389e
@ -5,11 +5,13 @@ let
|
|||||||
hostname = config.instance.hostname;
|
hostname = config.instance.hostname;
|
||||||
host-filesystems = config.fudo.hosts.${hostname}.encrypted-filesystems;
|
host-filesystems = config.fudo.hosts.${hostname}.encrypted-filesystems;
|
||||||
|
|
||||||
optionalOrDefault = tst: str: default: if tst then str else default;
|
optionalOrDefault = str: default: if (str != null) then str else default;
|
||||||
|
|
||||||
filesystemsToMountpointLists = mapAttrsToList
|
filesystemsToMountpointLists = mapAttrsToList
|
||||||
(fs: fsOpts: fsOpts.mountpoints);
|
(fs: fsOpts: fsOpts.mountpoints);
|
||||||
|
|
||||||
|
concatMapAttrs = f: as: concatMap (i: i) (mapAttrsToList f as);
|
||||||
|
|
||||||
in {
|
in {
|
||||||
config = {
|
config = {
|
||||||
users.groups = let
|
users.groups = let
|
||||||
@ -18,8 +20,10 @@ in {
|
|||||||
(nameValuePair mpOpts.group {
|
(nameValuePair mpOpts.group {
|
||||||
members = mpOpts.users;
|
members = mpOpts.users;
|
||||||
});
|
});
|
||||||
mountpointListsToGroups = mapConcat
|
mountpointListToGroups =
|
||||||
(mps: mapAttrsToList mountpointToGroups mps);
|
concatMapAttrs mountpointToGroups;
|
||||||
|
mountpointListsToGroups =
|
||||||
|
concatMap mountpointListToGroups;
|
||||||
in listToAttrs
|
in listToAttrs
|
||||||
(mountpointListsToGroups
|
(mountpointListsToGroups
|
||||||
(filesystemsToMountpointLists host-filesystems));
|
(filesystemsToMountpointLists host-filesystems));
|
||||||
|
@ -31,8 +31,13 @@ let
|
|||||||
in {
|
in {
|
||||||
config = {
|
config = {
|
||||||
boot = mkIf (initrd-cfg != null) {
|
boot = mkIf (initrd-cfg != null) {
|
||||||
kernelParams = [
|
kernelParams = let
|
||||||
"ip=${initrd-cfg.ip}"
|
site = config.instance.site;
|
||||||
|
site-gateway = site.gateway-v4;
|
||||||
|
netmask =
|
||||||
|
nixpkgs.lib.fudo.ip.maskFromV32Network site.network;
|
||||||
|
in [
|
||||||
|
"ip=${initrd-cfg.ip}:${site-gateway}:${netmask}:${hostname}:${initrd-cfg.interface}"
|
||||||
];
|
];
|
||||||
initrd = {
|
initrd = {
|
||||||
network = {
|
network = {
|
||||||
|
Loading…
Reference in New Issue
Block a user