# SPDX-FileCopyrightText: 2026 Nitesh Kumar Debnath # # SPDX-License-Identifier: GPL-3.0-or-later # # This is a homelab skeleton, please look at modules to see # what the homelabs actually use { lib, config, ... }: let module = config.flake.modules.nixos.homelab; in { flake.modules.nixos.homelab = { config, pkgs, ... }: let port = config.services.nix-serve.port |> lib.toString; username = config.services.atticd.user; hostname = "cache.curlew-rankine.ts.net"; in { # All homelabs will serve their nix stores # load balanced by tailscale # assuming I ever get more than one homelabs lol services.atticd = { enable = true; environmentFile = "/var/lib/attic/environment"; settings = { database.url = "postgresql://${username}?host=/run/postgresql"; allowed-hosts = [ hostname ]; api-endpoint = "https://${hostname}/"; }; }; services.postgresql = { ensureDatabases = [ username ]; ensureUsers = [ { name = username; ensureDBOwnership = true; } ]; }; # SSH based user for github runners # will be used as an allowed user users.users."gh-runner" = { isSystemUser = true; shell = pkgs.bashInteractive; group = "gh-runner"; }; users.groups."gh-runner" = { }; nix.settings.trusted-users = [ "gh-runner" ]; services.tailscale.serve = { enable = false; # TODO: > must be a URL starting with one of the supported schemes: [tcp unix] # they literally do not support the config they export # what a joke services.cache.endpoints."tcp:443" = "tls-terminated-tcp://localhost:${port}"; }; }; flake.modules.nixos = { disko-elysium.imports = [ module ]; pc = { pkgs, ... }: { environment.systemPackages = [ pkgs.attic-client ]; }; }; }