updated syncthing.nix

This commit is contained in:
serenity-F 2024-12-27 13:00:29 +10:00
parent 9df810e9ba
commit 00b8284314
3 changed files with 67 additions and 35 deletions

View file

@ -125,10 +125,15 @@
## Universal variable declarations
primaryUser = "serenity"; # used for admin purposes
#flakePath = "/home/${primaryUser}/SerenityOS/"; # for v1.0.0 release
flakePath = "/home/${primaryUser}/flakes/nixdots/"; # current path
disksPath = "/home/${primaryUser}/Disks/";
homeDir = "/home/${primaryUser}"; # for easy configuration
disksPath = "${homeDir}/Disks/";
flakePath = "${homeDir}/flakes/nixdots/"; # current path to flake
#flakePath = "${homeDir}/SerenityOS/"; # for v1.0.0 release
in {
@ -141,7 +146,7 @@
specialArgs = {
inherit inputs outputs;
inherit flakePath disksPath;
inherit primaryUser;
inherit primaryUser homeDir;
};
modules = [
sops-nix.nixosModules.sops
@ -160,7 +165,7 @@
specialArgs = {
inherit inputs outputs;
inherit flakePath disksPath;
inherit primaryUser;
inherit primaryUser homeDir;
};
modules = [
sops-nix.nixosModules.sops
@ -175,7 +180,7 @@
specialArgs = {
inherit inputs outputs;
inherit flakePath disksPath;
inherit primaryUser;
inherit primaryUser homeDir;
};
modules = [
sops-nix.nixosModules.sops
@ -189,7 +194,7 @@
specialArgs = {
inherit inputs outputs;
inherit flakePath disksPath;
inherit primaryUser;
inherit primaryUser homeDir;
};
modules = [
sops-nix.nixosModules.sops

View file

@ -5,7 +5,7 @@
imports = [
## Import program configs
./syncthing
#./syncthing
./firefox
./nheko
./fetch

View file

@ -1,42 +1,69 @@
{ pkgs, primaryUser, ... }:
{ pkgs, primaryUser, homeDir, ... }:
{
environment = {
systemPackages = with pkgs; [ syncthing syncthing-tray ];
systemPackages = with pkgs; [
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 = {
syncthing = {
enable = true;
openDefaultPorts = true;
#configDir = path;
#dataDir = "/home/${primaryUser}/sync";
#overrideDevices = true;
#overrideFolder = true;
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
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
settings = {
## these 3 devices are pretty much my entire ecosystem for now
#settings.devices = {
#hades.id = "DEVICE_ID";
#proserpina.id = "DEVICE_ID";
#hecate.id = "DEVICE_ID";
#};
## Syncthing Folders
overrideFolders = true; # force these folder on activation
folders = {
## plan to have this dir automatically committed and pushed to a git repo daily
#settings.folders = {
#"FOLDER_ID" = {
#path = "/home/${primaryUser}/Sync/Notes";
#devices = [ "hecate" "hades" "persephone" ];
#};
"Keyring" = { # folder for password/secrets vault
enable = false; # easy toggle - OFF for now
path = "${homeDir}/Keyring"; # defaults to primaryUser's homedir
#devices = [ ]; # left empty for now
versioning = { # versioning, for redundancy
type = "simple"; # nothing fancy, keeps x number of copies
params = { keep = "3"; }; # number of copies to keep
};
};
#"FOLDER_ID" = {
#path = "/home/${primaryUser}/Sync/Keyring";
#devices = [ "hecate" "hades" "persephone" ];
#};
#};
"Notes" = { # folder for organisation/notes vault
enable = true; # easy toggle
path = "${homeDir}/Notes"; # defaults to primaryUser's homedir
#devices = [ ]; # left empty for now
versioning = { # versioning, for redundancy
type = "simple"; # nothing fancy, keeps x number of copies
params = { keep = "3"; }; # number of copies to keep
};
};
};
## Syncthing Devices
overrideDevices = true; # force these devices on activation
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
};
};
};
};
}