diff options
| author | Mike Vink <mike@pionative.com> | 2024-02-11 15:53:44 +0100 |
|---|---|---|
| committer | Mike Vink <mike@pionative.com> | 2024-02-11 15:53:44 +0100 |
| commit | 3cc299a59572c8c9c09b67fc26cfc699355447fd (patch) | |
| tree | 7ca17359497f4b439c3a3c7ddd9e7da629a0e1c4 /profiles/core | |
| parent | 2524a1b80a983d0e4ef4796477bd2a8c812acb69 (diff) | |
setup syncthing on lemptop and pump
Diffstat (limited to 'profiles/core')
| -rw-r--r-- | profiles/core/configuration.nix | 4 | ||||
| -rw-r--r-- | profiles/core/hm.nix | 2 | ||||
| -rw-r--r-- | profiles/core/home.nix | 3 | ||||
| -rw-r--r-- | profiles/core/syncthing.nix | 39 |
4 files changed, 42 insertions, 6 deletions
diff --git a/profiles/core/configuration.nix b/profiles/core/configuration.nix index 36dc255..d8ad29f 100644 --- a/profiles/core/configuration.nix +++ b/profiles/core/configuration.nix @@ -66,7 +66,7 @@ file pstree bc - ] ++ optionals (!machine.isDarwin) [ + ] ++ (optionals (!machine.isDarwin) [ pkgsi686Linux.glibc gdb pciutils @@ -74,7 +74,7 @@ iputils inetutils usbutils - ]; + ]); nix.package = pkgs.nixUnstable; nix.extraOptions = '' diff --git a/profiles/core/hm.nix b/profiles/core/hm.nix index 76dd2e6..efa83af 100644 --- a/profiles/core/hm.nix +++ b/profiles/core/hm.nix @@ -1,4 +1,4 @@ -{inputs, lib, pkgs, ...}: with lib; { +{inputs, config, lib, pkgs, ...}: with lib; { imports = [ (mkAliasOptionModule [ "hm" ] [ "home-manager" "users" ivi.username ]) ]; diff --git a/profiles/core/home.nix b/profiles/core/home.nix index 7972a75..78abfe7 100644 --- a/profiles/core/home.nix +++ b/profiles/core/home.nix @@ -35,7 +35,7 @@ }; }; desktopEntries = with pkgs; optionalAttrs (!machine.isDarwin) { - text= { type = "Application"; name = "Text editor"; exec = "${st}/bin/st -e kak %u"; }; + text = { type = "Application"; name = "Text editor"; exec = "${st}/bin/st -e kak %u"; }; file = { type = "Application"; name = "File Manager"; exec = "${st}/bin/st -e lfub %u"; }; torrent = { type = "Application"; name = "Torrent"; exec = "${coreutils}/bin/env transadd %U"; }; img = { type = "Application"; name = "Image Viewer"; exec = "${sxiv}/bin/sxiv -a %u"; }; @@ -186,6 +186,7 @@ enableSshSupport = true; defaultCacheTtl = 34550000; maxCacheTtl = 34550000; + pinentryFlavor = "gtk2"; }; }; } diff --git a/profiles/core/syncthing.nix b/profiles/core/syncthing.nix index e5c19f7..a1767a6 100644 --- a/profiles/core/syncthing.nix +++ b/profiles/core/syncthing.nix @@ -3,16 +3,51 @@ enable = true; user = ivi.username; inherit (config.ivi) group; + dataDir = config.ivi.home; overrideDevices = true; overrideFolders = true; key = config.secrets.syncthing.path; - settings = { + settings = let + allDevices = (filterAttrs (_: m: m.syncthing.id != "") ivi.machines); + in { + gui = { + theme = "default"; + insecureAdminAccess = true; + }; + devices = mapAttrs (_: m: { inherit (m.syncthing) id; introducer = m.isServer; - }) (filterAttrs (_: m: m.syncthing.enable) ivi.machines); + }) allDevices; + + folders = let + trashcan = { + type = "trashcan"; + params.cleanoutDays = "0"; + }; + simple = { + type = "simple"; + params = { + keep = "5"; + cleanoutDays = "0"; + }; + }; + allNames = attrNames allDevices; + in { + my = { + path = "${config.ivi.home}/sync/my"; + devices = allNames; + versioning = simple; + }; + pictures = { + path = "${config.ivi.home}/sync/pictures"; + devices = allNames; + versioning = trashcan; + }; + }; }; }; + environment.systemPackages = [config.services.syncthing.package]; } |
