Initial dendritic rewrite
This commit is contained in:
37
modules/fileSystems/eclypsecloud-shares.nix
Normal file
37
modules/fileSystems/eclypsecloud-shares.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
inputs,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
{
|
||||
flake.modules.nixos.eclypsecloud-shares =
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = with self.factory.nixos; [
|
||||
(cifs {
|
||||
destination = "/mnt/EclypseCloud";
|
||||
host = "100.78.212.35";
|
||||
resource = "EclypseCloud";
|
||||
credentialsPath = config.age.secrets.eclypsecloud-eclypse.path;
|
||||
uid = config.users.users.eclypse.uid;
|
||||
})
|
||||
(cifs {
|
||||
destination = "/mnt/Music";
|
||||
host = "100.78.212.35";
|
||||
resource = "music";
|
||||
credentialsPath = config.age.secrets.eclypsecloud-eclypse.path;
|
||||
uid = config.users.users.eclypse.uid;
|
||||
})
|
||||
];
|
||||
|
||||
age.secrets.eclypsecloud-eclypse.rekeyFile = "${inputs.secrets}/eclypsecloud-eclypse.age";
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
cifs-utils
|
||||
];
|
||||
};
|
||||
}
|
||||
40
modules/fileSystems/factory.nix
Normal file
40
modules/fileSystems/factory.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
flake.factory.nixos.cifs =
|
||||
{
|
||||
destination,
|
||||
host,
|
||||
resource,
|
||||
credentialsPath,
|
||||
uid,
|
||||
gid ? null,
|
||||
}:
|
||||
{
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
fileSystems."${destination}" = {
|
||||
device = "//${host}/${resource}";
|
||||
fsType = "cifs";
|
||||
options =
|
||||
let
|
||||
automount-opts = [
|
||||
"x-systemd.automount"
|
||||
"x-systemd.idle-timeout=60"
|
||||
"x-systemd.device-timeout=5s"
|
||||
"x-systemd.mount-timeout=5s"
|
||||
"noauto"
|
||||
"nofail"
|
||||
"soft"
|
||||
];
|
||||
mount-opts = [
|
||||
"rw"
|
||||
"iocharset=utf8"
|
||||
];
|
||||
user = [ "uid=${toString uid}" ] ++ (lib.optionals (gid != null) [ "gid=${toString gid}" ]);
|
||||
credentials = [ "credentials=${credentialsPath}" ];
|
||||
in
|
||||
automount-opts ++ mount-opts ++ user ++ credentials;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user