loki: Add samba, spice-gtk

This commit is contained in:
Erwin Boskma 2025-01-14 19:45:47 +01:00
parent 63c7a2966c
commit 2713f1578d
Signed by: erwin
SSH key fingerprint: SHA256:9LmFDe1C6jSrEyqxxvX8NtJBmcbB105XoqyUZF092bg
2 changed files with 63 additions and 0 deletions

View file

@ -66,6 +66,9 @@
wallpaper = ../../wallpapers/river-2560.png;
wayvnc = false;
};
samba = {
enable = true;
};
tailscale = {
enable = true;
nftables = true;
@ -228,6 +231,8 @@
to = 1410;
}
];
allowPing = true;
};
wireless.iwd = {
@ -450,6 +455,8 @@
};
};
virtualisation.spiceUSBRedirection.enable = true;
programs = {
sway = {
enable = true;
@ -556,6 +563,7 @@
systemPackages = with pkgs; [
incus
iwgtk
spice-gtk
tailscale
];
};

55
modules/samba/default.nix Normal file
View file

@ -0,0 +1,55 @@
{
pkgs,
config,
lib,
...
}:
with lib;
let
cfg = config.eboskma.samba;
sharedFolder = types.submodule {
options = {
path = mkOption {
description = "Path";
type = types.path;
example = literalExpression "/srv/files";
};
name = mkOption {
description = "Name of the share. Defaults to folder name of {option}`eboskma.samba.shares.*.path`";
type = types.nullOr types.str;
};
};
};
in
{
options.eboskma.samba = {
enable = mkEnableOption "Shared folders over CIFS";
shares = mkOption {
description = "Folders to share";
type = types.listOf sharedFolder;
default = [ ];
};
};
config = mkIf cfg.enable {
services = {
samba = {
enable = true;
package = pkgs.samba4Full;
nmbd.enable = true;
openFirewall = true;
usershares = {
enable = true;
group = "users";
};
};
samba-wsdd = {
enable = true;
openFirewall = true;
};
};
};
}