updated syncthing.nix
This commit is contained in:
parent
9df810e9ba
commit
00b8284314
3 changed files with 67 additions and 35 deletions
19
flake.nix
19
flake.nix
|
|
@ -125,10 +125,15 @@
|
||||||
|
|
||||||
|
|
||||||
## Universal variable declarations
|
## Universal variable declarations
|
||||||
|
|
||||||
primaryUser = "serenity"; # used for admin purposes
|
primaryUser = "serenity"; # used for admin purposes
|
||||||
#flakePath = "/home/${primaryUser}/SerenityOS/"; # for v1.0.0 release
|
homeDir = "/home/${primaryUser}"; # for easy configuration
|
||||||
flakePath = "/home/${primaryUser}/flakes/nixdots/"; # current path
|
|
||||||
disksPath = "/home/${primaryUser}/Disks/";
|
disksPath = "${homeDir}/Disks/";
|
||||||
|
flakePath = "${homeDir}/flakes/nixdots/"; # current path to flake
|
||||||
|
#flakePath = "${homeDir}/SerenityOS/"; # for v1.0.0 release
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
@ -141,7 +146,7 @@
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit inputs outputs;
|
inherit inputs outputs;
|
||||||
inherit flakePath disksPath;
|
inherit flakePath disksPath;
|
||||||
inherit primaryUser;
|
inherit primaryUser homeDir;
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
sops-nix.nixosModules.sops
|
sops-nix.nixosModules.sops
|
||||||
|
|
@ -160,7 +165,7 @@
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit inputs outputs;
|
inherit inputs outputs;
|
||||||
inherit flakePath disksPath;
|
inherit flakePath disksPath;
|
||||||
inherit primaryUser;
|
inherit primaryUser homeDir;
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
sops-nix.nixosModules.sops
|
sops-nix.nixosModules.sops
|
||||||
|
|
@ -175,7 +180,7 @@
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit inputs outputs;
|
inherit inputs outputs;
|
||||||
inherit flakePath disksPath;
|
inherit flakePath disksPath;
|
||||||
inherit primaryUser;
|
inherit primaryUser homeDir;
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
sops-nix.nixosModules.sops
|
sops-nix.nixosModules.sops
|
||||||
|
|
@ -189,7 +194,7 @@
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit inputs outputs;
|
inherit inputs outputs;
|
||||||
inherit flakePath disksPath;
|
inherit flakePath disksPath;
|
||||||
inherit primaryUser;
|
inherit primaryUser homeDir;
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
sops-nix.nixosModules.sops
|
sops-nix.nixosModules.sops
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
|
|
||||||
## Import program configs
|
## Import program configs
|
||||||
./syncthing
|
#./syncthing
|
||||||
./firefox
|
./firefox
|
||||||
./nheko
|
./nheko
|
||||||
./fetch
|
./fetch
|
||||||
|
|
|
||||||
|
|
@ -1,42 +1,69 @@
|
||||||
{ pkgs, primaryUser, ... }:
|
{ pkgs, primaryUser, homeDir, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
environment = {
|
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 = {
|
services = {
|
||||||
|
|
||||||
syncthing = {
|
syncthing = {
|
||||||
enable = true;
|
enable = true; # easy toggle
|
||||||
openDefaultPorts = true;
|
dataDir = "${homeDir}"; # defaults to primaryUser's homedir
|
||||||
#configDir = path;
|
openDefaultPorts = true; # opens the default firewall ports
|
||||||
#dataDir = "/home/${primaryUser}/sync";
|
configDir = "${homeDir}/.config/syncthing"; # defaults to primaryUser's homedir
|
||||||
#overrideDevices = true;
|
user = "${primaryUser}"; # uses primaryUser to run the service
|
||||||
#overrideFolder = true;
|
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
|
## Syncthing Folders
|
||||||
#settings.devices = {
|
overrideFolders = true; # force these folder on activation
|
||||||
#hades.id = "DEVICE_ID";
|
folders = {
|
||||||
#proserpina.id = "DEVICE_ID";
|
|
||||||
#hecate.id = "DEVICE_ID";
|
|
||||||
#};
|
|
||||||
|
|
||||||
## plan to have this dir automatically committed and pushed to a git repo daily
|
"Keyring" = { # folder for password/secrets vault
|
||||||
#settings.folders = {
|
enable = false; # easy toggle - OFF for now
|
||||||
#"FOLDER_ID" = {
|
path = "${homeDir}/Keyring"; # defaults to primaryUser's homedir
|
||||||
#path = "/home/${primaryUser}/Sync/Notes";
|
#devices = [ ]; # left empty for now
|
||||||
#devices = [ "hecate" "hades" "persephone" ];
|
versioning = { # versioning, for redundancy
|
||||||
#};
|
type = "simple"; # nothing fancy, keeps x number of copies
|
||||||
|
params = { keep = "3"; }; # number of copies to keep
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
#"FOLDER_ID" = {
|
"Notes" = { # folder for organisation/notes vault
|
||||||
#path = "/home/${primaryUser}/Sync/Keyring";
|
enable = true; # easy toggle
|
||||||
#devices = [ "hecate" "hades" "persephone" ];
|
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
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue