From 98bb6c568f54ffc3ff53ce69a3257d2d16e16f34 Mon Sep 17 00:00:00 2001 From: yukkop Date: Sat, 6 Jun 2026 23:01:57 +0000 Subject: [PATCH] chore(`package`): `gitea`: verify heatmap package build --- lib/default.nix | 22 +++++++++++++------ nixos/module/default.nix | 4 ++-- nixos/module/generic/matrix-cluster-users.nix | 3 ++- nixos/module/hectic/service/sentinèlla.nix | 2 +- .../bfs.poland.xray/bfs.poland.xray.nix | 15 +++++++------ nixos/system/hectic-lab/hectic-lab.nix | 2 +- 6 files changed, 29 insertions(+), 19 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index afeaba58..03a85f99 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -187,19 +187,27 @@ in { readModulesRecursive' = path: extraArgs: with lib; with builtins; let - paths = pipe "${path}" [ - (filesystem.listFilesRecursive) - (filter (hasSuffix ".nix")) - ]; + collectPaths = dir: prefix: + concatLists (mapAttrsToList (name: type: let + path' = dir + "/${name}"; + name' = if prefix == "" then name else "${prefix}/${name}"; + in + if type == "directory" + then collectPaths path' name' + else [{ + inherit path'; + name = name'; + }] + ) (readDir dir)); + paths = filter (path': hasSuffix ".nix" path'.name) (collectPaths path ""); pathToName = flip pipe [ - (removePrefix "${path}/") (replaceStrings ["/" ".nix"] ["." ""]) (removeSuffix ".nix") ]; attrList = map (path': { - name = pathToName (unsafeDiscardStringContext path'); - value = import path' extraArgs; + name = pathToName path'.name; + value = import path'.path' extraArgs; }) paths; in diff --git a/nixos/module/default.nix b/nixos/module/default.nix index b082c703..5f67b6c0 100644 --- a/nixos/module/default.nix +++ b/nixos/module/default.nix @@ -9,11 +9,11 @@ with self.lib; let # Combine hectic modules into one hectic.imports = attrValues ( - readModulesRecursive' ./hectic { inherit flake self inputs; } + readModulesRecursive' (flake + "/nixos/module/hectic") { inherit flake self inputs; } ); # Read generic modules separately generic = readModulesRecursive' - ./generic + (flake + "/nixos/module/generic") { inherit flake self inputs; }; in generic // { inherit hectic; diff --git a/nixos/module/generic/matrix-cluster-users.nix b/nixos/module/generic/matrix-cluster-users.nix index 8aced07d..1b6dcedd 100644 --- a/nixos/module/generic/matrix-cluster-users.nix +++ b/nixos/module/generic/matrix-cluster-users.nix @@ -18,6 +18,7 @@ ]; adminNames = [ "yukkop" ]; + matrixClusterSopsFile = flake + "/sus/matrix-cluster.yaml"; cfg = config.hectic.generic.matrix-cluster; in { @@ -39,7 +40,7 @@ in { value = { key = "matrix/users/${name}/password"; owner = "matrix-synapse"; - sopsFile = "${flake}/sus/matrix-cluster.yaml"; + sopsFile = matrixClusterSopsFile; }; }) userNames ); diff --git a/nixos/module/hectic/service/sentinèlla.nix b/nixos/module/hectic/service/sentinèlla.nix index 01a881f8..c8d694fb 100644 --- a/nixos/module/hectic/service/sentinèlla.nix +++ b/nixos/module/hectic/service/sentinèlla.nix @@ -147,7 +147,7 @@ in { (lib.mkIf cfg.watcher.enable { sops.secrets."sentinèlla/watcher/environment" = lib.mkDefault { - sopsFile = "${flake}/sus/sentinella-default.yaml"; + sopsFile = flake + "/sus/sentinella-default.yaml"; }; systemd.services."sentinella-watcher" = { diff --git a/nixos/system/bfs.poland.xray/bfs.poland.xray.nix b/nixos/system/bfs.poland.xray/bfs.poland.xray.nix index 7dd1e00e..a727fd1f 100644 --- a/nixos/system/bfs.poland.xray/bfs.poland.xray.nix +++ b/nixos/system/bfs.poland.xray/bfs.poland.xray.nix @@ -14,6 +14,7 @@ jitsiHost = "meet.accord.tube"; elementEntryDomain = "element.bfs.band"; polandEntryDomain = "bfs.band"; + matrixClusterSopsFile = flake + "/sus/matrix-cluster.yaml"; backendProxyConfig = '' proxy_ssl_server_name on; proxy_ssl_name ${matrixHost}; @@ -203,41 +204,41 @@ in { key = "matrix/signing-key"; owner = "matrix-synapse"; mode = "0400"; - sopsFile = "${flake}/sus/matrix-cluster.yaml"; + sopsFile = matrixClusterSopsFile; }; sops.secrets."matrix/postgres-replication-password" = { key = "matrix/postgres-replication-password"; owner = "postgres"; mode = "0400"; - sopsFile = "${flake}/sus/matrix-cluster.yaml"; + sopsFile = matrixClusterSopsFile; }; sops.secrets."matrix/object-storage/credentials" = { key = "matrix/object-storage/credentials"; owner = "matrix-synapse"; mode = "0400"; - sopsFile = "${flake}/sus/matrix-cluster.yaml"; + sopsFile = matrixClusterSopsFile; }; sops.secrets."matrix/secrets" = { key = "matrix/secrets"; owner = "matrix-synapse"; mode = "0400"; - sopsFile = "${flake}/sus/matrix-cluster.yaml"; + sopsFile = matrixClusterSopsFile; }; sops.secrets."matrix/turn-secret" = { key = "matrix/turn-secret"; owner = "turnserver"; group = "turnserver"; mode = "0400"; - sopsFile = "${flake}/sus/matrix-cluster.yaml"; + sopsFile = matrixClusterSopsFile; }; sops.secrets."matrix/porkbun-api-key" = { key = "matrix/porkbun-api-key"; mode = "0400"; - sopsFile = "${flake}/sus/matrix-cluster.yaml"; + sopsFile = matrixClusterSopsFile; }; sops.secrets."matrix/porkbun-secret-api-key" = { key = "matrix/porkbun-secret-api-key"; mode = "0400"; - sopsFile = "${flake}/sus/matrix-cluster.yaml"; + sopsFile = matrixClusterSopsFile; }; } diff --git a/nixos/system/hectic-lab/hectic-lab.nix b/nixos/system/hectic-lab/hectic-lab.nix index 3eb763de..3d3abffb 100644 --- a/nixos/system/hectic-lab/hectic-lab.nix +++ b/nixos/system/hectic-lab/hectic-lab.nix @@ -116,7 +116,7 @@ in { sops = { gnupg.sshKeyPaths = [ ]; age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; - defaultSopsFile = "${flake}/sus/hectic-lab.yaml"; + defaultSopsFile = flake + "/sus/hectic-lab.yaml"; secrets = builtins.listToAttrs (map mkMailPasswordSecret mailUserNames) // { "init-postgresql" = { key = "init-postgresql";