Skip to content

Commit 45b75a6

Browse files
authored
Merge pull request #25 from silicon-heaven/flake
Flake
2 parents a3b2944 + c9c0c43 commit 45b75a6

5 files changed

Lines changed: 106 additions & 2 deletions

File tree

.github/workflows/rust.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,20 @@ jobs:
125125
- run: |
126126
cargo login <<< "${{secrets.CRATES_IO_TOKEN}}"
127127
cargo publish
128+
129+
nix:
130+
name: NixOS
131+
runs-on: ubuntu-latest
132+
steps:
133+
- name: Checkout code
134+
uses: actions/checkout@v6
135+
- name: Install Nix
136+
uses: cachix/install-nix-action@v31.9.0
137+
with:
138+
nix_path: nixpkgs=channel:nixos-unstable
139+
- name: Build
140+
run: nix --experimental-features 'nix-command flakes' build
141+
- name: Flake check
142+
run: nix --experimental-features 'nix-command flakes' flake check
143+
- name: Format
144+
run: nix --experimental-features 'nix-command flakes' fmt . && git diff --exit-code

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "shvcall"
33
description = "CLI utility to invoke remote SHV RPC calls"
44
license = "MIT"
55
repository = "https://github.com/silicon-heaven/shvcall-rs"
6-
version = "3.9.5"
6+
version = "3.9.6"
77
edition = "2024"
88

99
[[bin]]

flake.lock

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
description = "Rust implementation of headless Silicon Heaven applications";
3+
4+
outputs = {
5+
self,
6+
systems,
7+
nixpkgs,
8+
}: let
9+
inherit (builtins) head match readFile;
10+
inherit (nixpkgs.lib) genAttrs;
11+
forSystems = genAttrs (import systems);
12+
withPkgs = func: forSystems (system: func self.legacyPackages.${system});
13+
14+
package = {rustPlatform}:
15+
rustPlatform.buildRustPackage {
16+
pname = "shvcall-rs";
17+
version = head (
18+
match ".*\nversion[ ]*=[ ]*\"([^\"]+)\"\n.*" (readFile ./Cargo.toml)
19+
);
20+
21+
src = ./.;
22+
cargoLock = {
23+
lockFile = ./Cargo.lock;
24+
};
25+
doCheck = true;
26+
27+
meta = with nixpkgs.lib; {
28+
description = "CLI utility to invoke remote SHV RPC calls";
29+
homepage = "https://github.com/silicon-heaven/shvcall-rs/";
30+
license = licenses.mit;
31+
mainProgram = "shvcall";
32+
};
33+
};
34+
in {
35+
overlays.default = final: _: {
36+
shvcall-rs = final.callPackage package {};
37+
};
38+
39+
packages = withPkgs (pkgs: {default = pkgs.shvcall-rs;});
40+
41+
legacyPackages =
42+
forSystems (system:
43+
nixpkgs.legacyPackages.${system}.extend self.overlays.default);
44+
45+
formatter = withPkgs (pkgs: pkgs.alejandra);
46+
};
47+
}

0 commit comments

Comments
 (0)