File tree Expand file tree Collapse file tree 6 files changed +71
-2
lines changed
Expand file tree Collapse file tree 6 files changed +71
-2
lines changed Original file line number Diff line number Diff line change 1+ name : " nix builder"
2+ on :
3+ push :
4+ branches :
5+ - main
6+ jobs :
7+ build :
8+ runs-on : ubuntu-latest
9+ steps :
10+ - uses : actions/checkout@v4
11+ - uses : cachix/install-nix-action@v25
12+ with :
13+ nix_path : nixpkgs=channel:nixos-unstable
14+ - uses : cachix/cachix-action@v14
15+ with :
16+ name : trickypr
17+ authToken : ' ${{ secrets.CACHIX_AUTH_TOKEN }}'
18+ - run : nix build
19+
Original file line number Diff line number Diff line change 11/target
22.direnv /
3+ result
Original file line number Diff line number Diff line change 88 url = "github:oxalica/rust-overlay" ;
99 inputs . nixpkgs . follows = "nixpkgs" ;
1010 } ;
11+ crane = {
12+ url = "github:ipetkov/crane" ;
13+ } ;
1114 } ;
1215
1316 outputs =
1619 nixpkgs ,
1720 rust-overlay ,
1821 flake-utils ,
22+ crane ,
1923 ...
2024 } :
2125 flake-utils . lib . eachDefaultSystem (
2226 system :
2327 let
2428 overlays = [ ( import rust-overlay ) ] ;
29+ package = import ./nix/package.nix ;
30+ docker-image = import ./nix/docker-image.nix ;
2531 pkgs = import nixpkgs {
2632 inherit system overlays ;
2733 } ;
34+ craneLib = crane . mkLib pkgs ;
2835 in
2936 {
37+ packages = rec {
38+ bin = package {
39+ inherit pkgs ;
40+ craneLib = craneLib ;
41+ } ;
42+ docker = docker-image {
43+ inherit pkgs ;
44+ bin = bin ;
45+ } ;
46+ default = docker ;
47+ } ;
48+
3049 devShells . default =
3150 with pkgs ;
3251 mkShell {
3352 buildInputs = [
34- openssl
35- pkg-config
3653 rust-bin . stable . latest . default
54+ dive
3755 ] ;
3856
3957 shellHook = '''' ;
Original file line number Diff line number Diff line change 1+ { pkgs , bin , ... } :
2+ pkgs . dockerTools . buildImage {
3+ name = "ghcr.io/anucssa/rubric-merge" ;
4+ tag = "latest" ;
5+ copyToRoot = [ bin ] ;
6+ config = {
7+ Cmd = [ "${ bin } /bin/rubric-merge" ] ;
8+ } ;
9+ }
Original file line number Diff line number Diff line change 1+ { craneLib , ... } :
2+ craneLib . buildPackage rec {
3+ pname = "rubric-merge" ;
4+ name = pname ;
5+ src = craneLib . cleanCargoSource ../. ;
6+ }
You can’t perform that action at this time.
0 commit comments