149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 *
This commit is contained in:
@@ -31,6 +31,9 @@ in
|
|||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./services
|
./services
|
||||||
|
./shares/nfs.nix
|
||||||
|
./shares/smb.nix
|
||||||
|
./shares/zfs.nix.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
@@ -45,4 +48,3 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
{ pkgs, config, lib, ... }:
|
|
||||||
|
|
||||||
# define nfs exports
|
|
||||||
let
|
|
||||||
cfg = config.modules.homelab.nfs;
|
|
||||||
nfs_exports = ''
|
|
||||||
/holocron/vault *(rw,sync,no_subtree_check,no_root_squash)
|
|
||||||
/holocron/media *(ro,sync,no_subtree_check)
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.homelab.nfs = {
|
|
||||||
enable = lib.mkEnableOption "enables nfs";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
# enable nfs with all exports
|
|
||||||
services.nfs = {
|
|
||||||
server = {
|
|
||||||
enable = true;
|
|
||||||
exports = nfs_exports;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
{ pkgs, config, lib, ... }:
|
|
||||||
|
|
||||||
# define smb shares
|
|
||||||
let
|
|
||||||
cfg = config.modules.homelab.smb;
|
|
||||||
smb_shares = {
|
|
||||||
vault = {
|
|
||||||
path = "/holocron/vault";
|
|
||||||
browseable = true;
|
|
||||||
writable = true;
|
|
||||||
guestOk = false;
|
|
||||||
};
|
|
||||||
media = {
|
|
||||||
path = "/holocron/media";
|
|
||||||
browseable = true;
|
|
||||||
writable = true;
|
|
||||||
guestOk = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.homelab.smb = {
|
|
||||||
enable = lib.mkEnableOption "enables smb";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
# enable smb with all shares
|
|
||||||
services.samba = {
|
|
||||||
enable = true;
|
|
||||||
settings = smb_shares;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
{ pkgs, config, lib, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.homelab.zfs;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.homelab.zfs = {
|
|
||||||
enable = lib.mkEnableOption "enables zfs";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
# set network host id
|
|
||||||
networking.hostId = "3e6e7055";
|
|
||||||
|
|
||||||
# enable zfs support
|
|
||||||
boot.kernelModules = [ "zfs" ];
|
|
||||||
boot.supportedFilesystems = [ "zfs" ];
|
|
||||||
|
|
||||||
# enable smart monitoring
|
|
||||||
services.smartd.enable = true;
|
|
||||||
|
|
||||||
# enable zfs
|
|
||||||
services.zfs = {
|
|
||||||
autoScrub.enable = true;
|
|
||||||
autoScrub.interval = "weekly";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/holocron" = {
|
|
||||||
device = "holocron";
|
|
||||||
fsType = "zfs";
|
|
||||||
options = [ "nofail" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user