Compare commits

...

7 commits

11 changed files with 49 additions and 65 deletions

View file

@ -15,6 +15,7 @@ in
services.atticd = { services.atticd = {
enable = true; enable = true;
package = depot.inputs.attic.packages.attic-server;
credentialsFile = secrets.serverToken.path; credentialsFile = secrets.serverToken.path;

View file

@ -0,0 +1,5 @@
{ depot, ... }:
{
services.kanidm.package = depot.packages.kanidm;
}

View file

@ -22,8 +22,12 @@
client-soda = [ "soda" ]; client-soda = [ "soda" ];
}; };
nixos = { nixos = {
server = ./server.nix; server = [
./common.nix
./server.nix
];
client = [ client = [
./common.nix
./client.nix ./client.nix
./modules/idm-nss-ready.nix ./modules/idm-nss-ready.nix
./modules/idm-tmpfiles.nix ./modules/idm-tmpfiles.nix

View file

@ -1,40 +0,0 @@
{ config, lib, depot, ... }:
let
inherit (depot.lib.meta) domain;
apiAddr = "api.${domain}";
proxyTarget = config.links.api.url;
proxy = depot.lib.nginx.vhosts.proxy proxyTarget;
in
{
# n8n uses "Sustainable Use License"
nixpkgs.config.allowUnfree = true;
links.api.protocol = "http";
services.n8n = {
enable = true;
webhookUrl = "https://${apiAddr}";
settings = {
inherit (config.links.api) port;
};
};
systemd.services.n8n.environment = {
N8N_LISTEN_ADDRESS = "127.0.0.1";
N8N_ENDPOINT_WEBHOOK = "api";
N8N_ENDPOINT_WEBHOOK_TEST = "test";
};
services.nginx.virtualHosts."${apiAddr}" = lib.recursiveUpdate proxy {
locations."/api" = {
proxyPass = proxyTarget;
extraConfig = "auth_request off;";
};
locations."/test" = {
proxyPass = proxyTarget;
extraConfig = "auth_request off;";
};
};
services.oauth2-proxy.nginx.virtualHosts.${apiAddr} = { };
}

View file

@ -15,7 +15,6 @@
depot.inputs.mms.module depot.inputs.mms.module
# Services # Services
./services/api
./services/backbone-routing ./services/backbone-routing
./services/bitwarden ./services/bitwarden
./services/cdn-shield ./services/cdn-shield

View file

@ -1,4 +1,4 @@
{ config, lib, ... }: { config, lib, withSystem, ... }:
let let
inherit (lib) mapAttrs nixosSystem; inherit (lib) mapAttrs nixosSystem;
@ -6,8 +6,12 @@ let
mkNixOS = name: host: nixosSystem { mkNixOS = name: host: nixosSystem {
specialArgs = config.lib.summon name lib.id; specialArgs = config.lib.summon name lib.id;
inherit (host) system; modules = [
modules = [ host.nixos ] ++ config.cluster.config.out.injectNixosConfig name; host.nixos
(withSystem host.system ({ config, pkgs, ... }: {
nixpkgs.pkgs = pkgs // config.shadows;
}))
] ++ config.cluster.config.out.injectNixosConfig name;
}; };
in { in {
flake.nixosConfigurations = mapAttrs mkNixOS (gods.fromLight // gods.fromFlesh); flake.nixosConfigurations = mapAttrs mkNixOS (gods.fromLight // gods.fromFlesh);

View file

@ -1,18 +0,0 @@
{
nixpkgs.overlays = [
(self: super:
(let
patched = import ../../packages/patched-derivations.nix super;
in {
inherit (patched)
kanidm
prometheus-jitsi-exporter
;
jre_headless = patched.jre17_standard;
})
)
];
}

View file

@ -0,0 +1,9 @@
{ depot, lib, ... }:
{
imports = [
depot.inputs.nixpkgs.nixosModules.readOnlyPkgs
];
nixpkgs.overlays = lib.mkForce [];
}

View file

@ -6,7 +6,6 @@ in
{ {
flake.nixosModules = with config.flake.nixosModules; { flake.nixosModules = with config.flake.nixosModules; {
autopatch = ./autopatch;
ascensions = ./ascensions; ascensions = ./ascensions;
consul-distributed-services = ./consul-distributed-services; consul-distributed-services = ./consul-distributed-services;
consul-service-registry = ./consul-service-registry; consul-service-registry = ./consul-service-registry;
@ -23,6 +22,7 @@ in
networking = ./networking; networking = ./networking;
nix-builder = ./nix-builder; nix-builder = ./nix-builder;
nix-config-server = ./nix-config/server.nix; nix-config-server = ./nix-config/server.nix;
nixpkgs-config = ./nixpkgs-config;
nix-register-flakes = ./nix-register-flakes; nix-register-flakes = ./nix-register-flakes;
patroni = ./patroni; patroni = ./patroni;
port-magic = ./port-magic; port-magic = ./port-magic;
@ -34,10 +34,10 @@ in
tested = ./tested; tested = ./tested;
machineBase = group [ machineBase = group [
autopatch
enterprise enterprise
maintenance maintenance
minimal minimal
nixpkgs-config
port-magic port-magic
ssh ssh
systemd-extras systemd-extras

View file

@ -9,6 +9,7 @@ in {
./projects.nix ./projects.nix
./patched-inputs.nix ./patched-inputs.nix
./catalog ./catalog
./shadows.nix
]; ];
perSystem = { pkgs, self', system, ... }: let perSystem = { pkgs, self', system, ... }: let
patched-derivations = import ./patched-derivations.nix (pkgs // { flakePackages = self'.packages; }); patched-derivations = import ./patched-derivations.nix (pkgs // { flakePackages = self'.packages; });

19
packages/shadows.nix Normal file
View file

@ -0,0 +1,19 @@
{ lib, ... }:
{
perSystem = { inputs', self', ... }: {
# much like overlays, shadows can *shadow* packages in nixpkgs
# unlike overlays, shadows don't cause a nixpkgs re-evaluation
# this is a hack for dealing with poorly written NixOS modules
# that don't provide a `package` option to perform overrides
options.shadows = lib.mkOption {
type = with lib.types; lazyAttrsOf package;
default = {
inherit (self'.packages)
kanidm
;
};
};
};
}