From 0af185c7b6f509a6910b3c0e3e82631c0b36c319 Mon Sep 17 00:00:00 2001 From: sstent Date: Wed, 8 Mar 2023 03:46:34 +0000 Subject: [PATCH] added syncthing - need to secret certs per host --- hosts/common.nix | 1 + hosts/syncthing.nix | 49 +++++++++++++++++++++++++++++++++++++++++++++ lib/hm_secrets.nix | 2 +- 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 hosts/syncthing.nix diff --git a/hosts/common.nix b/hosts/common.nix index f22563e..609b2a1 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -4,6 +4,7 @@ imports = [ inputs.home-manager.nixosModules.home-manager ./sops.nix + ./syncthing.nix ]++ (builtins.attrValues outputs.nixosModules); ###dotfiles path variable diff --git a/hosts/syncthing.nix b/hosts/syncthing.nix new file mode 100644 index 0000000..7d494c2 --- /dev/null +++ b/hosts/syncthing.nix @@ -0,0 +1,49 @@ +{ lib, inputs, outputs, ... }: +{ + +services.syncthing = { + enable = true; + dataDir = "/home/sstent"; + openDefaultPorts = true; + configDir = "/home/sstent/.config/syncthing"; + user = "sstent"; + group = "users"; + guiAddress = "0.0.0.0:8385"; + declarative = { + overrideDevices = true; + overrideFolders = true; + devices = { + "StuPC" = { id = "Z43MPGF-OKG6K34-WTTFUDO-UG6E3TE-YCLSOAT-5LN5KMW-QHL2VSK-EZCGCAP"; }; + "Go3" = { id = "YDOL433-AHAL33M-NWLLDDQ-2D36ZIE-YNZVTKE-25TRBZ2-JXRSN7Y-Z5EOVQN"; }; + }; + folders = { + "default" = { + path = "/home/sstent/sync"; + devices = [ "StuPC" "Go3" ]; + }; + }; + }; +}; + +} + + + +# { lib, pkgs, config, ... }: +# with lib; + +# let cfg = config.services.ssh-proxy; +# in { +# options.services.ssh-proxy = { +# enable = mkOption { +# type = types.bool; +# default = false; +# description = '' +# Enable Mnt Public for WSL +# ''; +# }; +# }; + +# config = mkIf cfg.enable { + +# } \ No newline at end of file diff --git a/lib/hm_secrets.nix b/lib/hm_secrets.nix index 22f8f90..3335f7b 100644 --- a/lib/hm_secrets.nix +++ b/lib/hm_secrets.nix @@ -19,7 +19,7 @@ in rec { # 'sops' Encrypted Secrets hm_secrets = dir: out_dir: filter (name: type: type != null && !(hasPrefix "_" name)) (name: type: - if type == "regular" && hasSuffix ".age" name + if type == "regular" then nameValuePair name { sopsFile = dir + "/${name}";