WIP: add customer-portal module

This commit is contained in:
Chris Kruining 2025-09-23 16:18:19 +02:00
parent 25024f7fbd
commit 36629f6d02
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
6 changed files with 242 additions and 5 deletions

View file

View file

@ -0,0 +1,35 @@
{ ... }:
let
inherit (builtins) readFile;
in
{
_class = "clan.service";
manifest = {
name = "amarth-services/customer-portal";
description = "Service to host Amarth Cloud's customer-portal";
categories = [ "System" "Network" "Containers" "Virtualisation" ];
readme = readFile ./README.md;
};
#==============================================================================================================
# Server configuration
#==============================================================================================================
roles.server = {
interface = { lib, ... }:
let
inherit (lib) mkOption types toString;
in
{
options = {};
};
perInstance = { instanceName, settings, machine, roles, ... }: {
nixosModule = { config, pkgs, ... }: {
services.amarth-customer-portal = {
enable = true;
};
};
};
};
}

View file

@ -0,0 +1,15 @@
{ ... }:
let
module = ./default.nix;
in
{
clan.modules.customer-portal = module;
perSystem = { ... }: {
clan.nixosTests.customer-portal = {
imports = [ ./tests/vm/default.nix ];
clan.modules."@amarth/customer-portal" = module;
};
};
}

View file

@ -0,0 +1,37 @@
{ pkgs, ... }:
{
name = "service-customer-portal";
clan = {
directory = ./.;
inventory = {
machines = {
node1 = {};
};
instances = {
customer-portal = {
module = {
name = "@amarth/customer-portal";
input = "self";
};
roles.server.machines."node1" = {};
};
};
};
machines = {
node1 = {};
};
};
nodes = {
node1 = {};
};
testScript = ''
start_all()
'';
}

156
flake.lock generated
View file

@ -1,5 +1,76 @@
{
"nodes": {
"amarth-customer-portal": {
"inputs": {
"bun2nix": "bun2nix",
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1758634522,
"narHash": "sha256-Y5J+yCAbNZnPhrCvrTjhGUTD5amONxH/R/MGqwm0uIc=",
"ref": "refs/heads/main",
"rev": "e7b0307690730781d9908cf3a48b9081b9ffe87c",
"revCount": 23,
"type": "git",
"url": "https://git.amarth.cloud/amarth/customer-portal"
},
"original": {
"type": "git",
"url": "https://git.amarth.cloud/amarth/customer-portal"
}
},
"blueprint": {
"inputs": {
"nixpkgs": [
"amarth-customer-portal",
"bun2nix",
"nixpkgs"
],
"systems": [
"amarth-customer-portal",
"bun2nix",
"systems"
]
},
"locked": {
"lastModified": 1744632722,
"narHash": "sha256-0chvqUV1Kzf8BMQ7MsH3CeicJEb2HeCpwliS77FGyfc=",
"owner": "numtide",
"repo": "blueprint",
"rev": "49bbd5d072b577072f4a1d07d4b0621ecce768af",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "blueprint",
"type": "github"
}
},
"bun2nix": {
"inputs": {
"blueprint": "blueprint",
"nixpkgs": [
"amarth-customer-portal",
"nixpkgs"
],
"systems": "systems",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1758108094,
"narHash": "sha256-ZO7dOTEipchkK/2mX6uAGbe6zQXnvHr40ri6jOztNR4=",
"owner": "baileyluTCD",
"repo": "bun2nix",
"rev": "72c047583edc83e2c2eada6e348dfaa622781331",
"type": "github"
},
"original": {
"owner": "baileyluTCD",
"repo": "bun2nix",
"type": "github"
}
},
"clan-core": {
"inputs": {
"data-mesher": "data-mesher",
@ -14,8 +85,8 @@
"nixpkgs"
],
"sops-nix": "sops-nix",
"systems": "systems",
"treefmt-nix": "treefmt-nix"
"systems": "systems_2",
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
"lastModified": 1758121565,
@ -78,6 +149,27 @@
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"amarth-customer-portal",
"nixpkgs"
]
},
"locked": {
"lastModified": 1756770412,
"narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "4524271976b625a4a605beefd893f270620fd751",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
@ -147,6 +239,22 @@
}
},
"nixpkgs": {
"locked": {
"lastModified": 1758035966,
"narHash": "sha256-qqIJ3yxPiB0ZQTT9//nFGQYn8X/PBoJbofA7hRKZnmE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8d4ddb19d03c65a36ad8d189d001dc32ffb0306b",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1757745802,
"narHash": "sha256-hLEO2TPj55KcUFUU1vgtHE9UEIOjRcH/4QbmfHNF820=",
@ -164,10 +272,11 @@
},
"root": {
"inputs": {
"amarth-customer-portal": "amarth-customer-portal",
"clan-core": "clan-core",
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs",
"systems": "systems_2"
"flake-parts": "flake-parts_2",
"nixpkgs": "nixpkgs_2",
"systems": "systems_3"
}
},
"sops-nix": {
@ -221,7 +330,44 @@
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"amarth-customer-portal",
"bun2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1748243702,
"narHash": "sha256-9YzfeN8CB6SzNPyPm2XjRRqSixDopTapaRsnTpXUEY8=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "1f3f7b784643d488ba4bf315638b2b0a4c5fb007",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"treefmt-nix_2": {
"inputs": {
"nixpkgs": [
"clan-core",

View file

@ -15,6 +15,10 @@
inputs.flake-parts.follows = "flake-parts";
};
amarth-customer-portal = {
url = "git+https://git.amarth.cloud/amarth/customer-portal";
};
systems = {
url = "github:nix-systems/default";
};