use naersk

This commit is contained in:
2025-12-29 17:14:25 +01:00
parent b8c7dd98be
commit 305ae463a5
2 changed files with 55 additions and 31 deletions

72
flake.lock generated
View File

@@ -1,17 +1,45 @@
{ {
"nodes": { "nodes": {
"flake-utils": { "fenix": {
"inputs": {
"nixpkgs": [
"naersk",
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": { "locked": {
"lastModified": 1659877975, "lastModified": 1752475459,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "narHash": "sha256-z6QEu4ZFuHiqdOPbYss4/Q8B0BFhacR8ts6jO/F/aOU=",
"owner": "numtide", "owner": "nix-community",
"repo": "flake-utils", "repo": "fenix",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", "rev": "bf0d6f70f4c9a9cf8845f992105652173f4b617f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "numtide", "owner": "nix-community",
"repo": "flake-utils", "repo": "fenix",
"type": "github"
}
},
"naersk": {
"inputs": {
"fenix": "fenix",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1763384566,
"narHash": "sha256-r+wgI+WvNaSdxQmqaM58lVNvJYJ16zoq+tKN20cLst4=",
"owner": "nix-community",
"repo": "naersk",
"rev": "d4155d6ebb70fbe2314959842f744aa7cabbbf6a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "naersk",
"type": "github" "type": "github"
} }
}, },
@@ -33,28 +61,24 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs", "naersk": "naersk",
"rust-overlay": "rust-overlay" "nixpkgs": "nixpkgs"
} }
}, },
"rust-overlay": { "rust-analyzer-src": {
"inputs": { "flake": false,
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": { "locked": {
"lastModified": 1677119371, "lastModified": 1752428706,
"narHash": "sha256-L0Da4eKzDZrsy8ysOS1lhgDjAgEqGvYGf/lXaRd5/YQ=", "narHash": "sha256-EJcdxw3aXfP8Ex1Nm3s0awyH9egQvB2Gu+QEnJn2Sfg=",
"owner": "oxalica", "owner": "rust-lang",
"repo": "rust-overlay", "repo": "rust-analyzer",
"rev": "c67c79ea25664d66e74ae91a6fa0d6c65d12d3a7", "rev": "591e3b7624be97e4443ea7b5542c191311aa141d",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "oxalica", "owner": "rust-lang",
"repo": "rust-overlay", "ref": "nightly",
"repo": "rust-analyzer",
"type": "github" "type": "github"
} }
} }

View File

@@ -3,24 +3,23 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
rust-overlay.url = "github:oxalica/rust-overlay"; naersk.url = "github:nix-community/naersk";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs"; naersk.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = outputs =
{ {
self, self,
nixpkgs, nixpkgs,
rust-overlay, naersk,
}: }:
let let
pkgsFor = pkgsFor =
system: system:
import nixpkgs { import nixpkgs {
inherit system; inherit system;
overlays = [ overlays = [];
rust-overlay.overlays.default config = {};
];
}; };
lib = nixpkgs.lib; lib = nixpkgs.lib;
eachSupportedSystem = lib.genAttrs lib.systems.flakeExposed; eachSupportedSystem = lib.genAttrs lib.systems.flakeExposed;
@@ -30,6 +29,7 @@
system: system:
let let
pkgs = pkgsFor system; pkgs = pkgsFor system;
naersk' = pkgs.callPackage naersk {};
in in
{ {
bvg = bvg =
@@ -76,7 +76,7 @@
echo $(echo "($(od -tu -An -N 2 /dev/urandom)%1000)+500"|bc) $(echo "($(od -tu -An -N 2 /dev/urandom)%500)+100"|bc) echo $(echo "($(od -tu -An -N 2 /dev/urandom)%1000)+500"|bc) $(echo "($(od -tu -An -N 2 /dev/urandom)%500)+100"|bc)
done | rusty-jeep 1 done | rusty-jeep 1
''; '';
rusty-jeep = pkgs.rustPlatform.buildRustPackage rec { rusty-jeep = naersk'.buildPackage {
name = "rusty-jeep"; name = "rusty-jeep";
version = "1.0.0"; version = "1.0.0";
src = ./rusty-jeep; src = ./rusty-jeep;