Skip to content

Commit

Permalink
Add nix build for reference
Browse files Browse the repository at this point in the history
  • Loading branch information
kpcyrd committed Oct 14, 2023
1 parent b0dbacc commit 92dcbcd
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: NixOS/nix

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '0 9 * * 1'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@v2
- run: nix build .
- run: ls -lah result/bin/
- run: sha256sum result/bin/repro-env
- run: result/bin/repro-env --help
94 changes: 94 additions & 0 deletions flake.lock

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

22 changes: 22 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};

outputs = { self, flake-utils, naersk, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = (import nixpkgs) {
inherit system;
};

naersk' = pkgs.callPackage naersk {};

in rec {
defaultPackage = naersk'.buildPackage {
src = ./.;
};
}
);
}

0 comments on commit 92dcbcd

Please sign in to comment.