nix: don't drag rust toolchain into system closures
This commit is contained in:
parent
7800c19280
commit
bff8e24e56
3 changed files with 9 additions and 42 deletions
8
PLAN.md
8
PLAN.md
|
|
@ -955,11 +955,9 @@ No `tokio`, no `zbus`, no `dbus-*`.
|
|||
|
||||
`flake.nix` ships:
|
||||
|
||||
- A **devshell** with rust toolchain (via `rust-overlay` for pinned
|
||||
channel; default to a stable release pinned in
|
||||
`rust-toolchain.toml`), `pkg-config`, `pipewire`'s dev outputs,
|
||||
`clang` (for bindgen if invoked by deps), `socat` (handy for poking
|
||||
the IPC), `jq`.
|
||||
- A **devshell** with the Rust toolchain from nixpkgs, `pkg-config`,
|
||||
`pipewire`'s dev outputs, `clang` (for bindgen if invoked by deps),
|
||||
`socat` (handy for poking the IPC), `jq`.
|
||||
- A **package** output (`packages.<system>.default`) that builds the
|
||||
daemon + CLI with `rustPlatform.buildRustPackage`. v0 uses
|
||||
`cargoLock.lockFile`. Crane can come later if incremental builds in
|
||||
|
|
|
|||
23
flake.lock
generated
23
flake.lock
generated
|
|
@ -18,28 +18,7 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"rust-overlay": "rust-overlay"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1779074409,
|
||||
"narHash": "sha256-6aXy8Ga41iLVM8ibddFU1O5+wYWcBGNEfZzZuL91eIc=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "2a77b5b1dc952f214e8102acdef1622b68515560",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
20
flake.nix
20
flake.nix
|
|
@ -3,17 +3,12 @@
|
|||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
rust-overlay,
|
||||
}:
|
||||
let
|
||||
systems = [
|
||||
|
|
@ -26,7 +21,6 @@
|
|||
system:
|
||||
import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ rust-overlay.overlays.default ];
|
||||
};
|
||||
|
||||
perSystem =
|
||||
|
|
@ -34,13 +28,6 @@
|
|||
let
|
||||
pkgs = pkgsFor system;
|
||||
|
||||
rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
|
||||
rustPlatform = pkgs.makeRustPlatform {
|
||||
cargo = rustToolchain;
|
||||
rustc = rustToolchain;
|
||||
};
|
||||
|
||||
# Native libs the audio crates link against.
|
||||
nativeAudioBuildInputs = with pkgs; [
|
||||
pipewire
|
||||
|
|
@ -64,8 +51,11 @@
|
|||
name = "headroom-dev";
|
||||
|
||||
nativeBuildInputs = nativeBuildTools ++ [
|
||||
rustToolchain
|
||||
pkgs.cargo
|
||||
pkgs.clippy
|
||||
pkgs.rust-analyzer
|
||||
pkgs.rustc
|
||||
pkgs.rustfmt
|
||||
];
|
||||
|
||||
buildInputs =
|
||||
|
|
@ -89,7 +79,7 @@
|
|||
);
|
||||
|
||||
# `nix build` — the final packaged daemon + CLI.
|
||||
headroom = rustPlatform.buildRustPackage (
|
||||
headroom = pkgs.rustPlatform.buildRustPackage (
|
||||
{
|
||||
pname = "headroom";
|
||||
# Pull from the workspace Cargo.toml — the per-crate
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue