Compare commits
No commits in common. "4d7d75ca03f04c74f509c6385ac23cbc06802adb" and "2b88cdff39e480523a7941b6d0e079b00ee5606d" have entirely different histories.
4d7d75ca03
...
2b88cdff39
5 changed files with 30 additions and 38 deletions
|
@ -32,7 +32,7 @@ in {
|
||||||
# Bind conduwuit service to media mount
|
# Bind conduwuit service to media mount
|
||||||
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/matrix/conduit.nix#L113
|
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/matrix/conduit.nix#L113
|
||||||
systemd.services.conduit = let
|
systemd.services.conduit = let
|
||||||
mount = "mnt-local.mount";
|
mount = "mnt-remote-conduwuit.mount";
|
||||||
in {
|
in {
|
||||||
after = [mount];
|
after = [mount];
|
||||||
bindsTo = [mount];
|
bindsTo = [mount];
|
||||||
|
@ -47,10 +47,10 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Create bind mount to local media in lieu of conduwuit.toml setting
|
# Create bind mount to remote media in lieu of conduwuit.toml setting
|
||||||
# https://nixos.wiki/wiki/Filesystems#Bind_mounts
|
# https://nixos.wiki/wiki/Filesystems#Bind_mounts
|
||||||
fileSystems."/var/lib/matrix-conduit/media" = {
|
fileSystems."/var/lib/matrix-conduit/media" = {
|
||||||
device = "/mnt/local/conduwuit/media";
|
device = "/mnt/remote/conduwuit/media";
|
||||||
fsType = "none";
|
fsType = "none";
|
||||||
options = ["bind"];
|
options = ["bind"];
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,7 +15,7 @@ in {
|
||||||
dataDir = mkOption {default = "/home/${cfg.user}";};
|
dataDir = mkOption {default = "/home/${cfg.user}";};
|
||||||
devices = mkOption {
|
devices = mkOption {
|
||||||
default = [
|
default = [
|
||||||
"myne"
|
"myarm"
|
||||||
"mynix"
|
"mynix"
|
||||||
"myork"
|
"myork"
|
||||||
];
|
];
|
||||||
|
@ -124,9 +124,9 @@ in {
|
||||||
# Devices can be declared globally without issue
|
# Devices can be declared globally without issue
|
||||||
# Syncthing seems to ignore entries that match the machine's id
|
# Syncthing seems to ignore entries that match the machine's id
|
||||||
devices = {
|
devices = {
|
||||||
myne = {
|
myarm = {
|
||||||
introducer = true;
|
introducer = true;
|
||||||
id = "3YFGJ2J-X2653BB-WHKO54B-7FSL4LH-4CP4AUX-ZSUNIXW-NOBWBAN-324UOQR";
|
id = "XM3ZAIB-337KY6I-T2IFUF6-U6NE7M2-OHKKX4F-CGQDTYE-DBKSIUD-E6RUBQJ";
|
||||||
};
|
};
|
||||||
|
|
||||||
mynix.id = "UFLECA5-QQUKD5J-FQB55TE-YKKHD37-VT5ASXU-4EGUZNV-KW7Z434-FBI7CQ2";
|
mynix.id = "UFLECA5-QQUKD5J-FQB55TE-YKKHD37-VT5ASXU-4EGUZNV-KW7Z434-FBI7CQ2";
|
||||||
|
@ -155,17 +155,12 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd = {
|
|
||||||
# Ensure creation of config directory
|
|
||||||
tmpfiles.rules = ["d ${cfg.configDir} - ${cfg.user} ${cfg.group}"];
|
|
||||||
|
|
||||||
#!! Syncthing needs to start after mounting or there is a risk of file deletion
|
#!! Syncthing needs to start after mounting or there is a risk of file deletion
|
||||||
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/networking/syncthing.nix#L646
|
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/networking/syncthing.nix#L646
|
||||||
#?? systemctl status
|
#?? systemctl status
|
||||||
services.syncthing = mkIf (isString cfg.mount) {
|
systemd.services.syncthing = mkIf (isString cfg.mount) {
|
||||||
after = [cfg.mount];
|
after = [cfg.mount];
|
||||||
bindsTo = [cfg.mount]; # Start/stop service on mount/unmount
|
bindsTo = [cfg.mount]; # Start/stop service on mount/unmount
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,9 +45,6 @@ in {
|
||||||
|
|
||||||
# https://redis.io/docs/latest/develop/get-started/faq/#background-saving-fails-with-a-fork-error-on-linux
|
# https://redis.io/docs/latest/develop/get-started/faq/#background-saving-fails-with-a-fork-error-on-linux
|
||||||
"vm.overcommit_memory" = 1;
|
"vm.overcommit_memory" = 1;
|
||||||
|
|
||||||
# https://docs.syncthing.net/users/faq.html#inotify-limits
|
|
||||||
"fs.inotify.max_user_watches" = 204800;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
loader = {
|
loader = {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{config, ...}: {
|
{
|
||||||
custom = {
|
custom = {
|
||||||
profile = "sbc";
|
profile = "sbc";
|
||||||
programs.fastfetch.greet = true;
|
programs.fastfetch.greet = true;
|
||||||
|
@ -10,11 +10,11 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
#// tailscale.cert = true;
|
tailscale.cert = true;
|
||||||
|
|
||||||
borgmatic = {
|
borgmatic = {
|
||||||
enable = true;
|
enable = true;
|
||||||
sources = [config.custom.containers.directory];
|
sources = ["/containers"];
|
||||||
|
|
||||||
repositories = [
|
repositories = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{config, ...}: {
|
{
|
||||||
custom = {
|
custom = {
|
||||||
profile = "server";
|
profile = "server";
|
||||||
programs.fastfetch.greet = true;
|
programs.fastfetch.greet = true;
|
||||||
|
@ -6,7 +6,7 @@
|
||||||
containers = {
|
containers = {
|
||||||
enable = true;
|
enable = true;
|
||||||
boot = true;
|
boot = true;
|
||||||
#// actualbudget.enable = true;
|
actualbudget.enable = true;
|
||||||
coturn.enable = true;
|
coturn.enable = true;
|
||||||
forgejo.enable = true;
|
forgejo.enable = true;
|
||||||
foundryvtt.enable = true;
|
foundryvtt.enable = true;
|
||||||
|
@ -22,23 +22,21 @@
|
||||||
caddy.enable = true;
|
caddy.enable = true;
|
||||||
matrix-conduit.enable = true;
|
matrix-conduit.enable = true;
|
||||||
#// modufur.enable = true;
|
#// modufur.enable = true;
|
||||||
#// tailscale.cert = true;
|
tailscale.cert = true;
|
||||||
|
|
||||||
borgmatic = {
|
borgmatic = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
config.custom.containers.directory
|
"/containers"
|
||||||
"/home"
|
"/home"
|
||||||
"/mnt/local"
|
"/mnt/remote"
|
||||||
"/srv"
|
"/srv"
|
||||||
"/var/lib/matrix-conduit"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
repositories = [
|
repositories = [
|
||||||
{
|
{
|
||||||
path = "ssh://ysrll00y@ysrll00y.repo.borgbase.com/./repo";
|
path = "ssh://n882bnik@n882bnik.repo.borgbase.com/./repo";
|
||||||
label = "server";
|
label = "myarm";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -51,17 +49,19 @@
|
||||||
syncthing = {
|
syncthing = {
|
||||||
enable = true;
|
enable = true;
|
||||||
configDir = "/var/lib/syncthing";
|
configDir = "/var/lib/syncthing";
|
||||||
dataDir = "/mnt/local/syncthing";
|
dataDir = "/mnt/remote/syncthing";
|
||||||
mount = "mnt-local.mount";
|
ignorePerms = true; # Mount permissions are forced
|
||||||
|
mount = "mnt-remote-syncthing.mount";
|
||||||
type = "receiveonly";
|
type = "receiveonly";
|
||||||
user = "syncthing";
|
user = "syncthing";
|
||||||
group = "syncthing";
|
group = "syncthing";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# settings = {
|
settings = {
|
||||||
# mounts.enable = true;
|
boot.systemd-boot = true;
|
||||||
# #// users.myned.linger = true;
|
mounts.enable = true;
|
||||||
# };
|
users.myned.linger = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue