diff --git a/hosts/valefar/default.nix b/hosts/valefar/default.nix index a1b5597..5228216 100755 --- a/hosts/valefar/default.nix +++ b/hosts/valefar/default.nix @@ -39,6 +39,7 @@ modules.garage.enable = true; modules.forgejo.enable = true; modules.immich.enable = true; + modules.monero.enable = true; # ============================================================================= # NETWORKING @@ -147,7 +148,7 @@ systemd.tmpfiles.rules = [ "d /storage/immich 0755 immich immich -" "d /storage/immich/photos 0755 immich immich -" - "Z /storage/immich 0755 immich immich -" # Recursively fix ownership of existing files + "Z /storage/immich 0755 immich immich -" ]; # ============================================================================= @@ -160,44 +161,53 @@ ''; }; - services.samba = { + +services.samba = { enable = true; - securityType = "user"; - settings = { - global = { - "workgroup" = "WORKGROUP"; - "server string" = "smbnix"; - "netbios name" = "smbnix"; - "security" = "user"; - "hosts allow" = "100.64. 10.0.0. 127.0.0.1 localhost"; - "hosts deny" = "0.0.0.0/0"; - "guest account" = "nobody"; - "map to guest" = "bad user"; - "guest ok" = "yes"; - "public" = "yes"; - }; - "storage" = { - "path" = "/storage"; - "browseable" = "yes"; - "read only" = "no"; - "guest ok" = "yes"; - "public" = "yes"; - "force user" = "nobody"; - "force group" = "nogroup"; - "create mask" = "0666"; - "directory mask" = "0777"; - }; + enableNmbd = false; + enableWinbindd = false; + + settings = { + global = { + "guest account" = "regent"; + "map to guest" = "Bad User"; + "load printers" = "no"; + "printcap name" = "/dev/null"; + "log file" = "/var/log/samba/client.%I"; + "log level" = "2"; }; }; + shares = { + nas = { + "path" = "/storage"; + "guest ok" = "yes"; + "read only" = "no"; + "public" = "yes"; + "writable" = "yes"; + "force user" = "regent"; + "force group" = "users"; + "create mask" = "0777"; + "directory mask" = "0777"; + "force create mode" = "0777"; + "force directory mode" = "0777"; + "security mask" = "0777"; + "force security mode" = "0777"; + }; + }; +}; services.samba-wsdd = { enable = true; + discovery = true; openFirewall = true; + extraOptions = [ + "--verbose" + ]; }; services.avahi = { enable = true; - nssmdns = true; + nssmdns4 = true; publish = { enable = true; addresses = true; diff --git a/modules/monero/default.nix b/modules/monero/default.nix new file mode 100644 index 0000000..b1b7086 --- /dev/null +++ b/modules/monero/default.nix @@ -0,0 +1,42 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.modules.monero; + + #TODO make this configurable through nix + address = "46Ev6Vk4QeQZTr14tRjksTT2VPhi4jKB48mGz31rpUUci2Bvg9PHZj9GLK3VceWDc13tkUbzmqQz8eKR3hkD9bUKFKHLrzg"; + dataDir = "/storage/monero"; + miningThreads = 6; + user = "regent"; + password = "AnRPCPasswordChangedImperatively"; + rpcAddress = "10.0.0.30"; + rpcPort = 18081; +in +{ + options = { + modules = { + monero = { + enable = mkEnableOption "Deploy monero node"; + }; + }; + }; + + config = mkIf cfg.enable { + services.monero = { + enable = true; + dataDir = dataDir; + rpc = { + user = user; + password = password; + address = rpcAddress; + port = rpcPort; + }; + mining = { + enable = true; + threads = miningThreads; + address = address; + }; + }; + }; +} \ No newline at end of file