mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-21 21:50:43 -06:00
Compare commits
3 commits
79e8348c84
...
4c37ca0424
Author | SHA1 | Date | |
---|---|---|---|
4c37ca0424 | |||
dea2d9e473 | |||
0a13e2b754 |
7 changed files with 55 additions and 36 deletions
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
@ -41,7 +41,7 @@ jobs:
|
||||||
- uses: ./.github/actions/nix
|
- uses: ./.github/actions/nix
|
||||||
with:
|
with:
|
||||||
attic_token: ${{ secrets.ATTIC_TOKEN }}
|
attic_token: ${{ secrets.ATTIC_TOKEN }}
|
||||||
clean: true
|
# clean: true
|
||||||
btrfs: true
|
btrfs: true
|
||||||
|
|
||||||
- name: write lock file
|
- name: write lock file
|
||||||
|
|
14
.github/workflows/update.yml
vendored
14
.github/workflows/update.yml
vendored
|
@ -2,6 +2,13 @@ name: Flake Update / Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
hosts:
|
||||||
|
description: 'list of hosts to build'
|
||||||
|
required: true
|
||||||
|
default: 'othalan,algiz'
|
||||||
|
type: string
|
||||||
|
|
||||||
schedule:
|
schedule:
|
||||||
# At minute 00:00 on Monday, Wednesday, and Friday.
|
# At minute 00:00 on Monday, Wednesday, and Friday.
|
||||||
- cron: 0 0 * * 1,3,5
|
- cron: 0 0 * * 1,3,5
|
||||||
|
@ -51,7 +58,7 @@ jobs:
|
||||||
nix run .
|
nix run .
|
||||||
--
|
--
|
||||||
cache
|
cache
|
||||||
--host,=",othalan,algiz,mannaz,naudiz"
|
--host,="${{ inputs.hosts }}"
|
||||||
--flake .
|
--flake .
|
||||||
--debug
|
--debug
|
||||||
--
|
--
|
||||||
|
@ -94,7 +101,7 @@ jobs:
|
||||||
nix run .
|
nix run .
|
||||||
--
|
--
|
||||||
ci update
|
ci update
|
||||||
--host,=othalan,algiz,mannaz,naudiz
|
--host,="${{ inputs.hosts }}"
|
||||||
--flake .
|
--flake .
|
||||||
--debug
|
--debug
|
||||||
--
|
--
|
||||||
|
@ -102,7 +109,8 @@ jobs:
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
echo "# system diffs" >> $GITHUB_STEP_SUMMARY
|
echo "# system diffs" >> $GITHUB_STEP_SUMMARY
|
||||||
for host in othalan algiz mannaz naudiz; do
|
hosts="${{ inputs.hosts }}"
|
||||||
|
for host in ${hosts//,/ }; do
|
||||||
echo "## $host" >> $GITHUB_STEP_SUMMARY
|
echo "## $host" >> $GITHUB_STEP_SUMMARY
|
||||||
nix run "nixpkgs#nvd" -- --color always diff ./$host-current ./$host-updated >> $host-summary.md
|
nix run "nixpkgs#nvd" -- --color always diff ./$host-current ./$host-updated >> $host-summary.md
|
||||||
printf '```\n%s\n```\n' "$(nix run "nixpkgs#nvd" -- diff ./$host-current ./$host-updated)" >> $GITHUB_STEP_SUMMARY
|
printf '```\n%s\n```\n' "$(nix run "nixpkgs#nvd" -- diff ./$host-current ./$host-updated)" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
44
flake.lock
44
flake.lock
|
@ -165,11 +165,11 @@
|
||||||
"systems": "systems_3"
|
"systems": "systems_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1726560853,
|
"lastModified": 1731533236,
|
||||||
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -240,11 +240,11 @@
|
||||||
"zig": "zig"
|
"zig": "zig"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731947012,
|
"lastModified": 1732039947,
|
||||||
"narHash": "sha256-OL7pQ/dMLC1Ek+rkXHEXpvx+UBO1Pbo1kTVe2kmcYsY=",
|
"narHash": "sha256-LgLGpeyimlCyHWzsQZ5xL0GJv+14zTVsAPTOuwL/qkA=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "e54ae31d1cf1816f5b9fb7e1fb77d6537dabace6",
|
"rev": "14f603e691e13cb14855a4af8e9760a578f7aefd",
|
||||||
"revCount": 8018,
|
"revCount": 8023,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "ssh://git@github.com/ghostty-org/ghostty"
|
"url": "ssh://git@github.com/ghostty-org/ghostty"
|
||||||
},
|
},
|
||||||
|
@ -318,11 +318,11 @@
|
||||||
"xdph": "xdph"
|
"xdph": "xdph"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731945258,
|
"lastModified": 1732054045,
|
||||||
"narHash": "sha256-N7uJSSMqHzwH4uahb+Uw3sADVp3XdLfqkP2T144gnFk=",
|
"narHash": "sha256-/2SKmO6AWDqvhN8A8VxA244Au3LwFu7wOXzudWQXr9s=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "df9ff4489973afa9e29bb94ac47c946db745b460",
|
"rev": "c4eda46d0ef022a17348623beec4154ba34af691",
|
||||||
"revCount": 5475,
|
"revCount": 5482,
|
||||||
"submodules": true,
|
"submodules": true,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/hyprwm/Hyprland/"
|
"url": "https://github.com/hyprwm/Hyprland/"
|
||||||
|
@ -498,11 +498,11 @@
|
||||||
"lix": {
|
"lix": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731683711,
|
"lastModified": 1732056932,
|
||||||
"narHash": "sha256-bq21I1EjXJa/s5Rra9J9ot2NkPCnI0F5uNPurwYLdpE=",
|
"narHash": "sha256-3ubtSu0D+BUV5FKmBU7kTEXlI/okp/j1xC/ODC7LgTA=",
|
||||||
"rev": "c859d03013712b349d82ee6223948d6d03e63a8d",
|
"rev": "b0d7a816135de1cd551b8a54f5497148bf59d81d",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/c859d03013712b349d82ee6223948d6d03e63a8d.tar.gz?rev=c859d03013712b349d82ee6223948d6d03e63a8d"
|
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/b0d7a816135de1cd551b8a54f5497148bf59d81d.tar.gz?rev=b0d7a816135de1cd551b8a54f5497148bf59d81d"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
|
@ -521,11 +521,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731185731,
|
"lastModified": 1731967274,
|
||||||
"narHash": "sha256-RNaIu43b9PoXEhW4OqXUNZKY/jezQyCYWwdv1M0VjsA=",
|
"narHash": "sha256-n6dPGRlMGdL8X5gviA6ZuRfUdbdD5KiNN/BpABA5YT0=",
|
||||||
"rev": "691193879d96bdfd1e6ab5ebcca2fadc7604cf34",
|
"rev": "aa2846680fa9a2032939d720487942567fd9eb63",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/691193879d96bdfd1e6ab5ebcca2fadc7604cf34.tar.gz?rev=691193879d96bdfd1e6ab5ebcca2fadc7604cf34"
|
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/aa2846680fa9a2032939d720487942567fd9eb63.tar.gz?rev=aa2846680fa9a2032939d720487942567fd9eb63"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
|
@ -745,11 +745,11 @@
|
||||||
"nixpkgs": "nixpkgs_6"
|
"nixpkgs": "nixpkgs_6"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731954473,
|
"lastModified": 1732040857,
|
||||||
"narHash": "sha256-iNzMvn3P/3tinhRpYQVSVukrFP22qqlQ59a9kKYN7LU=",
|
"narHash": "sha256-nwbtI77CGa6AclGOmNXKLZFboxeAJWqX0IVgT2Ezo1Y=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs-wayland",
|
"repo": "nixpkgs-wayland",
|
||||||
"rev": "8cfa4547f95836136691e10493f18155694f198a",
|
"rev": "1e388cad31a52c4dc25613484b3591298b105935",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -8,7 +8,7 @@ buildNimblePackage {
|
||||||
verions = "unstable";
|
verions = "unstable";
|
||||||
src = lib.cleanSource ./.;
|
src = lib.cleanSource ./.;
|
||||||
nativeBuildInputs = [ openssl ];
|
nativeBuildInputs = [ openssl ];
|
||||||
nimbleDepsHash = "sha256-1YoGvWvoJJSMauDbeH8ZHuK+QQot48Mkye9TeWteT8k=";
|
nimbleDepsHash = "sha256-IWdlWC+j2h15WjVXXdDyxDZsb0/Ti1+jy6RfmqHFkjs=";
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "nix begat oizys";
|
description = "nix begat oizys";
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
"packages": {
|
"packages": {
|
||||||
"hwylterm": {
|
"hwylterm": {
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"vcsRevision": "c5f70cec4e40ba396f59162e98c359a1a1ea4fe1",
|
"vcsRevision": "ef573dc0f8bf39f80704f92cfab39e1b9af82492",
|
||||||
"url": "https://github.com/daylinmorgan/hwylterm",
|
"url": "https://github.com/daylinmorgan/hwylterm",
|
||||||
"downloadMethod": "git",
|
"downloadMethod": "git",
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha1": "5727969a8e82e29a7581c13cc7cc45996dbca5a1"
|
"sha1": "ccb51201898b5e913ffee1e18bdf4d9fc4004386"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"jsony": {
|
"jsony": {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
## nix begat oizys
|
## nix begat oizys
|
||||||
import std/[os, osproc, sequtils, strformat, strutils]
|
import std/[os, osproc, sequtils, strformat, strutils, tables]
|
||||||
import hwylterm, hwylterm/[hwylcli]
|
import hwylterm, hwylterm/[hwylcli]
|
||||||
import oizys/[context, github, nix, logging]
|
import oizys/[context, github, nix, logging]
|
||||||
|
|
||||||
|
@ -77,17 +77,27 @@ hwylCli:
|
||||||
ciUpdate(args)
|
ciUpdate(args)
|
||||||
|
|
||||||
[gha]
|
[gha]
|
||||||
... "trigger GHA"
|
... """
|
||||||
|
trigger GHA
|
||||||
|
|
||||||
|
examples:
|
||||||
|
[b]oizys gha update[/] --input:hosts:othalan,algiz,mannaz
|
||||||
|
"""
|
||||||
flags:
|
flags:
|
||||||
# make a key/value input that is passed to workflows and encoded in json
|
input:
|
||||||
# i.e. --input:ref:main
|
T seq[KVString]
|
||||||
|
? "inputs for dispatch"
|
||||||
`ref`:
|
`ref`:
|
||||||
T string
|
T string
|
||||||
? "git ref/branch/tag to trigger workflow on"
|
? "git ref/branch/tag to trigger workflow on"
|
||||||
* "main"
|
* "main"
|
||||||
run:
|
run:
|
||||||
|
# TODO: support file operations like gh
|
||||||
|
# i.e. @flake.lock means read a file a flake.lock and use it's contents
|
||||||
if args.len == 0: fatalQuit "expected workflow file name"
|
if args.len == 0: fatalQuit "expected workflow file name"
|
||||||
createDispatch(args[0], `ref`)
|
let inputs =
|
||||||
|
input.mapIt((it.key, it.val)).toTable()
|
||||||
|
createDispatch(args[0], `ref`, inputs)
|
||||||
|
|
||||||
[dry]
|
[dry]
|
||||||
... "dry run build"
|
... "dry run build"
|
||||||
|
|
|
@ -100,13 +100,14 @@ proc getInProgressRun(
|
||||||
|
|
||||||
warn "timeout reached waiting for workflow to start"
|
warn "timeout reached waiting for workflow to start"
|
||||||
|
|
||||||
proc createDispatch*(workflowFileName: string, `ref`: string) =
|
proc createDispatch*(workflowFileName: string, `ref`: string, inputs: Table[string, string]) =
|
||||||
## https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event
|
## https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event
|
||||||
let workflow =
|
let workflow =
|
||||||
if workflowFileName.endsWith(".yml") or workflowFileName.endsWith(".yaml"): workflowFileName
|
if workflowFileName.endsWith(".yml") or workflowFileName.endsWith(".yaml"): workflowFileName
|
||||||
else: workflowFileName & ".yml"
|
else: workflowFileName & ".yml"
|
||||||
let body = %*{"ref": `ref`}
|
let body = %*{"ref": `ref`, "inputs": inputs}
|
||||||
info fmt"creating dispatch event for {workflow}"
|
info fmt"creating dispatch event for {workflow}"
|
||||||
|
debug "with body: " & $body
|
||||||
postGhApi(
|
postGhApi(
|
||||||
fmt"https://api.github.com/repos/daylinmorgan/oizys/actions/workflows/{workflow}/dispatches",
|
fmt"https://api.github.com/repos/daylinmorgan/oizys/actions/workflows/{workflow}/dispatches",
|
||||||
body
|
body
|
||||||
|
|
Loading…
Reference in a new issue