refactor2
This commit is contained in:
parent
f0a79a07f1
commit
06f6636d75
5 changed files with 57 additions and 63 deletions
|
|
@ -1,28 +1,19 @@
|
|||
{ config, lib, ... }: {
|
||||
|
||||
options.nfs.client.enable = lib.mkEnableOption "Enable Nas (via NFS) as a client";
|
||||
options.nfs.server.enable = lib.mkEnableOption "Enable Nas (via NFS) as the server";
|
||||
# options.nfs.server.enable = lib.mkEnableOption "Enable Nas (via NFS) as the server";
|
||||
|
||||
config = lib.mkMerge [
|
||||
(
|
||||
lib.mkIf config.nfs.client.enable {
|
||||
fileSystems."/mnt/nas" = {
|
||||
device = "nixserver:/share";
|
||||
fsType = "nfs";
|
||||
options = [
|
||||
"nfsvers=4.2"
|
||||
"noauto"
|
||||
"x-systemd.automount"
|
||||
"x-systemd.idle-timeout=600"
|
||||
"_netdev"
|
||||
];
|
||||
};
|
||||
}
|
||||
)
|
||||
(
|
||||
lib.mkIf config.nfs.server.enable {
|
||||
|
||||
}
|
||||
)
|
||||
];
|
||||
config = lib.mkIf config.nfs.client.enable {
|
||||
fileSystems."/mnt/nas" = {
|
||||
device = "nixserver:/share";
|
||||
fsType = "nfs";
|
||||
options = [
|
||||
"nfsvers=4.2"
|
||||
"noauto"
|
||||
"x-systemd.automount"
|
||||
"x-systemd.idle-timeout=600"
|
||||
"_netdev"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue