This commit is contained in:
Sebastian Moser
2026-11-02 21:53:31 +01:00
parent a347145348
commit 72a707299f
39 changed files with 7068 additions and 287 deletions

View File

@@ -1,5 +1,5 @@
{ inputs, pkgs, secretsDir, config, dataDir, ... }: let
{ inputs, pkgs, secretsDir, config, dataDir, lib, ... }: let
in {
@@ -407,142 +407,4 @@ in {
};
############################## backups to fusu ##################################
users.users.borgs = {
uid = 2000;
isNormalUser = true;
group = "borgs";
};
users.groups.borgs = {
gid = 2000;
};
home-manager.users.borgs = { secretsDir, ... }: {
imports = [
../users/common/home.nix
];
home.file.".ssh/known_hosts".text = ''
195.201.148.94 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuxoYAjNYi3q2SFlzoVQTePcsnmT+qFHuaiiclC+S5I
195.201.148.94 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCtDgdBTd8apRMBTweK9ZMRTdFqkU1mbKQDmyXSXbhSQAYwlgkmh1ee4TBE4nt/2b28QT5AqWOazVraqlAoSp+n7GwdsPH26lhbuF+ZVHq05X3RuJLmbhOsa6QlPzjSHiyj+Onkmj9DyXwKhhMErGcT1n2nhC4Oi007qsqcYQIB/YJ7hmMDABMzm9Bwd5Rk6xsDfz+9umvSMpwtfctpKixoVq90Fe3X6wloo5sgXpqfdP1IDFxfiaDp6nOQuOhvcA1Z67oGpW3T8CbZ5aDqA8e1vtpkl7oT3YolR+5153B/e0zOSAk8AabfkLdvrReECg2AHloH7hf9TOBVH0RVZluK+GRVJoaO2b3EspwIlThdQthiZH5/6vwDLsY6zNw6bUlKNntcNbJ5ZHc7zVv03Zlbpp6aWye0O3HR1PkaOo7pragEX9VAGj8Af2fNinSZVtd30gZlRFhLXQRAad+gC9R/5Q9X7V9BZBbWZ3J9DCP5zFoM9Y2R2YySjHX8Dmy7Jps=
195.201.148.94 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBAFh44c1Efqv/g8lvjDSY6uBYevByf1fg4BhLVcfYudqrSSSwbeaPrv6B+M5psrHo6/zthciDzp4oYUG8ANVRWs=
[localhost]:49388 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFr1jHueUdsh4Bc9meR1Var4hbZKLCnZGfCSpsP0oOeS
[localhost]:49388 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDHr9ZzEzC+2s1YNfPsFqDMbZv+o4XG2tEWlAF3DzzgdDawwxSj963qR46OqefPO+yiPBR/x3tFjXtSQ96qDcum9fzuiSzB+z5+/Zhs7VWEPi9ugGTDLFpX823EQrgcVKFE4jWnGsx6Ek8C9YojKgKf5afHG+ww2jNhTPHgVTrQkqo0JzUEnfjhJ/1/WluzpiGHfIy9re5MU10f2z9Vja7M0oDZ/Je+zavA4tlQpZ3URQnCEKC2vf7DhtwYBAOuyXKMdUSaTNdeTytmDjxdhJ38q8bwTHtfLUBzyYjW012Q5d1+/g1dqInu99uN/+UjTJc/GFiqLCE0tmco1GafptnKHJLgDC93vE832G5qvxhykfUAJdNW58kbWugeQm6Rb0i1UL5ckVHurMZT9BL6E9LKV0SewozyBtnA21RKu1vsheN86N0uBLwn3v1r0H3xPL4+S1WbmpXpIoCAoyTLc2janw2Gt22W1p08tv+a+lntFVqBn5ZSpcaUxQ6wRQQAfokqDh5YUzb+Tu9Fxi483qb6bd18io3kMLDre3G4xXqlvAB386Uj8iAYivmZIPBEFDCWBVki9LzWPfQGumgYN0CqSM6Gpqk0RnyU1CNPACEGaRpE1ph4Dgl9NQzRCiw/fEUiMZy1CTkly1YCiqSpp2iMmsJw+QJjfAbehEP+Tl8NIQ==
'';
programs.ssh = {
enable = true;
matchBlocks = {
"*" = {
identityFile = "/home/borgs/backups/borgs-private";
};
ouranos = {
hostname = "195.201.148.94";
user = "root";
};
fusus = {
hostname = "localhost";
user = "server";
port = 49388;
};
ocih = {
hostname = "152.67.70.13";
user = "ubuntu";
};
};
};
};
# automatically creates the mountpoint as well!!
fileSystems."/home/borgs/backups" = {
device = "/home/files/storage/backups/servers";
options = [ "bind" ];
};
# ouranus
systemd.services.backup-ouranos-minecraft = {
enable = true;
description = "backup the /var/minecraft folder on ouranus to fusu";
unitConfig = {
Type = "simple";
};
path = with pkgs; [ curl bash socat borgbackup openssh ];
serviceConfig = {
ExecStart = "/home/borgs/backups/ouranos-minecraft.sh";
User = "borgs";
Group = "borgs";
WorkingDirectory = "/home/borgs/backups";
ExecStopPost = "/home/borgs/backups/exit-ouranos-minecraft.sh";
};
wants = [ "home-files-storage.mount" ];
};
systemd.timers.backup-ouranos-minecraft = {
wantedBy = [ "timers.target" ];
timerConfig = {
#OnBootSec = "5m";
#nUnitActiveSec = "1d";
OnCalendar = "*-*-* 04:00:00";
Persistent = "True";
Unit = "backup-ouranos-minecraft.service";
};
};
# ouranus
systemd.services.backup-fusu-server = {
enable = true;
description = "backup the ~/server folder on fusus";
unitConfig = {
Type = "simple";
};
path = with pkgs; [ curl bash socat borgbackup openssh ];
serviceConfig = {
ExecStart = "/home/borgs/backups/fusu-server.sh";
User = "borgs";
Group = "borgs";
WorkingDirectory = "/home/borgs/backups";
ExecStopPost = "/home/borgs/backups/exit-fusu-server.sh";
};
wants = [ "home-files-storage.mount" ];
};
systemd.timers.backup-fusu-server = {
wantedBy = [ "timers.target" ];
timerConfig = {
#OnBootSec = "5m";
#OnUnitActiveSec = "1d";
OnCalendar = "*-*-* 03:00:00";
Persistent = "True";
Unit = "backup-fusu-server.service";
};
};
# ocih
systemd.services.backup-ocih = {
enable = true;
description = "backup the ~/host folder on ocih";
unitConfig = {
Type = "simple";
};
path = with pkgs; [ curl bash socat borgbackup openssh ];
serviceConfig = {
ExecStart = "/home/borgs/backups/ocih.sh";
User = "borgs";
Group = "borgs";
WorkingDirectory = "/home/borgs/backups";
ExecStopPost = "/home/borgs/backups/exit-ocih.sh";
};
wants = [ "home-files-storage.mount" ];
};
systemd.timers.backup-ocih = {
wantedBy = [ "timers.target" ];
timerConfig = {
#OnBootSec = "5m";
#OnUnitActiveSec = "1d";
OnCalendar = "*-*-* 02:00:00";
Persistent = "True";
Unit = "backup-ocih.service";
};
};
}

View File

@@ -7,6 +7,7 @@ export BASH_ENV=$CONFIG_DIR/hosts/main/bashrc
export HOSTNAME=main
export DOOMDIR="$CONFIG_DIR/doomdir"
export MIZE_SRC=$CONFIG_DIR/mize
export MIZE_STORE=~/work/app-data/mize
mkdir -p $LOG_DIR
# arch path
@@ -78,7 +79,8 @@ function get_config() {
myconfig["mize.configFile"]="$CONFIG_DIR/hosts/main/"
myconfig["mize.secretsFile"]="~/secrets/mize-config.toml"
myconfig["mize.startDev"]="true"
myconfig["mize.backtrace"]="true"
myconfig["mize.runBuild"]="false"
myconfig["mize.backtrace"]="false"
# nixos case
if [[ "$DISTRO" == "nixos" ]]; then

44
hosts/main/bin/direnv-diff Executable file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env python
import os
import subprocess
import sys
import shlex
def read_env(data):
return dict(
item.split(b"=", 1)
for item in data.split(b"\0")
if item
)
def main():
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} DIR", file=sys.stderr)
return 2
before = {
os.fsencode(k): os.fsencode(v)
for k, v in os.environ.items()
}
result = subprocess.run(
["direnv", "exec", sys.argv[1], "env", "-0"],
stdout=subprocess.PIPE,
check=True,
)
after = read_env(result.stdout)
for key, value in after.items():
if before.get(key) != value:
name = os.fsdecode(key)
val = os.fsdecode(value)
print(f"export {name}={shlex.quote(val)}")
if __name__ == "__main__":
sys.exit(main())

View File

@@ -1,27 +0,0 @@
#!/bin/bash
if [[ -v IS_RUNIT ]]; then
exec 2>$LOG_DIR/mize
exec 1>$LOG_DIR/mize
exec /home/me/work/config/mize/target/debug/mize --config $CONFIG_DIR/hosts/main/mize.toml -o cli.daemonMode --secrets $SECRETS_DIR/mize-secrets.toml run
exit 0
fi
export LD_LIBRARY_PATH=/nix/store/992h4k1s2c0ma186wyc7a3080wrh1cc6-xdotool-4.20260303.1/lib:/nix/store/rsdvlq7wb59hdiwhhvkhx2xvxdkalkzc-webkitgtk-2.52.4+abi=4.1/lib:/nix/store/90ln3xz5m2x3r0ykad4mkg9gnwgrjpzg-pango-1.57.1/lib:/nix/store/l0vl4dali2mvbpi30a8da1f71jl85myg-openssl-3.6.2/lib:/nix/store/s2bjqqzdjs4ji71qm1wwnkiy7g3afdz6-at-spi2-core-2.60.4/lib:/nix/store/fzhjg6xris850npqr92g4m4pskj88brn-atkmm-2.28.5/lib:/nix/store/4zwifnznmqsg3zl8y5yyfafwp4sws6rs-cairo-1.18.4/lib:/nix/store/rgr3i966i5wnblv62fvkid3v3lxy1ivb-gdk-pixbuf-2.44.6/lib:/nix/store/7dl2py4dnp4ffj92r1lq0i54ik1v8kzn-glib-2.88.1/lib:/nix/store/7c73fgj9w0k8qrpq3j1h8h976bk7gqsp-gtk+3-3.24.52/lib:/nix/store/49i3fhgpfffwh3xm3j58ma4z7221sqbq-harfbuzz-13.2.1/lib:/nix/store/na21ka09652cgigpv9wlw904wpq8bnvz-librsvg-2.62.1/lib:/nix/store/jc4y9v7ci45vas65kyl00pzpam3dnbfk-libsoup-3.6.6/lib:/nix/store/3kncz3fkk7sv9xc61x096jnbxvxfnx1k-libxkbcommon-1.13.1/lib:/nix/store/a4h98420m9h8c84r2igrpdd94xsrc9b6-alsa-lib-1.2.15.3/lib:/nix/store/hngmi01i8wgi25a0byrxcn4ysz5j79mw-gcc-15.2.0-lib/lib:/nix/store/xpzd2xmvqpkv1la78qkfpybkfwak27xd-libxcb-1.17.0/lib:/nix/store/6y2b9qs1npwsvcsl9m66hjarzj0yagb4-pipewire-1.6.5/lib:/nix/store/clvzgv5kqq953s4azqhkg3ddgpvgl9wc-wayland-1.25.0/lib:/nix/store/8gyg3xn9i8xdz42yhbl0d3vmmz8phcs0-bzip2-1.0.8/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONFIG_DIR/mize/target/debug
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/nix/store/k7bh855izql4rli5hh0s5lsphzc0gnc2-rust-mixed/lib/rustlib/x86_64-unknown-linux-gnu/lib/
get_config mize.startDev START_DEV
get_config mize.backtrace RUST_BACKTRACE
export RUST_BACKTRACE
if [[ "$START_DEV" == "true" ]] then
exec /home/me/work/config/mize/target/debug/mize --config $CONFIG_DIR/hosts/main/mize.toml --secrets $SECRETS_DIR/mize-secrets.toml "$@"
else
exec /home/me/mize --config $CONFIG_DIR/hosts/main/mize.toml --secrets $SECRETS_DIR/mize-secrets.toml "$@"
fi
# alias sci="cargo run --manifest-path ~/work/config/mize/Cargo.toml --bin mize -- --config $CONFIG_DIR/hosts/main/mize.toml --secrets $SECRETS_DIR/mize-secrets.toml run sci"
# alias mr="cargo run --manifest-path ~/work/config/mize/Cargo.toml --bin mize -- --config $CONFIG_DIR/hosts/main/mize.toml --secrets $SECRETS_DIR/mize-secrets.toml run"
# alias md="cargo run --manifest-path ~/work/config/mize/Cargo.toml --bin mize -- --config $CONFIG_DIR/hosts/main/mize.toml --secrets $SECRETS_DIR/mize-secrets.toml run dev"

9
hosts/main/bin/xdg-open Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
echo XDG-OPEN args: > ~/last-xdg-open-call
echo $@ >> ~/last-xdg-open-call
exec /usr/bin/xdg-open "$@"

View File

@@ -3,6 +3,7 @@
192.168.3.1 gw
192.168.3.1 gw.c2vi.dev
192.168.3.105 mac
100.88.79.207 matrix.c2vi.dev
# netbird
100.88.137.49 te

View File

@@ -7,7 +7,8 @@ log.level = "debug"
part_path = "/home/me/work/config/mize/target/debug/"
mize.src = "/home/me/work/config/mize"
parts = [ "cli" ]
parts = [ "cli", "auth.client", "dev", "mme" ]
#parts = [ "cli", "dev", "mme" ]
#parts = [ "cli", "auth", "spacetime", "sci", "c2vi", "dev" ]
enable = [ "cli", "auth", "spacetime", "sci", "c2vi", "dev", "sci.timetrack" ]
timetrack.dailyNotesPath = "/home/me/work/things/nico/daily"

View File

@@ -1 +1 @@
1068
1095

View File

@@ -1 +1 @@
20922
1093

View File

@@ -1 +1 @@
1066
1094

View File

@@ -27,7 +27,7 @@ pacstrap -K /cachy base base-devel vim nix less direnv nvim
pacstrap -K /cachy wayland firefox alacritty dms-shell git cmake paru
pacstrap -K /cachy freerdp remmina
pacstrap -K /cachy brightnessctl playerctl nm-connection-editor ttf-hack zenity prismlauncher docker inetutils freerdp
pacstrap -K /cachy brightnessctl playerctl nm-connection-editor ttf-hack zenity prismlauncher docker inetutils freerdp noto-fonts-emoji
```
## chroot