New Flake Style XPS fix
This commit is contained in:
@@ -1,10 +1,5 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
user,
|
||||
host,
|
||||
secrets,
|
||||
... }: let
|
||||
{ config, pkgs, hyper, secrets, ... }:
|
||||
let
|
||||
# helper funcitons
|
||||
conv = _: device: with device; { "${name}" = {id = id;};};
|
||||
justname = devices: (builtins.map (device: device.name)) devices;
|
||||
@@ -22,7 +17,7 @@
|
||||
};
|
||||
|
||||
dirs = {
|
||||
default = { name = "sync"; path = "/home/${user}/sync"; };
|
||||
default = { name = "sync"; path = "/home/${hyper.user}/sync"; };
|
||||
s21u-dcim = { name = "s21u-dcim"; path = "/vault/Pictures/Lennart"; };
|
||||
diane-dcim = { name = "diane-dcim"; path = "/vault/Pictures/Diane"; };
|
||||
dianesd-dcim = { name = "dianesd-dcim"; path = "/vault/Pictures/Diane-SD"; };
|
||||
@@ -31,34 +26,35 @@
|
||||
};
|
||||
in {
|
||||
sops.secrets = {
|
||||
"syncthing/${host}/cert.pem" = { owner = user; };
|
||||
"syncthing/${host}/key.pem" = { owner = user; };
|
||||
"syncthing/${hyper.host}/cert.pem" = { owner = hyper.user; };
|
||||
"syncthing/${hyper.host}/key.pem" = { owner = hyper.user; };
|
||||
};
|
||||
services.syncthing = with (builtins.mapAttrs conv devices); {
|
||||
enable = true;
|
||||
user = "${user}";
|
||||
dataDir = "/home/${user}/.local/share/syncthing"; # useless ?
|
||||
configDir = "/home/${user}/.config/syncthing";
|
||||
key = config.sops.secrets."syncthing/${host}/key.pem".path;
|
||||
cert = config.sops.secrets."syncthing/${host}/cert.pem".path;
|
||||
user = "${hyper.user}";
|
||||
package = pkgs.syncthing;
|
||||
dataDir = "/home/${hyper.user}/.local/share/syncthing"; # useless ?
|
||||
configDir = "/home/${hyper.user}/.config/syncthing";
|
||||
key = config.sops.secrets."syncthing/${hyper.host}/key.pem".path;
|
||||
cert = config.sops.secrets."syncthing/${hyper.host}/cert.pem".path;
|
||||
overrideDevices = true;
|
||||
overrideFolders = true;
|
||||
# guiAddress = "127.0.0.1:8384";
|
||||
guiAddress = if ( host == "NxACE" ) then "0.0.0.0:8384" else "127.0.0.1:8384";
|
||||
guiAddress = if ( hyper.host == "NxACE" ) then "0.0.0.0:8384" else "127.0.0.1:8384";
|
||||
settings = {
|
||||
devices = with (builtins.mapAttrs conv devices); if (host == "NxXPS") then (
|
||||
devices = with (builtins.mapAttrs conv devices); if (hyper.host == "NxXPS") then (
|
||||
north // ace // s21u
|
||||
) else if (host == "NxNORTH") then (
|
||||
) else if (hyper.host == "NxNORTH") then (
|
||||
xps // ace // s21u
|
||||
) else (
|
||||
north // xps // s21u // diane // daniel // tessa // georg
|
||||
);
|
||||
folders = with dirs; if (host == "NxXPS") then {
|
||||
folders = with dirs; if (hyper.host == "NxXPS") then {
|
||||
"${default.name}" = {
|
||||
path = default.path;
|
||||
devices = with devices; (justname [ north ace s21u ]);
|
||||
};
|
||||
} else if (host == "NxNORTH") then {
|
||||
} else if (hyper.host == "NxNORTH") then {
|
||||
"${default.name}" = {
|
||||
path = default.path;
|
||||
devices = with devices; (justname [ xps ace s21u ]);
|
||||
@@ -91,7 +87,7 @@ in {
|
||||
};
|
||||
gui = {
|
||||
theme = "black";
|
||||
user = user;
|
||||
user = hyper.user;
|
||||
password = secrets.syncthing.gui-password; # option to use a file is till in the works... https://github.com/NixOS/nixpkgs/issues/85336
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user