From e00ccffa997dcaf736e70f33e44fef5a2bd7e2f6 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Tue, 26 Nov 2024 14:06:06 +0100 Subject: [PATCH] Update syncthing mixos module --- modules/nixos/syncthing/default.nix | 32 +++++---------------------- systems/x86_64-linux/aspi/default.nix | 8 ++++++- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/modules/nixos/syncthing/default.nix b/modules/nixos/syncthing/default.nix index 0e9a762..27d700a 100644 --- a/modules/nixos/syncthing/default.nix +++ b/modules/nixos/syncthing/default.nix @@ -26,6 +26,7 @@ in { options.modules.syncthing = { enable = lib.mkOption { default = false; }; + overrideSettings = lib.mkOption { default = false; }; }; config = lib.mkIf cfg.enable { @@ -33,33 +34,10 @@ in services.syncthing.user = "julian"; services.syncthing.openDefaultPorts = true; services.syncthing.configDir = "/home/julian/.config/syncthing"; - # services.syncthing. - #services.syncthing.key = config.sops.secrets."aspi/syncthing/key".path; - #services.syncthing.cert = config.sops.secrets."aspi/syncthing/cert".path; - services.syncthing.overrideDevices = false; # overrides any devices added or deleted through the WebUI - services.syncthing.overrideFolders = false; # overrides any folders added or deleted through the WebUI - # services.syncthing.settings = { - # devices = { - # "pianopi" = { - # id = "FD3XSFW-7LQSCIQ-KHZPLNQ-7VZYGKH-RJ2ZKTJ-BG67NRH-36TQIZM-CXDYWAH"; - # }; - # }; - # folders = { - # "Documents" = { - # # Name of folder in Syncthing, also the folder ID - # path = "/home/myusername/Documents"; # Which folder to add to Syncthing - # devices = [ - # "device1" - # "device2" - # ]; # Which devices to share the folder with - # }; - # "Example" = { - # path = "/home/myusername/Example"; - # devices = [ "device1" ]; - # ignorePerms = false; # By default, Syncthing doesn't sync file permissions. This line enables it for this folder. - # }; - # }; - # }; + services.syncthing.overrideDevices = cfg.overrideSettings; # overrides any devices added or deleted through the WebUI + services.syncthing.overrideFolders = cfg.overrideSettings; # overrides any folders added or deleted through the WebUI + + systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true"; # Don't create default ~/Sync folder }; } diff --git a/systems/x86_64-linux/aspi/default.nix b/systems/x86_64-linux/aspi/default.nix index c9bf357..0ac4d9f 100644 --- a/systems/x86_64-linux/aspi/default.nix +++ b/systems/x86_64-linux/aspi/default.nix @@ -56,12 +56,18 @@ virtualbox.enable = true; users-julian.enable = true; - syncthing.enable = true; + syncthing = { + enable = true; + overrideSettings = false; + }; xdg-portal.enable = true; polkit.enable = true; keyring.enable = true; }; + users.mutableUsers = false; + users.users.julian.hashedPasswordFile = config.sops.secrets."password/aspi".path; + services.blueman.enable = true; services.upower.enable = true;