mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 23:29:08 +01:00
Compare commits
6 commits
0b09699cc5
...
2d9a779fb1
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d9a779fb1 | |||
| db4bd23286 | |||
| cb0d7c716c | |||
| 81cb5c2723 | |||
| 3abf299cd6 | |||
| fd5acfbcf6 |
3 changed files with 74 additions and 8 deletions
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
|
|
@ -145,30 +145,30 @@ jobs:
|
||||||
- name: Notify success
|
- name: Notify success
|
||||||
if: needs.await-deploy.result == 'success'
|
if: needs.await-deploy.result == 'success'
|
||||||
env:
|
env:
|
||||||
BODY: |-
|
SHA: ${{ github.sha }}
|
||||||
Commit `${{ github.sha }}` deployed successfully.
|
COMMIT_MSG: ${{ github.event.head_commit.message }}
|
||||||
> ${{ github.event.head_commit.message }}
|
|
||||||
run: |
|
run: |
|
||||||
|
body=$(printf 'Commit `%s` deployed successfully.\n> %s' "${SHA::7}" "$COMMIT_MSG")
|
||||||
curl -s \
|
curl -s \
|
||||||
-H "Title: CI: Deployment succeeded" \
|
-H "Title: CI: Deployment succeeded" \
|
||||||
-H "Priority: low" \
|
-H "Priority: low" \
|
||||||
-H "Tags: white_check_mark" \
|
-H "Tags: white_check_mark" \
|
||||||
-H "Actions: view, Open workflow run, ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
-H "Actions: view, Open workflow run, ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
||||||
-H "Markdown: yes" \
|
-H "Markdown: yes" \
|
||||||
-d "$BODY" \
|
-d "$body" \
|
||||||
https://ntfy.sh/splitleaf
|
https://ntfy.sh/splitleaf
|
||||||
- name: Notify failure
|
- name: Notify failure
|
||||||
if: needs.await-deploy.result == 'failure'
|
if: needs.await-deploy.result == 'failure'
|
||||||
env:
|
env:
|
||||||
BODY: |-
|
SHA: ${{ github.sha }}
|
||||||
Commit `${{ github.sha }}` failed to deploy.
|
COMMIT_MSG: ${{ github.event.head_commit.message }}
|
||||||
> ${{ github.event.head_commit.message }}
|
|
||||||
run: |
|
run: |
|
||||||
|
body=$(printf 'Commit `%s` failed to deploy.\n> %s' "${SHA::7}" "$COMMIT_MSG")
|
||||||
curl -s \
|
curl -s \
|
||||||
-H "Title: CI: Deployment failed" \
|
-H "Title: CI: Deployment failed" \
|
||||||
-H "Priority: default" \
|
-H "Priority: default" \
|
||||||
-H "Tags: rotating_light" \
|
-H "Tags: rotating_light" \
|
||||||
-H "Actions: view, Open workflow run, ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
-H "Actions: view, Open workflow run, ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
||||||
-H "Markdown: yes" \
|
-H "Markdown: yes" \
|
||||||
-d "$BODY" \
|
-d "$body" \
|
||||||
https://ntfy.sh/splitleaf
|
https://ntfy.sh/splitleaf
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,11 @@
|
||||||
domain = "status.${config.custom.networking.overlay.domain}";
|
domain = "status.${config.custom.networking.overlay.domain}";
|
||||||
generateDefaultEndpoints = true;
|
generateDefaultEndpoints = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
glance = {
|
||||||
|
enable = true;
|
||||||
|
domain = "home.${config.custom.networking.overlay.domain}";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
61
modules/nixos/web-services/glance.nix
Normal file
61
modules/nixos/web-services/glance.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue