Skip to content

Commit

Permalink
feat: add ci
Browse files Browse the repository at this point in the history
Signed-off-by: Brian McGee <[email protected]>
  • Loading branch information
brianmcgee committed Apr 5, 2024
1 parent 4403955 commit 5ca4ebe
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 34 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Nix CI"
on: [push]
jobs:

nix-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v24
- id: set-matrix
name: Generate Nix Matrix
run: |
set -Eeu
matrix="$(nix eval --json '.#githubActions.matrix')"
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
nix-build:
needs: nix-matrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v24
- run: nix build -Lv ".#${{ matrix.attr }}"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
I've been thinking about a clustered `systemctl` for a while now, and when I started digging into it recently I
eventually ended up looking closely at [DBus](https://www.freedesktop.org/wiki/Software/dbus/).

What I *want to achieve* is remotely monitor and manage multiple machines.
What I _want to achieve_ is remotely monitor and manage multiple machines.

I think DBus provides the underlying mechanism for this in the form of:

Expand Down Expand Up @@ -141,7 +141,7 @@ Signature: s

```terminal
❯ nats --context TestAdmin sub "dbus.signals.>"
12:14:06 Subscribing on dbus.signals.>
12:14:06 Subscribing on dbus.signals.>
[#1] Received on "dbus.signals.UBQUIKYGFC7CH5XMF52P2NN4ESI4XTXGAKT3WTG3XGU3352DMHGZQAX7._1_1.org.freedesktop.systemd1.unit.nscd_2eservice"
Interface: org.freedesktop.DBus.Properties
Member: PropertiesChanged
Expand Down
39 changes: 16 additions & 23 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 4 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@
inputs.nixpkgs.follows = "srvos/nixpkgs";
};
process-compose-flake.url = "github:Platonic-Systems/process-compose-flake";
harmonia = {
url = "github:nix-community/harmonia";
inputs = {
nixpkgs.follows = "srvos/nixpkgs";
flake-parts.follows = "flake-parts";
treefmt-nix.follows = "treefmt-nix";
};
};
gomod2nix = {
url = "github:nix-community/gomod2nix";
inputs = {
Expand All @@ -56,6 +48,10 @@
};
};
nix-filter.url = "github:numtide/nix-filter";
github-actions = {
url = "github:nix-community/nix-github-actions";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs @ {
Expand Down
17 changes: 16 additions & 1 deletion nix/checks.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
{lib, ...}: {
{
lib,
self,
inputs,
...
}: {
flake.githubActions = let
platforms = {
"x86_64-linux" = ["ubuntu-latest"];
};
in
inputs.github-actions.lib.mkGithubMatrix {
inherit platforms;
checks = lib.getAttrs ["x86_64-linux"] self.checks;
};

perSystem = {self', ...}: {
checks = with lib; mapAttrs' (n: nameValuePair "package-${n}") self'.packages;
};
Expand Down

0 comments on commit 5ca4ebe

Please sign in to comment.