Compare commits

..

35 commits

Author SHA1 Message Date
b9bd093ba8
change build command
Some checks failed
Build / Determining hosts to build (push) Successful in 8s
Build / Determining hosts to build (pull_request) Successful in 8s
Build / build (Development Testing) (push) Failing after 8s
Build / build (Development Testing) (pull_request) Failing after 7s
2026-02-08 15:38:18 +01:00
3d4082c25c
hardcoding
Some checks failed
Build / build (Development Testing) (pull_request) Failing after 7s
Build / Determining hosts to build (push) Successful in 8s
Build / Determining hosts to build (pull_request) Successful in 8s
Build / build (Development Testing) (push) Failing after 6s
2026-02-08 15:35:02 +01:00
a5ed47a478
without json parse
Some checks failed
Build / build (push) Failing after 7s
Build / build (pull_request) Failing after 7s
Build / Determining hosts to build (push) Successful in 8s
Build / Determining hosts to build (pull_request) Successful in 8s
2026-02-08 15:30:52 +01:00
ea3492ee27
escape?
Some checks failed
Build / build (push) Failing after 7s
Build / Determining hosts to build (push) Successful in 8s
Build / Determining hosts to build (pull_request) Successful in 8s
Build / build (pull_request) Failing after 7s
2026-02-08 15:28:01 +01:00
44131ad8e7
test
Some checks failed
Build / Determining hosts to build (push) Successful in 8s
Build / build (push) Failing after 7s
Build / build (pull_request) Failing after 7s
Build / Determining hosts to build (pull_request) Successful in 8s
2026-02-08 15:17:34 +01:00
02f2ade703
Using EOF
Some checks failed
Build / Determining hosts to build (push) Successful in 7s
Build / build (push) Failing after 7s
Build / Determining hosts to build (pull_request) Successful in 8s
Build / build (pull_request) Failing after 7s
2026-02-08 15:16:02 +01:00
9008b6ab3d
printf escaped
Some checks failed
Build / Determining hosts to build (push) Failing after 8s
Build / build (push) Has been skipped
Build / Determining hosts to build (pull_request) Failing after 7s
Build / build (pull_request) Has been skipped
2026-02-08 15:14:24 +01:00
8824ee080c
Preserve quotes
Some checks failed
Build / Determining hosts to build (push) Successful in 9s
Build / Determining hosts to build (pull_request) Successful in 7s
Build / build (push) Failing after 6s
Build / build (pull_request) Failing after 7s
2026-02-08 15:08:55 +01:00
bc42639059
Debugging needs outputs hosts
Some checks failed
Build / Determining hosts to build (push) Successful in 8s
Build / Determining hosts to build (pull_request) Successful in 7s
Build / build (push) Failing after 6s
Build / build (pull_request) Failing after 6s
2026-02-08 14:59:10 +01:00
4245b09a71
Debugging needs outputs
Some checks failed
Build / Determining hosts to build (push) Successful in 8s
Build / Determining hosts to build (pull_request) Successful in 8s
Build / build (push) Failing after 7s
Build / build (pull_request) Failing after 7s
2026-02-08 14:58:21 +01:00
478ace7bb4
Debugging extra step
Some checks failed
Build / Determining hosts to build (push) Successful in 8s
Build / Determining hosts to build (pull_request) Successful in 7s
Build / build (push) Failing after 6s
Build / build (pull_request) Failing after 7s
2026-02-08 14:54:31 +01:00
4eff2772d1
Debugging
Some checks failed
Build / Determining hosts to build (push) Successful in 8s
Build / Determining hosts to build (pull_request) Successful in 8s
Build / build (push) Failing after 7s
Build / build (pull_request) Failing after 6s
2026-02-08 14:50:41 +01:00
de54d86be1
Change names and ordere
Some checks failed
Build / Determining hosts to build (push) Successful in 8s
Build / Determining hosts to build (pull_request) Successful in 8s
Build / build (push) Failing after 6s
Build / build (pull_request) Failing after 7s
2026-02-08 12:33:23 +01:00
3e78d7e0f7
add toolcache
Some checks failed
Build / Determining hosts to build (push) Successful in 8s
Build / Determining hosts to build (pull_request) Successful in 7s
Build / build (push) Failing after 6s
Build / build (pull_request) Failing after 6s
2026-02-08 12:29:05 +01:00
99141d2c7a
fix mappings
Some checks failed
Build / Determining hosts to build (push) Successful in 8s
Build / Determining hosts to build (pull_request) Successful in 7s
Build / build (push) Failing after 6s
Build / build (pull_request) Failing after 7s
2026-02-08 12:26:31 +01:00
675204152d
fix mappings 2026-02-08 12:25:52 +01:00
fce4a03fa5
use var directly 2026-02-08 12:25:00 +01:00
b5af201e86
run on push
All checks were successful
Test / tests (push) Has been skipped
Test / tests (pull_request) Has been skipped
2026-02-08 12:18:59 +01:00
2996df479f
Debug matrix
All checks were successful
Test / tests (push) Has been skipped
Test / tests (pull_request) Has been skipped
2026-02-08 12:17:33 +01:00
7d8a6693c1
try different way
Some checks failed
Test / tests (push) Has been skipped
Test / tests (pull_request) Has been skipped
Build / Determining hosts to build (pull_request) Successful in 8s
Build / build (pull_request) Failing after 6s
2026-02-08 12:14:07 +01:00
cef1259f8d
fix json elements
Some checks failed
Test / tests (push) Has been skipped
Build / Determining hosts to build (pull_request) Successful in 8s
Test / tests (pull_request) Has been skipped
Build / build (pull_request) Failing after 6s
2026-02-08 12:06:26 +01:00
bfbe4204e7
More specific hostnames
Some checks failed
Test / tests (push) Has been skipped
Build / Determining hosts to build (pull_request) Successful in 9s
Test / tests (pull_request) Has been skipped
Build / build (pull_request) Failing after 7s
2026-02-08 12:04:02 +01:00
60fe8110b1
Add NixOS to build step as well
Some checks failed
Test / tests (push) Has been skipped
Build / Determining hosts to build (pull_request) Successful in 9s
Test / tests (pull_request) Has been skipped
Build / build (pull_request) Failing after 6s
2026-02-08 12:00:31 +01:00
4103c488b3
Build each host
Some checks failed
Test / tests (push) Has been skipped
Build / Determining hosts to build (pull_request) Successful in 9s
Test / tests (pull_request) Has been skipped
Build / build (pull_request) Failing after 1s
2026-02-08 11:58:43 +01:00
90bd5ed66b
Determine hosts 2026-02-08 11:58:30 +01:00
bc8118b48a
chore: Disable test workflow 2026-02-08 11:57:18 +01:00
16b72ed6e0
feat: Test Action 2026-02-06 14:15:19 +01:00
5582384f01
feat: Add homepage module 2026-02-06 13:22:39 +01:00
d38c53762a
chore: Change Nextcloud IP 2026-02-04 20:23:56 +01:00
ca7875dee9
feat: Move URLs to vars 2026-02-04 09:25:45 +01:00
6deb36d920
chore(ssh): Update keys 2025-10-18 18:59:17 +02:00
652a9da077
flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/7df7ff7d8e00218376575f0acdcc5d66741351ee?narHash=sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs%3D' (2025-10-02)
  → 'github:NixOS/nixpkgs/544961dfcce86422ba200ed9a0b00dd4b1486ec5?narHash=sha256-EVAqOteLBFmd7pKkb0%2BFIUyzTF61VKi7YmvP1tw4nEw%3D' (2025-10-15)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/9fcfabe085281dd793589bdc770a2e577a3caa5d?narHash=sha256-f9QC2KKiNReZDG2yyKAtDZh0rSK2Xp1wkPzKbHeQVRU%3D' (2025-09-29)
  → 'github:Mic92/sops-nix/ab8d56e85b8be14cff9d93735951e30c3e86a437?narHash=sha256-8mN3kqyqa2PKY0wwZ2UmMEYMcxvNTwLaOrrDsw6Qi4E%3D' (2025-10-13)
2025-10-18 17:09:08 +02:00
2c195bf807
chore(arr): Use functions 2025-10-13 20:35:46 +02:00
b2e904306b
feat(traefik): Add external services 2025-10-11 15:44:29 +02:00
297a6df29e
feat: Add gitignore 2025-10-11 15:40:43 +02:00
17 changed files with 249 additions and 335 deletions

48
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,48 @@
name: "Build"
on:
pull_request:
push:
env:
RUNNER_TOOL_CACHE: /toolcache
jobs:
determine-hosts:
name: "Determining hosts to build"
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
outputs:
hosts: ${{ steps.hosts.outputs.hostnames }}
steps:
- uses: actions/checkout@v5
- uses: https://github.com/cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: "Determine hosts"
id: hosts
run: |
hostnames="$(nix eval .#nixosConfigurations --apply builtins.attrNames --json)"
printf "hostnames=%s\n" "${hostnames}" >> "${GITHUB_OUTPUT}"
build:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
needs: determine-hosts
strategy:
matrix:
hostname: [
Development
Testing
]
steps:
- uses: actions/checkout@v5
- uses: https://github.com/cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: "Build host"
run: |
nix build ".#nixosConfigurations.${{ matrix.hostname }}.config.system.build.toplevel"

17
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,17 @@
name: "Test"
on:
pull_request:
push:
jobs:
tests:
if: false
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- uses: actions/checkout@v5
- uses: https://github.com/cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: "My custom step"
run: nix run nixpkgs#hello

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
.idea
result

12
flake.lock generated
View file

@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1759381078,
"narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=",
"lastModified": 1760524057,
"narHash": "sha256-EVAqOteLBFmd7pKkb0+FIUyzTF61VKi7YmvP1tw4nEw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7df7ff7d8e00218376575f0acdcc5d66741351ee",
"rev": "544961dfcce86422ba200ed9a0b00dd4b1486ec5",
"type": "github"
},
"original": {
@ -48,11 +48,11 @@
]
},
"locked": {
"lastModified": 1759188042,
"narHash": "sha256-f9QC2KKiNReZDG2yyKAtDZh0rSK2Xp1wkPzKbHeQVRU=",
"lastModified": 1760393368,
"narHash": "sha256-8mN3kqyqa2PKY0wwZ2UmMEYMcxvNTwLaOrrDsw6Qi4E=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "9fcfabe085281dd793589bdc770a2e577a3caa5d",
"rev": "ab8d56e85b8be14cff9d93735951e30c3e86a437",
"type": "github"
},
"original": {

View file

@ -16,6 +16,7 @@
apps = {
speedtest.enable = true;
technitiumDNS.enable = true;
traefik.enable = true;
};
virtualisation.guest.enable = true;
};
@ -76,6 +77,14 @@
};
};
virtualisation.oci-containers.containers.traefik.labels = {
"traefik.http.routers.roxanne.rule" = "Host(`roxanne.depeuter.dev`)";
"traefik.http.services.roxanne.loadbalancer.server.url" = "https://192.168.0.13:8006";
"traefik.http.routers.hugo.rule" = "Host(`hugo.depeuter.dev`)";
"traefik.http.services.hugo.loadbalancer.server.url" = "https://192.168.0.11:444";
};
system.stateVersion = "24.05";
};
}

View file

@ -5,13 +5,12 @@
homelab = {
apps = {
bind9.enable = true;
homepage = {
enable = true;
exposePort = true;
};
traefik.enable = true;
plex.enable = true;
coder = {
enable = true;
accessUrl = "https://code.depeuter.dev";
wildcardAccessUrl = "*.code.depeuter.dev";
};
};
virtualisation.guest.enable = true;
};

View file

@ -5,6 +5,13 @@
homelab = {
apps.gitea.enable = true;
virtualisation.guest.enable = true;
users.admin = {
enable = true;
authorizedKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFrp6aM62Bf7bj1YM5AlAWuNrANU3N5e8+LtbbpmZPKS"
];
};
};
networking = {

View file

@ -68,7 +68,12 @@ prefixLength = 24;
# List services that you want to enable.
services = {
# Enable Nginx as a reverse proxy
nginx = {
nginx = let
nextcloud = {
host = "192.168.0.23";
officePort = 8080;
};
in {
enable = true;
# Use recommended settings
@ -80,7 +85,7 @@ prefixLength = 24;
# Only allow PFS-enabled ciphers with AES256
sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL";
upstreams.docservice.servers."192.168.0.14:8080" = {};
upstreams.docservice.servers."${nextcloud.host}:${toString nextcloud.officePort}" = {};
appendHttpConfig = ''
map $http_x_forwarded_proto $the_scheme {
@ -112,14 +117,14 @@ prefixLength = 24;
forceSSL = true;
locations = {
"/" = {
proxyPass = "http://192.168.0.14";
proxyPass = "http://${nextcloud.host}";
extraConfig = ''
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
fastcgi_request_buffering off;
'';
};
"/office/" = {
proxyPass = "http://192.168.0.14:8080/";
proxyPass = "http://${nextcloud.host}:${toString nextcloud.officePort}/";
priority = 500;
recommendedProxySettings = false;
extraConfig = ''
@ -137,12 +142,6 @@ prefixLength = 24;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
'';
};
"calendar.depeuter.dev" = {
useACMEHost = "depeuter.dev";
locations."/".return = "301 https://cloud.depeuter.dev/apps/calendar";
};
"tasks.depeuter.dev".locations."/".return = "301 https://cloud.depeuter.dev/apps/tasks";
"notes.depeuter.dev".locations."/".return = "301 https://cloud.depeuter.dev/apps/notes";
"home.depeuter.dev" = {
enableACME = true;
@ -158,12 +157,17 @@ prefixLength = 24;
};
};
"jelly.depeuter.dev" = {
"jelly.depeuter.dev" = let
jellyfin = {
host = "192.168.0.94";
port = 8096;
};
in {
enableACME = true;
forceSSL = true;
locations = {
"/" = {
proxyPass = "http://192.168.0.94:8096";
proxyPass = "http://${jellyfin.host}:${toString jellyfin.port}";
extraConfig = ''
# Proxy main Jellyfin traffic
proxy_set_header Host $host;
@ -178,7 +182,7 @@ prefixLength = 24;
'';
};
"/socket" = {
proxyPass = "http://192.168.0.91:8096";
proxyPass = "http://${jellyfin.host}:${toString jellyfin.port}";
extraConfig = ''
# Proxy Jellyfin Websockets traffic
proxy_http_version 1.1;
@ -240,7 +244,7 @@ prefixLength = 24;
locations = {
"/" = {
proxyPass = "http://192.168.0.22:10102";
proxyWebSockets = true;
proxyWebsockets = true;
};
"~ ^/admin".return = 403;
};

View file

@ -9,6 +9,13 @@
name = "Hugo's Vault";
};
virtualisation.guest.enable = true;
users.admin = {
enable = true;
authorizedKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJnihoyozOCnm6T9OzL2xoMeMZckBYR2w43us68ABA93"
];
};
};
networking = {

View file

@ -12,7 +12,16 @@ let
PGID = toString config.users.groups.media.gid;
UMASK = "002";
in {
options.homelab.apps.arr = {
options.homelab.apps.arr = let
mkAppOption = appName: {
enable = lib.mkEnableOption "${appName} using Docker";
exposePorts = lib.mkOption {
type = lib.types.bool;
description = "Expose ${appName} port";
default = cfg.exposePorts;
};
};
in {
enable = lib.mkEnableOption "Arr Stack using Docker";
exposePorts = lib.mkOption {
type = lib.types.bool;
@ -21,46 +30,11 @@ in {
default = ! config.homelab.apps.traefik.enable;
};
bazarr = {
enable = lib.mkEnableOption "Bazarr using Docker";
exposePorts = lib.mkOption {
type = lib.types.bool;
description = "Expose Bazarr port";
default = cfg.exposePorts;
};
};
prowlarr = {
enable = lib.mkEnableOption "Prowlarr using Docker";
exposePorts = lib.mkOption {
type = lib.types.bool;
description = "Expose Prowlarr port";
default = cfg.exposePorts;
};
};
qbittorrent = {
enable = lib.mkEnableOption "qBittorrent using Docker";
exposePorts = lib.mkOption {
type = lib.types.bool;
description = "Expose qBittorrent port";
default = cfg.exposePorts;
};
};
radarr = {
enable = lib.mkEnableOption "Radarr using Docker";
exposePorts = lib.mkOption {
type = lib.types.bool;
description = "Expose Radarr port";
default = cfg.exposePorts;
};
};
sonarr = {
enable = lib.mkEnableOption "Sonarr using Docker";
exposePorts = lib.mkOption {
type = lib.types.bool;
description = "Expose Sonarr port";
default = cfg.exposePorts;
};
};
bazarr = mkAppOption "Bazarr";
prowlarr = mkAppOption "Prowlarr";
qbittorrent = mkAppOption "qBittorrent";
radarr = mkAppOption "Radarr";
sonarr = mkAppOption "Sonarr";
};
config = {
@ -87,9 +61,9 @@ in {
virtualisation.containers.enable = lib.mkIf inUse true;
};
fileSystems = lib.mkIf inUse {
"/srv/bazarr-backup" = lib.mkIf cfg.bazarr.enable {
device = "192.168.0.11:/mnt/BIG/BACKUP/BAZARR";
fileSystems = let
mkFileSystem = device: {
inherit device;
fsType = "nfs";
options = [
"rw"
@ -102,75 +76,14 @@ in {
];
};
"/srv/prowlarr-backup" = lib.mkIf cfg.prowlarr.enable {
device = "192.168.0.11:/mnt/BIG/BACKUP/PROWLARR";
fsType = "nfs";
options = [
"rw"
"auto"
"nfsvers=4.2"
"rsize=1048576" "wsize=1048576"
"hard"
"timeo=600" "retrans=2"
"_netdev" "nosuid" "tcp"
];
};
"/srv/qbittorrent" = lib.mkIf cfg.qbittorrent.enable {
device = "192.168.0.11:/mnt/SMALL/CONFIG/QBITTORRENT";
fsType = "nfs";
options = [
"rw"
"auto"
"nfsvers=4.2"
"rsize=1048576" "wsize=1048576"
"hard"
"timeo=600" "retrans=2"
"_netdev" "nosuid" "tcp"
];
};
"/srv/radarr-backup" = lib.mkIf cfg.radarr.enable {
device = "192.168.0.11:/mnt/BIG/BACKUP/RADARR";
fsType = "nfs";
options = [
"rw"
"auto"
"nfsvers=4.2"
"rsize=1048576" "wsize=1048576"
"hard"
"timeo=600" "retrans=2"
"_netdev" "nosuid" "tcp"
];
};
"/srv/sonarr-backup" = lib.mkIf cfg.sonarr.enable {
device = "192.168.0.11:/mnt/BIG/BACKUP/SONARR";
fsType = "nfs";
options = [
"rw"
"auto"
"nfsvers=4.2"
"rsize=1048576" "wsize=1048576"
"hard"
"timeo=600" "retrans=2"
"_netdev" "nosuid" "tcp"
];
};
"/srv/torrent" = {
device = "192.168.0.11:/mnt/SMALL/MEDIA/TORRENT";
fsType = "nfs";
options = [
"rw"
"auto"
"nfsvers=4.2"
"rsize=1048576" "wsize=1048576"
"hard"
"timeo=600" "retrans=2"
"_netdev" "nosuid" "tcp"
];
};
hugoBackup = "192.168.0.11:/mnt/BIG/BACKUP";
in lib.mkIf inUse {
"/srv/bazarr-backup" = lib.mkIf cfg.bazarr.enable (mkFileSystem "${hugoBackup}/BAZARR");
"/srv/prowlarr-backup" = lib.mkIf cfg.bazarr.enable (mkFileSystem "${hugoBackup}/PROWLARR");
"/srv/qbittorrent" = lib.mkIf cfg.qbittorrent.enable (mkFileSystem "192.168.0.11:/mnt/SMALL/CONFIG/QBITTORRENT");
"/srv/radarr-backup" = lib.mkIf cfg.radarr.enable (mkFileSystem "${hugoBackup}/RADARR");
"/srv/sonarr-backup" = lib.mkIf cfg.sonarr.enable (mkFileSystem "${hugoBackup}/SONARR");
"/srv/torrent" = mkFileSystem "192.168.0.11:/mnt/SMALL/MEDIA/TORRENT";
};
# Make sure the Docker network exists.
@ -195,45 +108,24 @@ in {
};
# Create a user for each app.
users.users = {
bazarr = lib.mkIf cfg.bazarr.enable {
uid = lib.mkForce 3003;
users.users = let
mkUser = uid: {
uid = lib.mkForce uid;
isSystemUser = true;
group = config.users.groups.media.name;
home = "/var/empty";
shell = null;
};
prowlarr = lib.mkIf cfg.prowlarr.enable {
uid = lib.mkForce 3004;
isSystemUser = true;
group = config.users.groups.media.name;
home = "/var/empty";
shell = null;
};
qbittorrent = lib.mkIf cfg.qbittorrent.enable {
uid = lib.mkForce 3005;
isSystemUser = true;
group = config.users.groups.media.name;
in {
bazarr = lib.mkIf cfg.bazarr.enable (mkUser 3003);
prowlarr = lib.mkIf cfg.prowlarr.enable (mkUser 3004);
qbittorrent = lib.mkIf cfg.qbittorrent.enable (mkUser 3005) // {
extraGroups = [
config.users.groups.apps.name
];
home = "/var/empty";
shell = null;
};
radarr = lib.mkIf cfg.radarr.enable {
uid = lib.mkForce 3006;
isSystemUser = true;
group = config.users.groups.media.name;
home = "/var/empty";
shell = null;
};
sonarr = lib.mkIf cfg.sonarr.enable {
uid = lib.mkForce 3007;
isSystemUser = true;
group = config.users.groups.media.name;
home = "/var/empty";
shell = null;
};
radarr = lib.mkIf cfg.radarr.enable (mkUser 3006);
sonarr = lib.mkIf cfg.sonarr.enable (mkUser 3007);
};
virtualisation.oci-containers.containers = let

View file

@ -1,6 +1,6 @@
$TTL 604800
@ IN SOA ns1 admin (
18 ; Serial
15 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
@ -40,9 +40,6 @@ sonarr IN A 192.168.0.33
; Development VM
plex IN A 192.168.0.91
code IN A 192.168.0.91
*.code IN A 192.168.0.91
; Catchalls
*.production IN A 192.168.0.31
*.development IN A 192.168.0.91

View file

@ -1,148 +0,0 @@
{ config, lib, pkgs, ... }:
let
cfg = config.homelab.apps.coder;
postgresUser = "coder";
postgresPassword = "ChangeMe";
postgresDb = "coder";
networkName = "coder";
proxyNet = config.homelab.apps.traefik.sharedNetworkName;
coderVersion = "v2.25.3";
coderDbVersion = "17.6";
in {
options.homelab.apps.coder = {
enable = lib.mkEnableOption "Coder (Docker)";
port = lib.mkOption {
type = lib.types.port;
default = 7080;
description = "Port to expose Coder on.";
};
accessUrl = lib.mkOption {
type = lib.types.str;
description = "The URL to access Coder at.";
};
wildcardAccessUrl = lib.mkOption {
type = lib.types.str;
description = "A wildcard URL to access Coder at (e.g. for workspaces).";
};
db.port = lib.mkOption {
type = lib.types.either lib.types.bool lib.types.port;
default = false;
description = "Port to expose the database on. Set to false to not expose.";
};
};
config = lib.mkIf cfg.enable {
homelab.virtualisation.containers.enable = true;
systemd.services."docker-${networkName}-create-network" = {
description = "Create Docker network for ${networkName}";
requiredBy = [
"docker-coder.service"
"docker-coderDb.service"
];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
script = ''
if ! ${pkgs.docker}/bin/docker network ls | grep -q ${networkName}; then
${pkgs.docker}/bin/docker network create ${networkName}
fi
'';
};
virtualisation.oci-containers.containers = {
coder = let
coderPort = 7080;
in {
hostname = "coder";
image = "ghcr.io/coder/coder:${coderVersion}";
autoStart = true;
dependsOn = [
"coderDb"
];
extraOptions = [
"--group-add" "131" # Add docker group to access the socket
# Modify DNS
"--dns=192.168.0.91"
];
ports = [
"${toString cfg.port}:${toString coderPort}/tcp"
];
networks = [
networkName
proxyNet
];
volumes = [
"/var/run/docker.sock:/var/run/docker.sock"
];
labels = {
"traefik.enable" = "true";
"traefik.docker.network" = proxyNet;
"traefik.http.routers.coder.rule" = "HostRegexp(`.+\.code\.depeuter\.dev`) || Host(`code.depeuter.dev`)";
"traefik.http.services.coder.loadbalancer.server.port" = toString coderPort;
};
environment = {
CODER_PG_CONNECTION_URL = "postgresql://${postgresUser}:${postgresPassword}@coder-db/${postgresDb}?sslmode=disable";
# Required if you are not using the tunnel
CODER_ACCESS_URL = cfg.accessUrl;
CODER_WILDCARD_ACCESS_URL = cfg.wildcardAccessUrl;
CODER_DISABLE_PATH_APPS = "false"; # TODO Enable me!
CODER_HTTP_ADDRESS = "0.0.0.0:${toString coderPort}";
CODER_TLS_ENABLE = "false";
# TODO Enable me!
#CODER_REDIRECT_TO_ACCESS_URL = "true";
# Disable telemetry
CODER_TELEMETRY_ENABLED = "false";
};
};
coderDb = {
hostname = "coder-db";
image = "postgres:${coderDbVersion}";
autoStart = true;
extraOptions = [
''--health-cmd="pg_isready -U ${postgresUser} -d ${postgresDb}"''
"--health-interval=5s"
"--health-timeout=5s"
"--health-retries=5"
];
ports = lib.mkIf cfg.db.port [
"${toString cfg.db.port}:5432/tcp"
];
networks = [
networkName
];
volumes = [
"coder_data:/var/lib/postgresql/data"
];
environment = {
POSTGRES_USER = postgresUser;
POSTGRES_PASSWORD = postgresPassword;
POSTGRES_DB = postgresDb;
};
};
traefik.cmd = [
"--entrypoints.websecure.http.tls.domains[2].main=code.depeuter.dev"
"--entrypoints.websecure.http.tls.domains[2].sans=*.code.depeuter.dev"
];
};
virtualisation.docker.daemon.settings = {
dns = [
"192.168.0.91"
];
};
};
}

View file

@ -4,9 +4,9 @@
./bind9
./calibre
./changedetection
./coder
./freshrss
./gitea
./homepage
./jellyfin
./plex
./speedtest

View file

@ -0,0 +1,79 @@
{ config, lib, ... }:
let
cfg = config.homelab.apps.homepage;
PUID = toString config.users.users.homepage.uid;
PGID = toString config.users.groups.apps.gid;
homepage-config = "/srv/homepage-config";
proxyNet = config.homelab.apps.traefik.sharedNetworkName;
in {
options.homelab.apps.homepage = {
enable = lib.mkEnableOption "homepage";
port = lib.mkOption {
type = lib.types.int;
default = 3000;
description = "homepage WebUI port";
};
exposePort = lib.mkEnableOption "expose homepage port";
};
config = lib.mkIf cfg.enable {
homelab = {
users.apps.enable = true;
virtualisation.containers.enable = true;
};
users.users.homepage = {
uid = lib.mkForce 3018;
isSystemUser = true;
group = config.users.groups.apps.name;
home = "/var/empty";
shell = null;
};
fileSystems."${homepage-config}" = {
device = "192.168.0.11:/mnt/SMALL/CONFIG/HOMEPAGE";
fsType = "nfs";
options = [
"rw"
"auto"
"nfsvers=4.2"
"async" "soft" "timeo=100" "retry=50" "actimeo=1800" "lookupcache=all"
"nosuid" "tcp"
];
};
virtualisation.oci-containers.containers.homepage = let
host = "homepage.${config.networking.domain}";
in {
hostname = "homepage";
image = "ghcr.io/gethomepage/homepage:v1.10.1";
autoStart = true;
user = "${toString PUID}:${toString PGID}";
ports = lib.mkIf cfg.exposePort [
"${toString cfg.port}:3000/tcp"
];
networks = [
proxyNet
];
volumes = [
"${homepage-config}:/app/config"
# "/var/run/docker.sock:/var/run/docker.sock:ro" # For docker integrations
];
labels = {
"traefik.enable" = "true";
"traefik.docker.network" = proxyNet;
"traefik.http.routers.homepage.rule" = "Host(`${host}`)";
"traefik.http.services.homepage.loadbalancer.server.port" = toString cfg.port;
};
environment = {
inherit PUID PGID;
HOMEPAGE_ALLOWED_HOSTS = "${host},192.168.0.91:3000";
};
};
};
}

View file

@ -8,7 +8,7 @@ in {
options.homelab.apps.vaultwarden = {
enable = lib.mkEnableOption "Vaultwarden";
port = lib.mkOption {
type = lib.types.port;
type = lib.types.int;
default = 10102;
description = "Vaultwarden WebUI port";
};

View file

@ -3,24 +3,30 @@
let
cfg = config.homelab.users.admin;
in {
options.homelab.users.admin.enable = lib.mkEnableOption "user System Administrator";
options.homelab.users.admin = {
enable = lib.mkEnableOption "user System Administrator";
authorizedKeys = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [
# HomeLab > NixOS > admin > ssh
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGWIOOEqTy8cWKpENVbzD4p7bsQgQb/Dgpzk8i0dZ00T"
];
};
};
config = lib.mkIf cfg.enable {
nix.settings.trusted-users = [
config.users.users.admin.name
config.users.users.gh0st.name
];
users.users.admin = {
users.users.gh0st = {
description = "System Administrator";
isNormalUser = true;
extraGroups = [
config.users.groups.wheel.name # Enable 'sudo' for the user.
];
initialPassword = "ChangeMe";
openssh.authorizedKeys.keys = [
# HomeLab > NixOS > admin > ssh
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGWIOOEqTy8cWKpENVbzD4p7bsQgQb/Dgpzk8i0dZ00T"
];
openssh.authorizedKeys.keys = cfg.authorizedKeys;
packages = with pkgs; [
curl
git

View file

@ -13,13 +13,8 @@ in {
"docker" # Allow access to the docker socket.
];
openssh.authorizedKeys.keys = [
# TODO ChangeMe
# Tibo-NixFat
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPrG+ldRBdCeHEXrsy/qHXIJYg8xQXVuiUR0DxhFjYNg"
# Hugo
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDAxR813vqq5zbu1NHrIybu5Imlu3k0rDCGxHiuGEhPoVV9c5FpnKNGLCi3ctm15ZcVBX4HcponYsKRBsCzM2pI4uXjxhHkLzbss5LttFuSzv5v/QHfLW1bvyJEMBEPxguGqAydAeWrBFdI9uHBEXeb325uKxMKBZHYvvpyAQ115c1wKy1bL8BfR0LTkhsFqexRvI86q59AVrAU/KFf6RXO0T9QA6H/vyWLlIPc7Ta+tSWwQ68bMmS5Pwn8q58tOAOAd6Lpt4TqUDJSppPjLEPKyKC6ShwMdEjwmwpEG0hxfsvaU8XERyQbSbEE9sLHRA2LoEdtMx3J8nzX3AwYUNspsqIv6NQZksnVqJ8OfL45ngUFcSJ6kBsUvCZfzEUGUTJ6Js0v84NOIXxNG/ZfPsk6ArXm3dvj2TYeK8llO6wpJnMMyztmmiODWoj9tepZSij44IgVM5wdWYIK/RZoYTsCQbmvJFfB8jhyJnf/7F19Vo5+LwhmCOsQh/KEK0F1DVc= admin@Hugo"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICms6vjhE9kOlqV5GBPGInwUHAfCSVHLI2Gtzee0VXPh"
];
};
};