Compare commits
68 Commits
kexec_luks
...
7e812001f0
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e812001f0 | |||
| 14c19b80ef | |||
| e8dd0cb5ff | |||
| dc9f5e969a | |||
| 03150667b6 | |||
| 1dfd7bc8a2 | |||
| fa649b1e2a | |||
| e34752c791 | |||
| 75031567bd | |||
| 800a95d431 | |||
| 932b05a42e | |||
| b5cc4d4609 | |||
| ba3d15d82a | |||
| e80fb7b3db | |||
| 84e1f6e573 | |||
| c4847bd39b | |||
| c0c1ec5c67 | |||
| 6739115cfb | |||
| 4606cc32ba | |||
| 2d27bf7505 | |||
| d07af6d101 | |||
| 4890dc20e0 | |||
| 8b01a9b240 | |||
| 8dfba8646c | |||
| 63c0f52955 | |||
| 5413a8e7db | |||
| 330c801e43 | |||
| 8ba08ce982 | |||
| 2b50aeba93 | |||
| c1aef574b1 | |||
| 52ed25f1b9 | |||
| 0446d18712 | |||
| d2bbbb827e | |||
| 6fba594625 | |||
| fa6e092c06 | |||
| 3a6dae2b82 | |||
| 62bb740634 | |||
| 577e0d21bc | |||
| b481a518f5 | |||
| f93b2c6908 | |||
| 890b24200e | |||
| d3259457de | |||
| 8eb42ee68b | |||
| 9d4c48badb | |||
| 9cf2b82e92 | |||
| 61ca918cca | |||
| ef61792da4 | |||
| 3dc97f4960 | |||
| f4a26a8d15 | |||
| 37782a26d5 | |||
| 1434bd2df1 | |||
| e49ea3a7c4 | |||
| 9a6cde1e89 | |||
| 35972b6d68 | |||
| b8021c1756 | |||
| 4b21489141 | |||
| a256ab7728 | |||
| da7ebe7baa | |||
| 1922bbbcfd | |||
| b17be86927 | |||
| ec73a63e09 | |||
| af26a004e5 | |||
| d83782f315 | |||
| 162b544249 | |||
| 0c58e62ed4 | |||
| 96de109d62 | |||
| 0efcf8f3fc | |||
| 2009180827 |
24
.gitea/workflows/check-flake.yaml
Normal file
24
.gitea/workflows/check-flake.yaml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
name: Check Flake
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
env:
|
||||||
|
DEBIAN_FRONTEND: noninteractive
|
||||||
|
PATH: /run/current-system/sw/bin/
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-flake:
|
||||||
|
runs-on: nixos
|
||||||
|
steps:
|
||||||
|
- name: Checkout the repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- run: |
|
||||||
|
pwd
|
||||||
|
ls -lah .
|
||||||
|
whoami
|
||||||
|
|
||||||
|
- name: Check Flake
|
||||||
|
run: nix flake check --show-trace
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
# Modify auto-update so that it pulls a flake
|
# Modify auto-update so that it pulls a flake
|
||||||
|
|
||||||
@@ -6,20 +6,10 @@ let
|
|||||||
cfg = config.system.autoUpgrade;
|
cfg = config.system.autoUpgrade;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
config = lib.mkIf cfg.enable {
|
||||||
{
|
system.autoUpgrade = {
|
||||||
system.autoUpgrade = {
|
flake = "git+https://git.neet.dev/zuckerberg/nix-config.git";
|
||||||
flake = "git+https://git.neet.dev/zuckerberg/nix-config.git";
|
flags = [ "--recreate-lock-file" "--no-write-lock-file" ]; # ignore lock file, just pull the latest
|
||||||
flags = [ "--recreate-lock-file" "--no-write-lock-file" ]; # ignore lock file, just pull the latest
|
};
|
||||||
|
};
|
||||||
# dates = "03:40";
|
|
||||||
# kexecWindow = lib.mkDefault { lower = "01:00"; upper = "05:00"; };
|
|
||||||
# randomizedDelaySec = "45min";
|
|
||||||
};
|
|
||||||
|
|
||||||
system.autoUpgrade.allowKexec = lib.mkDefault true;
|
|
||||||
|
|
||||||
luks.enableKexec = cfg.allowKexec && builtins.length config.luks.devices > 0;
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|||||||
17
common/binary-cache.nix
Normal file
17
common/binary-cache.nix
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
nix = {
|
||||||
|
settings = {
|
||||||
|
substituters = [
|
||||||
|
"https://cache.nixos.org/"
|
||||||
|
"https://nix-community.cachix.org"
|
||||||
|
"http://s0.koi-bebop.ts.net:5000"
|
||||||
|
];
|
||||||
|
trusted-public-keys = [
|
||||||
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
|
"s0.koi-bebop.ts.net:OjbzD86YjyJZpCp9RWaQKANaflcpKhtzBMNP8I2aPUU="
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -13,13 +13,11 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
# Use GRUB 2 for BIOS
|
|
||||||
boot.loader = {
|
boot.loader = {
|
||||||
timeout = 2;
|
timeout = 2;
|
||||||
grub = {
|
grub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
device = cfg.device;
|
device = cfg.device;
|
||||||
version = 2;
|
|
||||||
useOSProber = true;
|
useOSProber = true;
|
||||||
configurationLimit = 20;
|
configurationLimit = 20;
|
||||||
theme = pkgs.nixos-grub2-theme;
|
theme = pkgs.nixos-grub2-theme;
|
||||||
|
|||||||
@@ -5,8 +5,6 @@
|
|||||||
./firmware.nix
|
./firmware.nix
|
||||||
./efi.nix
|
./efi.nix
|
||||||
./bios.nix
|
./bios.nix
|
||||||
./kexec-luks.nix
|
|
||||||
./luks.nix
|
|
||||||
./remote-luks-unlock.nix
|
./remote-luks-unlock.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,14 +10,12 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
# Use GRUB2 for EFI
|
|
||||||
boot.loader = {
|
boot.loader = {
|
||||||
efi.canTouchEfiVariables = true;
|
efi.canTouchEfiVariables = true;
|
||||||
timeout = 2;
|
timeout = 2;
|
||||||
grub = {
|
grub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
device = "nodev";
|
device = "nodev";
|
||||||
version = 2;
|
|
||||||
efiSupport = true;
|
efiSupport = true;
|
||||||
useOSProber = true;
|
useOSProber = true;
|
||||||
# memtest86.enable = true;
|
# memtest86.enable = true;
|
||||||
|
|||||||
@@ -1,121 +0,0 @@
|
|||||||
# Allows kexec'ing as an alternative to rebooting for machines that
|
|
||||||
# have luks encrypted partitions that need to be mounted at boot.
|
|
||||||
# These luks partitions will be automatically unlocked, no password,
|
|
||||||
# or any interaction needed whatsoever.
|
|
||||||
|
|
||||||
# This is accomplished by fetching the luks key(s) while the system is running,
|
|
||||||
# then building a temporary initrd that contains the luks key(s), and kexec'ing.
|
|
||||||
|
|
||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
options.luks = {
|
|
||||||
enableKexec = lib.mkEnableOption "Enable support for transparent passwordless kexec while using luks";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf config.luks.enableKexec {
|
|
||||||
luks.fallbackToPassword = true;
|
|
||||||
luks.disableKeyring = true;
|
|
||||||
|
|
||||||
boot.initrd.luks.devices = lib.listToAttrs
|
|
||||||
(builtins.map
|
|
||||||
(item:
|
|
||||||
{
|
|
||||||
name = item;
|
|
||||||
value = {
|
|
||||||
masterKeyFile = "/etc/${item}.key";
|
|
||||||
};
|
|
||||||
})
|
|
||||||
config.luks.deviceNames);
|
|
||||||
|
|
||||||
systemd.services.prepare-luks-kexec-image = {
|
|
||||||
description = "Prepare kexec automatic LUKS unlock on kexec reboot without a password";
|
|
||||||
|
|
||||||
wantedBy = [ "kexec.target" ];
|
|
||||||
unitConfig.DefaultDependencies = false;
|
|
||||||
serviceConfig.Type = "oneshot";
|
|
||||||
|
|
||||||
path = with pkgs; [ file kexec-tools coreutils-full cpio findutils gzip xz zstd lvm2 xxd gawk ];
|
|
||||||
|
|
||||||
# based on https://github.com/flowztul/keyexec
|
|
||||||
script = ''
|
|
||||||
system=/nix/var/nix/profiles/system
|
|
||||||
old_initrd=$(readlink -f "$system/initrd")
|
|
||||||
|
|
||||||
umask 0077
|
|
||||||
CRYPTROOT_TMPDIR="$(mktemp -d --tmpdir=/dev/shm)"
|
|
||||||
|
|
||||||
cleanup() {
|
|
||||||
shred -fu "$CRYPTROOT_TMPDIR/initrd_contents/etc/"*.key || true
|
|
||||||
shred -fu "$CRYPTROOT_TMPDIR/new_initrd" || true
|
|
||||||
shred -fu "$CRYPTROOT_TMPDIR/secret/"* || true
|
|
||||||
rm -rf "$CRYPTROOT_TMPDIR"
|
|
||||||
}
|
|
||||||
# trap cleanup INT TERM EXIT
|
|
||||||
|
|
||||||
mkdir -p "$CRYPTROOT_TMPDIR"
|
|
||||||
cd "$CRYPTROOT_TMPDIR"
|
|
||||||
|
|
||||||
# Determine the compression type of the initrd image
|
|
||||||
compression=$(file -b --mime-type "$old_initrd" | awk -F'/' '{print $2}')
|
|
||||||
|
|
||||||
# Decompress the initrd image based on its compression type
|
|
||||||
case "$compression" in
|
|
||||||
gzip)
|
|
||||||
gunzip -c "$old_initrd" > initrd.cpio
|
|
||||||
;;
|
|
||||||
xz)
|
|
||||||
unxz -c "$old_initrd" > initrd.cpio
|
|
||||||
;;
|
|
||||||
zstd)
|
|
||||||
zstd -d -c "$old_initrd" > initrd.cpio
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unsupported compression type: $compression"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Extract the contents of the cpio archive
|
|
||||||
mkdir -p initrd_contents
|
|
||||||
cd initrd_contents
|
|
||||||
cpio -idv < ../initrd.cpio
|
|
||||||
|
|
||||||
# Generate keys and add them to the extracted initrd filesystem
|
|
||||||
luksDeviceNames=(${builtins.concatStringsSep " " config.luks.deviceNames})
|
|
||||||
for item in "''${luksDeviceNames[@]}"; do
|
|
||||||
dmsetup --showkeys table "$item" | cut -d ' ' -f5 | xxd -ps -g1 -r > "./etc/$item.key"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Add normal initrd secrets too
|
|
||||||
${lib.concatStringsSep "\n" (lib.mapAttrsToList (dest: source:
|
|
||||||
let source' = if source == null then dest else builtins.toString source; in
|
|
||||||
''
|
|
||||||
mkdir -p $(dirname "./${dest}")
|
|
||||||
cp -a ${source'} "./${dest}"
|
|
||||||
''
|
|
||||||
) config.boot.initrd.secrets)
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create a new cpio archive with the modified contents
|
|
||||||
find . | cpio -o -H newc -v > ../new_initrd.cpio
|
|
||||||
|
|
||||||
# Compress the new cpio archive using the original compression type
|
|
||||||
cd ..
|
|
||||||
case "$compression" in
|
|
||||||
gzip)
|
|
||||||
gunzip -c new_initrd.cpio > new_initrd
|
|
||||||
;;
|
|
||||||
xz)
|
|
||||||
unxz -c new_initrd.cpio > new_initrd
|
|
||||||
;;
|
|
||||||
zstd)
|
|
||||||
zstd -c new_initrd.cpio > new_initrd
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
kexec --load "$system/kernel" --append "init=$system/init ${builtins.concatStringsSep " " config.boot.kernelParams}" --initrd "$CRYPTROOT_TMPDIR/new_initrd"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
# Makes it a little easier to configure luks partitions for boot
|
|
||||||
# Additionally, this solves a circular dependency between kexec luks
|
|
||||||
# and NixOS's luks module.
|
|
||||||
|
|
||||||
{ config, lib, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.luks;
|
|
||||||
|
|
||||||
deviceCount = builtins.length cfg.devices;
|
|
||||||
|
|
||||||
deviceMap = lib.imap
|
|
||||||
(i: item: {
|
|
||||||
device = item;
|
|
||||||
name =
|
|
||||||
if deviceCount == 1 then "enc-pv"
|
|
||||||
else "enc-pv${builtins.toString (i + 1)}";
|
|
||||||
})
|
|
||||||
cfg.devices;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.luks = {
|
|
||||||
devices = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.str;
|
|
||||||
default = [ ];
|
|
||||||
};
|
|
||||||
|
|
||||||
allowDiscards = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
fallbackToPassword = lib.mkEnableOption
|
|
||||||
"Fallback to interactive passphrase prompt if the cannot be found.";
|
|
||||||
|
|
||||||
disableKeyring = lib.mkEnableOption
|
|
||||||
"When opening LUKS2 devices, don't use the kernel keyring";
|
|
||||||
|
|
||||||
# set automatically, don't touch
|
|
||||||
deviceNames = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.str;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkMerge [
|
|
||||||
{
|
|
||||||
assertions = [
|
|
||||||
{
|
|
||||||
assertion = deviceCount == builtins.length (builtins.attrNames config.boot.initrd.luks.devices);
|
|
||||||
message = ''
|
|
||||||
All luks devices must be specified using `luks.devices` not `boot.initrd.luks.devices`.
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
(lib.mkIf (deviceCount != 0) {
|
|
||||||
luks.deviceNames = builtins.map (device: device.name) deviceMap;
|
|
||||||
|
|
||||||
boot.initrd.luks.devices = lib.listToAttrs (
|
|
||||||
builtins.map
|
|
||||||
(item:
|
|
||||||
{
|
|
||||||
name = item.name;
|
|
||||||
value = {
|
|
||||||
device = item.device;
|
|
||||||
allowDiscards = cfg.allowDiscards;
|
|
||||||
fallbackToPassword = cfg.fallbackToPassword;
|
|
||||||
disableKeyring = cfg.disableKeyring;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
deviceMap);
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
# TODO: use tailscale instead of tor https://gist.github.com/antifuchs/e30d58a64988907f282c82231dde2cbc
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.remoteLuksUnlock;
|
cfg = config.remoteLuksUnlock;
|
||||||
in
|
in
|
||||||
@@ -33,6 +35,11 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
# boot.initrd.luks.devices.${cfg.device.name} = {
|
||||||
|
# device = cfg.device.path;
|
||||||
|
# allowDiscards = cfg.device.allowDiscards;
|
||||||
|
# };
|
||||||
|
|
||||||
# Unlock LUKS disk over ssh
|
# Unlock LUKS disk over ssh
|
||||||
boot.initrd.network.enable = true;
|
boot.initrd.network.enable = true;
|
||||||
boot.initrd.kernelModules = cfg.kernelModules;
|
boot.initrd.kernelModules = cfg.kernelModules;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./backups.nix
|
./backups.nix
|
||||||
|
./binary-cache.nix
|
||||||
./flakes.nix
|
./flakes.nix
|
||||||
./auto-update.nix
|
./auto-update.nix
|
||||||
./shell.nix
|
./shell.nix
|
||||||
@@ -11,12 +12,13 @@
|
|||||||
./server
|
./server
|
||||||
./pc
|
./pc
|
||||||
./machine-info
|
./machine-info
|
||||||
|
./nix-builder.nix
|
||||||
./ssh.nix
|
./ssh.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nix.flakes.enable = true;
|
nix.flakes.enable = true;
|
||||||
|
|
||||||
system.stateVersion = "21.11";
|
system.stateVersion = "23.11";
|
||||||
|
|
||||||
networking.useDHCP = false;
|
networking.useDHCP = false;
|
||||||
|
|
||||||
@@ -24,7 +26,13 @@
|
|||||||
networking.firewall.allowPing = true;
|
networking.firewall.allowPing = true;
|
||||||
|
|
||||||
time.timeZone = "America/Denver";
|
time.timeZone = "America/Denver";
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n = {
|
||||||
|
defaultLocale = "en_US.UTF-8";
|
||||||
|
extraLocaleSettings = {
|
||||||
|
LANGUAGE = "en_US.UTF-8";
|
||||||
|
LC_ALL = "en_US.UTF-8";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
# TODO implement this module such that the wireguard VPN doesn't have to live in a container
|
# TODO implement this module such that the wireguard VPN doesn't have to live in a container
|
||||||
# TODO don't add forward rules if the PIA port is the same as cfg.forwardedPort
|
# TODO don't add forward rules if the PIA port is the same as cfg.forwardedPort
|
||||||
# TODO verify signatures of PIA responses
|
# TODO verify signatures of PIA responses
|
||||||
|
# TODO `RuntimeMaxSec = "30d";` for pia-vpn-wireguard-init isn't allowed per the systemd logs. Find alternative.
|
||||||
|
|
||||||
with builtins;
|
with builtins;
|
||||||
with lib;
|
with lib;
|
||||||
@@ -143,14 +144,14 @@ in
|
|||||||
systemd.services.pia-vpn-wireguard-init = {
|
systemd.services.pia-vpn-wireguard-init = {
|
||||||
description = "Creates PIA VPN Wireguard Interface";
|
description = "Creates PIA VPN Wireguard Interface";
|
||||||
|
|
||||||
requires = [ "network-online.target" ];
|
wants = [ "network-online.target" ];
|
||||||
after = [ "network.target" "network-online.target" ];
|
after = [ "network.target" "network-online.target" ];
|
||||||
before = [ containerServiceName ];
|
before = [ containerServiceName ];
|
||||||
requiredBy = [ containerServiceName ];
|
requiredBy = [ containerServiceName ];
|
||||||
partOf = [ containerServiceName ];
|
partOf = [ containerServiceName ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
path = with pkgs; [ wireguard-tools jq curl iproute ];
|
path = with pkgs; [ wireguard-tools jq curl iproute iputils ];
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
@@ -162,6 +163,11 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
script = ''
|
script = ''
|
||||||
|
echo Waiting for internet...
|
||||||
|
while ! ping -c 1 -W 1 1.1.1.1; do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
# Prepare to connect by generating wg secrets and auth'ing with PIA since the container
|
# Prepare to connect by generating wg secrets and auth'ing with PIA since the container
|
||||||
# cannot do without internet to start with. NAT'ing the host's internet would address this
|
# cannot do without internet to start with. NAT'ing the host's internet would address this
|
||||||
# issue but is not ideal because then leaking network outside of the VPN is more likely.
|
# issue but is not ideal because then leaking network outside of the VPN is more likely.
|
||||||
@@ -214,7 +220,7 @@ in
|
|||||||
vpn-container.config.systemd.services.pia-vpn-wireguard = {
|
vpn-container.config.systemd.services.pia-vpn-wireguard = {
|
||||||
description = "Initializes the PIA VPN WireGuard Tunnel";
|
description = "Initializes the PIA VPN WireGuard Tunnel";
|
||||||
|
|
||||||
requires = [ "network-online.target" ];
|
wants = [ "network-online.target" ];
|
||||||
after = [ "network.target" "network-online.target" ];
|
after = [ "network.target" "network-online.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
|
|||||||
@@ -72,9 +72,6 @@ in
|
|||||||
config = {
|
config = {
|
||||||
imports = allModules ++ [ cfg.config ];
|
imports = allModules ++ [ cfg.config ];
|
||||||
|
|
||||||
# speeds up evaluation
|
|
||||||
nixpkgs.pkgs = pkgs;
|
|
||||||
|
|
||||||
# networking.firewall.enable = mkForce false;
|
# networking.firewall.enable = mkForce false;
|
||||||
networking.firewall.trustedInterfaces = [
|
networking.firewall.trustedInterfaces = [
|
||||||
# completely trust internal interface to host
|
# completely trust internal interface to host
|
||||||
|
|||||||
60
common/nix-builder.nix
Normal file
60
common/nix-builder.nix
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
builderRole = "nix-builder";
|
||||||
|
builderUserName = "nix-builder";
|
||||||
|
|
||||||
|
machinesByRole = role: lib.filterAttrs (hostname: cfg: builtins.elem role cfg.systemRoles) config.machines.hosts;
|
||||||
|
otherMachinesByRole = role: lib.filterAttrs (hostname: cfg: hostname != config.networking.hostName) (machinesByRole role);
|
||||||
|
thisMachineHasRole = role: builtins.hasAttr config.networking.hostName (machinesByRole role);
|
||||||
|
|
||||||
|
builders = machinesByRole builderRole;
|
||||||
|
thisMachineIsABuilder = thisMachineHasRole builderRole;
|
||||||
|
|
||||||
|
# builders don't include themselves as a remote builder
|
||||||
|
otherBuilders = lib.filterAttrs (hostname: cfg: hostname != config.networking.hostName) builders;
|
||||||
|
in
|
||||||
|
lib.mkMerge [
|
||||||
|
# configure builder
|
||||||
|
(lib.mkIf thisMachineIsABuilder {
|
||||||
|
users.users.${builderUserName} = {
|
||||||
|
description = "Distributed Nix Build User";
|
||||||
|
group = builderUserName;
|
||||||
|
isSystemUser = true;
|
||||||
|
createHome = true;
|
||||||
|
home = "/var/lib/nix-builder";
|
||||||
|
useDefaultShell = true;
|
||||||
|
openssh.authorizedKeys.keys = builtins.map
|
||||||
|
(builderCfg: builderCfg.hostKey)
|
||||||
|
(builtins.attrValues config.machines.hosts);
|
||||||
|
};
|
||||||
|
users.groups.${builderUserName} = { };
|
||||||
|
|
||||||
|
nix.settings.trusted-users = [
|
||||||
|
builderUserName
|
||||||
|
];
|
||||||
|
})
|
||||||
|
|
||||||
|
# use each builder
|
||||||
|
{
|
||||||
|
nix.distributedBuilds = true;
|
||||||
|
|
||||||
|
nix.buildMachines = builtins.map
|
||||||
|
(builderCfg: {
|
||||||
|
hostName = builtins.elemAt builderCfg.hostNames 0;
|
||||||
|
system = builderCfg.arch;
|
||||||
|
protocol = "ssh-ng";
|
||||||
|
sshUser = builderUserName;
|
||||||
|
sshKey = "/etc/ssh/ssh_host_ed25519_key";
|
||||||
|
maxJobs = 3;
|
||||||
|
speedFactor = 10;
|
||||||
|
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
||||||
|
})
|
||||||
|
(builtins.attrValues otherBuilders);
|
||||||
|
|
||||||
|
# It is very likely that the builder's internet is faster or just as fast
|
||||||
|
nix.extraOptions = ''
|
||||||
|
builders-use-substitutes = true
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -17,38 +17,6 @@ let
|
|||||||
"PREFIX=$(out)"
|
"PREFIX=$(out)"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
nvidia-vaapi-driver = pkgs.stdenv.mkDerivation rec {
|
|
||||||
pname = "nvidia-vaapi-driver";
|
|
||||||
version = "0.0.5";
|
|
||||||
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "elFarto";
|
|
||||||
repo = pname;
|
|
||||||
rev = "v${version}";
|
|
||||||
sha256 = "2bycqKolVoaHK64XYcReteuaON9TjzrFhaG5kty28YY=";
|
|
||||||
};
|
|
||||||
|
|
||||||
patches = [
|
|
||||||
./use-meson-v57.patch
|
|
||||||
];
|
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
|
||||||
meson
|
|
||||||
cmake
|
|
||||||
ninja
|
|
||||||
pkg-config
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = with pkgs; [
|
|
||||||
nv-codec-headers-11-1-5-1
|
|
||||||
libva
|
|
||||||
gst_all_1.gstreamer
|
|
||||||
gst_all_1.gst-plugins-bad
|
|
||||||
libglvnd
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ in
|
|||||||
mumble
|
mumble
|
||||||
tigervnc
|
tigervnc
|
||||||
bluez-tools
|
bluez-tools
|
||||||
vscodium
|
|
||||||
element-desktop
|
element-desktop
|
||||||
mpv
|
mpv
|
||||||
nextcloud-client
|
nextcloud-client
|
||||||
@@ -53,6 +52,8 @@ in
|
|||||||
jellyfin-media-player
|
jellyfin-media-player
|
||||||
joplin-desktop
|
joplin-desktop
|
||||||
config.inputs.deploy-rs.packages.${config.currentSystem}.deploy-rs
|
config.inputs.deploy-rs.packages.${config.currentSystem}.deploy-rs
|
||||||
|
lxqt.pavucontrol-qt
|
||||||
|
barrier
|
||||||
|
|
||||||
# For Nix IDE
|
# For Nix IDE
|
||||||
nixpkgs-fmt
|
nixpkgs-fmt
|
||||||
|
|||||||
@@ -20,5 +20,7 @@ in
|
|||||||
# plasma5Packages.kmail-account-wizard
|
# plasma5Packages.kmail-account-wizard
|
||||||
kate
|
kate
|
||||||
];
|
];
|
||||||
|
|
||||||
|
services.xserver.desktopManager.plasma5.useQtScaling = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ let
|
|||||||
auth_opts = "sec=ntlmv2i,credentials=/run/agenix/smb-secrets";
|
auth_opts = "sec=ntlmv2i,credentials=/run/agenix/smb-secrets";
|
||||||
version_opts = "vers=3.1.1";
|
version_opts = "vers=3.1.1";
|
||||||
|
|
||||||
|
public_user_opts = "gid=${toString config.users.groups.users.gid}";
|
||||||
|
|
||||||
opts = "${systemd_opts},${network_opts},${user_opts},${version_opts},${auth_opts}";
|
opts = "${systemd_opts},${network_opts},${user_opts},${version_opts},${auth_opts}";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@@ -24,7 +26,7 @@ in
|
|||||||
fileSystems."/mnt/public" = {
|
fileSystems."/mnt/public" = {
|
||||||
device = "//s0.koi-bebop.ts.net/public";
|
device = "//s0.koi-bebop.ts.net/public";
|
||||||
fsType = "cifs";
|
fsType = "cifs";
|
||||||
options = [ opts ];
|
options = [ "${opts},${public_user_opts}" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/mnt/private" = {
|
fileSystems."/mnt/private" = {
|
||||||
|
|||||||
@@ -4,8 +4,20 @@ let
|
|||||||
cfg = config.de;
|
cfg = config.de;
|
||||||
|
|
||||||
extensions = with pkgs.vscode-extensions; [
|
extensions = with pkgs.vscode-extensions; [
|
||||||
# bbenoist.Nix # nix syntax support
|
bbenoist.nix # nix syntax support
|
||||||
# arrterian.nix-env-selector # nix dev envs
|
arrterian.nix-env-selector # nix dev envs
|
||||||
|
dart-code.dart-code
|
||||||
|
dart-code.flutter
|
||||||
|
golang.go
|
||||||
|
jnoortheen.nix-ide
|
||||||
|
ms-vscode.cpptools
|
||||||
|
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
|
||||||
|
{
|
||||||
|
name = "platformio-ide";
|
||||||
|
publisher = "platformio";
|
||||||
|
version = "3.1.1";
|
||||||
|
sha256 = "g9yTG3DjVUS2w9eHGAai5LoIfEGus+FPhqDnCi4e90Q=";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
vscodium-with-extensions = pkgs.vscode-with-extensions.override {
|
vscodium-with-extensions = pkgs.vscode-with-extensions.override {
|
||||||
|
|||||||
53
common/server/dashy.nix
Normal file
53
common/server/dashy.nix
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.dashy;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.services.dashy = {
|
||||||
|
enable = mkEnableOption "dashy";
|
||||||
|
imageTag = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "latest";
|
||||||
|
};
|
||||||
|
port = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 56815;
|
||||||
|
};
|
||||||
|
configFile = lib.mkOption {
|
||||||
|
type = lib.types.path;
|
||||||
|
description = "Path to the YAML configuration file";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
virtualisation.oci-containers.containers = {
|
||||||
|
dashy = {
|
||||||
|
image = "lissy93/dashy:${cfg.imageTag}";
|
||||||
|
environment = {
|
||||||
|
TZ = "${config.time.timeZone}";
|
||||||
|
};
|
||||||
|
ports = [
|
||||||
|
"127.0.0.1:${toString cfg.port}:80"
|
||||||
|
];
|
||||||
|
volumes = [
|
||||||
|
"${cfg.configFile}:/app/public/conf.yml"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.enable = true;
|
||||||
|
services.nginx.virtualHosts."s0.koi-bebop.ts.net" = {
|
||||||
|
default = true;
|
||||||
|
addSSL = true;
|
||||||
|
serverAliases = [ "s0" ];
|
||||||
|
sslCertificate = "/secret/ssl/s0.koi-bebop.ts.net.crt";
|
||||||
|
sslCertificateKey = "/secret/ssl/s0.koi-bebop.ts.net.key";
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:${toString cfg.port}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -10,7 +10,6 @@
|
|||||||
./matrix.nix
|
./matrix.nix
|
||||||
./zerobin.nix
|
./zerobin.nix
|
||||||
./gitea.nix
|
./gitea.nix
|
||||||
./gitea-runner.nix
|
|
||||||
./privatebin/privatebin.nix
|
./privatebin/privatebin.nix
|
||||||
./radio.nix
|
./radio.nix
|
||||||
./samba.nix
|
./samba.nix
|
||||||
@@ -19,5 +18,8 @@
|
|||||||
./nextcloud.nix
|
./nextcloud.nix
|
||||||
./iodine.nix
|
./iodine.nix
|
||||||
./searx.nix
|
./searx.nix
|
||||||
|
./gitea-actions-runner.nix
|
||||||
|
./dashy.nix
|
||||||
|
./librechat.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
136
common/server/gitea-actions-runner.nix
Normal file
136
common/server/gitea-actions-runner.nix
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
{ config, pkgs, lib, allModules, ... }:
|
||||||
|
|
||||||
|
# Gitea Actions Runner. Starts 'host' runner that runs directly on the host inside of a nixos container
|
||||||
|
# This is useful for providing a real Nix/OS builder to gitea.
|
||||||
|
# Warning, NixOS containers are not secure. For example, the container shares the /nix/store
|
||||||
|
# Therefore, this should not be used to run untrusted code.
|
||||||
|
# To enable, assign a machine the 'gitea-actions-runner' system role
|
||||||
|
|
||||||
|
# TODO: skipping running inside of nixos container for now because of issues getting docker/podman running
|
||||||
|
|
||||||
|
let
|
||||||
|
runnerRole = "gitea-actions-runner";
|
||||||
|
runners = config.machines.roles.${runnerRole};
|
||||||
|
thisMachineIsARunner = builtins.elem config.networking.hostName runners;
|
||||||
|
|
||||||
|
containerName = "gitea-runner";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkIf (thisMachineIsARunner && !config.boot.isContainer) {
|
||||||
|
# containers.${containerName} = {
|
||||||
|
# ephemeral = true;
|
||||||
|
# autoStart = true;
|
||||||
|
|
||||||
|
# # for podman
|
||||||
|
# enableTun = true;
|
||||||
|
|
||||||
|
# # privateNetwork = true;
|
||||||
|
# # hostAddress = "172.16.101.1";
|
||||||
|
# # localAddress = "172.16.101.2";
|
||||||
|
|
||||||
|
# bindMounts =
|
||||||
|
# {
|
||||||
|
# "/run/agenix/gitea-actions-runner-token" = {
|
||||||
|
# hostPath = "/run/agenix/gitea-actions-runner-token";
|
||||||
|
# isReadOnly = true;
|
||||||
|
# };
|
||||||
|
# "/var/lib/gitea-runner" = {
|
||||||
|
# hostPath = "/var/lib/gitea-runner";
|
||||||
|
# isReadOnly = false;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
|
||||||
|
# extraFlags = [
|
||||||
|
# # Allow podman
|
||||||
|
# ''--system-call-filter=thisystemcalldoesnotexistforsure''
|
||||||
|
# ];
|
||||||
|
|
||||||
|
# additionalCapabilities = [
|
||||||
|
# "CAP_SYS_ADMIN"
|
||||||
|
# ];
|
||||||
|
|
||||||
|
# config = {
|
||||||
|
# imports = allModules;
|
||||||
|
|
||||||
|
# # speeds up evaluation
|
||||||
|
# nixpkgs.pkgs = pkgs;
|
||||||
|
|
||||||
|
# networking.hostName = lib.mkForce containerName;
|
||||||
|
|
||||||
|
# # don't use remote builders
|
||||||
|
# nix.distributedBuilds = lib.mkForce false;
|
||||||
|
|
||||||
|
# environment.systemPackages = with pkgs; [
|
||||||
|
# git
|
||||||
|
# # Gitea Actions rely heavily on node. Include it because it would be installed anyway.
|
||||||
|
# nodejs
|
||||||
|
# ];
|
||||||
|
|
||||||
|
# services.gitea-actions-runner.instances.inst = {
|
||||||
|
# enable = true;
|
||||||
|
# name = config.networking.hostName;
|
||||||
|
# url = "https://git.neet.dev/";
|
||||||
|
# tokenFile = "/run/agenix/gitea-actions-runner-token";
|
||||||
|
# labels = [
|
||||||
|
# "ubuntu-latest:docker://node:18-bullseye"
|
||||||
|
# "nixos:host"
|
||||||
|
# ];
|
||||||
|
# };
|
||||||
|
|
||||||
|
# # To allow building on the host, must override the the service's config so it doesn't use a dynamic user
|
||||||
|
# systemd.services.gitea-runner-inst.serviceConfig.DynamicUser = lib.mkForce false;
|
||||||
|
# users.users.gitea-runner = {
|
||||||
|
# home = "/var/lib/gitea-runner";
|
||||||
|
# group = "gitea-runner";
|
||||||
|
# isSystemUser = true;
|
||||||
|
# createHome = true;
|
||||||
|
# };
|
||||||
|
# users.groups.gitea-runner = { };
|
||||||
|
|
||||||
|
# virtualisation.podman.enable = true;
|
||||||
|
# boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
|
||||||
|
# networking.nat.enable = true;
|
||||||
|
# networking.nat.internalInterfaces = [
|
||||||
|
# "ve-${containerName}"
|
||||||
|
# ];
|
||||||
|
# networking.ip_forward = true;
|
||||||
|
|
||||||
|
# don't use remote builders
|
||||||
|
nix.distributedBuilds = lib.mkForce false;
|
||||||
|
|
||||||
|
services.gitea-actions-runner.instances.inst = {
|
||||||
|
enable = true;
|
||||||
|
name = config.networking.hostName;
|
||||||
|
url = "https://git.neet.dev/";
|
||||||
|
tokenFile = "/run/agenix/gitea-actions-runner-token";
|
||||||
|
labels = [
|
||||||
|
"ubuntu-latest:docker://node:18-bullseye"
|
||||||
|
"nixos:host"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
git
|
||||||
|
# Gitea Actions rely heavily on node. Include it because it would be installed anyway.
|
||||||
|
nodejs
|
||||||
|
];
|
||||||
|
|
||||||
|
# To allow building on the host, must override the the service's config so it doesn't use a dynamic user
|
||||||
|
systemd.services.gitea-runner-inst.serviceConfig.DynamicUser = lib.mkForce false;
|
||||||
|
users.users.gitea-runner = {
|
||||||
|
home = "/var/lib/gitea-runner";
|
||||||
|
group = "gitea-runner";
|
||||||
|
isSystemUser = true;
|
||||||
|
createHome = true;
|
||||||
|
};
|
||||||
|
users.groups.gitea-runner = { };
|
||||||
|
|
||||||
|
virtualisation.podman.enable = true;
|
||||||
|
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||||
|
|
||||||
|
age.secrets.gitea-actions-runner-token.file = ../../secrets/gitea-actions-runner-token.age;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.services.gitea-runner;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.services.gitea-runner = {
|
|
||||||
enable = lib.mkEnableOption "Enables gitea runner";
|
|
||||||
dataDir = lib.mkOption {
|
|
||||||
default = "/var/lib/gitea-runner";
|
|
||||||
type = lib.types.str;
|
|
||||||
description = lib.mdDoc "gitea runner data directory.";
|
|
||||||
};
|
|
||||||
instanceUrl = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
};
|
|
||||||
registrationTokenFile = lib.mkOption {
|
|
||||||
type = lib.types.path;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
virtualisation.docker.enable = true;
|
|
||||||
|
|
||||||
users.users.gitea-runner = {
|
|
||||||
description = "Gitea Runner Service";
|
|
||||||
home = cfg.dataDir;
|
|
||||||
useDefaultShell = true;
|
|
||||||
group = "gitea-runner";
|
|
||||||
isSystemUser = true;
|
|
||||||
createHome = true;
|
|
||||||
extraGroups = [
|
|
||||||
"docker" # allow creating docker containers
|
|
||||||
];
|
|
||||||
};
|
|
||||||
users.groups.gitea-runner = { };
|
|
||||||
|
|
||||||
# registration token
|
|
||||||
services.gitea-runner.registrationTokenFile = "/run/agenix/gitea-runner-registration-token";
|
|
||||||
age.secrets.gitea-runner-registration-token = {
|
|
||||||
file = ../../secrets/gitea-runner-registration-token.age;
|
|
||||||
owner = "gitea-runner";
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.gitea-runner = {
|
|
||||||
description = "Gitea Runner";
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
WorkingDirectory = cfg.dataDir;
|
|
||||||
User = "gitea-runner";
|
|
||||||
Group = "gitea-runner";
|
|
||||||
};
|
|
||||||
|
|
||||||
requires = [ "network-online.target" ];
|
|
||||||
after = [ "network.target" "network-online.target" ];
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
|
|
||||||
path = with pkgs; [ gitea-actions-runner ];
|
|
||||||
|
|
||||||
# based on https://gitea.com/gitea/act_runner/src/branch/main/run.sh
|
|
||||||
script = ''
|
|
||||||
. ${cfg.registrationTokenFile}
|
|
||||||
|
|
||||||
if [[ ! -s .runner ]]; then
|
|
||||||
try=$((try + 1))
|
|
||||||
success=0
|
|
||||||
|
|
||||||
LOGFILE="$(mktemp)"
|
|
||||||
|
|
||||||
# The point of this loop is to make it simple, when running both act_runner and gitea in docker,
|
|
||||||
# for the act_runner to wait a moment for gitea to become available before erroring out. Within
|
|
||||||
# the context of a single docker-compose, something similar could be done via healthchecks, but
|
|
||||||
# this is more flexible.
|
|
||||||
while [[ $success -eq 0 ]] && [[ $try -lt ''${10:-10} ]]; do
|
|
||||||
act_runner register \
|
|
||||||
--instance "${cfg.instanceUrl}" \
|
|
||||||
--token "$GITEA_RUNNER_REGISTRATION_TOKEN" \
|
|
||||||
--name "${config.networking.hostName}" \
|
|
||||||
--no-interactive > $LOGFILE 2>&1
|
|
||||||
|
|
||||||
cat $LOGFILE
|
|
||||||
|
|
||||||
cat $LOGFILE | grep 'Runner registered successfully' > /dev/null
|
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
echo "SUCCESS"
|
|
||||||
success=1
|
|
||||||
else
|
|
||||||
echo "Waiting to retry ..."
|
|
||||||
sleep 5
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec act_runner daemon
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -12,12 +12,14 @@ in
|
|||||||
};
|
};
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.gitea = {
|
services.gitea = {
|
||||||
domain = cfg.hostname;
|
|
||||||
rootUrl = "https://${cfg.hostname}/";
|
|
||||||
appName = cfg.hostname;
|
appName = cfg.hostname;
|
||||||
# lfs.enable = true;
|
lfs.enable = true;
|
||||||
# dump.enable = true;
|
# dump.enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
server = {
|
||||||
|
ROOT_URL = "https://${cfg.hostname}/";
|
||||||
|
DOMAIN = cfg.hostname;
|
||||||
|
};
|
||||||
other = {
|
other = {
|
||||||
SHOW_FOOTER_VERSION = false;
|
SHOW_FOOTER_VERSION = false;
|
||||||
};
|
};
|
||||||
@@ -29,6 +31,9 @@ in
|
|||||||
};
|
};
|
||||||
session = {
|
session = {
|
||||||
COOKIE_SECURE = true;
|
COOKIE_SECURE = true;
|
||||||
|
PROVIDER = "db";
|
||||||
|
SESSION_LIFE_TIME = 259200; # 3 days
|
||||||
|
GC_INTERVAL_TIME = 259200; # 3 days
|
||||||
};
|
};
|
||||||
mailer = {
|
mailer = {
|
||||||
ENABLED = true;
|
ENABLED = true;
|
||||||
@@ -42,6 +47,9 @@ in
|
|||||||
actions = {
|
actions = {
|
||||||
ENABLED = true;
|
ENABLED = true;
|
||||||
};
|
};
|
||||||
|
indexer = {
|
||||||
|
REPO_INDEXER_ENABLED = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
mailerPasswordFile = "/run/agenix/robots-email-pw";
|
mailerPasswordFile = "/run/agenix/robots-email-pw";
|
||||||
};
|
};
|
||||||
@@ -60,7 +68,7 @@ in
|
|||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://localhost:${toString cfg.httpPort}";
|
proxyPass = "http://localhost:${toString cfg.settings.server.HTTP_PORT}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
62
common/server/librechat.nix
Normal file
62
common/server/librechat.nix
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.librechat;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.services.librechat = {
|
||||||
|
enable = mkEnableOption "librechat";
|
||||||
|
port = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 3080;
|
||||||
|
};
|
||||||
|
host = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
example = "example.com";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
virtualisation.oci-containers.containers = {
|
||||||
|
librechat = {
|
||||||
|
image = "ghcr.io/danny-avila/librechat:v0.6.6";
|
||||||
|
environment = {
|
||||||
|
HOST = "0.0.0.0";
|
||||||
|
MONGO_URI = "mongodb://host.containers.internal:27017/LibreChat";
|
||||||
|
ENDPOINTS = "openAI,google,bingAI,gptPlugins";
|
||||||
|
};
|
||||||
|
environmentFiles = [
|
||||||
|
"/run/agenix/librechat-env-file"
|
||||||
|
];
|
||||||
|
ports = [
|
||||||
|
"${toString cfg.port}:3080"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
age.secrets.librechat-env-file.file = ../../secrets/librechat-env-file.age;
|
||||||
|
|
||||||
|
services.mongodb.enable = true;
|
||||||
|
services.mongodb.bind_ip = "0.0.0.0";
|
||||||
|
|
||||||
|
# easier podman maintenance
|
||||||
|
virtualisation.oci-containers.backend = "podman";
|
||||||
|
virtualisation.podman.dockerSocket.enable = true;
|
||||||
|
virtualisation.podman.dockerCompat = true;
|
||||||
|
|
||||||
|
# For mongodb access
|
||||||
|
networking.firewall.trustedInterfaces = [
|
||||||
|
"podman0" # for librechat
|
||||||
|
];
|
||||||
|
|
||||||
|
services.nginx.virtualHosts.${cfg.host} = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:${toString cfg.port}";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -37,6 +37,10 @@ in
|
|||||||
# catchall for all domains
|
# catchall for all domains
|
||||||
aliases = map (domain: "@${domain}") domains;
|
aliases = map (domain: "@${domain}") domains;
|
||||||
};
|
};
|
||||||
|
"cris@runyan.org" = {
|
||||||
|
hashedPasswordFile = "/run/agenix/cris-hashed-email-pw";
|
||||||
|
aliases = [ "chris@runyan.org" ];
|
||||||
|
};
|
||||||
"robot@runyan.org" = {
|
"robot@runyan.org" = {
|
||||||
aliases = [
|
aliases = [
|
||||||
"no-reply@neet.dev"
|
"no-reply@neet.dev"
|
||||||
@@ -52,9 +56,16 @@ in
|
|||||||
"damon@runyan.org"
|
"damon@runyan.org"
|
||||||
"jonas@runyan.org"
|
"jonas@runyan.org"
|
||||||
];
|
];
|
||||||
|
forwards = {
|
||||||
|
"amazon@runyan.org" = [
|
||||||
|
"jeremy@runyan.org"
|
||||||
|
"cris@runyan.org"
|
||||||
|
];
|
||||||
|
};
|
||||||
certificateScheme = 3; # use let's encrypt for certs
|
certificateScheme = 3; # use let's encrypt for certs
|
||||||
};
|
};
|
||||||
age.secrets.hashed-email-pw.file = ../../secrets/hashed-email-pw.age;
|
age.secrets.hashed-email-pw.file = ../../secrets/hashed-email-pw.age;
|
||||||
|
age.secrets.cris-hashed-email-pw.file = ../../secrets/cris-hashed-email-pw.age;
|
||||||
age.secrets.hashed-robots-email-pw.file = ../../secrets/hashed-robots-email-pw.age;
|
age.secrets.hashed-robots-email-pw.file = ../../secrets/hashed-robots-email-pw.age;
|
||||||
|
|
||||||
# sendmail to use xxx@domain instead of xxx@mail.domain
|
# sendmail to use xxx@domain instead of xxx@mail.domain
|
||||||
|
|||||||
@@ -8,13 +8,12 @@ in
|
|||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.nextcloud = {
|
services.nextcloud = {
|
||||||
https = true;
|
https = true;
|
||||||
package = pkgs.nextcloud25;
|
package = pkgs.nextcloud28;
|
||||||
hostName = "neet.cloud";
|
hostName = "neet.cloud";
|
||||||
config.dbtype = "sqlite";
|
config.dbtype = "sqlite";
|
||||||
config.adminuser = "jeremy";
|
config.adminuser = "jeremy";
|
||||||
config.adminpassFile = "/run/agenix/nextcloud-pw";
|
config.adminpassFile = "/run/agenix/nextcloud-pw";
|
||||||
autoUpdateApps.enable = true;
|
autoUpdateApps.enable = true;
|
||||||
enableBrokenCiphersForSSE = false;
|
|
||||||
};
|
};
|
||||||
age.secrets.nextcloud-pw = {
|
age.secrets.nextcloud-pw = {
|
||||||
file = ../../secrets/nextcloud-pw.age;
|
file = ../../secrets/nextcloud-pw.age;
|
||||||
|
|||||||
146
flake.lock
generated
146
flake.lock
generated
@@ -3,45 +3,24 @@
|
|||||||
"agenix": {
|
"agenix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"darwin": "darwin",
|
"darwin": "darwin",
|
||||||
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1682101079,
|
|
||||||
"narHash": "sha256-MdAhtjrLKnk2uiqun1FWABbKpLH090oeqCSiWemtuck=",
|
|
||||||
"owner": "ryantm",
|
|
||||||
"repo": "agenix",
|
|
||||||
"rev": "2994d002dcff5353ca1ac48ec584c7f6589fe447",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "ryantm",
|
|
||||||
"repo": "agenix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"archivebox": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": [
|
|
||||||
"flake-utils"
|
|
||||||
],
|
],
|
||||||
"nixpkgs": [
|
"systems": "systems"
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1648612759,
|
"lastModified": 1703433843,
|
||||||
"narHash": "sha256-SJwlpD2Wz3zFoX2mIYCQfwIOYHaOdeiWGFeDXsLGM84=",
|
"narHash": "sha256-nmtA4KqFboWxxoOAA6Y1okHbZh+HsXaMPFkYHsoDRDw=",
|
||||||
"ref": "refs/heads/master",
|
"owner": "ryantm",
|
||||||
"rev": "39d338b9b24159d8ef3309eecc0d32a2a9f102b5",
|
"repo": "agenix",
|
||||||
"revCount": 2,
|
"rev": "417caa847f9383e111d1397039c9d4337d024bf0",
|
||||||
"type": "git",
|
"type": "github"
|
||||||
"url": "https://git.neet.dev/zuckerberg/archivebox.git"
|
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "git",
|
"owner": "ryantm",
|
||||||
"url": "https://git.neet.dev/zuckerberg/archivebox.git"
|
"repo": "agenix",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"blobs": {
|
"blobs": {
|
||||||
@@ -91,11 +70,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1673295039,
|
"lastModified": 1700795494,
|
||||||
"narHash": "sha256-AsdYgE8/GPwcelGgrntlijMg4t3hLFJFCRF3tL5WVjA=",
|
"narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=",
|
||||||
"owner": "lnl7",
|
"owner": "lnl7",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "87b9d090ad39b25b2400029c64825fc2a8868943",
|
"rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -117,11 +96,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1682063650,
|
"lastModified": 1704875591,
|
||||||
"narHash": "sha256-VaDHh2z6xlnTHaONlNVHP7qEMcK5rZ8Js3sT6mKb2XY=",
|
"narHash": "sha256-eWRLbqRcrILgztU/m/k7CYLzETKNbv0OsT2GjkaNm8A=",
|
||||||
"owner": "serokell",
|
"owner": "serokell",
|
||||||
"repo": "deploy-rs",
|
"repo": "deploy-rs",
|
||||||
"rev": "c2ea4e642dc50fd44b537e9860ec95867af30d39",
|
"rev": "1776009f1f3fb2b5d236b84d9815f2edee463a9b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -130,14 +109,26 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"fix-nvidia-x11-latest": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"narHash": "sha256-fLopADeWElHn3zRLJxyRZf2pjXsPQL4K1NaZ9Dmaj3E=",
|
||||||
|
"type": "file",
|
||||||
|
"url": "https://github.com/NixOS/nixpkgs/pull/286084.diff"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "file",
|
||||||
|
"url": "https://github.com/NixOS/nixpkgs/pull/286084.diff"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1668681692,
|
"lastModified": 1696426674,
|
||||||
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
|
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||||
"owner": "edolstra",
|
"owner": "edolstra",
|
||||||
"repo": "flake-compat",
|
"repo": "flake-compat",
|
||||||
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
|
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -148,14 +139,14 @@
|
|||||||
},
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems"
|
"systems": "systems_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681202837,
|
"lastModified": 1705309234,
|
||||||
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -164,6 +155,27 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"home-manager": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"agenix",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1703113217,
|
||||||
|
"narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nix-index-database": {
|
"nix-index-database": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -171,11 +183,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681591833,
|
"lastModified": 1707016097,
|
||||||
"narHash": "sha256-lW+xOELafAs29yw56FG4MzNOFkh8VHC/X/tRs1wsGn8=",
|
"narHash": "sha256-V4lHr6hFQ3rK650dh64Xffxsf4kse9vUYWsM+ldjkco=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "nix-index-database",
|
"repo": "nix-index-database",
|
||||||
"rev": "68ec961c51f48768f72d2bbdb396ce65a316677e",
|
"rev": "3e3dad2808379c522138e2e8b0eb73500721a237",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -186,16 +198,16 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1682133240,
|
"lastModified": 1706826059,
|
||||||
"narHash": "sha256-s6yRsI/7V+k/+rckp0+/2cs/UXnea3SEfMpy95QiGcc=",
|
"narHash": "sha256-N69Oab+cbt3flLvYv8fYnEHlBsWwdKciNZHUbynVEOA=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "8dafae7c03d6aa8c2ae0a0612fbcb47e994e3fb8",
|
"rev": "25e3d4c0d3591c99929b1ec07883177f6ea70c9d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "master",
|
"ref": "nixos-23.11",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@@ -215,18 +227,6 @@
|
|||||||
"type": "indirect"
|
"type": "indirect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-hostapd-pr": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"narHash": "sha256-1rGQKcB1jeRPc1n021ulyOVkA6L6xmNYKmeqQ94+iRc=",
|
|
||||||
"type": "file",
|
|
||||||
"url": "https://github.com/NixOS/nixpkgs/pull/222536.patch"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "file",
|
|
||||||
"url": "https://github.com/NixOS/nixpkgs/pull/222536.patch"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"radio": {
|
"radio": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": [
|
"flake-utils": [
|
||||||
@@ -271,13 +271,12 @@
|
|||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"agenix": "agenix",
|
"agenix": "agenix",
|
||||||
"archivebox": "archivebox",
|
|
||||||
"dailybuild_modules": "dailybuild_modules",
|
"dailybuild_modules": "dailybuild_modules",
|
||||||
"deploy-rs": "deploy-rs",
|
"deploy-rs": "deploy-rs",
|
||||||
|
"fix-nvidia-x11-latest": "fix-nvidia-x11-latest",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nix-index-database": "nix-index-database",
|
"nix-index-database": "nix-index-database",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-hostapd-pr": "nixpkgs-hostapd-pr",
|
|
||||||
"radio": "radio",
|
"radio": "radio",
|
||||||
"radio-web": "radio-web",
|
"radio-web": "radio-web",
|
||||||
"simple-nixos-mailserver": "simple-nixos-mailserver"
|
"simple-nixos-mailserver": "simple-nixos-mailserver"
|
||||||
@@ -322,6 +321,21 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"systems_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"utils": {
|
"utils": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1605370193,
|
"lastModified": 1605370193,
|
||||||
|
|||||||
28
flake.nix
28
flake.nix
@@ -1,8 +1,6 @@
|
|||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/master";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
|
||||||
# nixpkgs-patch-howdy.url = "https://github.com/NixOS/nixpkgs/pull/216245.diff";
|
|
||||||
# nixpkgs-patch-howdy.flake = false;
|
|
||||||
|
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
@@ -26,11 +24,6 @@
|
|||||||
dailybuild_modules.inputs.nixpkgs.follows = "nixpkgs";
|
dailybuild_modules.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
dailybuild_modules.inputs.flake-utils.follows = "flake-utils";
|
dailybuild_modules.inputs.flake-utils.follows = "flake-utils";
|
||||||
|
|
||||||
# archivebox
|
|
||||||
archivebox.url = "git+https://git.neet.dev/zuckerberg/archivebox.git";
|
|
||||||
archivebox.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
archivebox.inputs.flake-utils.follows = "flake-utils";
|
|
||||||
|
|
||||||
# nixos config deployment
|
# nixos config deployment
|
||||||
deploy-rs.url = "github:serokell/deploy-rs";
|
deploy-rs.url = "github:serokell/deploy-rs";
|
||||||
deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
|
deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -40,8 +33,9 @@
|
|||||||
nix-index-database.url = "github:Mic92/nix-index-database";
|
nix-index-database.url = "github:Mic92/nix-index-database";
|
||||||
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
|
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
nixpkgs-hostapd-pr.url = "https://github.com/NixOS/nixpkgs/pull/222536.patch";
|
# https://github.com/NixOS/nixpkgs/issues/286313
|
||||||
nixpkgs-hostapd-pr.flake = false;
|
fix-nvidia-x11-latest.url = "https://github.com/NixOS/nixpkgs/pull/286084.diff";
|
||||||
|
fix-nvidia-x11-latest.flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, ... }@inputs:
|
outputs = { self, nixpkgs, ... }@inputs:
|
||||||
@@ -60,10 +54,12 @@
|
|||||||
simple-nixos-mailserver.nixosModule
|
simple-nixos-mailserver.nixosModule
|
||||||
agenix.nixosModules.default
|
agenix.nixosModules.default
|
||||||
dailybuild_modules.nixosModule
|
dailybuild_modules.nixosModule
|
||||||
archivebox.nixosModule
|
|
||||||
nix-index-database.nixosModules.nix-index
|
nix-index-database.nixosModules.nix-index
|
||||||
|
self.nixosModules.kernel-modules
|
||||||
({ lib, ... }: {
|
({ lib, ... }: {
|
||||||
config = {
|
config = {
|
||||||
|
nixpkgs.overlays = [ self.overlays.default ];
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
agenix.packages.${system}.agenix
|
agenix.packages.${system}.agenix
|
||||||
];
|
];
|
||||||
@@ -86,8 +82,8 @@
|
|||||||
name = "nixpkgs-patched";
|
name = "nixpkgs-patched";
|
||||||
src = nixpkgs;
|
src = nixpkgs;
|
||||||
patches = [
|
patches = [
|
||||||
inputs.nixpkgs-hostapd-pr
|
./patches/gamepadui.patch
|
||||||
./patches/kexec-luks.patch
|
inputs.fix-nvidia-x11-latest
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
patchedNixpkgs = nixpkgs.lib.fix (self: (import "${patchedNixpkgsSrc}/flake.nix").outputs { self = nixpkgs; });
|
patchedNixpkgs = nixpkgs.lib.fix (self: (import "${patchedNixpkgsSrc}/flake.nix").outputs { self = nixpkgs; });
|
||||||
@@ -99,6 +95,7 @@
|
|||||||
|
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit allModules;
|
inherit allModules;
|
||||||
|
lib = self.lib;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
@@ -127,6 +124,9 @@
|
|||||||
"aarch64-linux"."iso" = mkIso "aarch64-linux";
|
"aarch64-linux"."iso" = mkIso "aarch64-linux";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
overlays.default = import ./overlays;
|
||||||
|
nixosModules.kernel-modules = import ./overlays/kernel-modules;
|
||||||
|
|
||||||
deploy.nodes =
|
deploy.nodes =
|
||||||
let
|
let
|
||||||
mkDeploy = configName: arch: hostname: {
|
mkDeploy = configName: arch: hostname: {
|
||||||
@@ -142,5 +142,7 @@
|
|||||||
machines;
|
machines;
|
||||||
|
|
||||||
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib;
|
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib;
|
||||||
|
|
||||||
|
lib = nixpkgs.lib.extend (final: prev: import ./lib { lib = nixpkgs.lib; });
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
56
lib/default.nix
Normal file
56
lib/default.nix
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
# Passthrough trace for debugging
|
||||||
|
pTrace = v: traceSeq v v;
|
||||||
|
# find the total sum of a int list
|
||||||
|
sum = foldr (x: y: x + y) 0;
|
||||||
|
# splits a list of length two into two params then they're passed to a func
|
||||||
|
splitPair = f: pair: f (head pair) (last pair);
|
||||||
|
# Finds the max value in a list
|
||||||
|
maxList = foldr max 0;
|
||||||
|
# Sorts a int list. Greatest value first
|
||||||
|
sortList = sort (x: y: x > y);
|
||||||
|
# Cuts a list in half and returns the two parts in a list
|
||||||
|
cutInHalf = l: [ (take (length l / 2) l) (drop (length l / 2) l) ];
|
||||||
|
# Splits a list into a list of lists with length cnt
|
||||||
|
chunksOf = cnt: l:
|
||||||
|
if length l > 0 then
|
||||||
|
[ (take cnt l) ] ++ chunksOf cnt (drop cnt l)
|
||||||
|
else [ ];
|
||||||
|
# same as intersectLists but takes an array of lists to intersect instead of just two
|
||||||
|
intersectManyLists = ll: foldr intersectLists (head ll) ll;
|
||||||
|
# converts a boolean to a int (c style)
|
||||||
|
boolToInt = b: if b then 1 else 0;
|
||||||
|
# drops the last element of a list
|
||||||
|
dropLast = l: take (length l - 1) l;
|
||||||
|
# transposes a matrix
|
||||||
|
transpose = ll:
|
||||||
|
let
|
||||||
|
outerSize = length ll;
|
||||||
|
innerSize = length (elemAt ll 0);
|
||||||
|
in
|
||||||
|
genList (i: genList (j: elemAt (elemAt ll j) i) outerSize) innerSize;
|
||||||
|
# attriset recursiveUpdate but for a list of attrisets
|
||||||
|
combineAttrs = foldl recursiveUpdate { };
|
||||||
|
# visits every single attriset element of an attriset recursively
|
||||||
|
# and accumulates the result of every visit in a flat list
|
||||||
|
recurisveVisitAttrs = f: set:
|
||||||
|
let
|
||||||
|
visitor = n: v:
|
||||||
|
if isAttrs v then [ (f n v) ] ++ recurisveVisitAttrs f v
|
||||||
|
else [ (f n v) ];
|
||||||
|
in
|
||||||
|
concatLists (map (name: visitor name set.${name}) (attrNames set));
|
||||||
|
# merges two lists of the same size (similar to map but both lists are inputs per iteration)
|
||||||
|
mergeLists = f: a: imap0 (i: f (elemAt a i));
|
||||||
|
map2D = f: ll:
|
||||||
|
let
|
||||||
|
outerSize = length ll;
|
||||||
|
innerSize = length (elemAt ll 0);
|
||||||
|
getElem = x: y: elemAt (elemAt ll y) x;
|
||||||
|
in
|
||||||
|
genList (y: genList (x: f x y (getElem x y)) innerSize) outerSize;
|
||||||
|
}
|
||||||
57
machines/ephemeral/sdimg.nix
Normal file
57
machines/ephemeral/sdimg.nix
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
{ config, modulesPath, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
pinecube-uboot = pkgs.buildUBoot {
|
||||||
|
defconfig = "pinecube_defconfig";
|
||||||
|
extraMeta.platforms = [ "armv7l-linux" ];
|
||||||
|
filesToInstall = [ "u-boot-sunxi-with-spl.bin" ];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/sd-card/sd-image.nix")
|
||||||
|
./minimal.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
sdImage.populateFirmwareCommands = "";
|
||||||
|
sdImage.populateRootCommands = ''
|
||||||
|
mkdir -p ./files/boot
|
||||||
|
${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d ./files/boot
|
||||||
|
'';
|
||||||
|
sdImage.postBuildCommands = ''
|
||||||
|
dd if=${pinecube-uboot}/u-boot-sunxi-with-spl.bin of=$img bs=1024 seek=8 conv=notrunc
|
||||||
|
'';
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
networking.hostName = "pinecube";
|
||||||
|
|
||||||
|
boot.loader.grub.enable = false;
|
||||||
|
boot.loader.generic-extlinux-compatible.enable = true;
|
||||||
|
boot.consoleLogLevel = 7;
|
||||||
|
|
||||||
|
# cma is 64M by default which is waay too much and we can't even unpack initrd
|
||||||
|
boot.kernelParams = [ "console=ttyS0,115200n8" "cma=32M" ];
|
||||||
|
|
||||||
|
boot.kernelModules = [ "spi-nor" ]; # Not sure why this doesn't autoload. Provides SPI NOR at /dev/mtd0
|
||||||
|
boot.extraModulePackages = [ config.boot.kernelPackages.rtl8189es ];
|
||||||
|
|
||||||
|
zramSwap.enable = true; # 128MB is not much to work with
|
||||||
|
|
||||||
|
sound.enable = true;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
ffmpeg
|
||||||
|
(v4l_utils.override { withGUI = false; })
|
||||||
|
usbutils
|
||||||
|
];
|
||||||
|
|
||||||
|
services.getty.autologinUser = lib.mkForce "googlebot";
|
||||||
|
users.users.googlebot = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [ "wheel" "networkmanager" "video" ];
|
||||||
|
openssh.authorizedKeys.keys = config.machines.ssh.userKeys;
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.wireless.enable = true;
|
||||||
|
}
|
||||||
@@ -5,10 +5,5 @@
|
|||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
services.gitea-runner = {
|
networking.hostName = "phil";
|
||||||
enable = true;
|
|
||||||
instanceUrl = "https://git.neet.dev";
|
|
||||||
};
|
|
||||||
|
|
||||||
system.autoUpgrade.enable = true;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,10 @@
|
|||||||
boot.kernelModules = [ ];
|
boot.kernelModules = [ ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
luks.devices = [ "/dev/disk/by-uuid/d26c1820-4c39-4615-98c2-51442504e194" ];
|
boot.initrd.luks.devices."enc-pv" = {
|
||||||
|
device = "/dev/disk/by-uuid/d26c1820-4c39-4615-98c2-51442504e194";
|
||||||
|
allowDiscards = true;
|
||||||
|
};
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
|
|
||||||
systemRoles = [
|
systemRoles = [
|
||||||
"server"
|
"server"
|
||||||
"gitea-runner"
|
"nix-builder"
|
||||||
|
"gitea-actions-runner"
|
||||||
];
|
];
|
||||||
|
|
||||||
hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBlgRPpuUkZqe8/lHugRPm/m2vcN9psYhh5tENHZt9I2";
|
hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBlgRPpuUkZqe8/lHugRPm/m2vcN9psYhh5tENHZt9I2";
|
||||||
|
|||||||
@@ -5,10 +5,7 @@
|
|||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
system.autoUpgrade.enable = true;
|
# system.autoUpgrade.enable = true;
|
||||||
# I want to manually trigger kexec updates for now on ponyo
|
|
||||||
system.autoUpgrade.allowKexec = false;
|
|
||||||
luks.enableKexec = true;
|
|
||||||
|
|
||||||
# p2p mesh network
|
# p2p mesh network
|
||||||
services.tailscale.exitNode = true;
|
services.tailscale.exitNode = true;
|
||||||
@@ -66,17 +63,32 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
pia.wireguard.badPortForwardPorts = [ ];
|
pia.wireguard.badPortForwardPorts = [ ];
|
||||||
services.nginx.virtualHosts."radio.runyan.org" = {
|
services.nginx.virtualHosts = {
|
||||||
enableACME = true;
|
"radio.runyan.org" = {
|
||||||
forceSSL = true;
|
enableACME = true;
|
||||||
locations = {
|
forceSSL = true;
|
||||||
"/stream.mp3" = {
|
locations = {
|
||||||
proxyPass = "http://vpn.containers:8001/stream.mp3";
|
"/stream.mp3" = {
|
||||||
extraConfig = ''
|
proxyPass = "http://vpn.containers:8001/stream.mp3";
|
||||||
add_header Access-Control-Allow-Origin *;
|
extraConfig = ''
|
||||||
'';
|
add_header Access-Control-Allow-Origin *;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
"/".root = config.inputs.radio-web;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"radio.neet.space" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations = {
|
||||||
|
"/stream.mp3" = {
|
||||||
|
proxyPass = "http://vpn.containers:8001/stream.mp3";
|
||||||
|
extraConfig = ''
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
"/".root = config.inputs.radio-web;
|
||||||
};
|
};
|
||||||
"/".root = config.inputs.radio-web;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -99,7 +111,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
# pin postgresql for matrix (will need to migrate eventually)
|
# pin postgresql for matrix (will need to migrate eventually)
|
||||||
services.postgresql.package = pkgs.postgresql_11;
|
services.postgresql.package = pkgs.postgresql_15;
|
||||||
|
|
||||||
# iodine DNS-based vpn
|
# iodine DNS-based vpn
|
||||||
services.iodine.server.enable = true;
|
services.iodine.server.enable = true;
|
||||||
@@ -139,4 +151,8 @@
|
|||||||
# owncast live streaming
|
# owncast live streaming
|
||||||
services.owncast.enable = true;
|
services.owncast.enable = true;
|
||||||
services.owncast.hostname = "live.neet.dev";
|
services.owncast.hostname = "live.neet.dev";
|
||||||
|
|
||||||
|
# librechat
|
||||||
|
services.librechat.enable = true;
|
||||||
|
services.librechat.host = "chat.neet.dev";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,15 +19,12 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
remoteLuksUnlock.enable = true;
|
remoteLuksUnlock.enable = true;
|
||||||
|
boot.initrd.luks.devices."enc-pv".device = "/dev/disk/by-uuid/4cc36be4-dbff-4afe-927d-69bf4637bae2";
|
||||||
luks.devices = [
|
boot.initrd.luks.devices."enc-pv2".device = "/dev/disk/by-uuid/e52b01b3-81c8-4bb2-ae7e-a3d9c793cb00"; # expanded disk
|
||||||
"/dev/disk/by-uuid/4cc36be4-dbff-4afe-927d-69bf4637bae2"
|
|
||||||
"/dev/disk/by-uuid/e52b01b3-81c8-4bb2-ae7e-a3d9c793cb00"
|
|
||||||
];
|
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{
|
{
|
||||||
device = "/dev/mapper/enc-pv1";
|
device = "/dev/mapper/enc-pv";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
"nextcloud"
|
"nextcloud"
|
||||||
"dailybot"
|
"dailybot"
|
||||||
"gitea"
|
"gitea"
|
||||||
|
"librechat"
|
||||||
];
|
];
|
||||||
|
|
||||||
hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMBBlTAIp38RhErU1wNNV5MBeb+WGH0mhF/dxh5RsAXN";
|
hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMBBlTAIp38RhErU1wNNV5MBeb+WGH0mhF/dxh5RsAXN";
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
services.tor.enable = true;
|
services.tor.enable = true;
|
||||||
services.tor.client.enable = true;
|
services.tor.client.enable = true;
|
||||||
|
|
||||||
|
# don't use remote builders
|
||||||
|
nix.distributedBuilds = lib.mkForce false;
|
||||||
|
|
||||||
# services.howdy.enable = true;
|
# services.howdy.enable = true;
|
||||||
|
|
||||||
hardware.openrazer.enable = true;
|
hardware.openrazer.enable = true;
|
||||||
@@ -27,6 +30,7 @@
|
|||||||
# Wally Flashing rules for the Moonlander and Planck EZ
|
# Wally Flashing rules for the Moonlander and Planck EZ
|
||||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE:="0666", SYMLINK+="stm32_dfu"
|
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE:="0666", SYMLINK+="stm32_dfu"
|
||||||
'';
|
'';
|
||||||
|
services.udev.packages = [ pkgs.platformio ];
|
||||||
users.groups.plugdev = {
|
users.groups.plugdev = {
|
||||||
members = [ "googlebot" ];
|
members = [ "googlebot" ];
|
||||||
};
|
};
|
||||||
@@ -36,14 +40,15 @@
|
|||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
virtualisation.spiceUSBRedirection.enable = true;
|
virtualisation.spiceUSBRedirection.enable = true;
|
||||||
environment.systemPackages = with pkgs; [ virt-manager ];
|
environment.systemPackages = with pkgs; [ virt-manager ];
|
||||||
users.users.googlebot.extraGroups = [ "libvirtd" ];
|
users.users.googlebot.extraGroups = [ "libvirtd" "adbusers" ];
|
||||||
|
|
||||||
# allow building ARM derivations
|
# allow building ARM derivations
|
||||||
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||||
|
|
||||||
services.spotifyd.enable = true;
|
services.spotifyd.enable = true;
|
||||||
|
|
||||||
virtualisation.docker.enable = true;
|
virtualisation.podman.enable = true;
|
||||||
|
virtualisation.podman.dockerCompat = true;
|
||||||
|
|
||||||
virtualisation.appvm.enable = true;
|
virtualisation.appvm.enable = true;
|
||||||
virtualisation.appvm.user = "googlebot";
|
virtualisation.appvm.user = "googlebot";
|
||||||
@@ -52,4 +57,11 @@
|
|||||||
|
|
||||||
de.enable = true;
|
de.enable = true;
|
||||||
de.touchpad.enable = true;
|
de.touchpad.enable = true;
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
# barrier
|
||||||
|
24800
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.adb.enable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,10 @@
|
|||||||
|
|
||||||
# disks
|
# disks
|
||||||
remoteLuksUnlock.enable = true;
|
remoteLuksUnlock.enable = true;
|
||||||
luks.devices = [ "/dev/disk/by-uuid/c1822e5f-4137-44e1-885f-954e926583ce" ];
|
boot.initrd.luks.devices."enc-pv" = {
|
||||||
|
device = "/dev/disk/by-uuid/c1822e5f-4137-44e1-885f-954e926583ce";
|
||||||
|
allowDiscards = true;
|
||||||
|
};
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{
|
{
|
||||||
device = "/dev/vg/root";
|
device = "/dev/vg/root";
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
# disks
|
# disks
|
||||||
remoteLuksUnlock.enable = true;
|
remoteLuksUnlock.enable = true;
|
||||||
luks.devices = [ "/dev/disk/by-uuid/9b090551-f78e-45ca-8570-196ed6a4af0c" ];
|
boot.initrd.luks.devices."enc-pv".device = "/dev/disk/by-uuid/9b090551-f78e-45ca-8570-196ed6a4af0c";
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{
|
{
|
||||||
device = "/dev/disk/by-uuid/421c82b9-d67c-4811-8824-8bb57cb10fce";
|
device = "/dev/disk/by-uuid/421c82b9-d67c-4811-8824-8bb57cb10fce";
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ in
|
|||||||
radios = {
|
radios = {
|
||||||
# 2.4GHz
|
# 2.4GHz
|
||||||
wlp4s0 = {
|
wlp4s0 = {
|
||||||
hwMode = "g";
|
band = "2g";
|
||||||
noScan = true;
|
noScan = true;
|
||||||
channel = 6;
|
channel = 6;
|
||||||
countryCode = "US";
|
countryCode = "US";
|
||||||
@@ -124,15 +124,15 @@ in
|
|||||||
# authentication.saePasswordsFile = "/run/agenix/hostapd-pw-experimental-tower";
|
# authentication.saePasswordsFile = "/run/agenix/hostapd-pw-experimental-tower";
|
||||||
# };
|
# };
|
||||||
};
|
};
|
||||||
extraConfig = ''
|
settings = {
|
||||||
he_oper_centr_freq_seg0_idx=8
|
he_oper_centr_freq_seg0_idx = 8;
|
||||||
vht_oper_centr_freq_seg0_idx=8
|
vht_oper_centr_freq_seg0_idx = 8;
|
||||||
'';
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# 5GHz
|
# 5GHz
|
||||||
wlan1 = {
|
wlan1 = {
|
||||||
hwMode = "a";
|
band = "5g";
|
||||||
noScan = true;
|
noScan = true;
|
||||||
channel = 128;
|
channel = 128;
|
||||||
countryCode = "US";
|
countryCode = "US";
|
||||||
@@ -164,10 +164,10 @@ in
|
|||||||
# authentication.saePasswordsFile = "/run/agenix/hostapd-pw-experimental-tower";
|
# authentication.saePasswordsFile = "/run/agenix/hostapd-pw-experimental-tower";
|
||||||
# };
|
# };
|
||||||
};
|
};
|
||||||
extraConfig = ''
|
settings = {
|
||||||
vht_oper_centr_freq_seg0_idx=114
|
vht_oper_centr_freq_seg0_idx = 114;
|
||||||
he_oper_centr_freq_seg0_idx=114
|
he_oper_centr_freq_seg0_idx = 114;
|
||||||
'';
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
249
machines/storage/s0/dashy.yaml
Normal file
249
machines/storage/s0/dashy.yaml
Normal file
@@ -0,0 +1,249 @@
|
|||||||
|
appConfig:
|
||||||
|
theme: vaporware
|
||||||
|
customColors:
|
||||||
|
material-dark-original:
|
||||||
|
primary: '#f36558'
|
||||||
|
background: '#39434C'
|
||||||
|
background-darker: '#eb615c'
|
||||||
|
material-light: '#f36558'
|
||||||
|
item-text-color: '#ff948a'
|
||||||
|
curve-factor: 5px
|
||||||
|
enableErrorReporting: false
|
||||||
|
layout: auto
|
||||||
|
iconSize: large
|
||||||
|
language: en
|
||||||
|
startingView: default
|
||||||
|
defaultOpeningMethod: sametab
|
||||||
|
statusCheck: true
|
||||||
|
statusCheckInterval: 20
|
||||||
|
faviconApi: faviconkit
|
||||||
|
routingMode: history
|
||||||
|
enableMultiTasking: false
|
||||||
|
webSearch:
|
||||||
|
disableWebSearch: false
|
||||||
|
searchEngine: duckduckgo
|
||||||
|
openingMethod: sametab
|
||||||
|
searchBangs: {}
|
||||||
|
enableFontAwesome: true
|
||||||
|
cssThemes: []
|
||||||
|
externalStyleSheet: []
|
||||||
|
hideComponents:
|
||||||
|
hideHeading: false
|
||||||
|
hideNav: false
|
||||||
|
hideSearch: false
|
||||||
|
hideSettings: false
|
||||||
|
hideFooter: false
|
||||||
|
hideSplashScreen: false
|
||||||
|
auth:
|
||||||
|
enableGuestAccess: false
|
||||||
|
users: []
|
||||||
|
enableKeycloak: false
|
||||||
|
keycloak: {}
|
||||||
|
allowConfigEdit: true
|
||||||
|
enableServiceWorker: false
|
||||||
|
disableContextMenu: false
|
||||||
|
disableUpdateChecks: false
|
||||||
|
disableSmartSort: false
|
||||||
|
pageInfo:
|
||||||
|
title: s0
|
||||||
|
description: s0
|
||||||
|
sections:
|
||||||
|
- name: Media & Entertainment
|
||||||
|
icon: fas fa-photo-video
|
||||||
|
displayData:
|
||||||
|
sortBy: most-used
|
||||||
|
cols: 1
|
||||||
|
rows: 1
|
||||||
|
collapsed: false
|
||||||
|
hideForGuests: false
|
||||||
|
items:
|
||||||
|
- &ref_0
|
||||||
|
title: Jellyfin
|
||||||
|
icon: hl-jellyfin
|
||||||
|
url: http://s0:8097
|
||||||
|
target: sametab
|
||||||
|
statusCheck: true
|
||||||
|
statusCheckUrl: http://jellyfin.s0
|
||||||
|
id: 0_1956_jellyfin
|
||||||
|
- &ref_1
|
||||||
|
title: Sonarr
|
||||||
|
description: Manage TV
|
||||||
|
icon: hl-sonarr
|
||||||
|
url: http://s0:8989
|
||||||
|
target: sametab
|
||||||
|
statusCheck: true
|
||||||
|
statusCheckUrl: http://sonarr.s0
|
||||||
|
id: 1_1956_sonarr
|
||||||
|
- &ref_2
|
||||||
|
title: Radarr
|
||||||
|
description: Manage Movies
|
||||||
|
icon: hl-radarr
|
||||||
|
url: http://s0:7878
|
||||||
|
target: sametab
|
||||||
|
statusCheck: true
|
||||||
|
statusCheckUrl: http://radarr.s0
|
||||||
|
id: 2_1956_radarr
|
||||||
|
- &ref_3
|
||||||
|
title: Lidarr
|
||||||
|
description: Manage Music
|
||||||
|
icon: hl-lidarr
|
||||||
|
url: http://s0:8686
|
||||||
|
target: sametab
|
||||||
|
statusCheck: true
|
||||||
|
statusCheckUrl: http://lidarr.s0
|
||||||
|
id: 3_1956_lidarr
|
||||||
|
- &ref_4
|
||||||
|
title: Prowlarr
|
||||||
|
description: Indexers
|
||||||
|
icon: hl-prowlarr
|
||||||
|
url: http://prowlarr.s0
|
||||||
|
target: sametab
|
||||||
|
statusCheck: true
|
||||||
|
statusCheckUrl: http://prowlarr.s0
|
||||||
|
id: 4_1956_prowlarr
|
||||||
|
- &ref_5
|
||||||
|
title: Bazarr
|
||||||
|
description: Subtitles
|
||||||
|
icon: hl-bazarr
|
||||||
|
url: http://s0:6767
|
||||||
|
target: sametab
|
||||||
|
statusCheck: true
|
||||||
|
statusCheckUrl: http://bazarr.s0
|
||||||
|
id: 5_1956_bazarr
|
||||||
|
- &ref_6
|
||||||
|
title: Navidrome
|
||||||
|
description: Play Music
|
||||||
|
icon: hl-navidrome
|
||||||
|
url: http://s0:4534
|
||||||
|
target: sametab
|
||||||
|
statusCheck: true
|
||||||
|
statusCheckUrl: http://music.s0
|
||||||
|
id: 6_1956_navidrome
|
||||||
|
- &ref_7
|
||||||
|
title: Transmission
|
||||||
|
description: Torrenting
|
||||||
|
icon: hl-transmission
|
||||||
|
url: http://s0:9091
|
||||||
|
target: sametab
|
||||||
|
statusCheck: true
|
||||||
|
statusCheckUrl: http://transmission.s0
|
||||||
|
id: 7_1956_transmission
|
||||||
|
filteredItems:
|
||||||
|
- *ref_0
|
||||||
|
- *ref_1
|
||||||
|
- *ref_2
|
||||||
|
- *ref_3
|
||||||
|
- *ref_4
|
||||||
|
- *ref_5
|
||||||
|
- *ref_6
|
||||||
|
- *ref_7
|
||||||
|
- name: Network
|
||||||
|
icon: fas fa-network-wired
|
||||||
|
items:
|
||||||
|
- &ref_8
|
||||||
|
title: Gateway
|
||||||
|
description: openwrt
|
||||||
|
icon: hl-openwrt
|
||||||
|
url: http://openwrt.lan/
|
||||||
|
target: sametab
|
||||||
|
statusCheck: true
|
||||||
|
id: 0_746_gateway
|
||||||
|
- &ref_9
|
||||||
|
title: Wireless
|
||||||
|
description: openwrt (ish)
|
||||||
|
icon: hl-openwrt
|
||||||
|
url: http://PacketProvocateur.lan
|
||||||
|
target: sametab
|
||||||
|
statusCheck: true
|
||||||
|
id: 1_746_wireless
|
||||||
|
filteredItems:
|
||||||
|
- *ref_8
|
||||||
|
- *ref_9
|
||||||
|
displayData:
|
||||||
|
sortBy: default
|
||||||
|
rows: 1
|
||||||
|
cols: 1
|
||||||
|
collapsed: false
|
||||||
|
hideForGuests: false
|
||||||
|
- name: Services
|
||||||
|
icon: fas fa-monitor-heart-rate
|
||||||
|
items:
|
||||||
|
- &ref_10
|
||||||
|
title: Matrix
|
||||||
|
description: ''
|
||||||
|
icon: hl-matrix
|
||||||
|
url: https://chat.neet.space
|
||||||
|
target: sametab
|
||||||
|
statusCheck: true
|
||||||
|
id: 0_836_matrix
|
||||||
|
- &ref_11
|
||||||
|
title: Radio
|
||||||
|
description: Radio service
|
||||||
|
icon: generative
|
||||||
|
url: https://radio.runyan.org
|
||||||
|
target: sametab
|
||||||
|
statusCheck: true
|
||||||
|
id: 1_836_radio
|
||||||
|
- &ref_12
|
||||||
|
title: Mumble
|
||||||
|
description: voice.neet.space
|
||||||
|
icon: hl-mumble
|
||||||
|
url: https://voice.neet.space
|
||||||
|
target: sametab
|
||||||
|
statusCheck: false
|
||||||
|
id: 2_836_mumble
|
||||||
|
- &ref_13
|
||||||
|
title: IRC
|
||||||
|
description: irc.neet.dev
|
||||||
|
icon: hl-thelounge
|
||||||
|
url: https://irc.neet.dev
|
||||||
|
target: sametab
|
||||||
|
statusCheck: true
|
||||||
|
id: 3_836_irc
|
||||||
|
- &ref_14
|
||||||
|
title: Git
|
||||||
|
description: git.neet.dev
|
||||||
|
icon: hl-gitea
|
||||||
|
url: https://git.neet.dev
|
||||||
|
target: sametab
|
||||||
|
statusCheck: true
|
||||||
|
id: 4_836_git
|
||||||
|
- &ref_15
|
||||||
|
title: Nextcloud
|
||||||
|
description: neet.cloud
|
||||||
|
icon: hl-nextcloud
|
||||||
|
url: https://neet.cloud
|
||||||
|
target: sametab
|
||||||
|
statusCheck: true
|
||||||
|
id: 5_836_nextcloud
|
||||||
|
- &ref_16
|
||||||
|
title: Roundcube
|
||||||
|
description: mail.neet.dev
|
||||||
|
icon: hl-roundcube
|
||||||
|
url: https://mail.neet.dev
|
||||||
|
target: sametab
|
||||||
|
statusCheck: true
|
||||||
|
id: 6_836_roundcube
|
||||||
|
- &ref_17
|
||||||
|
title: Jitsi Meet
|
||||||
|
description: meet.neet.space
|
||||||
|
icon: hl-jitsimeet
|
||||||
|
url: https://meet.neet.space
|
||||||
|
target: sametab
|
||||||
|
statusCheck: true
|
||||||
|
id: 7_836_jitsimeet
|
||||||
|
filteredItems:
|
||||||
|
- *ref_10
|
||||||
|
- *ref_11
|
||||||
|
- *ref_12
|
||||||
|
- *ref_13
|
||||||
|
- *ref_14
|
||||||
|
- *ref_15
|
||||||
|
- *ref_16
|
||||||
|
- *ref_17
|
||||||
|
displayData:
|
||||||
|
sortBy: default
|
||||||
|
rows: 1
|
||||||
|
cols: 1
|
||||||
|
collapsed: false
|
||||||
|
hideForGuests: false
|
||||||
@@ -3,9 +3,29 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
./home-automation.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
system.autoUpgrade.enable = true;
|
networking.hostName = "s0";
|
||||||
|
|
||||||
|
# system.autoUpgrade.enable = true;
|
||||||
|
|
||||||
|
nix.gc.automatic = lib.mkForce false; # allow the nix store to serve as a build cache
|
||||||
|
|
||||||
|
# binary cache
|
||||||
|
services.nix-serve = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
secretKeyFile = "/run/agenix/binary-cache-private-key";
|
||||||
|
};
|
||||||
|
age.secrets.binary-cache-private-key.file = ../../../secrets/binary-cache-private-key.age;
|
||||||
|
users.users.cache-push = {
|
||||||
|
isNormalUser = true;
|
||||||
|
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINpUZFFL9BpBVqeeU63sFPhR9ewuhEZerTCDIGW1NPSB" ];
|
||||||
|
};
|
||||||
|
nix.settings = {
|
||||||
|
trusted-users = [ "cache-push" ];
|
||||||
|
};
|
||||||
|
|
||||||
services.iperf3.enable = true;
|
services.iperf3.enable = true;
|
||||||
services.iperf3.openFirewall = true;
|
services.iperf3.openFirewall = true;
|
||||||
@@ -20,9 +40,6 @@
|
|||||||
# samba
|
# samba
|
||||||
services.samba.enable = true;
|
services.samba.enable = true;
|
||||||
|
|
||||||
# disable suspend on lid close
|
|
||||||
services.logind.lidSwitch = "ignore";
|
|
||||||
|
|
||||||
# navidrome
|
# navidrome
|
||||||
services.navidrome = {
|
services.navidrome = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -32,7 +49,6 @@
|
|||||||
MusicFolder = "/data/samba/Public/Media/Music";
|
MusicFolder = "/data/samba/Public/Media/Music";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networking.firewall.allowedTCPPorts = [ config.services.navidrome.settings.Port ];
|
|
||||||
|
|
||||||
# allow access to transmisson data
|
# allow access to transmisson data
|
||||||
users.users.googlebot.extraGroups = [ "transmission" ];
|
users.users.googlebot.extraGroups = [ "transmission" ];
|
||||||
@@ -100,13 +116,19 @@
|
|||||||
# "speed-limit-up-enabled" = true;
|
# "speed-limit-up-enabled" = true;
|
||||||
|
|
||||||
/* seeding limit */
|
/* seeding limit */
|
||||||
"ratio-limit" = 2;
|
"ratio-limit" = 3;
|
||||||
"ratio-limit-enabled" = true;
|
"ratio-limit-enabled" = true;
|
||||||
|
|
||||||
"download-queue-enabled" = true;
|
"download-queue-enabled" = true;
|
||||||
"download-queue-size" = 20; # gotta go fast
|
"download-queue-size" = 20; # gotta go fast
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
# https://github.com/NixOS/nixpkgs/issues/258793
|
||||||
|
systemd.services.transmission.serviceConfig = {
|
||||||
|
RootDirectoryStartOnly = lib.mkForce (lib.mkForce false);
|
||||||
|
RootDirectory = lib.mkForce (lib.mkForce "");
|
||||||
|
};
|
||||||
|
|
||||||
users.groups.public_data.gid = 994;
|
users.groups.public_data.gid = 994;
|
||||||
users.users.public_data = {
|
users.users.public_data = {
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
@@ -144,22 +166,66 @@
|
|||||||
|
|
||||||
# nginx
|
# nginx
|
||||||
services.nginx.enable = true;
|
services.nginx.enable = true;
|
||||||
services.nginx.virtualHosts."bazarr.s0".locations."/".proxyPass = "http://vpn.containers:6767";
|
services.nginx.virtualHosts."bazarr.s0" = {
|
||||||
services.nginx.virtualHosts."radarr.s0".locations."/".proxyPass = "http://vpn.containers:7878";
|
listen = [{ addr = "0.0.0.0"; port = 6767; } { addr = "0.0.0.0"; port = 80; }];
|
||||||
services.nginx.virtualHosts."lidarr.s0".locations."/".proxyPass = "http://vpn.containers:8686";
|
locations."/".proxyPass = "http://vpn.containers:6767";
|
||||||
services.nginx.virtualHosts."sonarr.s0".locations."/".proxyPass = "http://vpn.containers:8989";
|
};
|
||||||
services.nginx.virtualHosts."prowlarr.s0".locations."/".proxyPass = "http://vpn.containers:9696";
|
services.nginx.virtualHosts."radarr.s0" = {
|
||||||
services.nginx.virtualHosts."music.s0".locations."/".proxyPass = "http://localhost:4533";
|
listen = [{ addr = "0.0.0.0"; port = 7878; } { addr = "0.0.0.0"; port = 80; }];
|
||||||
services.nginx.virtualHosts."jellyfin.s0".locations."/" = {
|
locations."/".proxyPass = "http://vpn.containers:7878";
|
||||||
proxyPass = "http://localhost:8096";
|
};
|
||||||
proxyWebsockets = true;
|
services.nginx.virtualHosts."lidarr.s0" = {
|
||||||
|
listen = [{ addr = "0.0.0.0"; port = 8686; } { addr = "0.0.0.0"; port = 80; }];
|
||||||
|
locations."/".proxyPass = "http://vpn.containers:8686";
|
||||||
|
};
|
||||||
|
services.nginx.virtualHosts."sonarr.s0" = {
|
||||||
|
listen = [{ addr = "0.0.0.0"; port = 8989; } { addr = "0.0.0.0"; port = 80; }];
|
||||||
|
locations."/".proxyPass = "http://vpn.containers:8989";
|
||||||
|
};
|
||||||
|
services.nginx.virtualHosts."prowlarr.s0" = {
|
||||||
|
listen = [{ addr = "0.0.0.0"; port = 9696; } { addr = "0.0.0.0"; port = 80; }];
|
||||||
|
locations."/".proxyPass = "http://vpn.containers:9696";
|
||||||
|
};
|
||||||
|
services.nginx.virtualHosts."music.s0" = {
|
||||||
|
listen = [{ addr = "0.0.0.0"; port = 4534; } { addr = "0.0.0.0"; port = 80; }];
|
||||||
|
locations."/".proxyPass = "http://localhost:4533";
|
||||||
|
};
|
||||||
|
services.nginx.virtualHosts."jellyfin.s0" = {
|
||||||
|
listen = [{ addr = "0.0.0.0"; port = 8097; } { addr = "0.0.0.0"; port = 80; }];
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:8096";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
services.nginx.virtualHosts."jellyfin.neet.cloud".locations."/" = {
|
services.nginx.virtualHosts."jellyfin.neet.cloud".locations."/" = {
|
||||||
proxyPass = "http://localhost:8096";
|
proxyPass = "http://localhost:8096";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
services.nginx.virtualHosts."transmission.s0".locations."/" = {
|
services.nginx.virtualHosts."transmission.s0" = {
|
||||||
proxyPass = "http://vpn.containers:9091";
|
listen = [{ addr = "0.0.0.0"; port = 9091; } { addr = "0.0.0.0"; port = 80; }];
|
||||||
proxyWebsockets = true;
|
locations."/" = {
|
||||||
|
proxyPass = "http://vpn.containers:9091";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
6767
|
||||||
|
7878
|
||||||
|
8686
|
||||||
|
8989
|
||||||
|
9696
|
||||||
|
4534
|
||||||
|
8097
|
||||||
|
9091
|
||||||
|
];
|
||||||
|
|
||||||
|
virtualisation.oci-containers.backend = "podman";
|
||||||
|
virtualisation.podman.dockerSocket.enable = true; # TODO needed?
|
||||||
|
services.dashy = {
|
||||||
|
enable = true;
|
||||||
|
configFile = ./dashy.yaml;
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.binfmt.emulatedSystems = [ "aarch64-linux" "armv7l-linux" ];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,26 +25,20 @@
|
|||||||
|
|
||||||
# luks
|
# luks
|
||||||
remoteLuksUnlock.enable = true;
|
remoteLuksUnlock.enable = true;
|
||||||
luks.devices = [
|
boot.initrd.luks.devices."enc-pv1".device = "/dev/disk/by-uuid/d52e99a9-8825-4d0a-afc1-8edbef7e0a86";
|
||||||
"/dev/disk/by-uuid/d52e99a9-8825-4d0a-afc1-8edbef7e0a86"
|
boot.initrd.luks.devices."enc-pv2".device = "/dev/disk/by-uuid/f7275585-7760-4230-97de-36704b9a2aa3";
|
||||||
"/dev/disk/by-uuid/f7275585-7760-4230-97de-36704b9a2aa3"
|
boot.initrd.luks.devices."enc-pv3".device = "/dev/disk/by-uuid/5d1002b8-a0ed-4a1c-99f5-24b8816d9e38";
|
||||||
"/dev/disk/by-uuid/5d1002b8-a0ed-4a1c-99f5-24b8816d9e38"
|
boot.initrd.luks.devices."enc-pv4".device = "/dev/disk/by-uuid/e2c7402a-e72c-4c4a-998f-82e4c10187bc";
|
||||||
"/dev/disk/by-uuid/e2c7402a-e72c-4c4a-998f-82e4c10187bc"
|
|
||||||
];
|
|
||||||
|
|
||||||
# mounts
|
# mounts
|
||||||
|
services.zfs.autoScrub.enable = true;
|
||||||
|
services.zfs.trim.enable = true;
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{
|
{
|
||||||
device = "rpool/nixos/root";
|
device = "rpool/nixos/root";
|
||||||
fsType = "zfs";
|
fsType = "zfs";
|
||||||
options = [ "zfsutil" "X-mount.mkdir" ];
|
options = [ "zfsutil" "X-mount.mkdir" ];
|
||||||
};
|
};
|
||||||
fileSystems."/home" =
|
|
||||||
{
|
|
||||||
device = "rpool/nixos/home";
|
|
||||||
fsType = "zfs";
|
|
||||||
options = [ "zfsutil" "X-mount.mkdir" ];
|
|
||||||
};
|
|
||||||
fileSystems."/var/lib" =
|
fileSystems."/var/lib" =
|
||||||
{
|
{
|
||||||
device = "rpool/nixos/var/lib";
|
device = "rpool/nixos/var/lib";
|
||||||
@@ -57,13 +51,6 @@
|
|||||||
fsType = "zfs";
|
fsType = "zfs";
|
||||||
options = [ "zfsutil" "X-mount.mkdir" ];
|
options = [ "zfsutil" "X-mount.mkdir" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/data" =
|
|
||||||
{
|
|
||||||
device = "rpool/nixos/data";
|
|
||||||
fsType = "zfs";
|
|
||||||
options = [ "zfsutil" "X-mount.mkdir" ];
|
|
||||||
};
|
|
||||||
fileSystems."/boot" =
|
fileSystems."/boot" =
|
||||||
{
|
{
|
||||||
device = "/dev/disk/by-uuid/4FB4-738E";
|
device = "/dev/disk/by-uuid/4FB4-738E";
|
||||||
@@ -72,6 +59,7 @@
|
|||||||
swapDevices = [ ];
|
swapDevices = [ ];
|
||||||
|
|
||||||
networking.interfaces.eth0.useDHCP = true;
|
networking.interfaces.eth0.useDHCP = true;
|
||||||
|
networking.interfaces.eth1.useDHCP = true;
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = "powersave";
|
powerManagement.cpuFreqGovernor = "powersave";
|
||||||
}
|
}
|
||||||
|
|||||||
185
machines/storage/s0/home-automation.nix
Normal file
185
machines/storage/s0/home-automation.nix
Normal file
@@ -0,0 +1,185 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
frigateHostname = "frigate.s0";
|
||||||
|
frigatePort = 61617;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
# 1883 # mqtt
|
||||||
|
55834 # mqtt zigbee frontend
|
||||||
|
frigatePort
|
||||||
|
4180 # oauth proxy
|
||||||
|
];
|
||||||
|
|
||||||
|
services.frigate = {
|
||||||
|
enable = true;
|
||||||
|
hostname = frigateHostname;
|
||||||
|
settings = {
|
||||||
|
mqtt = {
|
||||||
|
enabled = true;
|
||||||
|
host = "localhost:1883";
|
||||||
|
};
|
||||||
|
cameras = {
|
||||||
|
dahlia-cam = {
|
||||||
|
ffmpeg = {
|
||||||
|
input_args = "";
|
||||||
|
inputs = [{
|
||||||
|
path = "http://dahlia-cam.lan:8080";
|
||||||
|
roles = [ "detect" "record" ];
|
||||||
|
}];
|
||||||
|
|
||||||
|
output_args.record = "-f segment -pix_fmt yuv420p -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v libx264 -preset ultrafast -an ";
|
||||||
|
};
|
||||||
|
rtmp.enabled = false;
|
||||||
|
snapshots = {
|
||||||
|
enabled = true;
|
||||||
|
bounding_box = true;
|
||||||
|
};
|
||||||
|
record = {
|
||||||
|
enabled = false;
|
||||||
|
retain.days = 0; # To not retain any recording if there is no detection of any events
|
||||||
|
events.retain = {
|
||||||
|
default = 3; # To retain recording for 3 days of only the events that happened
|
||||||
|
mode = "active_objects";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
detect = {
|
||||||
|
enabled = true;
|
||||||
|
width = 800;
|
||||||
|
height = 600;
|
||||||
|
fps = 20;
|
||||||
|
};
|
||||||
|
objects = {
|
||||||
|
track = [ "dog" ];
|
||||||
|
filters.dog.threshold = 0.4;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# ffmpeg = {
|
||||||
|
# hwaccel_args = "preset-vaapi";
|
||||||
|
# };
|
||||||
|
detectors.coral = {
|
||||||
|
type = "edgetpu";
|
||||||
|
device = "pci";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# AMD GPU for vaapi
|
||||||
|
systemd.services.frigate.environment.LIBVA_DRIVER_NAME = "radeonsi";
|
||||||
|
|
||||||
|
# Coral TPU for frigate
|
||||||
|
services.udev.packages = [ pkgs.libedgetpu ];
|
||||||
|
users.groups.apex = { };
|
||||||
|
systemd.services.frigate.environment.LD_LIBRARY_PATH = "${pkgs.libedgetpu}/lib";
|
||||||
|
systemd.services.frigate.serviceConfig = {
|
||||||
|
SupplementaryGroups = "apex";
|
||||||
|
};
|
||||||
|
# Coral PCIe driver
|
||||||
|
kernel.enableGasketKernelModule = true;
|
||||||
|
|
||||||
|
# Allow accessing frigate UI on a specific port in addition to by hostname
|
||||||
|
services.nginx.virtualHosts.${frigateHostname} = {
|
||||||
|
listen = [{ addr = "0.0.0.0"; port = frigatePort; } { addr = "0.0.0.0"; port = 80; }];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.esphome = {
|
||||||
|
enable = true;
|
||||||
|
address = "0.0.0.0";
|
||||||
|
openFirewall = true;
|
||||||
|
};
|
||||||
|
# TODO remove after upgrading nixos version
|
||||||
|
systemd.services.esphome.serviceConfig.ProcSubset = lib.mkForce "all";
|
||||||
|
systemd.services.esphome.serviceConfig.ProtectHostname = lib.mkForce false;
|
||||||
|
systemd.services.esphome.serviceConfig.ProtectKernelLogs = lib.mkForce false;
|
||||||
|
systemd.services.esphome.serviceConfig.ProtectKernelTunables = lib.mkForce false;
|
||||||
|
|
||||||
|
# TODO lock down
|
||||||
|
services.mosquitto = {
|
||||||
|
enable = true;
|
||||||
|
listeners = [
|
||||||
|
{
|
||||||
|
acl = [ "pattern readwrite #" ];
|
||||||
|
omitPasswordAuth = true;
|
||||||
|
settings.allow_anonymous = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.zigbee2mqtt = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
homeassistant = true;
|
||||||
|
permit_join = false;
|
||||||
|
serial = {
|
||||||
|
port = "/dev/ttyACM0";
|
||||||
|
};
|
||||||
|
mqtt = {
|
||||||
|
server = "mqtt://localhost:1883";
|
||||||
|
# base_topic = "zigbee2mqtt";
|
||||||
|
};
|
||||||
|
frontend = {
|
||||||
|
host = "0.0.0.0";
|
||||||
|
port = 55834;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.home-assistant = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
configWritable = true;
|
||||||
|
extraComponents = [
|
||||||
|
"esphome"
|
||||||
|
"met"
|
||||||
|
"radio_browser"
|
||||||
|
"wled"
|
||||||
|
"mqtt"
|
||||||
|
];
|
||||||
|
# config = null;
|
||||||
|
config = {
|
||||||
|
# Includes dependencies for a basic setup
|
||||||
|
# https://www.home-assistant.io/integrations/default_config/
|
||||||
|
default_config = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.oauth2_proxy =
|
||||||
|
let
|
||||||
|
nextcloudServer = "https://neet.cloud/";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
httpAddress = "http://0.0.0.0:4180";
|
||||||
|
|
||||||
|
nginx.virtualHosts = [
|
||||||
|
frigateHostname
|
||||||
|
];
|
||||||
|
|
||||||
|
email.domains = [ "*" ];
|
||||||
|
|
||||||
|
cookie.secure = false;
|
||||||
|
|
||||||
|
provider = "nextcloud";
|
||||||
|
|
||||||
|
# redirectURL = "http://s0:4180/oauth2/callback"; # todo forward with nginx?
|
||||||
|
clientID = "4FfhEB2DNzUh6wWhXTjqQQKu3Ibm6TeYpS8TqcHe55PJC1DorE7vBZBELMKDjJ0X";
|
||||||
|
keyFile = "/run/agenix/oauth2-proxy-env";
|
||||||
|
|
||||||
|
loginURL = "${nextcloudServer}/index.php/apps/oauth2/authorize";
|
||||||
|
redeemURL = "${nextcloudServer}/index.php/apps/oauth2/api/v1/token";
|
||||||
|
validateURL = "${nextcloudServer}/ocs/v2.php/cloud/user?format=json";
|
||||||
|
|
||||||
|
# todo --cookie-refresh
|
||||||
|
|
||||||
|
extraConfig = {
|
||||||
|
# cookie-csrf-per-request = true;
|
||||||
|
# cookie-csrf-expire = "5m";
|
||||||
|
# user-id-claim = "preferred_username";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
age.secrets.oauth2-proxy-env.file = ../../../secrets/oauth2-proxy-env.age;
|
||||||
|
}
|
||||||
@@ -9,6 +9,8 @@
|
|||||||
"storage"
|
"storage"
|
||||||
"server"
|
"server"
|
||||||
"pia"
|
"pia"
|
||||||
|
"binary-cache"
|
||||||
|
"gitea-actions-runner"
|
||||||
];
|
];
|
||||||
|
|
||||||
hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAwiXcUFtAvZCayhu4+AIcF+Ktrdgv9ee/mXSIhJbp4q";
|
hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAwiXcUFtAvZCayhu4+AIcF+Ktrdgv9ee/mXSIhJbp4q";
|
||||||
|
|||||||
99
machines/zoidberg/default.nix
Normal file
99
machines/zoidberg/default.nix
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
de.enable = true;
|
||||||
|
|
||||||
|
# Login DE Option: Steam
|
||||||
|
programs.steam.gamescopeSession.enable = true;
|
||||||
|
# programs.gamescope.capSysNice = true;
|
||||||
|
|
||||||
|
# Login DE Option: Kodi
|
||||||
|
services.xserver.desktopManager.kodi.enable = true;
|
||||||
|
services.xserver.desktopManager.kodi.package =
|
||||||
|
(
|
||||||
|
pkgs.kodi.passthru.withPackages (kodiPackages: with kodiPackages; [
|
||||||
|
jellyfin
|
||||||
|
joystick
|
||||||
|
])
|
||||||
|
);
|
||||||
|
services.mount-samba.enable = true;
|
||||||
|
|
||||||
|
# Login DE Option: RetroArch
|
||||||
|
services.xserver.desktopManager.retroarch.enable = true;
|
||||||
|
services.xserver.desktopManager.retroarch.package = pkgs.retroarchFull;
|
||||||
|
|
||||||
|
# wireless xbox controller support
|
||||||
|
hardware.xone.enable = true;
|
||||||
|
boot.kernelModules = [ "xone-wired" "xone-dongle" ];
|
||||||
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
hardware.enableAllFirmware = true;
|
||||||
|
|
||||||
|
# ROCm
|
||||||
|
hardware.opengl.extraPackages = with pkgs; [
|
||||||
|
rocm-opencl-icd
|
||||||
|
rocm-opencl-runtime
|
||||||
|
];
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
|
||||||
|
];
|
||||||
|
|
||||||
|
# System wide barrier instance
|
||||||
|
systemd.services.barrier-sddm = {
|
||||||
|
description = "Barrier mouse/keyboard share";
|
||||||
|
requires = [ "display-manager.service" ];
|
||||||
|
after = [ "network.target" "display-manager.service" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = 10;
|
||||||
|
# todo use user/group
|
||||||
|
};
|
||||||
|
path = with pkgs; [ barrier doas ];
|
||||||
|
script = ''
|
||||||
|
# Wait for file to show up. "display-manager.service" finishes a bit too soon
|
||||||
|
while ! [ -e /run/sddm/* ]; do sleep 1; done;
|
||||||
|
export XAUTHORITY=$(ls /run/sddm/*)
|
||||||
|
# Disable crypto is fine because tailscale is E2E encrypting better than barrier could anyway
|
||||||
|
barrierc -f --disable-crypto --name zoidberg ray.koi-bebop.ts.net
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# Login into X11 plasma so barrier works well
|
||||||
|
services.xserver.displayManager.defaultSession = "plasma";
|
||||||
|
|
||||||
|
users.users.cris = {
|
||||||
|
isNormalUser = true;
|
||||||
|
hashedPassword = "$y$j9T$LMGwHVauFWAcAyWSSmcuS/$BQpDyjDHZZbvj54.ijvNb03tr7IgX9wcjYCuCxjSqf6";
|
||||||
|
uid = 1001;
|
||||||
|
packages = with pkgs; [
|
||||||
|
maestral
|
||||||
|
maestral-gui
|
||||||
|
] ++ config.users.users.googlebot.packages;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Dr. John A. Zoidberg
|
||||||
|
users.users.john = {
|
||||||
|
isNormalUser = true;
|
||||||
|
inherit (config.users.users.googlebot) hashedPassword packages;
|
||||||
|
uid = 1002;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Auto login into Plasma in john zoidberg account
|
||||||
|
services.xserver.displayManager.sddm.settings = {
|
||||||
|
Autologin = {
|
||||||
|
Session = "plasma";
|
||||||
|
User = "john";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
jellyfin-media-player
|
||||||
|
config.services.xserver.desktopManager.kodi.package
|
||||||
|
spotify
|
||||||
|
retroarchFull
|
||||||
|
];
|
||||||
|
}
|
||||||
46
machines/zoidberg/hardware-configuration.nix
Normal file
46
machines/zoidberg/hardware-configuration.nix
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
# boot
|
||||||
|
efi.enable = true;
|
||||||
|
boot.loader.timeout = lib.mkForce 15;
|
||||||
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||||
|
|
||||||
|
# kernel
|
||||||
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
|
# disks
|
||||||
|
remoteLuksUnlock.enable = true;
|
||||||
|
boot.initrd.luks.devices."enc-pv" = {
|
||||||
|
device = "/dev/disk/by-uuid/04231c41-2f13-49c0-8fce-0357eea67990";
|
||||||
|
allowDiscards = true;
|
||||||
|
|
||||||
|
# Fetch key from USB drive
|
||||||
|
keyFileSize = 4096;
|
||||||
|
keyFile = "/dev/disk/by-id/usb-Mass_Storage_Device_121220160204-0:0-part2";
|
||||||
|
fallbackToPassword = true;
|
||||||
|
};
|
||||||
|
fileSystems."/" =
|
||||||
|
{
|
||||||
|
device = "/dev/disk/by-uuid/39ee326c-a42f-49f3-84d9-f10091a903cd";
|
||||||
|
fsType = "btrfs";
|
||||||
|
};
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{
|
||||||
|
device = "/dev/disk/by-uuid/8074-B04D";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
swapDevices =
|
||||||
|
[{ device = "/dev/disk/by-uuid/44e36954-9f1c-49ae-af07-72b240f93a95"; }];
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
14
machines/zoidberg/properties.nix
Normal file
14
machines/zoidberg/properties.nix
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
hostNames = [
|
||||||
|
"zoidberg"
|
||||||
|
];
|
||||||
|
|
||||||
|
arch = "x86_64-linux";
|
||||||
|
|
||||||
|
systemRoles = [
|
||||||
|
"personal"
|
||||||
|
"media-center"
|
||||||
|
];
|
||||||
|
|
||||||
|
hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHvdC1EiLqSNVmk5L1p7cWRIrrlelbK+NMj6tEBrwqIq";
|
||||||
|
}
|
||||||
5
overlays/default.nix
Normal file
5
overlays/default.nix
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
final: prev:
|
||||||
|
|
||||||
|
{
|
||||||
|
libedgetpu = prev.callPackage ./libedgetpu { };
|
||||||
|
}
|
||||||
19
overlays/kernel-modules/default.nix
Normal file
19
overlays/kernel-modules/default.nix
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
# Adds additional kernel modules to the nixos system
|
||||||
|
# Not actually an overlay but a module. Has to be this way because kernel
|
||||||
|
# modules are tightly coupled to the kernel version they were built against.
|
||||||
|
# https://nixos.wiki/wiki/Linux_kernel
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.kernel;
|
||||||
|
|
||||||
|
gasket = config.boot.kernelPackages.callPackage ./gasket.nix { };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.kernel.enableGasketKernelModule = lib.mkEnableOption "Enable Gasket Kernel Module";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enableGasketKernelModule {
|
||||||
|
boot.extraModulePackages = [ gasket ];
|
||||||
|
};
|
||||||
|
}
|
||||||
35
overlays/kernel-modules/gasket.nix
Normal file
35
overlays/kernel-modules/gasket.nix
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{ stdenv, lib, fetchFromGitHub, kernel }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "gasket";
|
||||||
|
version = "1.0-18";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "google";
|
||||||
|
repo = "gasket-driver";
|
||||||
|
rev = "09385d485812088e04a98a6e1227bf92663e0b59";
|
||||||
|
sha256 = "fcnqCBh04e+w8g079JyuyY2RPu34M+/X+Q8ObE+42i4=";
|
||||||
|
};
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"-C"
|
||||||
|
"${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
||||||
|
"M=$(PWD)"
|
||||||
|
];
|
||||||
|
buildFlags = [ "modules" ];
|
||||||
|
|
||||||
|
installFlags = [ "INSTALL_MOD_PATH=${placeholder "out"}" ];
|
||||||
|
installTargets = [ "modules_install" ];
|
||||||
|
|
||||||
|
sourceRoot = "source/src";
|
||||||
|
hardeningDisable = [ "pic" "format" ];
|
||||||
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "The Coral Gasket Driver allows usage of the Coral EdgeTPU on Linux systems.";
|
||||||
|
homepage = "https://github.com/google/gasket-driver";
|
||||||
|
license = licenses.gpl2;
|
||||||
|
maintainers = [ lib.maintainers.kylehendricks ];
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
||||||
72
overlays/libedgetpu/default.nix
Normal file
72
overlays/libedgetpu/default.nix
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
{ stdenv
|
||||||
|
, lib
|
||||||
|
, fetchFromGitHub
|
||||||
|
, libusb1
|
||||||
|
, abseil-cpp
|
||||||
|
, flatbuffers
|
||||||
|
, xxd
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
flatbuffers_1_12 = flatbuffers.overrideAttrs (oldAttrs: rec {
|
||||||
|
version = "1.12.0";
|
||||||
|
NIX_CFLAGS_COMPILE = "-Wno-error=class-memaccess -Wno-error=maybe-uninitialized";
|
||||||
|
cmakeFlags = (oldAttrs.cmakeFlags or [ ]) ++ [ "-DFLATBUFFERS_BUILD_SHAREDLIB=ON" ];
|
||||||
|
NIX_CXXSTDLIB_COMPILE = "-std=c++17";
|
||||||
|
configureFlags = (oldAttrs.configureFlags or [ ]) ++ [ "--enable-shared" ];
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "google";
|
||||||
|
repo = "flatbuffers";
|
||||||
|
rev = "v${version}";
|
||||||
|
sha256 = "sha256-L1B5Y/c897Jg9fGwT2J3+vaXsZ+lfXnskp8Gto1p/Tg=";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "libedgetpu";
|
||||||
|
version = "grouper";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "google-coral";
|
||||||
|
repo = pname;
|
||||||
|
rev = "release-${version}";
|
||||||
|
sha256 = "sha256-73hwItimf88Iqnb40lk4ul/PzmCNIfdt6Afi+xjNiBE=";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [ ./libedgetpu-stddef.diff ];
|
||||||
|
|
||||||
|
makeFlags = [ "-f" "makefile_build/Makefile" "libedgetpu" ];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
libusb1
|
||||||
|
abseil-cpp
|
||||||
|
flatbuffers_1_12
|
||||||
|
];
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
xxd
|
||||||
|
];
|
||||||
|
|
||||||
|
NIX_CXXSTDLIB_COMPILE = "-std=c++17";
|
||||||
|
|
||||||
|
TFROOT = "${fetchFromGitHub {
|
||||||
|
owner = "tensorflow";
|
||||||
|
repo = "tensorflow";
|
||||||
|
rev = "v2.7.4";
|
||||||
|
sha256 = "sha256-liDbUAdaVllB0b74aBeqNxkYNu/zPy7k3CevzRF5dk0=";
|
||||||
|
}}";
|
||||||
|
|
||||||
|
enableParallelBuilding = false;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/lib
|
||||||
|
cp out/direct/k8/libedgetpu.so.1.0 $out/lib
|
||||||
|
ln -s $out/lib/libedgetpu.so.1.0 $out/lib/libedgetpu.so.1
|
||||||
|
mkdir -p $out/lib/udev/rules.d
|
||||||
|
cp debian/edgetpu-accelerator.rules $out/lib/udev/rules.d/99-edgetpu-accelerator.rules
|
||||||
|
|
||||||
|
# PCIe rule
|
||||||
|
echo 'SUBSYSTEM=="apex", MODE="0660", GROUP="apex"' > $out/lib/udev/rules.d/65-apex.rules
|
||||||
|
'';
|
||||||
|
}
|
||||||
12
overlays/libedgetpu/libedgetpu-stddef.diff
Normal file
12
overlays/libedgetpu/libedgetpu-stddef.diff
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/api/allocated_buffer.h b/api/allocated_buffer.h
|
||||||
|
index 97740f0..7bc0547 100644
|
||||||
|
--- a/api/allocated_buffer.h
|
||||||
|
+++ b/api/allocated_buffer.h
|
||||||
|
@@ -16,6 +16,7 @@
|
||||||
|
#define DARWINN_API_ALLOCATED_BUFFER_H_
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
+#include <cstddef>
|
||||||
|
|
||||||
|
namespace platforms {
|
||||||
|
namespace darwinn {
|
||||||
13
patches/gamepadui.patch
Normal file
13
patches/gamepadui.patch
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/nixos/modules/programs/steam.nix b/nixos/modules/programs/steam.nix
|
||||||
|
index 29c449c16946..f6c728eb7f0c 100644
|
||||||
|
--- a/nixos/modules/programs/steam.nix
|
||||||
|
+++ b/nixos/modules/programs/steam.nix
|
||||||
|
@@ -11,7 +11,7 @@ let
|
||||||
|
in
|
||||||
|
pkgs.writeShellScriptBin "steam-gamescope" ''
|
||||||
|
${builtins.concatStringsSep "\n" exports}
|
||||||
|
- gamescope --steam ${toString cfg.gamescopeSession.args} -- steam -tenfoot -pipewire-dmabuf
|
||||||
|
+ gamescope --steam ${toString cfg.gamescopeSession.args} -- steam -gamepadui -steamdeck -pipewire-dmabuf &> /tmp/steamlog
|
||||||
|
'';
|
||||||
|
|
||||||
|
gamescopeSessionFile =
|
||||||
@@ -1,264 +0,0 @@
|
|||||||
diff --git a/nixos/modules/system/boot/luksroot.nix b/nixos/modules/system/boot/luksroot.nix
|
|
||||||
index b8f36538e70..cc320a04c70 100644
|
|
||||||
--- a/nixos/modules/system/boot/luksroot.nix
|
|
||||||
+++ b/nixos/modules/system/boot/luksroot.nix
|
|
||||||
@@ -146,6 +146,7 @@ let
|
|
||||||
csopen = "cryptsetup luksOpen ${dev.device} ${dev.name}"
|
|
||||||
+ optionalString dev.allowDiscards " --allow-discards"
|
|
||||||
+ optionalString dev.bypassWorkqueues " --perf-no_read_workqueue --perf-no_write_workqueue"
|
|
||||||
+ + optionalString dev.disableKeyring " --disable-keyring"
|
|
||||||
+ optionalString (dev.header != null) " --header=${dev.header}";
|
|
||||||
cschange = "cryptsetup luksChangeKey ${dev.device} ${optionalString (dev.header != null) "--header=${dev.header}"}";
|
|
||||||
fido2luksCredentials = dev.fido2.credentials ++ optional (dev.fido2.credential != null) dev.fido2.credential;
|
|
||||||
@@ -243,6 +244,26 @@ let
|
|
||||||
do_open_passphrase
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
+ '' else if (dev.masterKeyFile != null) then ''
|
|
||||||
+ if wait_target "key file" ${dev.masterKeyFile}; then
|
|
||||||
+ ${csopen} --master-key-file=${dev.masterKeyFile}
|
|
||||||
+ cs_status=$?
|
|
||||||
+ if [ $cs_status -ne 0 ]; then
|
|
||||||
+ echo "Key File ${dev.masterKeyFile} failed!"
|
|
||||||
+ if ! try_empty_passphrase; then
|
|
||||||
+ ${if dev.fallbackToPassword then "echo" else "die"} "${dev.masterKeyFile} is unavailable"
|
|
||||||
+ echo " - failing back to interactive password prompt"
|
|
||||||
+ do_open_passphrase
|
|
||||||
+ fi
|
|
||||||
+ fi
|
|
||||||
+ else
|
|
||||||
+ # If the key file never shows up we should also try the empty passphrase
|
|
||||||
+ if ! try_empty_passphrase; then
|
|
||||||
+ ${if dev.fallbackToPassword then "echo" else "die"} "${dev.masterKeyFile} is unavailable"
|
|
||||||
+ echo " - failing back to interactive password prompt"
|
|
||||||
+ do_open_passphrase
|
|
||||||
+ fi
|
|
||||||
+ fi
|
|
||||||
'' else ''
|
|
||||||
if ! try_empty_passphrase; then
|
|
||||||
do_open_passphrase
|
|
||||||
@@ -625,6 +646,15 @@ in
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
+ masterKeyFile = mkOption {
|
|
||||||
+ default = null;
|
|
||||||
+ type = types.nullOr types.str;
|
|
||||||
+ description = lib.mdDoc ''
|
|
||||||
+ The name of the file (can be a raw device or a partition) that
|
|
||||||
+ should be used as the master decryption key for the encrypted device.
|
|
||||||
+ '';
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
tryEmptyPassphrase = mkOption {
|
|
||||||
default = false;
|
|
||||||
type = types.bool;
|
|
||||||
@@ -700,6 +730,15 @@ in
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
+ disableKeyring = mkOption {
|
|
||||||
+ default = false;
|
|
||||||
+ type = types.bool;
|
|
||||||
+ description = lib.mdDoc ''
|
|
||||||
+ Disables using the kernel keyring for LUKS2 disks.
|
|
||||||
+ This is already the default behavior for LUKS1
|
|
||||||
+ '';
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
fallbackToPassword = mkOption {
|
|
||||||
default = false;
|
|
||||||
type = types.bool;
|
|
||||||
diff --git a/nixos/modules/tasks/auto-upgrade.nix b/nixos/modules/tasks/auto-upgrade.nix
|
|
||||||
index 29e3e313336..050bf09c208 100644
|
|
||||||
--- a/nixos/modules/tasks/auto-upgrade.nix
|
|
||||||
+++ b/nixos/modules/tasks/auto-upgrade.nix
|
|
||||||
@@ -4,7 +4,8 @@ with lib;
|
|
||||||
|
|
||||||
let cfg = config.system.autoUpgrade;
|
|
||||||
|
|
||||||
-in {
|
|
||||||
+in
|
|
||||||
+{
|
|
||||||
|
|
||||||
options = {
|
|
||||||
|
|
||||||
@@ -22,7 +23,7 @@ in {
|
|
||||||
};
|
|
||||||
|
|
||||||
operation = mkOption {
|
|
||||||
- type = types.enum ["switch" "boot"];
|
|
||||||
+ type = types.enum [ "switch" "boot" ];
|
|
||||||
default = "switch";
|
|
||||||
example = "boot";
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
@@ -86,14 +87,14 @@ in {
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
- allowReboot = mkOption {
|
|
||||||
+ allowKexec = mkOption {
|
|
||||||
default = false;
|
|
||||||
type = types.bool;
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
- Reboot the system into the new generation instead of a switch
|
|
||||||
+ kexec the system into the new generation instead of a switch
|
|
||||||
if the new generation uses a different kernel, kernel modules
|
|
||||||
or initrd than the booted system.
|
|
||||||
- See {option}`rebootWindow` for configuring the times at which a reboot is allowed.
|
|
||||||
+ See {option}`kexecWindow` for configuring the times at which a kexec is allowed.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -109,25 +110,25 @@ in {
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
- rebootWindow = mkOption {
|
|
||||||
+ kexecWindow = mkOption {
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Define a lower and upper time value (in HH:MM format) which
|
|
||||||
- constitute a time window during which reboots are allowed after an upgrade.
|
|
||||||
- This option only has an effect when {option}`allowReboot` is enabled.
|
|
||||||
- The default value of `null` means that reboots are allowed at any time.
|
|
||||||
+ constitute a time window during which kexecs are allowed after an upgrade.
|
|
||||||
+ This option only has an effect when {option}`allowKexec` is enabled.
|
|
||||||
+ The default value of `null` means that kexecs are allowed at any time.
|
|
||||||
'';
|
|
||||||
default = null;
|
|
||||||
example = { lower = "01:00"; upper = "05:00"; };
|
|
||||||
type = with types; nullOr (submodule {
|
|
||||||
options = {
|
|
||||||
lower = mkOption {
|
|
||||||
- description = lib.mdDoc "Lower limit of the reboot window";
|
|
||||||
+ description = lib.mdDoc "Lower limit of the kexec window";
|
|
||||||
type = types.strMatching "[[:digit:]]{2}:[[:digit:]]{2}";
|
|
||||||
example = "01:00";
|
|
||||||
};
|
|
||||||
|
|
||||||
upper = mkOption {
|
|
||||||
- description = lib.mdDoc "Upper limit of the reboot window";
|
|
||||||
+ description = lib.mdDoc "Upper limit of the kexec window";
|
|
||||||
type = types.strMatching "[[:digit:]]{2}:[[:digit:]]{2}";
|
|
||||||
example = "05:00";
|
|
||||||
};
|
|
||||||
@@ -165,12 +166,12 @@ in {
|
|
||||||
}];
|
|
||||||
|
|
||||||
system.autoUpgrade.flags = (if cfg.flake == null then
|
|
||||||
- [ "--no-build-output" ] ++ optionals (cfg.channel != null) [
|
|
||||||
- "-I"
|
|
||||||
- "nixpkgs=${cfg.channel}/nixexprs.tar.xz"
|
|
||||||
- ]
|
|
||||||
- else
|
|
||||||
- [ "--flake ${cfg.flake}" ]);
|
|
||||||
+ [ "--no-build-output" ] ++ optionals (cfg.channel != null) [
|
|
||||||
+ "-I"
|
|
||||||
+ "nixpkgs=${cfg.channel}/nixexprs.tar.xz"
|
|
||||||
+ ]
|
|
||||||
+ else
|
|
||||||
+ [ "--flake ${cfg.flake}" ]);
|
|
||||||
|
|
||||||
systemd.services.nixos-upgrade = {
|
|
||||||
description = "NixOS Upgrade";
|
|
||||||
@@ -195,54 +196,56 @@ in {
|
|
||||||
config.programs.ssh.package
|
|
||||||
];
|
|
||||||
|
|
||||||
- script = let
|
|
||||||
- nixos-rebuild = "${config.system.build.nixos-rebuild}/bin/nixos-rebuild";
|
|
||||||
- date = "${pkgs.coreutils}/bin/date";
|
|
||||||
- readlink = "${pkgs.coreutils}/bin/readlink";
|
|
||||||
- shutdown = "${config.systemd.package}/bin/shutdown";
|
|
||||||
- upgradeFlag = optional (cfg.channel == null) "--upgrade";
|
|
||||||
- in if cfg.allowReboot then ''
|
|
||||||
- ${nixos-rebuild} boot ${toString (cfg.flags ++ upgradeFlag)}
|
|
||||||
- booted="$(${readlink} /run/booted-system/{initrd,kernel,kernel-modules})"
|
|
||||||
- built="$(${readlink} /nix/var/nix/profiles/system/{initrd,kernel,kernel-modules})"
|
|
||||||
-
|
|
||||||
- ${optionalString (cfg.rebootWindow != null) ''
|
|
||||||
- current_time="$(${date} +%H:%M)"
|
|
||||||
-
|
|
||||||
- lower="${cfg.rebootWindow.lower}"
|
|
||||||
- upper="${cfg.rebootWindow.upper}"
|
|
||||||
-
|
|
||||||
- if [[ "''${lower}" < "''${upper}" ]]; then
|
|
||||||
- if [[ "''${current_time}" > "''${lower}" ]] && \
|
|
||||||
- [[ "''${current_time}" < "''${upper}" ]]; then
|
|
||||||
- do_reboot="true"
|
|
||||||
+ script =
|
|
||||||
+ let
|
|
||||||
+ nixos-rebuild = "${config.system.build.nixos-rebuild}/bin/nixos-rebuild";
|
|
||||||
+ date = "${pkgs.coreutils}/bin/date";
|
|
||||||
+ readlink = "${pkgs.coreutils}/bin/readlink";
|
|
||||||
+ systemctl_kexec = "${config.systemd.package}/bin/systemctl kexec";
|
|
||||||
+ upgradeFlag = optional (cfg.channel == null) "--upgrade";
|
|
||||||
+ in
|
|
||||||
+ if cfg.allowKexec then ''
|
|
||||||
+ ${nixos-rebuild} boot ${toString (cfg.flags ++ upgradeFlag)}
|
|
||||||
+ booted="$(${readlink} /run/booted-system/{initrd,kernel,kernel-modules})"
|
|
||||||
+ built="$(${readlink} /nix/var/nix/profiles/system/{initrd,kernel,kernel-modules})"
|
|
||||||
+
|
|
||||||
+ ${optionalString (cfg.kexecWindow != null) ''
|
|
||||||
+ current_time="$(${date} +%H:%M)"
|
|
||||||
+
|
|
||||||
+ lower="${cfg.kexecWindow.lower}"
|
|
||||||
+ upper="${cfg.kexecWindow.upper}"
|
|
||||||
+
|
|
||||||
+ if [[ "''${lower}" < "''${upper}" ]]; then
|
|
||||||
+ if [[ "''${current_time}" > "''${lower}" ]] && \
|
|
||||||
+ [[ "''${current_time}" < "''${upper}" ]]; then
|
|
||||||
+ do_kexec="true"
|
|
||||||
+ else
|
|
||||||
+ do_kexec="false"
|
|
||||||
+ fi
|
|
||||||
else
|
|
||||||
- do_reboot="false"
|
|
||||||
+ # lower > upper, so we are crossing midnight (e.g. lower=23h, upper=6h)
|
|
||||||
+ # we want to reboot if cur > 23h or cur < 6h
|
|
||||||
+ if [[ "''${current_time}" < "''${upper}" ]] || \
|
|
||||||
+ [[ "''${current_time}" > "''${lower}" ]]; then
|
|
||||||
+ do_kexec="true"
|
|
||||||
+ else
|
|
||||||
+ do_kexec="false"
|
|
||||||
+ fi
|
|
||||||
fi
|
|
||||||
+ ''}
|
|
||||||
+
|
|
||||||
+ if [ "''${booted}" = "''${built}" ]; then
|
|
||||||
+ ${nixos-rebuild} ${cfg.operation} ${toString cfg.flags}
|
|
||||||
+ ${optionalString (cfg.kexecWindow != null) ''
|
|
||||||
+ elif [ "''${do_kexec}" != true ]; then
|
|
||||||
+ echo "Outside of configured kexec window, skipping."
|
|
||||||
+ ''}
|
|
||||||
else
|
|
||||||
- # lower > upper, so we are crossing midnight (e.g. lower=23h, upper=6h)
|
|
||||||
- # we want to reboot if cur > 23h or cur < 6h
|
|
||||||
- if [[ "''${current_time}" < "''${upper}" ]] || \
|
|
||||||
- [[ "''${current_time}" > "''${lower}" ]]; then
|
|
||||||
- do_reboot="true"
|
|
||||||
- else
|
|
||||||
- do_reboot="false"
|
|
||||||
- fi
|
|
||||||
+ ${systemctl_kexec}
|
|
||||||
fi
|
|
||||||
- ''}
|
|
||||||
-
|
|
||||||
- if [ "''${booted}" = "''${built}" ]; then
|
|
||||||
- ${nixos-rebuild} ${cfg.operation} ${toString cfg.flags}
|
|
||||||
- ${optionalString (cfg.rebootWindow != null) ''
|
|
||||||
- elif [ "''${do_reboot}" != true ]; then
|
|
||||||
- echo "Outside of configured reboot window, skipping."
|
|
||||||
- ''}
|
|
||||||
- else
|
|
||||||
- ${shutdown} -r +1
|
|
||||||
- fi
|
|
||||||
- '' else ''
|
|
||||||
- ${nixos-rebuild} ${cfg.operation} ${toString (cfg.flags ++ upgradeFlag)}
|
|
||||||
- '';
|
|
||||||
+ '' else ''
|
|
||||||
+ ${nixos-rebuild} ${cfg.operation} ${toString (cfg.flags ++ upgradeFlag)}
|
|
||||||
+ '';
|
|
||||||
|
|
||||||
startAt = cfg.dates;
|
|
||||||
|
|
||||||
Binary file not shown.
11
secrets/binary-cache-private-key.age
Normal file
11
secrets/binary-cache-private-key.age
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 hPp1nw eORh0m8mAPd3H/wjnHocuh/xheMuhLgWyzepL9RNii0
|
||||||
|
154IPIdkb8WpYgX/fj5jraQY5mN7udg3iaZ3VJB+3X8
|
||||||
|
-> ssh-ed25519 dMQYog 0eg1j3jL736OwjeMB55z52A6P34mSEYL6ulrn72blj0
|
||||||
|
UdFKIbrzAKCzZhYfH41z64cwkQRp1RZztYgknIEfoDc
|
||||||
|
-> K/&@p'&{-grease yb~ xHlc7m _t xm{3f
|
||||||
|
Gi2UGm5YXyByJuH6rRRBle/D5T7GS4FDt7Kv8aBKe8dfwUCu65OcvoaXzjm08EKA
|
||||||
|
m0yx
|
||||||
|
--- f79zGG5kBOul/cF0NJu1+f/NmaI0h/JcuHDano/1ghU
|
||||||
|
U¥÷7°åóʤï1måÔE\{^£$ŸÕCx~2"±8¶Æõ?&öó°„ÂË‹(áä±
|
||||||
|
…aÝÀyßÝ쥘g¬â†øÇ CYX}’Ö
|
||||||
BIN
secrets/binary-cache-push-sshkey.age
Normal file
BIN
secrets/binary-cache-push-sshkey.age
Normal file
Binary file not shown.
10
secrets/cris-hashed-email-pw.age
Normal file
10
secrets/cris-hashed-email-pw.age
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 6AT2/g MmInWcw6GlfzvN9kxFtTVWMX+UX9PHO5V35TzRcmex0
|
||||||
|
dSMoGNuJMpRwyWTAnjHpO9mJBCxsJ77M5fWA0F1gR6s
|
||||||
|
-> ssh-ed25519 dMQYog ua3OPiErZcVRNGf/uxv7PiBBFOKAUkaSSIV4UCMu5Wc
|
||||||
|
L8kYIzyEXcAxAlPQbqasgiaQi7JARhja6vM6WzvdMrs
|
||||||
|
-> CIn-grease !G{f,9h( Hjn\ \hTpE MAP<)J
|
||||||
|
0u+eQDvbxgI6aDT7xqdwOX3A34E2T4Ft9bSF6KBpHqucHib9tA5lJHgtXwgkpa/P
|
||||||
|
nbaJDnRWbM/AL7nnT7XpdLVO2r7w2ish4ALBgPvXxH/0iUXqvQk1B/E
|
||||||
|
--- +aKXbSfk6VkxqtTn+fI8VhcgO7Dw0jNSUJOJlqCbEGM
|
||||||
|
á? Þ÷Ùþq}` ¿Žiämó<>.6Û{I
|
||||||
BIN
secrets/gitea-actions-runner-token.age
Normal file
BIN
secrets/gitea-actions-runner-token.age
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,9 +1,10 @@
|
|||||||
age-encryption.org/v1
|
age-encryption.org/v1
|
||||||
-> ssh-ed25519 VyYH/Q X+fXLJz227KkBLu45rb9mUkkIpENSMtZeEJjl6qj5Xw
|
-> ssh-ed25519 VyYH/Q evYn+9ipH4t4cT2lZOiwnGqSkU+bbdVw80S0rgAqt00
|
||||||
AFAFnvsiogoMMwsAJO0DDoaizL9lmCLsF4QHDjmubr0
|
Vr24AqHOqH5DQYYlyS0X+k6TnczKHRDGZCeoLOJkybE
|
||||||
-> ssh-ed25519 dMQYog P84+7TBcMFSALTn6FR/aXyqFE9DfOzp38ImkdWj7nE0
|
-> ssh-ed25519 dMQYog 23GqNi0N24EtnRV25Ick+aurPOngZ2Zd279LmZH15WY
|
||||||
PqOn1OL9Zt0x1pBIYOSKkkS//mbk1OX5pnDGp+OLYeI
|
FEo0GyymjnPrSjf608SyCH22FvaqEixyVcbXdQ+Z3zA
|
||||||
-> @?-grease
|
-> (Rd{ky@}-grease D f/KA]Pe
|
||||||
3JvpmcTxdTgvv6vPL8dXEwjR+g
|
8Ip1fddb0BYUwg62FSmUBp7O+TILFaCtWHcxheEyUlXPoY9TGTaySl6Znw9Mksde
|
||||||
--- aMYF1SbC+p01YWmg24+Ih78VPQcwzGU/P1cEfgRvXV8
|
q2aAHn8
|
||||||
Ÿ @$™sžQ¼z<15><>®xkÊNfÛuÕ;§¿ ÎvI0•ªÇÎ^4.?, 8…çî
|
--- ibLXcq9R/5X2jFKBABgsUcDiBjjuoA9SrCuFbGOiNBI
|
||||||
|
¸Ó;ù½XôóÀ m£h޲ý%펗+6â×k@nWÃäT®‘0
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
age-encryption.org/v1
|
age-encryption.org/v1
|
||||||
-> ssh-ed25519 VyYH/Q biHhTmstx4FJmstCt7pYUjQlwZpgbFkZVlpzQu2Lf1w
|
-> ssh-ed25519 VyYH/Q 64dqV1h1JUR4j42fb1I5jhXGaY/qZeSKm1rBzQgbbw8
|
||||||
K2lHbhdETesM86K6fKk91/2Z0LRQcwVtnXxYOtVCCaE
|
pJnxiMQ736hEEx674n1mZGzgLhRISKjZnHKh7NoVGVQ
|
||||||
-> ssh-ed25519 dMQYog cyeabgOaV3nLPdLYs4G1g41bMAEBnHlEXoeW+A7NLFw
|
-> ssh-ed25519 dMQYog z95pFmJuZTdFphdWJwLK7NSNQC0PqXw+aFtzt17xv0I
|
||||||
FRGdlHVQ81JjjYQ/PRoAq+JRMZ28rSBEUko8VHKNeDM
|
IET4jLrUiJAXsvOWkh2jWGdDgnib7fW90389V7P4C0w
|
||||||
-> cyfV-grease +X51me hk_`YB> 6DFo`? V
|
-> 2-grease \vwS,
|
||||||
/EoPdwBCc9S2GafKdhDnPZE06kxZBlzAob0Eb2qEMuwzVJF+7LesiK0ilpSrzdPU
|
mEdgxTI1rxUMuAOhUUoitN0tfN4c6BU
|
||||||
cVN1ka2+k4pH7os/QUuu6oW9r3SxCw
|
--- Efo4U1RV0Mcd2th5AoXpy8XL2LejIH4GaOKBPCSuQEE
|
||||||
--- FJOYm8/TVXlxV+9Ih376xWyJlKz2uk8KzPoY5FpIJjo
|
ÍCLd…
|
||||||
C`Ñ” -“Ýþo’YIEœ_.y˜XãÝÈË›iþëµFØW±…ЍIm5ŽA“õ*÷}Àßêkî”þ9ûzë
|
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
age-encryption.org/v1
|
age-encryption.org/v1
|
||||||
-> ssh-ed25519 6AT2/g yTW46JmDIftcOqogIDjheXJf2sw/dG2WEJxfCXU/LDk
|
-> ssh-ed25519 6AT2/g UG+Ub0bZK74/Ifa/YkZOc6B3cPl6oI7M4Ev1zxkFEh0
|
||||||
0Co5/Rn22kmdcPr61ZOrmZJbPFHx2wJ8/YkbDjcjqKo
|
z71vjnEqhL3kuLePbP0nKQNwU0mrCOO386wLdUhH5tU
|
||||||
-> ssh-ed25519 dMQYog RtZT0PwVL4kxUHilOhH2GBp8Z9WfyBkaxB62pjKpHA4
|
-> ssh-ed25519 dMQYog t8H6XoIhhE4H9g4913sWgZ5BaYK04uk7Mj0FYnOdtTo
|
||||||
muMlIt8VYQftMYacfdnQFeejfWpKTEG5gxbFNy97GTc
|
U4Ygto4z3l4dcCsnGxnRo1YGBl6YZ5y5pnVBJXCSrOc
|
||||||
-> 4|)`7yq-grease P#\5k8 +f
|
-> Bad-grease <$Y
|
||||||
jMegn6ATsj2Ai9B5Xmy+tay1nppwxvF1IGJH+hLNanYMsTIDZypM6UsNdzYQ/3mw
|
1xw
|
||||||
VZ9ooy8TKUgAJ7jsd6IrKw
|
--- wiGO0H6gfd+3D/+V/rMNLGkDk6FPFUihXi43J82LAkg
|
||||||
--- tLaPQWJA0Hh5MrxfhaySURgY02K16IlzvsxKpOWGva0
|
³8>`®Às«»pú¨€¿U#ü™º¯KV%jbwïxN¸@
|
||||||
5?lヌ'シ!ケコ<EFBDB9><EFBDBA>ワキ匪Nxス+<2B>A9゚ムリl/グ諟ホ|旙<>Sオ&コサ、繃<>Q;_<>K
|
Žî@œª€iæ
|
||||||
|
Ow\º(@@Tòìèzá
|
||||||
BIN
secrets/librechat-env-file.age
Normal file
BIN
secrets/librechat-env-file.age
Normal file
Binary file not shown.
@@ -1,10 +1,10 @@
|
|||||||
age-encryption.org/v1
|
age-encryption.org/v1
|
||||||
-> ssh-ed25519 6AT2/g hXS7zxzYhlu5GrUAEAnaO+CizpbifjDxIwoAK55cjV0
|
-> ssh-ed25519 6AT2/g ZfG2BGntlwCXJgQsYqvoPsQe5Y0JLLs4Vanm2NEciV4
|
||||||
xU7Z52cjARU8tmd1AJ9v8+QTQzfL/mNxP/f/bJAzYvo
|
iEBfqquq6Kqnmj6djNQHSMlpyiFP+TM/mXSa+X4jJJ8
|
||||||
-> ssh-ed25519 dMQYog 8PEp5TmEOumhWUZvko42sOKpkqOCW9/zCrMqn+fJ2ws
|
-> ssh-ed25519 dMQYog r5DtWLdIDn58h5bwpvBMMP2VK/sm0B+qW1p8kpkVC38
|
||||||
wJo8x6+hyU8iJkTqGVecZ88hG661F3ZvEvVqpJzox5w
|
N1ABWvmnHjipSd/2XaNPDPOzB4hzmwmOhOACfAeHYOY
|
||||||
-> x-grease tdW'\ +(>9 da%@^H6
|
-> PfP*-grease >7 7pu;\o@ g
|
||||||
q04xwjRaNOBfNhAvik762vJHio/qTfR6qQW4QsD+wzEidRYRggNdQwTl+G4jkWAu
|
ZduZJ2nqJZ0RQXwxBjDZdQ49Q1xO2bTM0TSPbC/5WbIwPlBeN79CT46lSi/l+evk
|
||||||
fx0xZeiI5qVm6WG8lg
|
UE6c9mUXNZvNdeUyyLzonENN0YSVW0ikQtRdKZwBsM0OTYWBGxkKx2fmasW3nQ
|
||||||
--- pHx5BdqI3HubR9wAtPyfMaYbr8uqRwOS1qFJhtC4wuM
|
--- VPIFJ2C3BP6OZGP5rZC3Gzu7D0hhNcF23OMM6d/9Jmo
|
||||||
Èv°ºg9sÉÉ¡§6:`Nlëªø`.‘•ÓÍPebÅSNn<>åÄ8C<<3C>¥a=-¨Gh¤ò.ªfHm<48>»æUëçPGpS}µxýùã#ÎT
|
xÆ2¹id5̬=J¬¦;S«³F`ù¬.Åi(Û“¬÷°øZjÉ`뢓>«ÁøÙÔ˜‰&€ÃM§:\g¿!£áÂ^ñDhr,[J²}
|
||||||
BIN
secrets/oauth2-proxy-env.age
Normal file
BIN
secrets/oauth2-proxy-env.age
Normal file
Binary file not shown.
@@ -1,11 +1,13 @@
|
|||||||
age-encryption.org/v1
|
age-encryption.org/v1
|
||||||
-> ssh-ed25519 6AT2/g J3H9xUUwUMB7VkHHGtsZaCm/GiyqTFUrEmsuwcrgrhE
|
-> ssh-ed25519 6AT2/g gPeZnJ8arK6xAGnEK9uTcGfwBI1pYjjv6VX4o9EBIns
|
||||||
tn+zbj5cISZzkUzJcu7JlaqhE4Dr4fhczSJU2kV91AU
|
sKFfqnafLachTKE93Pb7gsZ5gdKis64N64BK5128LKg
|
||||||
-> ssh-ed25519 hPp1nw 370YNPQn4mqeHjOvnIXkm+BzbrRNHkFICJaJhHCSHDQ
|
-> ssh-ed25519 hPp1nw e2taazZ3R6EBCbgh6Gg0Dc9p1K7zp5R7n9LIkWF/Wj8
|
||||||
WLhDRA8jp50aKkY8t9GvyAHoLxYQD2Bhw3y01hwhoOA
|
+/VkcMDL1HNJhbc6/OxpiUe1dlO0lrc1hgkD/RrYXjY
|
||||||
-> ssh-ed25519 dMQYog 1dwQN8hmbLY54OnRTXtcwAXHoYLLNV0IK/rQQ9ZgV2A
|
-> ssh-ed25519 dMQYog znMKkv1O7F/EeAyvTfULUn/pWdai2NI0uBfWn/02xg0
|
||||||
gP2HQinVYW72oJRFW69qAeF/iNEEtJqya1iRMOugNKk
|
45W9s4Vo8J+xOTGec9h6s0ra9ZSUA6JkorAAyqqlPfg
|
||||||
-> ~-grease 2%p4s G:$f41y " vZ87PA*|
|
-> T/!XI-grease GJ_O'
|
||||||
+hI029392lrjxlsXUI8opFVcUK+JOjgBYGMH
|
mAOW54Txa2H9WdEMog0g1XQjkC5z0wQIoqNlnbsjCSvM1UaPiiu6vJOJKCmJb1Z6
|
||||||
--- juX+tgNpNr8it5QnbcBkR9u88vZkC47L5fIlZQNxPYg
|
3wyLN6lCIjkR
|
||||||
,J}¸œ}Y§˜B%ˆo~3M×½HÊ—]ºˆû©ðÔ¤–žËn0cVs(´;axc#o™Üüv'kˆù#]o<>N`ÆœøÁ´Ì¿<C38C>˜¼ûp<>ÒšKàøk†0(
|
--- yX7lzKnDkn+KkRVTumffcd/SJSznR5n6JtUgWkSSohk
|
||||||
|
ãQô^àèyW; â§]Š+u>¥3wŒz±¨oêM:ã™øêúÀöŸÃ9,xv×KÁÜXT-K8rÔAç(@Ø-|³
|
||||||
|
:PÈ<50>‡*H6€'¹&Ôi
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,8 +1,8 @@
|
|||||||
age-encryption.org/v1
|
age-encryption.org/v1
|
||||||
-> ssh-ed25519 dMQYog yPsN2a4x6jsVoICJQrP5sJEiZEuLFcPMAAUOWIlAFAw
|
-> ssh-ed25519 dMQYog 82ZRseC994TzEUg20LuFD4kToykRtk7NISGrolHJO1Y
|
||||||
A4cPt0h2miu6maXCZqNDi3eBH+wz089PkTedPgjhVGQ
|
rbSPACXEjLSHKYpZzGNGTKIjFSFCsoXA3Y8CIcPv8rg
|
||||||
-> )0CM-grease {H^$`
|
-> z/-grease zQd~R\dJ
|
||||||
z45BS81IhE6Xqdtz/idIzEExM7T8Sb7zl6NH6ODSJ7p6nRM
|
SeA2ve/+W285dHnBIfGbOFPLt4/ORrI6HeGeTnkackymUAh23+Ur581Duhjo3T3B
|
||||||
--- 9P/MF94zA5XDi+jwUMKHqVFqGCgGaYMaryevwvI5gsk
|
j53tPUXXTwuXKpd4Ga0xpmr44Yo
|
||||||
½èá=¸,ööîó£ oá¯H¸uVÊ·HãŸè–25êÿ<C3AA>î1&£C‰IŠä.áDs!¥Íh?öPuo$"ª-’m}Ñ!úi<•'
|
--- /mQNdS7QAVSNQQ1RRjD9dxMYFjI6UBgqHIA+hvHRPOU
|
||||||
wT»‘¼÷À([‘UÿH6¦Úï9×67Z_ÄÅ·³…ܱÀ”Rü?„{^ÄH/{C©ùd?nð¢ã÷œÈ
|
Ëæ:^½AqÏvRkÀaˆc–u\éùë¾:ãë©<C3AB>˜jzç¶Öÿ'ÉDÚ¬=éÞ_îÐoÃYgbâfîL\ÇN`)Šdkó„˜ižbHß<>$°¨}2”)X<>Ú<EFBFBD>ÓS=8`ªaÄ\»Uȇ’‚¸Óµ¸º¾¹Çß?¤<LêÞä€Ñ;·
|
||||||
@@ -14,12 +14,16 @@ with roles;
|
|||||||
{
|
{
|
||||||
# email
|
# email
|
||||||
"hashed-email-pw.age".publicKeys = email-server;
|
"hashed-email-pw.age".publicKeys = email-server;
|
||||||
|
"cris-hashed-email-pw.age".publicKeys = email-server;
|
||||||
"sasl_relay_passwd.age".publicKeys = email-server;
|
"sasl_relay_passwd.age".publicKeys = email-server;
|
||||||
"hashed-robots-email-pw.age".publicKeys = email-server;
|
"hashed-robots-email-pw.age".publicKeys = email-server;
|
||||||
"robots-email-pw.age".publicKeys = gitea;
|
"robots-email-pw.age".publicKeys = gitea;
|
||||||
|
|
||||||
# gitea
|
# nix binary cache
|
||||||
"gitea-runner-registration-token.age".publicKeys = gitea-runner;
|
# public key: s0.koi-bebop.ts.net:OjbzD86YjyJZpCp9RWaQKANaflcpKhtzBMNP8I2aPUU=
|
||||||
|
"binary-cache-private-key.age".publicKeys = binary-cache;
|
||||||
|
# public key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINpUZFFL9BpBVqeeU63sFPhR9ewuhEZerTCDIGW1NPSB
|
||||||
|
"binary-cache-push-sshkey.age".publicKeys = nobody; # this value is directly given to gitea
|
||||||
|
|
||||||
# vpn
|
# vpn
|
||||||
"iodine.age".publicKeys = iodine;
|
"iodine.age".publicKeys = iodine;
|
||||||
@@ -27,7 +31,8 @@ with roles;
|
|||||||
|
|
||||||
# cloud
|
# cloud
|
||||||
"nextcloud-pw.age".publicKeys = nextcloud;
|
"nextcloud-pw.age".publicKeys = nextcloud;
|
||||||
"smb-secrets.age".publicKeys = personal;
|
"smb-secrets.age".publicKeys = personal ++ media-center;
|
||||||
|
"oauth2-proxy-env.age".publicKeys = server;
|
||||||
|
|
||||||
# services
|
# services
|
||||||
"searx.age".publicKeys = nobody;
|
"searx.age".publicKeys = nobody;
|
||||||
@@ -35,10 +40,16 @@ with roles;
|
|||||||
"wolframalpha.age".publicKeys = dailybot;
|
"wolframalpha.age".publicKeys = dailybot;
|
||||||
|
|
||||||
# hostapd
|
# hostapd
|
||||||
"hostapd-pw-experimental-tower.age".publicKeys = wireless;
|
"hostapd-pw-experimental-tower.age".publicKeys = nobody;
|
||||||
"hostapd-pw-CXNK00BF9176.age".publicKeys = wireless;
|
"hostapd-pw-CXNK00BF9176.age".publicKeys = nobody;
|
||||||
|
|
||||||
# backups
|
# backups
|
||||||
"backblaze-s3-backups.age".publicKeys = personal ++ server;
|
"backblaze-s3-backups.age".publicKeys = personal ++ server;
|
||||||
"restic-password.age".publicKeys = personal ++ server;
|
"restic-password.age".publicKeys = personal ++ server;
|
||||||
|
|
||||||
|
# gitea actions runner
|
||||||
|
"gitea-actions-runner-token.age".publicKeys = gitea-actions-runner;
|
||||||
|
|
||||||
|
# Librechat
|
||||||
|
"librechat-env-file.age".publicKeys = librechat;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -1,10 +1,10 @@
|
|||||||
age-encryption.org/v1
|
age-encryption.org/v1
|
||||||
-> ssh-ed25519 6AT2/g xp04CsJvlYhBZS5W/MSDLWGiNCegAjg4XPv43wU5u0g
|
-> ssh-ed25519 6AT2/g 3xkROcKh6I/oVGRwnvJ9Dy36JvYmsJQZq2DBvYC4Dz4
|
||||||
i6q0YgKOFGaHOKVYMppNtcvjCFfHHqOS9M+oh2mqc1M
|
JunaGg8zg2SJZmBnuV0ZcDSc8vsMHgTd1RbDn8giy+Y
|
||||||
-> ssh-ed25519 dMQYog Mk90WFb+fYCFV7afu3+VbuAtOlvRAgpJGFGqn4ZWGjE
|
-> ssh-ed25519 dMQYog JG8QC1thl+CMlxoI1Y+ZUj0dQ3FXF4cquk7tdzfaS0E
|
||||||
wHeScgV248lHiL0B/QEraD4QOBudezhJPrppY50u7S8
|
zW7jyrXhVvyIq7HXfcRqkyZdg/wkWwNfPk5KbI2jH7I
|
||||||
-> G/9-grease
|
-> $"v%-grease `Xo|a eIFIq 7hBk?8%1
|
||||||
0hCyP7pGu5xkk4eWJTpLWy6f8Zuo8wmgBSNFK7bgzfYdW29mdOrO2Ey3Oa2Gvtji
|
ZoNiAXY1HE1GEQPd1aJirTitFgXf3HKcV2H6HxRpzWysUd1DGOsF/jScUO36JgIP
|
||||||
rze9v27gMUFRXOqPHNmaSjAneCwtcqTMReV+LZr9q9FN6qZnzAE
|
sY8FA22PjyUv7g
|
||||||
--- /SN6cSyrvbDEHTiIvv4MdoVkIjz3yZkvtr2SVBE1rRk
|
--- zFpfG3JQpSmE108GMEWLjGWMJe7cXVn3NN9vs8iDY3E
|
||||||
=„ñ1fJ…XÍô‹~ÃÝÆD¬c¹aFâ¨@ݹc=89;¿sôv®Ïú´‘
|
8f,ÕªÒÅðÚÏ*}V¥Æ@j†3ÿïCèM*@}ìy2Øì9€Éè ìN|y›æ
|
||||||
Reference in New Issue
Block a user