run nixfmt

This commit is contained in:
Joakim Repomaa
2025-03-01 13:23:01 +02:00
parent a93d4afbcf
commit 8dfc9b5a6d
51 changed files with 1611 additions and 778 deletions

View File

@@ -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 ];
};