From e0668988e630afdc8cc0de4aa6bc1db6ba9dc879 Mon Sep 17 00:00:00 2001 From: serenity-F Date: Fri, 27 Dec 2024 23:32:56 +1000 Subject: [PATCH] merged `sync.nix` from `gitwatch.nix` & `syncthing.nix` --- hosts/hades/modules/default.nix | 5 +- hosts/hades/modules/gitwatch.nix | 20 ------- .../hades/modules/{syncthing.nix => sync.nix} | 54 ++++++++++++++----- 3 files changed, 42 insertions(+), 37 deletions(-) delete mode 100644 hosts/hades/modules/gitwatch.nix rename hosts/hades/modules/{syncthing.nix => sync.nix} (58%) diff --git a/hosts/hades/modules/default.nix b/hosts/hades/modules/default.nix index 127f700..0ea6618 100755 --- a/hosts/hades/modules/default.nix +++ b/hosts/hades/modules/default.nix @@ -7,12 +7,11 @@ ## Selected host modules for import ./hardware.nix # hardware configuration ./network.nix # network configuration - ./syncthing.nix # syncthing configuration - ./gitwatch.nix # more syncthing adjacent stuff + ./sync.nix # syncthing & gitwatch ./zfs.nix # zfs configuration ## Additional core modules to import - ../../../core/modules/jellyfin.nix + ../../../core/modules/jellyfin.nix # temporary for config purposes ../../../core/modules/gaming.nix # didnt work in home-manager :( ]; diff --git a/hosts/hades/modules/gitwatch.nix b/hosts/hades/modules/gitwatch.nix deleted file mode 100644 index 9900e9e..0000000 --- a/hosts/hades/modules/gitwatch.nix +++ /dev/null @@ -1,20 +0,0 @@ -# https://github.com/gitwatch/gitwatch -{ primaryUser, homeDir, ... }: - -{ - - services.gitwatch.Keyring = { - enable = false; - user = "${primaryUser}"; - path = "${homeDir}/Keyring/"; - remote = "git@codeberg.org:serenity-F/keyring.git"; - }; - - services.gitwatch.Notes = { - enable = false; - user = "${primaryUser}"; - path = "${homeDir}/Notes/"; - remote = "git@codeberg.org:serenity-F/notes.git"; - }; - -} diff --git a/hosts/hades/modules/syncthing.nix b/hosts/hades/modules/sync.nix similarity index 58% rename from hosts/hades/modules/syncthing.nix rename to hosts/hades/modules/sync.nix index 4f58fc3..f4bfd55 100755 --- a/hosts/hades/modules/syncthing.nix +++ b/hosts/hades/modules/sync.nix @@ -1,29 +1,47 @@ +# https://github.com/gitwatch/gitwatch +# https://nixos.wiki/wiki/Syncthing { pkgs, primaryUser, homeDir, ... }: { environment = { systemPackages = with pkgs; [ + gitwatch # automatic git versioning syncthing # standard syncthing package syncthing-tray # tray applet for syncthing ]; }; - systemd.services = { - syncthing = { - environment.STNODEFAULTFOLDER = "true"; # prevents the `Sync` folder from being created on activation - }; - }; - services = { + + ## Gitwatch + gitwatch = { + + Keyring = { # keyring backup, dont have a nextcloud (yet) + enable = false; + user = "${primaryUser}"; + path = "${homeDir}/Keyring/"; + remote = "git@codeberg.org:serenity-F/keyring.git"; + }; + + Notes = { # notes backup, not paying for obsidian backup lol + enable = false; + user = "${primaryUser}"; + path = "${homeDir}/Notes/"; + remote = "git@codeberg.org:serenity-F/notes.git"; + }; + }; + + ## Syncthing syncthing = { enable = true; # easy toggle dataDir = "${homeDir}"; # defaults to primaryUser's homedir openDefaultPorts = true; # opens the default firewall ports - configDir = "${homeDir}/.config/syncthing"; # defaults to primaryUser's homedir + configDir = + "${homeDir}/.config/syncthing"; # defaults to primaryUser's homedir user = "${primaryUser}"; # uses primaryUser to run the service group = "users"; # runs in the users group - guiAddress = "0.0.0.0:8384"; # default web address for the GUI + #guiAddress = "0.0.0.0:8384"; # default web address for the GUI settings = { ## WebApp GUI user = "serenity"; @@ -65,16 +83,24 @@ ## Syncthing Devices overrideDevices = true; # force these devices on activation - devices = { # all syncthing devices listed - 'boilerplate' for other hosts + devices = + { # all syncthing devices listed - 'boilerplate' for other hosts - #"Orcus".id = "REALLY-LONG-ORCUS-SYNCTHING-KEY-HERE"; # disabled for testing - #"Hades".id = "REALLY-LONG-HADES-SYNCTHING-KEY-HERE"; # disabled for testing - "Hecate".id = "36WUSM4-HFYOGWP-33JHBPI-WR2TXXE-ZX3PFMB-QH6BMXM-DQ523ZF-FD7M3AI"; - #"Persephone".id = "REALLY-LONG-PERSEPHONE-SYNCTHING-KEY-HERE"; # disabled for testing + #"Orcus".id = "REALLY-LONG-ORCUS-SYNCTHING-KEY-HERE"; # disabled for testing + #"Hades".id = "REALLY-LONG-HADES-SYNCTHING-KEY-HERE"; # disabled for testing + "Hecate".id = "36WUSM4-HFYOGWP-33JHBPI-WR2TXXE-ZX3PFMB-QH6BMXM-DQ523ZF-FD7M3AI"; + #"Persephone".id = "REALLY-LONG-PERSEPHONE-SYNCTHING-KEY-HERE"; # disabled for testing - }; + }; }; }; }; + systemd.services = { + syncthing = { + environment.STNODEFAULTFOLDER = + "true"; # prevents the `Sync` folder from being created on activation + }; + }; + }