sops is no go, made syncthing and tailscale modular for no reason

This commit is contained in:
2026-04-23 15:20:27 -05:00
parent 48cac1436a
commit f6011be1d1
4 changed files with 25 additions and 89 deletions
+1 -2
View File
@@ -15,9 +15,8 @@
# home grown nixos modules # home grown nixos modules
darwin = { darwin = {
# ssh.enable = true; # ssh.enable = true;
sops.enable = true;
tailscale.enable = true;
syncthing.enable = true; syncthing.enable = true;
tailscale.enable = true;
}; };
+1 -1
View File
@@ -8,7 +8,7 @@
# ./ssh # ./ssh
./tailscale ./tailscale
./syncthing ./syncthing
./sops # ./sops
]; ];
} }
+14 -74
View File
@@ -2,12 +2,13 @@
pkgs, pkgs,
config, config,
lib, lib,
inputs,
... ...
}: let }: let
service = "syncthing"; service = "syncthing";
cfg = config.darwin.${service}; cfg = config.darwin.${service};
sec = config.sops.secrets;
in { in {
options.darwin.${service} = { options.darwin.${service} = {
enable = lib.mkEnableOption "enables syncthing"; enable = lib.mkEnableOption "enables syncthing";
host = lib.mkOption { host = lib.mkOption {
@@ -17,79 +18,18 @@ in {
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.syncthing = { # environment.systemPackages = with pkgs; [
enable = true; # syncthing
user = "bhelderman"; # syncthingtray
group = "bhelderman"; # ];
guiAddress = "127.0.0.1:2222"; #
openDefaultPorts = true; homebrew = {
dataDir = "/home/blake/.config/syncthing"; # brews = [
#extraFlags = ["--no-default-folder"]; # "syncthing"
overrideFolders = false; # ];
overrideDevices = false; casks = [
key = sec."${service}/${cfg.host}/key".path; "syncthing-app"
cert = sec."${service}/${cfg.host}/cert".path; ];
settings = {
devices = {
"snowbelle" = {id = "6WQ6ATA-5AT4RUM-NW67PAL-N62CPNV-ALRFG3P-5BDRO22-HWFC2Q4-5S5BDA5";};
"mudkip" = {id = "OV4NUQK-3YHRL5R-SIZGTNL-7VZFFUX-FOJ6NTS-C7ROXR7-I2Q2W7G-QERO7AO";};
"zygarde" = {id = "UYLTF52-VVKUR7F-JN33HQZ-RFNWGL3-JER52LA-GZD2LPJ-QIFEE7K-MNMZRQ5";};
"mew" = {id = "7ZC2NAS-QONQKAL-Z54NPMB-7TRXM6M-K7Z6PZD-FG4AI4H-V7SMFJN-JOYBHQO";};
"yveltal" = {id = "ZVSQ4WJ-7OICYOZ-3ECES4X-KH37IPB-TKHKUJG-BSEGXVM-AHYY5C3-VKG44AX";};
"CEN-IT-07" = {id = "DPYKA4Z-3PX7JB2-FBEOXXX-SC7TLT2-QC5P2IR-SXOPJGX-QO3DMII-5B7UCA4";};
"CEN-IT-00007" = {id = "XBPXGYU-DUJSLDH-6BDNF4D-CO2COC3-N3FM6W5-IHZOJBM-Z2N77RI-IVAV5AH";};
};
folders = {
"holocron" = {
path = "/home/bhelderman/holocron";
devices = ["mudkip" "zygarde" "mew" "yveltal" "CEN-IT-07" "CEN-IT-00007" "snowbelle"];
id = "5voxg-c3he2";
versioning = {
type = "staggered";
fsPath = "/home/blake/holocron/.stversions";
params = {
cleanInterval = "3600";
maxAge = "0";
};
};
ignorePerms = true;
ignorePatterns = [
"// syncthing"
"/.versions"
"/.versions/**"
"/.stversions"
"/.stversions/**"
"// macos system junk"
"(?d).DS_Store"
"(?d).AppleDouble"
"(?d).LSOverride"
"(?d)Icon?"
"(?d)._*"
"(?d).Spotlight-V100"
"(?d).Trashes"
"(?d).fseventsd"
"(?d).metadata_never_index"
"(?d).com.apple.timemachine.donotpresent"
"(?d).com.apple.*"
"(?d)~*.tmp"
];
};
};
options = {
urAccepted = -1;
};
};
};
sops.secrets = {
"${service}/${cfg.host}/key" = {
owner = "blake";
group = "blake";
};
"${service}/${cfg.host}/cert" = {
owner = "blake";
group = "blake";
};
}; };
}; };
} }
+9 -12
View File
@@ -2,11 +2,12 @@
pkgs, pkgs,
config, config,
lib, lib,
inputs,
... ...
}: let }: let
cfg = config.darwin.tailscale; cfg = config.darwin.tailscale;
authkey_file = config.sops.secrets."tailscale_authkey".path;
in { in {
options.darwin.tailscale = { options.darwin.tailscale = {
enable = lib.mkEnableOption "enables tailscale"; enable = lib.mkEnableOption "enables tailscale";
}; };
@@ -14,20 +15,16 @@ in {
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.tailscale = { services.tailscale = {
enable = true; enable = true;
useRoutingFeatures = "both"; #overrideLocalDns = true;
#authKeyFile = authkey_file; #authKeyFile = authkey_file;
extraSetFlags = [ };
"--accept-routes=true" # true is equilivant to useRoutingFeatures = "client" (breaks shit)
"--accept-dns=true" # explicitly allow resolved homebrew = {
casks = [
"tailscale-app"
]; ];
}; };
# declare authkey secrets
sops.secrets = {
"tailscale_authkey" = {
owner = "root";
};
};
}; };
} }