diff --git a/Makefile b/Makefile index b4097808..b9d9a3e8 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,7 @@ -.PHONY: test lock +.PHONY: default test lock + +default: + sudo nixos-rebuild switch --flake . test: git -C . add . diff --git a/services/syncthing/H0615.nix b/services/syncthing/H0615.nix deleted file mode 100644 index 7e1ae0ff..00000000 --- a/services/syncthing/H0615.nix +++ /dev/null @@ -1,27 +0,0 @@ -{...}: { - imports = [ - ./default.nix - ./devices/Ion.nix - ./devices/J0162.nix - ./devices/Legion.nix - ./devices/Monarch.nix - ./devices/Northstar.nix - ./devices/Vanguard.nix - ./folders/notes.nix - ./folders/zotero.nix - ]; - services.syncthing = { - user = "elitherl"; - group = "users"; - dataDir = "/home/elitherl"; - extraOptions.options.globalAnnounceEnabled = true; - folders."Notes" = { - path = "~/notes"; - devices = ["ion" "J0162" "legion" "monarch" "northstar" "vanguard"]; - }; - folders."Zotero" = { - path = "~/Documents/Zotero"; - devices = ["ion" "J0162" "legion"]; - }; - }; -} diff --git a/services/syncthing/J0162.nix b/services/syncthing/J0162.nix deleted file mode 100644 index 14907a89..00000000 --- a/services/syncthing/J0162.nix +++ /dev/null @@ -1,27 +0,0 @@ -{...}: { - imports = [ - ./default.nix - ./devices/H0615.nix - ./devices/Ion.nix - ./devices/Legion.nix - ./devices/Monarch.nix - ./devices/Northstar.nix - ./devices/Vanguard.nix - ./folders/notes.nix - ./folders/zotero.nix - ]; - services.syncthing = { - user = "elitherl"; - group = "users"; - dataDir = "/home/elitherl"; - extraOptions.options.globalAnnounceEnabled = true; - folders."Notes" = { - path = "~/notes"; - devices = ["H0615" "ion" "legion" "monarch" "northstar" "vanguard"]; - }; - folders."Zotero" = { - path = "~/Documents/Zotero"; - devices = ["ion" "H0615" "legion"]; - }; - }; -} diff --git a/services/syncthing/Legion.nix b/services/syncthing/Legion.nix index a35afd30..3cf1ce47 100644 --- a/services/syncthing/Legion.nix +++ b/services/syncthing/Legion.nix @@ -1,12 +1,6 @@ {...}: { imports = [ ./default.nix - ./devices/H0615.nix - ./devices/Ion.nix - ./devices/Monarch.nix - ./devices/Northstar.nix - ./devices/Remarkable.nix - ./devices/Vanguard.nix ./folders/archive.nix ./folders/books.nix ./folders/camera.nix @@ -24,17 +18,15 @@ group = "users"; extraOptions.options.globalAnnounceEnabled = true; folders = { - "Archive".devices = ["ion" "monarch" "vanguard"]; + "Archive".devices = ["monarch" "vanguard"]; "Books".devices = ["monarch" "northstar" "remarkable" "vanguard"]; - "Camera".devices = ["ion"]; "Comics".devices = ["ion" "monarch" "northstar" "vanguard"]; "Documents".devices = ["monarch" "northstar" "vanguard"]; "Exports".devices = ["monarch" "vanguard"]; - "Movies".devices = ["ion" "monarch" "northstar" "vanguard"]; - "Notes".devices = ["H0615" "ion" "monarch" "northstar" "vanguard"]; + "Notes".devices = ["ion" "monarch" "northstar" "vanguard"]; "Pictures".devices = ["ion" "monarch" "northstar" "vanguard"]; "Xochitl".devices = ["remarkable"]; - "Zotero".devices = ["H0615"]; + "Zotero".devices = ["ion"]; }; }; } diff --git a/services/syncthing/N0245.nix b/services/syncthing/N0245.nix index 14907a89..19247d1e 100644 --- a/services/syncthing/N0245.nix +++ b/services/syncthing/N0245.nix @@ -1,7 +1,6 @@ {...}: { imports = [ ./default.nix - ./devices/H0615.nix ./devices/Ion.nix ./devices/Legion.nix ./devices/Monarch.nix @@ -17,11 +16,11 @@ extraOptions.options.globalAnnounceEnabled = true; folders."Notes" = { path = "~/notes"; - devices = ["H0615" "ion" "legion" "monarch" "northstar" "vanguard"]; + devices = ["ion" "legion" "monarch" "northstar" "vanguard"]; }; folders."Zotero" = { path = "~/Documents/Zotero"; - devices = ["ion" "H0615" "legion"]; + devices = ["ion" "legion"]; }; }; } diff --git a/services/syncthing/Vanguard.nix b/services/syncthing/Vanguard.nix index d15f18dd..48ba7077 100644 --- a/services/syncthing/Vanguard.nix +++ b/services/syncthing/Vanguard.nix @@ -1,7 +1,6 @@ {...}: { imports = [ ./default.nix - ./devices/H0615.nix ./devices/Ion.nix ./devices/Legion.nix ./devices/Monarch.nix @@ -18,10 +17,6 @@ group = "users"; extraOptions.options.globalAnnounceEnabled = true; folders = { - "Camera" = { - path = "~/Camera"; - devices = ["ion"]; - }; "Comics" = { path = "~/Documents/Comics"; devices = ["ion" "legion" "monarch" "northstar"]; @@ -32,7 +27,7 @@ }; "Notes" = { path = "~/notes"; - devices = ["ion" "legion" "monarch" "northstar" "H0615"]; + devices = ["ion" "legion" "monarch" "northstar"]; }; "Pictures" = { path = "~/Pictures"; diff --git a/services/syncthing/default.nix b/services/syncthing/default.nix index 2e4d7a62..4e08a54d 100644 --- a/services/syncthing/default.nix +++ b/services/syncthing/default.nix @@ -1,4 +1,5 @@ {lib, ...}: { + imports = [./devices]; services.syncthing = { enable = true; systemService = true; diff --git a/services/syncthing/devices/default.nix b/services/syncthing/devices/default.nix new file mode 100644 index 00000000..6d45a093 --- /dev/null +++ b/services/syncthing/devices/default.nix @@ -0,0 +1,10 @@ +{...}: { + imports = [ + ./Ion.nix + ./Legion.nix + ./Monarch.nix + ./Northstar.nix + ./Remarkable.nix + ./Vanguard.nix + ]; +} diff --git a/services/syncthing/folders/archive.nix b/services/syncthing/folders/archive.nix index 750f763a..b7ba1514 100644 --- a/services/syncthing/folders/archive.nix +++ b/services/syncthing/folders/archive.nix @@ -1,9 +1,11 @@ {lib, ...}: { + imports = [../devices]; services.syncthing.folders."Archive" = { label = "Archive"; path = lib.mkDefault "/var/lib/syncthing/Archive/"; id = "hwnqy-xzcdx"; ignorePerms = true; + devices = lib.mkDefault ["legion" "monarch" "vanguard"]; enable = true; }; } diff --git a/services/syncthing/folders/books.nix b/services/syncthing/folders/books.nix index ad98f28b..2d9b05c5 100644 --- a/services/syncthing/folders/books.nix +++ b/services/syncthing/folders/books.nix @@ -1,9 +1,17 @@ {lib, ...}: { + imports = [../devices]; services.syncthing.folders."Books" = { label = "Books"; path = lib.mkDefault "/var/lib/syncthing/Books/"; id = "zjmxy-ycmbq"; ignorePerms = true; + devices = lib.mkDefault [ + "legion" + "monarch" + "northstar" + "remarkable" + "vanguard" + ]; enable = true; }; } diff --git a/services/syncthing/folders/camera.nix b/services/syncthing/folders/camera.nix index b3185c48..bd2b87fa 100644 --- a/services/syncthing/folders/camera.nix +++ b/services/syncthing/folders/camera.nix @@ -1,10 +1,12 @@ {lib, ...}: { + imports = [../devices]; services.syncthing.folders."Camera" = { label = "Camera"; path = lib.mkDefault "/var/lib/syncthing/Camera/"; id = "fp4_4j7w-photos"; type = "receiveonly"; ignorePerms = true; - enable = true; + devices = lib.mkDefault []; + enable = false; }; } diff --git a/services/syncthing/folders/comics.nix b/services/syncthing/folders/comics.nix index d9bb9ae3..4295af66 100644 --- a/services/syncthing/folders/comics.nix +++ b/services/syncthing/folders/comics.nix @@ -1,9 +1,17 @@ {lib, ...}: { + imports = [../devices]; services.syncthing.folders."Comics" = { label = "Comics"; path = lib.mkDefault "/var/lib/syncthing/Comics/"; id = "kc2h0-q3wot"; ignorePerms = true; + devices = lib.mkDefault [ + "ion" + "legion" + "monarch" + "northstar" + "vanguard" + ]; enable = true; }; } diff --git a/services/syncthing/folders/documents.nix b/services/syncthing/folders/documents.nix index 984ce87c..7bccc417 100644 --- a/services/syncthing/folders/documents.nix +++ b/services/syncthing/folders/documents.nix @@ -1,9 +1,16 @@ {lib, ...}: { + imports = [../devices]; services.syncthing.folders."Documents" = { label = "Documents"; path = lib.mkDefault "/var/lib/syncthing/Documents/"; id = "qc6qa-bipsd"; ignorePerms = true; + devices = lib.mkDefault [ + "legion" + "monarch" + "northstar" + "vanguard" + ]; enable = true; }; } diff --git a/services/syncthing/folders/exports.nix b/services/syncthing/folders/exports.nix index 2d141ab1..1801e3e5 100644 --- a/services/syncthing/folders/exports.nix +++ b/services/syncthing/folders/exports.nix @@ -1,9 +1,11 @@ {lib, ...}: { + imports = [../devices]; services.syncthing.folders."Exports" = { label = "Exports"; path = lib.mkDefault "/var/lib/syncthing/Exports/"; id = "tof2e-pdtde"; ignorePerms = true; + devices = lib.mkDefault ["legion" "monarch" "vanguard"]; enable = true; }; } diff --git a/services/syncthing/folders/movies.nix b/services/syncthing/folders/movies.nix index 5459fee3..35391ff2 100644 --- a/services/syncthing/folders/movies.nix +++ b/services/syncthing/folders/movies.nix @@ -1,9 +1,11 @@ {lib, ...}: { + imports = [../devices]; services.syncthing.folders."Movies" = { label = "Movies"; path = lib.mkDefault "/var/lib/syncthing/Movies/"; id = "3f75o-4x6sq"; ignorePerms = true; - enable = true; + devices = lib.mkDefault []; + enable = false; }; } diff --git a/services/syncthing/folders/notes.nix b/services/syncthing/folders/notes.nix index 044dcdb3..ea6a198a 100644 --- a/services/syncthing/folders/notes.nix +++ b/services/syncthing/folders/notes.nix @@ -1,9 +1,17 @@ {lib, ...}: { + imports = [../devices]; services.syncthing.folders."Notes" = { label = "Notes"; path = lib.mkDefault "/var/lib/syncthing/Notes/"; id = "4ggjz-5dyop"; ignorePerms = true; + devices = lib.mkDefault [ + "ion" + "legion" + "monarch" + "northstar" + "vanguard" + ]; enable = true; }; } diff --git a/services/syncthing/folders/pictures.nix b/services/syncthing/folders/pictures.nix index d8699444..f8045654 100644 --- a/services/syncthing/folders/pictures.nix +++ b/services/syncthing/folders/pictures.nix @@ -1,9 +1,17 @@ {lib, ...}: { + imports = [../devices]; services.syncthing.folders."Pictures" = { label = "Pictures"; path = lib.mkDefault "/var/lib/syncthing/Pictures/"; id = "ziuj8-rm6dn"; ignorePerms = true; + devices = lib.mkDefault [ + "ion" + "legion" + "monarch" + "northstar" + "vanguard" + ]; enable = true; }; } diff --git a/services/syncthing/folders/xochitl.nix b/services/syncthing/folders/xochitl.nix index 71cc4f6e..ba4a121d 100644 --- a/services/syncthing/folders/xochitl.nix +++ b/services/syncthing/folders/xochitl.nix @@ -1,10 +1,12 @@ {lib, ...}: { + imports = [../devices]; services.syncthing.folders."Xochitl" = { label = "Xochitl"; path = lib.mkDefault "/var/lib/syncthing/Xochitl/"; id = "dkcbx-kq7hl"; type = "receiveonly"; ignorePerms = true; + devices = lib.mkDefault ["legion" "remarkable"]; enable = true; }; } diff --git a/services/syncthing/folders/zotero.nix b/services/syncthing/folders/zotero.nix index ab0ffafa..ef9e99b7 100644 --- a/services/syncthing/folders/zotero.nix +++ b/services/syncthing/folders/zotero.nix @@ -1,9 +1,11 @@ {lib, ...}: { + imports = [../devices]; services.syncthing.folders."Zotero" = { label = "Zotero"; path = lib.mkDefault "/var/lib/syncthing/Zotero/"; id = "huyvn-liwc9"; ignorePerms = true; + devices = lib.mkDefault ["ion" "legion"]; enable = true; }; }