syncthing refactor
This commit is contained in:
parent
c9cb613280
commit
155dfacc13
4 changed files with 61 additions and 50 deletions
|
|
@ -17,6 +17,11 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
syncthing = {
|
||||||
|
enable = true;
|
||||||
|
dataDir = "/data/sync";
|
||||||
|
};
|
||||||
|
|
||||||
hardware.nvidia = {
|
hardware.nvidia = {
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||||
nvidiaSettings = true;
|
nvidiaSettings = true;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ in
|
||||||
|
|
||||||
audio.enable = true;
|
audio.enable = true;
|
||||||
desktop.enable = true;
|
desktop.enable = true;
|
||||||
|
syncthing.enable = true;
|
||||||
home-manager.users."lilith".desktop.touchSupport = true;
|
home-manager.users."lilith".desktop.touchSupport = true;
|
||||||
|
|
||||||
nfs.client.enable = true;
|
nfs.client.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ in
|
||||||
audio.enable = true;
|
audio.enable = true;
|
||||||
desktop.enable = true;
|
desktop.enable = true;
|
||||||
gaming.enable = true;
|
gaming.enable = true;
|
||||||
|
syncthing.enable = true;
|
||||||
nfs.client.enable = true;
|
nfs.client.enable = true;
|
||||||
auto_styling.enable = true;
|
auto_styling.enable = true;
|
||||||
# ollama.enable = true;
|
# ollama.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
{ config, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
host = config.networking.hostName;
|
host = config.networking.hostName;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
options.syncthing.enable = lib.mkEnableOption "Enables Syncthing";
|
||||||
|
options.syncthing.dataDir = lib.mkOption { default = "/home/lilith"; };
|
||||||
|
|
||||||
|
config = lib.mkIf config.syncthing.enable {
|
||||||
sops.secrets."syncthing/key.pem" = {
|
sops.secrets."syncthing/key.pem" = {
|
||||||
sopsFile = ../../hosts/${host}/secrets/default.yaml;
|
sopsFile = ../../hosts/${host}/secrets/default.yaml;
|
||||||
};
|
};
|
||||||
|
|
@ -15,7 +18,7 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
user = "lilith";
|
user = "lilith";
|
||||||
dataDir = "/home/lilith";
|
dataDir = config.syncthing.dataDir;
|
||||||
configDir = "/home/lilith/.config/syncthing";
|
configDir = "/home/lilith/.config/syncthing";
|
||||||
|
|
||||||
overrideDevices = true;
|
overrideDevices = true;
|
||||||
|
|
@ -42,7 +45,7 @@ in
|
||||||
folders = {
|
folders = {
|
||||||
"sync" = {
|
"sync" = {
|
||||||
id = "rdcj2-mfyb4";
|
id = "rdcj2-mfyb4";
|
||||||
path = "/home/lilith/sync";
|
path = "${config.syncthing.dataDir}/sync";
|
||||||
devices = [
|
devices = [
|
||||||
"lilith-phone"
|
"lilith-phone"
|
||||||
"lilith-lab"
|
"lilith-lab"
|
||||||
|
|
@ -52,7 +55,7 @@ in
|
||||||
};
|
};
|
||||||
"keepass" = {
|
"keepass" = {
|
||||||
id = "sdpfs-2beqd";
|
id = "sdpfs-2beqd";
|
||||||
path = "/home/lilith/.keepass";
|
path = "${config.syncthing.dataDir}/.keepass";
|
||||||
devices = [
|
devices = [
|
||||||
"lilith-phone"
|
"lilith-phone"
|
||||||
"lilith-lab"
|
"lilith-lab"
|
||||||
|
|
@ -63,4 +66,5 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue