Merge remote-tracking branch 'refs/remotes/origin/master'

This commit is contained in:
Ahwx 2025-07-07 23:21:48 +02:00
commit 04d9c6edec
15 changed files with 176 additions and 81 deletions

View file

@ -27,6 +27,19 @@
time.timeZone = "Europe/Amsterdam"; time.timeZone = "Europe/Amsterdam";
systemd.network.networks."99-local" = {
matchConfig.name = "ens3s1";
address = [
"192.168.1.100/24"
];
routes = [
{
Gateway = "172.16.10.1";
GatewayOnLink = false;
}
];
};
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
kitty.terminfo kitty.terminfo
zfs zfs

View file

@ -11,6 +11,7 @@
./../../modules/core ./../../modules/core
./../../modules/core/virtualization.nix ./../../modules/core/virtualization.nix
./../../modules/services/tailscale.nix ./../../modules/services/tailscale.nix
./../../modules/services/mpd.nix
inputs.nixos-hardware.nixosModules.framework-13-7040-amd inputs.nixos-hardware.nixosModules.framework-13-7040-amd
]; ];

View file

@ -11,6 +11,7 @@
./../../modules/core ./../../modules/core
# ./../../modules/home/nfs.nix # ./../../modules/home/nfs.nix
./../../modules/core/virtualization.nix ./../../modules/core/virtualization.nix
./../../modules/services/tailscale.nix
]; ];
powerManagement = { powerManagement = {

View file

@ -17,5 +17,6 @@
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGXi00z/rxVrWLKgYr+tWIsbHsSQO75hUMSTThNm5wUw liv@sakura" # main laptop "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGXi00z/rxVrWLKgYr+tWIsbHsSQO75hUMSTThNm5wUw liv@sakura" # main laptop
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ2nsQHyWnrmuQway0ehoMUcYYfhD8Ph/vpD0Tzip1b1 liv@meow" # main phone "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ2nsQHyWnrmuQway0ehoMUcYYfhD8Ph/vpD0Tzip1b1 liv@meow" # main phone
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHv2zxCy22KU1tZOH2hA1p8fWVpOSrTYF68+3E5r330O liv@ichiyo" # 2nd laptop "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHv2zxCy22KU1tZOH2hA1p8fWVpOSrTYF68+3E5r330O liv@ichiyo" # 2nd laptop
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGm9dLpj13r+Iso5SuHSCSQbriumwW1Fs7TkgaBmmXeo liv@azalea" # linux phone
]; ];
} }

View file

@ -226,6 +226,7 @@
"$mainMod SHIFT, W, exec, wdisplays" "$mainMod SHIFT, W, exec, wdisplays"
"$mainMod SHIFT, T, exec, thunderbird" "$mainMod SHIFT, T, exec, thunderbird"
"$mainMod SHIFT, E, exec, element-desktop" "$mainMod SHIFT, E, exec, element-desktop"
"$mainMod SHIFT, X, exec, gajim"
"$mainMod SHIFT, P, exec, pavucontrol-qt" "$mainMod SHIFT, P, exec, pavucontrol-qt"
"$mainMod SHIFT, N ,exec, notes" "$mainMod SHIFT, N ,exec, notes"
"$mainMod, N,exec, swaync-client -t" "$mainMod, N,exec, swaync-client -t"

View file

@ -59,6 +59,7 @@
# GUI shit # GUI shit
element-desktop element-desktop
gajim
signal-desktop signal-desktop
anki-bin anki-bin
obs-studio obs-studio

View file

@ -1,7 +1,12 @@
{ pkgs, config, ... }: {
pkgs,
config,
username,
...
}:
let let
hostname = "violet"; hostname = "violet";
repo = "ssh://dandelion.booping.local:${toString config.services.openssh.ports}/spinners/rootvol/backups/${hostname}"; baseRepo = "ssh://liv@dandelion:9123/spinners/rootvol/backups/${hostname}";
in in
{ {
services.borgbackup.jobs = { services.borgbackup.jobs = {
@ -9,55 +14,41 @@ in
paths = [ paths = [
"/home/liv/MinecraftDocker" "/home/liv/MinecraftDocker"
]; ];
repo = "${repo}/MinecraftDocker-tulip"; repo = "ssh://liv@dandelion:9123/spinners/rootvol/backups/violet/MinecraftDocker-tulip";
compression = "auto,zstd"; encryption.mode = "none";
startAt = "daily"; compression = "auto,zstd,10";
startAt = [ "3:00" ];
postHook = '' postHook = ''
if [ $exitStatus -eq 2 ]; then if [ $exitStatus -eq 2 ]; then
${pkgs.ntfy-sh}/bin/ntfy send https://ntfy.liv.town/${hostname} "borgbackup: ${hostname} backup (violet-minecraft) failed with errors" ${pkgs.ntfy-sh}/bin/ntfy send https://notify.liv.town/${hostname} "borgbackup: ${hostname} backup (violet-minecraft) failed with errors"
else else
${pkgs.ntfy-sh}/bin/ntfy send https://ntfy.liv.town/${hostname} "borgbackup: ${hostname} backup (violet-minecraft) completed succesfully with exit status $exitStatus" ${pkgs.ntfy-sh}/bin/ntfy send https://notify.liv.town/${hostname} "borgbackup: ${hostname} backup (violet-minecraft) completed succesfully with exit status $exitStatus"
fi fi
''; '';
user = "${username}";
environment = {
BORG_RSH = "ssh -p 9123 -i /home/liv/.ssh/id_ed25519";
};
}; };
"violet-lib" = { "violet-lib" = {
paths = [ paths = [
"/var/lib" "/var/lib"
]; ];
repo = "${repo}/var-lib"; repo = "${baseRepo}/var-lib";
encryption.mode = "none";
compression = "auto,zstd"; compression = "auto,zstd";
startAt = "daily"; startAt = "daily";
postHook = '' postHook = ''
if [ $exitStatus -eq 2 ]; then if [ $exitStatus -eq 2 ]; then
${pkgs.ntfy-sh}/bin/ntfy send https://ntfy.liv.town/${hostname} "borgbackup: ${hostname} backup (violet-lib) failed with errors" ${pkgs.ntfy-sh}/bin/ntfy send https://notify.liv.town/${hostname} "borgbackup: ${hostname} backup (violet-lib) failed with errors"
else else
${pkgs.ntfy-sh}/bin/ntfy send https://ntfy.liv.town/${hostname} "borgbackup: ${hostname} backup (violet-lib) completed succesfully with exit status $exitStatus" ${pkgs.ntfy-sh}/bin/ntfy send https://notify.liv.town/${hostname} "borgbackup: ${hostname} backup (violet-lib) completed succesfully with exit status $exitStatus"
fi fi
''; '';
# user = "${username}";
environment = {
BORG_RSH = "ssh -p 9123 -i /home/liv/.ssh/id_ed25519";
};
}; };
# "violet-random" = {
# paths = [
# "/random"
# ];
# exclude = [
# "/random/a"
# "/random/a"
# ];
# encryption = {
# mode = "";
# passCommand = "";
# };
# environment.BORG_RSH = "ssh -i ${config.sops.secrets."ssh_private_key_violet".path}";
# repo = "${repo}/violet/random";
# compression = "auto,zstd";
# startAt = "daily";
# postHook = ''
# if [ $exitStatus -eq 2 ]; then
# ${pkgs.ntfy-sh}/bin/ntfy send https://ntfy.${domain}/nixbox "BorgBackup: nixbox backup failed with errors"
# else
# ${pkgs.ntfy-sh}/bin/ntfy send https://ntfy.${domain}/nixbox "BorgBackup: nixbox backup completed succesfully with exit status $exitStatus"
# fi
# '';
# };
}; };
} }

View file

