feat: use rust-overlay to get the rust binaries
This should ensure I use my own rust version instead of the one in nixpkgs.
This commit is contained in:
parent
3b72936a49
commit
95cfb31b9a
3 changed files with 48 additions and 8 deletions
|
@ -1,16 +1,24 @@
|
|||
{ inputs, ... }:
|
||||
let
|
||||
inherit (inputs) crane;
|
||||
in
|
||||
{
|
||||
flake.overlays.default = final: prev: {
|
||||
webnsupdate = prev.callPackage ../default.nix {
|
||||
inherit (inputs) crane;
|
||||
inherit crane;
|
||||
pkgSrc = inputs.self;
|
||||
};
|
||||
};
|
||||
|
||||
perSystem =
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
system,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
craneLib = inputs.crane.mkLib pkgs;
|
||||
craneLib = (crane.mkLib pkgs).overrideToolchain (pkgs: pkgs.rust-bin.stable.latest.default);
|
||||
src = craneLib.cleanCargoSource inputs.self;
|
||||
|
||||
commonArgs = {
|
||||
|
@ -36,11 +44,17 @@
|
|||
{ inherit cargoArtifacts; }
|
||||
];
|
||||
webnsupdate = pkgs.callPackage ../default.nix {
|
||||
inherit (inputs) crane;
|
||||
pkgSrc = inputs.self;
|
||||
inherit crane;
|
||||
pkgSrc = src;
|
||||
};
|
||||
in
|
||||
{
|
||||
# Consume the rust-rust-overlay
|
||||
_module.args.pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ inputs.rust-overlay.overlays.default ];
|
||||
};
|
||||
|
||||
checks = {
|
||||
nextest = craneLib.cargoNextest withArtifacts;
|
||||
clippy = craneLib.cargoClippy (
|
||||
|
|
21
flake.lock
generated
21
flake.lock
generated
|
@ -53,10 +53,31 @@
|
|||
"crane": "crane",
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"rust-overlay": "rust-overlay",
|
||||
"systems": "systems",
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1747363019,
|
||||
"narHash": "sha256-N4dwkRBmpOosa4gfFkFf/LTD8oOcNkAyvZ07JvRDEf0=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "0e624f2b1972a34be1a9b35290ed18ea4b419b6f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
|
|
11
flake.nix
11
flake.nix
|
@ -1,17 +1,22 @@
|
|||
{
|
||||
description = "An http server that calls nsupdate internally";
|
||||
inputs = {
|
||||
crane.url = "github:ipetkov/crane";
|
||||
nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz";
|
||||
flake-parts = {
|
||||
url = "github:hercules-ci/flake-parts";
|
||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||
};
|
||||
nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz";
|
||||
systems.url = "github:nix-systems/default";
|
||||
treefmt-nix = {
|
||||
url = "github:numtide/treefmt-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
crane.url = "github:ipetkov/crane";
|
||||
rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
systems.url = "github:nix-systems/default";
|
||||
};
|
||||
|
||||
outputs =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue