Compare commits

...

6 commits

3 changed files with 74 additions and 8 deletions

View file

@ -145,30 +145,30 @@ jobs:
- name: Notify success
if: needs.await-deploy.result == 'success'
env:
BODY: |-
Commit `${{ github.sha }}` deployed successfully.
> ${{ github.event.head_commit.message }}
SHA: ${{ github.sha }}
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
body=$(printf 'Commit `%s` deployed successfully.\n> %s' "${SHA::7}" "$COMMIT_MSG")
curl -s \
-H "Title: CI: Deployment succeeded" \
-H "Priority: low" \
-H "Tags: white_check_mark" \
-H "Actions: view, Open workflow run, ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
-H "Markdown: yes" \
-d "$BODY" \
-d "$body" \
https://ntfy.sh/splitleaf
- name: Notify failure
if: needs.await-deploy.result == 'failure'
env:
BODY: |-
Commit `${{ github.sha }}` failed to deploy.
> ${{ github.event.head_commit.message }}
SHA: ${{ github.sha }}
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
body=$(printf 'Commit `%s` failed to deploy.\n> %s' "${SHA::7}" "$COMMIT_MSG")
curl -s \
-H "Title: CI: Deployment failed" \
-H "Priority: default" \
-H "Tags: rotating_light" \
-H "Actions: view, Open workflow run, ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
-H "Markdown: yes" \
-d "$BODY" \
-d "$body" \
https://ntfy.sh/splitleaf

View file

@ -72,6 +72,11 @@
domain = "status.${config.custom.networking.overlay.domain}";
generateDefaultEndpoints = true;
};
glance = {
enable = true;
domain = "home.${config.custom.networking.overlay.domain}";
};
};
};
}

View file

@ -0,0 +1,61 @@
{
config,
lib,
allHosts,
...
}:
let
cfg = config.custom.web-services.glance;
in
{
options.custom.web-services.glance = {
enable = lib.mkEnableOption "";
domain = lib.mkOption {
type = lib.types.nonEmptyStr;
default = "";
};
port = lib.mkOption {
type = lib.types.port;
default = 63958;
};
};
config = lib.mkIf cfg.enable {
services.glance = {
enable = true;
settings = {
server.port = cfg.port;
pages = lib.singleton {
name = "Services";
columns = [
{
size = "full";
widgets = [
{
type = "monitor";
cache = "1m";
title = "Services";
sites =
allHosts
|> lib.attrValues
|> lib.map (
host:
host.config.custom.services.caddy.virtualHosts |> lib.attrValues |> lib.map (vHost: vHost.domain)
)
|> lib.concatLists
|> lib.map (domain: {
title = domain;
url = "https://${domain}";
});
}
];
}
];
};
};
};
custom.services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
};
}