diff --git a/machines/loki/configuration.nix b/machines/loki/configuration.nix index b175a07..0c7cd67 100644 --- a/machines/loki/configuration.nix +++ b/machines/loki/configuration.nix @@ -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 ]; }; diff --git a/modules/samba/default.nix b/modules/samba/default.nix new file mode 100644 index 0000000..ee8459e --- /dev/null +++ b/modules/samba/default.nix @@ -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; + }; + }; + }; +}