initial migration

This commit is contained in:
Chris Kruining 2026-03-24 14:09:46 +00:00
parent 01fb98ba10
commit 59a1fbaf0f
54 changed files with 522 additions and 613 deletions

View file

@ -1,5 +1,4 @@
{
inputs,
lib,
config,
namespace,
@ -9,8 +8,6 @@
cfg = config.${namespace}.services.authentication.himmelblau;
in {
imports = [inputs.himmelblau.nixosModules.himmelblau];
options.${namespace}.services.authentication.himmelblau = {
enable = mkEnableOption "enable azure entra ID authentication";
};

View file

@ -1,7 +1,7 @@
{ config, lib, pkgs, namespace, system, inputs, ... }:
{ config, lib, pkgs, namespace, system, terranixLib, sneeuwvlokLib, ... }:
let
inherit (lib) mkIf mkEnableOption mkOption types toUpper toSentenceCase nameValuePair mapAttrs mapAttrs' concatMapAttrs concatMapStringsSep filterAttrsRecursive listToAttrs imap0 head drop length literalExpression attrNames;
inherit (lib.${namespace}.strings) toSnakeCase;
inherit (sneeuwvlokLib.strings) toSnakeCase;
cfg = config.${namespace}.services.authentication.zitadel;
@ -339,7 +339,7 @@ in
config' = config;
# this is a nix package, the generated json file to be exact
terraformConfiguration = inputs.terranix.lib.terranixConfiguration {
terraformConfiguration = terranixLib.terranixConfiguration {
inherit system;
modules = [
@ -576,7 +576,7 @@ in
let
tofu = lib.getExe pkgs.opentofu;
in
''
lib.replaceStrings ["\r"] [""] ''
if [ "$(systemctl is-active zitadel)" != "active" ]; then
echo "Zitadel is not running"
exit 1

View file

@ -1,5 +1,4 @@
{
inputs,
config,
lib,
pkgs,
@ -11,10 +10,6 @@
cfg = config.${namespace}.services.games.minecraft;
in {
imports = [
inputs.nix-minecraft.nixosModules.minecraft-servers
];
options.${namespace}.services.games.minecraft = {
enable = mkEnableOption "Minecraft";

View file

@ -2,7 +2,6 @@
config,
lib,
namespace,
inputs,
system,
...
}: let
@ -10,10 +9,6 @@
cfg = config.${namespace}.services.media.mydia;
in {
imports = [
inputs.mydia.nixosModules.default
];
options.${namespace}.services.media.mydia = {
enable = mkEnableOption "Enable Mydia";
};

View file

@ -3,8 +3,8 @@
config,
lib,
namespace,
inputs,
system,
terranixLib,
...
}: let
inherit (builtins) toString;
@ -155,7 +155,7 @@ in {
config' = config;
lib' = lib;
terraformConfiguration = inputs.terranix.lib.terranixConfiguration {
terraformConfiguration = terranixLib.terranixConfiguration {
inherit system;
modules = [
@ -341,11 +341,11 @@ in {
}
'';
script = ''
script = lib.replaceStrings ["\r"] [""] ''
# Sleep for a bit to give the service a chance to start up
sleep 5s
if [ "$(systemctl is-active "${service}")" != "active" ]; then
if [ "$(systemctl is-active ${lib.escapeShellArg service})" != "active" ]; then
echo "${service} is not running"
exit 1
fi

View file

@ -10,25 +10,22 @@
cfg = config.${namespace}.services.networking.caddy;
hasHosts = (cfg.hosts |> attrNames |> length) > 0;
caddyBase = pkgs.callPackage "${pkgs.path}/pkgs/by-name/ca/caddy/package.nix" {
buildGo125Module = pkgs.buildGo126Module;
caddy = caddyBase;
caddyPackage = pkgs.caddy.withPlugins {
plugins = ["github.com/corazawaf/coraza-caddy/v2@v2.1.0"];
hash = "sha256-rsDnTunR8C7hVOX5aKcba+iFYHbpWek65DZgbMxOdTs=";
};
caddyPackage =
caddyBase.withPlugins {
plugins = ["github.com/corazawaf/coraza-caddy/v2@v2.1.0"];
hash = "sha256-pSXjLaZoRtKV3eFl2ySRSjl3yxi514G1Cb7pfrpxxtE=";
};
in {
options.${namespace}.services.networking.caddy = {
enable = mkEnableOption "enable caddy" // {default = true;};
hosts = mkOption {
type = types.attrsOf types.str;
default = {};
};
extraConfig = mkOption {
type = types.str;
default = "";
};
};

View file

@ -3,6 +3,8 @@
config,
lib,
namespace,
repoRoot,
sneeuwvlokLib,
...
}: let
inherit (builtins) toString;
@ -26,7 +28,7 @@
});
databaseProviderPostgresql = types.submodule ({...}: let
urlOptions = lib.${namespace}.options.mkUrlOptions {
urlOptions = sneeuwvlokLib.options.mkUrlOptions {
host = {
description = ''
Hostname of the postgresql server
@ -118,7 +120,7 @@ in {
enable = true;
dbBackend = "postgresql";
package = pkgs.${namespace}.vaultwarden;
package = pkgs.callPackage (repoRoot + "/packages/vaultwarden/default.nix") {};
config = {
SIGNUPS_ALLOWED = false;
@ -196,7 +198,7 @@ in {
else if type == "postgresql"
then {
inherit (db) type;
url = lib.${namespace}.strings.toUrl {
url = sneeuwvlokLib.strings.toUrl {
inherit (db) protocol host port;
path = "vaultwarden";
query = {