my nix configs for my servers and desktop

i love burning electricity

Changed files
+80 -28
hosts
valefar
modules
monero
+38 -28
hosts/valefar/default.nix
···
modules.garage.enable = true;
modules.forgejo.enable = true;
modules.immich.enable = true;
+
modules.monero.enable = true;
# =============================================================================
# NETWORKING
···
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 -"
];
# =============================================================================
···
'';
};
-
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;
+42
modules/monero/default.nix
···
+
{ 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;
+
};
+
};
+
};
+
}