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