homeserver: enabled samba
This commit is contained in:
parent
0713245e6e
commit
5d27259205
|
@ -6,5 +6,8 @@ in
|
|||
options.profile.services = {
|
||||
caddy.enable = mkEnableOption "caddy";
|
||||
cockpit.enable = mkEnableOption "cockpit";
|
||||
forgejo.enable = mkEnableOption "forgejo";
|
||||
kavita.enable = mkEnableOption "kavita";
|
||||
samba.enable = mkEnableOption "samba";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -36,6 +36,9 @@
|
|||
services = {
|
||||
caddy.enable = true;
|
||||
cockpit.enable = true;
|
||||
forgejo.enable = true;
|
||||
kavita.enable = true;
|
||||
samba.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
imports = [
|
||||
./caddy.nix
|
||||
./cockpit.nix
|
||||
./samba.nix
|
||||
];
|
||||
}
|
||||
|
|
22
system/services/forgejo.nix
Normal file
22
system/services/forgejo.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.profile.services.forgejo;
|
||||
inherit (lib) mkIf;
|
||||
in
|
||||
{
|
||||
config = mkIf cfg.enable {
|
||||
sops.secrets."forgejo" = {
|
||||
sopsFile = ../../secrets/caddy_reverse_proxy.yaml;
|
||||
path = "/etc/caddy/sites-enabled/forgejo";
|
||||
mode = "0440";
|
||||
};
|
||||
|
||||
services.forgejo = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server.PROTOCOL = "http+unix";
|
||||
session.COOKIE_SECURE = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
37
system/services/samba.nix
Normal file
37
system/services/samba.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.profile.services.samba;
|
||||
user = config.profile.user;
|
||||
inherit (lib) mkIf;
|
||||
in
|
||||
{
|
||||
config = mkIf cfg.enable {
|
||||
services.samba = {
|
||||
enable = true;
|
||||
securityType = "user";
|
||||
openFirewall = true;
|
||||
extraConfig = ''
|
||||
workgroup = WORKGROUP
|
||||
server string = smbnix
|
||||
netbios name = smbnix
|
||||
security = user
|
||||
'';
|
||||
shares = {
|
||||
nas = {
|
||||
path = "/nas";
|
||||
browsable = "yes";
|
||||
"read only" = "no";
|
||||
"guest ok" = "yes";
|
||||
"create mask" = "0777";
|
||||
"directory mask" = "0777";
|
||||
"force user" = user.name;
|
||||
"force group" = user.name;
|
||||
};
|
||||
};
|
||||
};
|
||||
services.samba-wsdd = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue