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, ... }:
|
{ inputs, ... }:
|
||||||
|
let
|
||||||
|
inherit (inputs) crane;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
flake.overlays.default = final: prev: {
|
flake.overlays.default = final: prev: {
|
||||||
webnsupdate = prev.callPackage ../default.nix {
|
webnsupdate = prev.callPackage ../default.nix {
|
||||||
inherit (inputs) crane;
|
inherit crane;
|
||||||
pkgSrc = inputs.self;
|
pkgSrc = inputs.self;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
perSystem =
|
perSystem =
|
||||||
{ pkgs, lib, ... }:
|
{
|
||||||
|
system,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
craneLib = inputs.crane.mkLib pkgs;
|
craneLib = (crane.mkLib pkgs).overrideToolchain (pkgs: pkgs.rust-bin.stable.latest.default);
|
||||||
src = craneLib.cleanCargoSource inputs.self;
|
src = craneLib.cleanCargoSource inputs.self;
|
||||||
|
|
||||||
commonArgs = {
|
commonArgs = {
|
||||||
|
@ -36,11 +44,17 @@
|
||||||
{ inherit cargoArtifacts; }
|
{ inherit cargoArtifacts; }
|
||||||
];
|
];
|
||||||
webnsupdate = pkgs.callPackage ../default.nix {
|
webnsupdate = pkgs.callPackage ../default.nix {
|
||||||
inherit (inputs) crane;
|
inherit crane;
|
||||||
pkgSrc = inputs.self;
|
pkgSrc = src;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
# Consume the rust-rust-overlay
|
||||||
|
_module.args.pkgs = import inputs.nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = [ inputs.rust-overlay.overlays.default ];
|
||||||
|
};
|
||||||
|
|
||||||
checks = {
|
checks = {
|
||||||
nextest = craneLib.cargoNextest withArtifacts;
|
nextest = craneLib.cargoNextest withArtifacts;
|
||||||
clippy = craneLib.cargoClippy (
|
clippy = craneLib.cargoClippy (
|
||||||
|
|
21
flake.lock
generated
21
flake.lock
generated
|
@ -53,10 +53,31 @@
|
||||||
"crane": "crane",
|
"crane": "crane",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
|
"rust-overlay": "rust-overlay",
|
||||||
"systems": "systems",
|
"systems": "systems",
|
||||||
"treefmt-nix": "treefmt-nix"
|
"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": {
|
"systems": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681028828,
|
"lastModified": 1681028828,
|
||||||
|
|
11
flake.nix
11
flake.nix
|
@ -1,17 +1,22 @@
|
||||||
{
|
{
|
||||||
description = "An http server that calls nsupdate internally";
|
description = "An http server that calls nsupdate internally";
|
||||||
inputs = {
|
inputs = {
|
||||||
crane.url = "github:ipetkov/crane";
|
nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz";
|
||||||
flake-parts = {
|
flake-parts = {
|
||||||
url = "github:hercules-ci/flake-parts";
|
url = "github:hercules-ci/flake-parts";
|
||||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz";
|
|
||||||
systems.url = "github:nix-systems/default";
|
|
||||||
treefmt-nix = {
|
treefmt-nix = {
|
||||||
url = "github:numtide/treefmt-nix";
|
url = "github:numtide/treefmt-nix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
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 =
|
outputs =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue