# SPDX-FileCopyrightText: 2025 Nitesh Kumar Debnath # # SPDX-License-Identifier: GPL-3.0-or-later { flake.modules.nixos.vps = { modulesPath, lib, pkgs, config, ... }: let inherit (config.services.bind) domain_name; in { imports = [ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/profiles/qemu-guest.nix") ]; nix.settings.substituters = [ "https://nix-community.cachix.org" ]; nix.settings.trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; services.cloud-init = { enable = true; network.enable = true; }; networking.useNetworkd = true; # Firewalls networking.nftables.enable = true; environment.systemPackages = map lib.lowPrio [ pkgs.btop pkgs.curl pkgs.gitMinimal pkgs.helix pkgs.openssl ]; # services.authentik = { # # other authentik options as in the example configuration at the top # enable = true; # # The environmentFile needs to be on the target host! # # Best use something like sops-nix or agenix to manage it # environmentFile = config.sops.secrets.authentik-env.path; # settings = { # disable_startup_analytics = true; # avatars = "initials"; # }; # nginx = { # enable = true; # enableACME = true; # host = "auth.${domain_name}"; # }; # }; sops.secrets.authentik-env = { sopsFile = ../secrets/authentik.env; format = "dotenv"; }; services.nginx.enable = true; services.nginx.virtualHosts = { "tacker.${domain_name}" = { enableACME = true; addSSL = true; locations."/" = { root = "/var/www/tacker"; }; }; }; nix.gc = { automatic = true; dates = "weekly"; options = "--delete-older-than 7d"; }; system.autoUpgrade = { enable = true; flake = "git+https://codeberg.org/nitdn/nixos-machine.git"; allowReboot = true; }; boot.loader.grub = { # no need to set devices, disko will add all devices that have a EF02 partition to the list already # devices = [ ]; efiSupport = true; efiInstallAsRemovable = true; }; system.stateVersion = "24.11"; }; }