1
1
Fork 0

Compare commits

..

4 commits

Author SHA1 Message Date
4d7d75ca03
profiles: update nixos config
Signed-off-by: Myned <dev@bjork.tech>
2024-10-09 17:39:14 -05:00
30145e16d8
matrix: migrate to myne
Signed-off-by: Myned <dev@bjork.tech>
2024-10-09 17:38:54 -05:00
84732d1033
syncthing: migrate to myne
Signed-off-by: Myned <dev@bjork.tech>
2024-10-09 17:38:38 -05:00
9805d255e3
sysctl: increase inotify limits
Signed-off-by: Myned <dev@bjork.tech>
2024-10-09 17:38:17 -05:00
5 changed files with 38 additions and 30 deletions

View file

@ -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-remote-conduwuit.mount"; mount = "mnt-local.mount";
in { in {
after = [mount]; after = [mount];
bindsTo = [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 # https://nixos.wiki/wiki/Filesystems#Bind_mounts
fileSystems."/var/lib/matrix-conduit/media" = { fileSystems."/var/lib/matrix-conduit/media" = {
device = "/mnt/remote/conduwuit/media"; device = "/mnt/local/conduwuit/media";
fsType = "none"; fsType = "none";
options = ["bind"]; options = ["bind"];
}; };

View file

@ -15,7 +15,7 @@ in {
dataDir = mkOption {default = "/home/${cfg.user}";}; dataDir = mkOption {default = "/home/${cfg.user}";};
devices = mkOption { devices = mkOption {
default = [ default = [
"myarm" "myne"
"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 = {
myarm = { myne = {
introducer = true; 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"; mynix.id = "UFLECA5-QQUKD5J-FQB55TE-YKKHD37-VT5ASXU-4EGUZNV-KW7Z434-FBI7CQ2";
@ -155,12 +155,17 @@ 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
systemd.services.syncthing = mkIf (isString cfg.mount) { 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
}; };
}; };
};
} }

View file

@ -45,6 +45,9 @@ 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 = {

View file

@ -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 = ["/containers"]; sources = [config.custom.containers.directory];
repositories = [ repositories = [
{ {

View file

@ -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,21 +22,23 @@
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 = [
"/containers" config.custom.containers.directory
"/home" "/home"
"/mnt/remote" "/mnt/local"
"/srv" "/srv"
"/var/lib/matrix-conduit"
]; ];
repositories = [ repositories = [
{ {
path = "ssh://n882bnik@n882bnik.repo.borgbase.com/./repo"; path = "ssh://ysrll00y@ysrll00y.repo.borgbase.com/./repo";
label = "myarm"; label = "server";
} }
]; ];
}; };
@ -49,19 +51,17 @@
syncthing = { syncthing = {
enable = true; enable = true;
configDir = "/var/lib/syncthing"; configDir = "/var/lib/syncthing";
dataDir = "/mnt/remote/syncthing"; dataDir = "/mnt/local/syncthing";
ignorePerms = true; # Mount permissions are forced mount = "mnt-local.mount";
mount = "mnt-remote-syncthing.mount";
type = "receiveonly"; type = "receiveonly";
user = "syncthing"; user = "syncthing";
group = "syncthing"; group = "syncthing";
}; };
}; };
settings = { # settings = {
boot.systemd-boot = true; # mounts.enable = true;
mounts.enable = true; # #// users.myned.linger = true;
users.myned.linger = true; # };
};
}; };
} }