Skip to content

Commit 30649b0

Browse files
committed
feat: soft-serve
ssh git.elyth.xyz
1 parent a400822 commit 30649b0

3 files changed

Lines changed: 78 additions & 6 deletions

File tree

‎annas-arch-a44489c5d6e7.pdf‎

-9.5 MB
Binary file not shown.

‎hosts/mithrix/home.nix‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,21 @@
4747
booklore.enable = true;
4848
ephemera.enable = true;
4949
# lidify.enable = true;
50-
koito.enable = true;
51-
twitch.enable = true;
52-
traefik = {
53-
enable = true;
54-
domain = "elyth.xyz";
55-
};
50+
koito.enable = true;
51+
twitch.enable = true;
52+
softserve = {
53+
enable = true;
54+
initialAdminPublicKeyFile = "${config.home.homeDirectory}/.ssh/id_default.pub";
55+
repos = {
56+
flake = "https://github.com/elythh/flake.git";
57+
nvim = "https://github.com/elythh/nvim.git";
58+
mithrix = "https://github.com/elythh/mithrix.git";
59+
};
60+
};
61+
traefik = {
62+
enable = true;
63+
domain = "elyth.xyz";
64+
};
5665
};
5766
};
5867
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
config,
3+
lib,
4+
...
5+
}: let
6+
optionName = "softserve";
7+
containerName = "soft-serve";
8+
cfg = config.meadow.stacks.${optionName};
9+
storage = "${config.meadow.stacks.storageBaseDir}/${containerName}";
10+
in {
11+
options.meadow.stacks.${optionName} = {
12+
enable = lib.mkEnableOption containerName;
13+
repos = lib.mkOption {
14+
type = lib.types.attrsOf lib.types.str;
15+
default = {};
16+
description = "Repositories to mirror into Soft Serve (name = clone URL).";
17+
};
18+
initialAdminPublicKey = lib.mkOption {
19+
type = lib.types.nullOr lib.types.str;
20+
default = null;
21+
description = "SSH public key used for Soft Serve first-run admin bootstrap.";
22+
};
23+
initialAdminPublicKeyFile = lib.mkOption {
24+
type = lib.types.nullOr lib.types.str;
25+
default = null;
26+
description = "Path to SSH public key file for Soft Serve first-run admin bootstrap.";
27+
};
28+
syncInterval = lib.mkOption {
29+
type = lib.types.str;
30+
default = "30m";
31+
description = "How often to sync public GitHub repositories into Soft Serve.";
32+
};
33+
};
34+
35+
config = lib.mkIf cfg.enable {
36+
services.podman.containers.${containerName} = {
37+
image = "docker.io/charmcli/soft-serve:latest";
38+
volumes = [
39+
"${storage}/data:/data"
40+
] ++ lib.optional (cfg.initialAdminPublicKeyFile != null) "${cfg.initialAdminPublicKeyFile}:/tmp/initial_admin_key.pub:ro";
41+
ports = ["22:23231"];
42+
environment =
43+
{
44+
SOFT_SERVE_DATA_PATH = "/data";
45+
}
46+
// lib.optionalAttrs (cfg.initialAdminPublicKey != null) {
47+
SOFT_SERVE_INITIAL_ADMIN_KEYS = cfg.initialAdminPublicKey;
48+
}
49+
// lib.optionalAttrs (cfg.initialAdminPublicKeyFile != null) {
50+
SOFT_SERVE_INITIAL_ADMIN_KEYS = "/tmp/initial_admin_key.pub";
51+
};
52+
stack = containerName;
53+
homepage = {
54+
category = "Utilities";
55+
name = "Soft Serve";
56+
settings = {
57+
description = "Self-hosted Git over SSH";
58+
icon = "github";
59+
};
60+
};
61+
};
62+
};
63+
}

0 commit comments

Comments
 (0)