@ -8,5 +8,6 @@
++ [ (import ./monitoring.nix) ] ++ [ (import ./monitoring.nix) ]
++ [ (import ./smart-monitoring.nix) ] ++ [ (import ./smart-monitoring.nix) ]
++ [ (import ./tailscale.nix) ] ++ [ (import ./tailscale.nix) ]
++ [ (import ./nfs.nix) ]
++ [ (import ./hd-idle.nix) ]; ++ [ (import ./hd-idle.nix) ];
} }

34
modules/services/frp.nix Normal file
View file

@ -0,0 +1,34 @@
{
pkgs,
config,
lib,
...
}:
{
services.frp = {
enable = true;
role = "client";
settings = {
serverAddr = "";
serverPort = 7000;
auth.method = "token";
auth.token = "";
proxies = [
{
name = "http";
type = "tcp";
localIP = "localhost";
localPort = 80;
remotePort = 80;
}
{
name = "https";
type = "tcp";
localIP = "localhost";
localPort = 443;
remotePort = 443;
}
];
};
};
}

View file

@ -1,9 +1,12 @@
{ config, ... }: { config, ... }:
{ {
services.immich = { # services.immich = {
enable = true; # enable = true;
port = 2283; # port = 2283;
}; # mediaLocation = "/spinners/rootvol/immich/";
# openFirewall = true;
# machine-learning.enable = true;
# };
# services.nginx.virtualHosts."" = { # services.nginx.virtualHosts."" = {
# forceSSL = true; # forceSSL = true;

View file

@ -1,8 +1,13 @@
{ username, config, ... }: {
username,
config,
pkgs,
...
}:
{ {
services.mpd = { services.mpd = {
enable = true; enable = true;
musicDirectory = "/dandelion/home/liv/music"; musicDirectory = "/home/liv/Music";
extraConfig = '' extraConfig = ''
audio_output { audio_output {
type "pipewire" type "pipewire"
@ -13,10 +18,14 @@
# Optional: # Optional:
# network.listenAddress = "any"; # if you want to allow non-localhost connections # network.listenAddress = "any"; # if you want to allow non-localhost connections
network.startWhenNeeded = false; # systemd feature: only start MPD service upon connection to its socket
}; };
systemd.services.mpd.environment = { systemd.services.mpd.environment = {
# see: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/609 # see: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/609
XDG_RUNTIME_DIR = "/run/user/${toString config.users.users.userRunningPipeWire.uid}"; # User-id must match above user. MPD will look inside this directory for the PipeWire socket. XDG_RUNTIME_DIR = "/run/user/${toString config.users.users.${username}.uid}"; # User-id must match above user. MPD will look inside this directory for the PipeWire socket.
}; };
environment.systemPackages = with pkgs; [
mpdris2
ncmpcpp
];
} }

38
modules/services/nfs.nix Normal file
View file

@ -0,0 +1,38 @@
{
config,
lib,
pkgs,
...
}:
{
services = {
# Network shares
samba = {
package = pkgs.samba4Full;
# ^^ `samba4Full` is compiled with avahi, ldap, AD etc support (compared to the default package, `samba`
# Required for samba to register mDNS records for auto discovery
# See https://github.com/NixOS/nixpkgs/blob/592047fc9e4f7b74a4dc85d1b9f5243dfe4899e3/pkgs/top-level/all-packages.nix#L27268
enable = true;
openFirewall = true;
shares.main = {
path = "/spinners/rootvol/nfs";
writable = "true";
comment = "Hello world!";
};
};
avahi = {
publish.enable = true;
publish.userServices = true;
# ^^ Needed to allow samba to automatically register mDNS records (without the need for an `extraServiceFile`
#nssmdns4 = true;
# ^^ Not one hundred percent sure if this is needed- if it aint broke, don't fix it
enable = true;
openFirewall = true;
};
samba-wsdd = {
# This enables autodiscovery on windows since SMB1 (and thus netbios) support was discontinued
enable = true;
openFirewall = true;
};
};
}

View file

@ -1,29 +0,0 @@
{
services.prosody = {
enable = false;
user = "acme";
modules = {
welcome = true;
websocket = true;
watchregistrations = true;
};
admins = [ "liv@liv.town" ];
allowRegistration = false;
ssl.cert = "/var/lib/acme/liv.town/cert.pem";
ssl.key = "/var/lib/acme/liv.town/key.pem";
virtualHosts."liv.town" = {
enabled = true;
domain = "liv.town";
ssl.cert = "/var/lib/acme/liv.town/fullchain.pem";
ssl.key = "/var/lib/acme/liv.town/key.pem";
};
muc = [
{
domain = "conference.liv.town";
}
];
uploadHttp = {
domain = "upload.liv.town";
};
};
}

View file

@ -3,11 +3,14 @@
imports = imports =
[ (import ./invidious.nix) ] [ (import ./invidious.nix) ]
++ [ (import ./anubis.nix) ] ++ [ (import ./anubis.nix) ]
++ [ (import ./borg.nix) ]
++ [ (import ./binternet-proxy.nix) ] ++ [ (import ./binternet-proxy.nix) ]
++ [ (import ./bluemap-proxy.nix) ]
++ [ (import ./docker.nix) ] ++ [ (import ./docker.nix) ]
++ [ (import ./frp.nix) ] # ++ [ (import ./frp.nix) ]
++ [ (import ./forgejo.nix) ] ++ [ (import ./forgejo.nix) ]
++ [ (import ./grafana.nix) ] ++ [ (import ./grafana.nix) ]
++ [ (import ./guacamole.nix) ]
++ [ (import ./gokapi.nix) ] ++ [ (import ./gokapi.nix) ]
++ [ (import ./jellyfin.nix) ] ++ [ (import ./jellyfin.nix) ]
++ [ (import ./librey-proxy.nix) ] ++ [ (import ./librey-proxy.nix) ]
@ -16,15 +19,13 @@
++ [ (import ./mumble.nix) ] ++ [ (import ./mumble.nix) ]
++ [ (import ./monitoring.nix) ] ++ [ (import ./monitoring.nix) ]
++ [ (import ./ntfy.nix) ] ++ [ (import ./ntfy.nix) ]
++ [ (import ./bluemap-proxy.nix) ]
++ [ (import ./sharkey-proxy.nix) ]
++ [ (import ./nginx.nix) ] ++ [ (import ./nginx.nix) ]
# ++ [(import ./komga.nix)]
++ [ (import ./radicale.nix) ] ++ [ (import ./radicale.nix) ]
++ [ (import ./prosody.nix) ] ++ [ (import ./readarr.nix) ]
++ [ (import ./tailscale.nix) ] ++ [ (import ./sharkey-proxy.nix) ]
++ [ (import ./guacamole.nix) ] # ++ [ (import ./komga.nix) ]
++ [ (import ./readarr.nix) ]; # ++ [ (import ./prosody.nix) ]
# ++ [(import ./smart-monitoring.nix)] ++ [ (import ./tailscale.nix) ];
# ++ [(import ./jitsi-meet.nix)] # ++ [ (import ./smart-monitoring.nix) ]
# ++ [ (import ./jitsi-meet.nix) ]
} }

29
modules/services/xmpp.nix Normal file
View file

@ -0,0 +1,29 @@
{
# services.prosody = {
# enable = false;
# user = "acme";
# modules = {
# welcome = true;
# websocket = true;
# watchregistrations = true;
# };
# admins = [ "liv@liv.town" ];
# allowRegistration = false;
# ssl.cert = "/var/lib/acme/liv.town/cert.pem";
# ssl.key = "/var/lib/acme/liv.town/key.pem";
# virtualHosts."liv.town" = {
# enabled = true;
# domain = "liv.town";
# ssl.cert = "/var/lib/acme/liv.town/fullchain.pem";
# ssl.key = "/var/lib/acme/liv.town/key.pem";
# };
# muc = [
# {
# domain = "conference.liv.town";
# }
# ];
# uploadHttp = {
# domain = "upload.liv.town";
# };
# };
}