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
# 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"];
};

View file

@ -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 {
};
};
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
systemd.services.syncthing = mkIf (isString cfg.mount) {
services.syncthing = mkIf (isString cfg.mount) {
after = [cfg.mount];
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
"vm.overcommit_memory" = 1;
# https://docs.syncthing.net/users/faq.html#inotify-limits
"fs.inotify.max_user_watches" = 204800;
};
loader = {

View file

@ -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 = [
{

View file

@ -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;
# };
};
}