add new syncthing folder
This commit is contained in:
@@ -24,9 +24,7 @@ in {
|
||||
};
|
||||
|
||||
services = {
|
||||
displayManager = {
|
||||
defaultSession = "none+i3";
|
||||
};
|
||||
displayManager = { defaultSession = "none+i3"; };
|
||||
|
||||
xserver = {
|
||||
enable = true;
|
||||
@@ -46,6 +44,24 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
security.polkit.enable = true;
|
||||
systemd = {
|
||||
user.services.polkit-gnome-authentication-agent-1 = {
|
||||
description = "polkit-gnome-authentication-agent-1";
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
wants = [ "graphical-session.target" ];
|
||||
after = [ "graphical-session.target" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart =
|
||||
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 1;
|
||||
TimeoutStopSec = 10;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
picom # compositor
|
||||
rofi # application
|
||||
|
||||
@@ -10,7 +10,7 @@ in {
|
||||
# Enable OpenGL
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
driSupport32Bit = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
@@ -17,5 +17,6 @@
|
||||
./kop-fileshare.nix
|
||||
./adam-site.nix
|
||||
./plausible.nix
|
||||
./syncthing.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,18 +1,27 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let basePath = "/synced";
|
||||
{ config, pkgs, lib, inputs, ... }:
|
||||
let cfg = config.custom.services.syncthing;
|
||||
in {
|
||||
options.custom.services.syncthing = {
|
||||
enable = lib.mkEnableOption "Enables syncthing";
|
||||
basePath = lib.mkOption {
|
||||
type = with lib.types; string;
|
||||
default = "/synced";
|
||||
description = "Base path for syncthing data";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
systemd.tmpfiles.rules =
|
||||
[ "d ${basePath} 0700 ${config.mainUser.name} users -" ];
|
||||
[ "d ${cfg.basePath} 0700 ${config.mainUser.name} users -" ];
|
||||
|
||||
# check device id: syncthing cli --gui-address=/synced/gui-socket --gui-apikey=<key> show system
|
||||
environment.systemPackages = with pkgs; [ syncthing ];
|
||||
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
dataDir = basePath;
|
||||
dataDir = cfg.basePath;
|
||||
user = config.mainUser.name;
|
||||
group = "users";
|
||||
guiAddress = "${basePath}/gui-socket";
|
||||
guiAddress = "${cfg.basePath}/gui-socket";
|
||||
overrideDevices = true;
|
||||
overrideFolders = true;
|
||||
|
||||
@@ -56,7 +65,7 @@ in {
|
||||
};
|
||||
folders."default" = {
|
||||
id = "default";
|
||||
path = "${basePath}/default";
|
||||
path = "${cfg.basePath}/default";
|
||||
devices =
|
||||
[ "kop-pc" "server" "laptop" "mini-pc" "mini-pc-proxmox" "phone" ];
|
||||
ignorePerms = false;
|
||||
@@ -64,19 +73,25 @@ in {
|
||||
|
||||
folders."books" = {
|
||||
id = "books";
|
||||
path = "${basePath}/books";
|
||||
path = "${cfg.basePath}/books";
|
||||
devices = [ "kop-pc" "server" "laptop" "mini-pc" "mini-pc-proxmox" ];
|
||||
};
|
||||
|
||||
folders."fh" = {
|
||||
id = "fh";
|
||||
path = "${basePath}/fh";
|
||||
path = "${cfg.basePath}/fh";
|
||||
devices = [ "kop-pc" "server" "laptop" "mini-pc" "mini-pc-proxmox" ];
|
||||
};
|
||||
|
||||
folders."work_drive" = {
|
||||
id = "work_drive";
|
||||
path = "${basePath}/work_drive";
|
||||
path = "${cfg.basePath}/work_drive";
|
||||
devices = [ "kop-pc" "server" "laptop" "mini-pc" "mini-pc-proxmox" ];
|
||||
};
|
||||
|
||||
folders."no_backup" = {
|
||||
id = "no_backup";
|
||||
path = "${cfg.basePath}/no_backup";
|
||||
devices = [ "kop-pc" "server" "laptop" "mini-pc" "mini-pc-proxmox" ];
|
||||
};
|
||||
};
|
||||
@@ -84,4 +99,5 @@ in {
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 8384 22000 ];
|
||||
networking.firewall.allowedUDPPorts = [ 22000 21027 ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
./hardware-configuration.nix
|
||||
../../modules/services/ssh.nix
|
||||
../../modules/services/step-ca.nix
|
||||
../../modules/services/syncthing.nix
|
||||
../../modules/fail2ban.nix
|
||||
../../modules/logging.nix
|
||||
../../modules/motd.nix
|
||||
@@ -86,6 +85,10 @@
|
||||
ip = "192.168.2.1";
|
||||
};
|
||||
adguard.enable = true;
|
||||
syncthing = {
|
||||
enable = true;
|
||||
basePath = "/data/synced";
|
||||
};
|
||||
};
|
||||
nftables.enable = true;
|
||||
cli-tools.enable = true;
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
# server = [ "192.168.0.10" ];
|
||||
#};
|
||||
misc = { docker.enable = true; };
|
||||
services = { syncthing = { enable = true; }; };
|
||||
hardware = {
|
||||
android.enable = true;
|
||||
nvidia.enable = true;
|
||||
@@ -65,7 +66,7 @@
|
||||
i3.enable = true;
|
||||
#hyprland.enable = true;
|
||||
#gnome.enable = true;
|
||||
cosmic.enable = true;
|
||||
#cosmic.enable = true;
|
||||
shared.enable = true;
|
||||
stylix.enable = true;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user