Flake lock file updates:
• Updated input 'nixpkgs':
'github:nixos/nixpkgs/cf5e76507c6e23b59f7e0ffcc7baa2a39ddd8442' (2026-09-27)
→ 'github:nixos/nixpkgs/7c8764b7c7b09b34f632464276218ef9090eaa11' (2026-10-08)
• Updated input 'nixpkgs-unstable':
'github:nixos/nixpkgs/419fe0f449b3fbe3bdd53d9840288db4509ec32e' (2026-09-28)
→ 'github:nixos/nixpkgs/39ad350a0602fa0a58a544344e3e9187526ea45c' (2026-10-07)
• Updated input 'sops-nix':
'github:Mic92/sops-nix/5efb5a6f4f5ab192817d28557dd4d650fa14d866' (2026-09-27)
→ 'github:Mic92/sops-nix/dcd241ba97088c22569d1573286e1b9daad340c0' (2026-10-04)
59 lines
1.7 KiB
Nix
59 lines
1.7 KiB
Nix
{ pkgs, ... }:
|
|
|
|
let
|
|
version = "v0.2.0-rc2";
|
|
spaceapidSrc = pkgs.fetchgit {
|
|
url = "https://git.hamburg.ccc.de/CCCHH/spaceapid.git";
|
|
rev = version;
|
|
hash = "sha256-FW6ag7I46261K6Fj014v1IpFx9S0gOPuclcJTHt6Ze0=";
|
|
};
|
|
spaceapid = pkgs.buildGo127Module rec {
|
|
pname = "spaceapid";
|
|
inherit version;
|
|
|
|
src = spaceapidSrc;
|
|
|
|
ldflags = [
|
|
"-X main.version=${version}"
|
|
];
|
|
|
|
# Since spaceapid doesn't have any dependencies, we can set this to null and
|
|
# use the nonexistend vendored dependencies.
|
|
vendorHash = null;
|
|
};
|
|
spaceapidConfigResponse = pkgs.writeText "spaceapid-config-ccchh-response.json" (builtins.readFile spaceapid-config/ccchh-response.json);
|
|
spaceapidConfigDynamic = pkgs.writeText "spaceapid-config-ccchh-dynamic.json" (builtins.readFile spaceapid-config/ccchh-dynamic.json);
|
|
in
|
|
{
|
|
|
|
|
|
users.users.spaceapi = {
|
|
isSystemUser = true;
|
|
group = "spaceapi";
|
|
};
|
|
users.groups.spaceapi = { };
|
|
|
|
systemd.services.spaceapid = {
|
|
enable = true;
|
|
description = "Daemon hosting the SpaceAPI";
|
|
unitConfig = {
|
|
Wants = [ "network-online.target" ];
|
|
After = [ "network.target" "network-online.target" ];
|
|
};
|
|
serviceConfig = {
|
|
ExecStart = "${spaceapid}/bin/spaceapid -c ${spaceapidConfigResponse},${spaceapidConfigDynamic},/run/secrets/spaceapid_config_ccchh_credentials";
|
|
User = "spaceapi";
|
|
Group = "spaceapi";
|
|
Restart = "on-failure";
|
|
StateDirectory = "spaceapid";
|
|
};
|
|
wantedBy = [ "multi-user.target" ];
|
|
};
|
|
|
|
sops.secrets."spaceapid_config_ccchh_credentials" = {
|
|
mode = "0440";
|
|
owner = "spaceapi";
|
|
group = "spaceapi";
|
|
restartUnits = [ "spaceapid.service" ];
|
|
};
|
|
}
|