Recursive update

This commit is contained in:
Filippo Berto 2022-06-29 09:34:43 +02:00
parent 8592e99bf3
commit c741cd7201
4 changed files with 51 additions and 46 deletions

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, ... }:
with lib;
{
boot = {
binfmt.emulatedSystems = [ "armv7l-linux" "aarch64-linux" ];
@ -78,7 +78,7 @@
dbus.packages = with pkgs; [ dconf ];
fail2ban = { enable = true; bantime-increment.enable = true; };
gnome.gnome-keyring.enable = true;
gvfs = { enable = true; package = lib.mkForce pkgs.gnome3.gvfs; };
gvfs = { enable = true; package = mkForce pkgs.gnome3.gvfs; };
jackett = { enable = true; openFirewall = true; group = "users"; };
jellyfin = { enable = true; openFirewall = true; group = "users"; };
logind.lidSwitch = "ignore";
@ -109,19 +109,19 @@
"force group" = "users";
}; in
{
bertof = common // {
bertof = recursiveUpdate common {
path = "/mnt/raid0/bertof";
comment = "Bertof samba share";
"force user" = "bertof";
"valid users" = "bertof";
};
tiziano = common // {
tiziano = recursiveUpdate common {
path = "/mnt/raid0/tiziano";
comment = "Tiziano samba share";
"force user" = "tiziano";
"valid users" = "tiziano";
};
condiviso = common // {
condiviso = recursiveUpdate common {
path = "/mnt/raid0/condiviso";
comment = "Samba share condiviso";
"valid users" = "bertof tiziano";
@ -130,19 +130,19 @@
"force create mode" = "0660";
"force directory mode" = "2770";
};
bertof_safe = common // {
bertof_safe = recursiveUpdate common {
path = "/mnt/raid1/bertof";
comment = "Bertof samba share";
"force user" = "bertof";
"valid users" = "bertof";
};
tiziano_safe = common // {
tiziano_safe = recursiveUpdate common {
path = "/mnt/raid1/tiziano";
comment = "Tiziano samba share";
"force user" = "tiziano";
"valid users" = "tiziano";
};
condiviso_safe = common // {
condiviso_safe = recursiveUpdate common {
path = "/mnt/raid1/condiviso";
comment = "Samba share condiviso";
"valid users" = "bertof tiziano";
@ -239,13 +239,18 @@
systemd.packages = with pkgs; [ syncthing ];
systemd.services = let common = {
documentation = [ "man:syncthing(1)" ];
startLimitIntervalSec = 60;
startLimitBurst = 4;
after = [ "network.target" ];
environment = { STNORESTART = "yes"; STNOUPGRADE = "yes"; };
wantedBy = [ "default.target" ];
serviceConfig = {
Restart = "on-failure";
SuccessExitStatus = "2 3 4";
RestartSec = 1;
SuccessExitStatus = "3 4";
RestartForceExitStatus = "3 4";
Group = config.ids.gids.users;
MemoryDenyWriteExecute = true;
NoNewPrivileges = true;
@ -264,13 +269,13 @@
};
}; in
{
syncthing-bertof = common // {
syncthing-bertof = recursiveUpdate common {
description = "Syncthing service bertof";
serviceConfig = common.serviceConfig // { User = "bertof"; ExecStart = "${pkgs.syncthing}/bin/syncthing -no-browser -gui-address=0.0.0.0:8384 -home=/mnt/raid0/bertof/Syncthing/.config"; };
serviceConfig = { User = "bertof"; ExecStart = "${pkgs.syncthing}/bin/syncthing -no-browser -gui-address=0.0.0.0:8384 -home=/mnt/raid0/bertof/Syncthing/.config"; };
};
syncthing-tiziano = common // {
syncthing-tiziano = recursiveUpdate common {
description = "Syncthing service tiziano";
serviceConfig = common.serviceConfig // { User = "tiziano"; ExecStart = "${pkgs.syncthing}/bin/syncthing -no-browser -gui-address=0.0.0.0:8385 -home=/mnt/raid0/tiziano/Syncthing/.config"; };
serviceConfig = { User = "tiziano"; ExecStart = "${pkgs.syncthing}/bin/syncthing -no-browser -gui-address=0.0.0.0:8385 -home=/mnt/raid0/tiziano/Syncthing/.config"; };
};
};
@ -324,7 +329,7 @@
nixpkgs.config.allowUnfree = true;
nix = {
package = pkgs.nixFlakes;
extraOptions = lib.optionalString (config.nix.package == pkgs.nixFlakes)
extraOptions = optionalString (config.nix.package == pkgs.nixFlakes)
"experimental-features = nix-command flakes";
gc.automatic = true;
};