run nixfmt
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
types = {
|
||||
mount = lib.types.submodule {
|
||||
@@ -25,17 +30,17 @@ let
|
||||
cfg = config.modules.storageBoxMounts;
|
||||
secrets = config.age.secrets;
|
||||
|
||||
mountOptions = { uid, gid, ... }: [
|
||||
"x-systemd.automount"
|
||||
"auto"
|
||||
"x-systemd.device-timeout=5s"
|
||||
"x-systemd.mount-timeout=5s"
|
||||
"credentials=${secrets.storage-box-credentials.path}"
|
||||
] ++ (
|
||||
if (uid != null) then [ "uid=${toString uid}" ] else [ ]
|
||||
) ++ (
|
||||
if (gid != null) then [ "gid=${toString gid}" ] else [ ]
|
||||
);
|
||||
mountOptions =
|
||||
{ uid, gid, ... }:
|
||||
[
|
||||
"x-systemd.automount"
|
||||
"auto"
|
||||
"x-systemd.device-timeout=5s"
|
||||
"x-systemd.mount-timeout=5s"
|
||||
"credentials=${secrets.storage-box-credentials.path}"
|
||||
]
|
||||
++ (if (uid != null) then [ "uid=${toString uid}" ] else [ ])
|
||||
++ (if (gid != null) then [ "gid=${toString gid}" ] else [ ]);
|
||||
in
|
||||
{
|
||||
options.modules.storageBoxMounts = lib.mkOption {
|
||||
@@ -44,13 +49,15 @@ in
|
||||
};
|
||||
|
||||
config = {
|
||||
fileSystems = lib.mapAttrs
|
||||
(_: { path, user, ... }@options: {
|
||||
fileSystems = lib.mapAttrs (
|
||||
_:
|
||||
{ path, user, ... }@options:
|
||||
{
|
||||
device = "//${user}.your-storagebox.de${path}";
|
||||
fsType = "cifs";
|
||||
options = mountOptions options;
|
||||
})
|
||||
cfg;
|
||||
}
|
||||
) cfg;
|
||||
|
||||
environment.systemPackages = lib.mkIf ((lib.length (lib.attrNames cfg)) > 0) [ pkgs.cifs-utils ];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user