chore: Remove flake-utils from flake inputs

This commit is contained in:
Patrick Auernig 2024-11-28 02:06:32 +01:00
parent 9447de3f74
commit 0dd74ac770
2 changed files with 58 additions and 91 deletions

View File

@ -1,30 +1,12 @@
{ {
"nodes": { "nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1732238832, "lastModified": 1732617236,
"narHash": "sha256-sQxuJm8rHY20xq6Ah+GwIUkF95tWjGRd1X8xF+Pkk38=", "narHash": "sha256-PYkz6U0bSEaEB1al7O1XsqVNeSNS+s3NVclJw7YC43w=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8edf06bea5bcbee082df1b7369ff973b91618b8d", "rev": "af51545ec9a44eadf3fe3547610a5cdd882bc34e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,7 +18,6 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
} }
@ -48,11 +29,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1732328983, "lastModified": 1732674798,
"narHash": "sha256-RHt12f/slrzDpSL7SSkydh8wUE4Nr4r23HlpWywed9E=", "narHash": "sha256-oM1gjCv9R4zxDFO3as9wqQ4FI3+pDA9MKZ72L7tTIII=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "ed8aa5b64f7d36d9338eb1d0a3bb60cf52069a72", "rev": "1d569430326b0a7807ccffdb2a188b814091976c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -60,21 +41,6 @@
"repo": "rust-overlay", "repo": "rust-overlay",
"type": "github" "type": "github"
} }
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@ -3,41 +3,34 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = { rust-overlay = {
url = "github:oxalica/rust-overlay"; url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = { nixpkgs, flake-utils, rust-overlay, ... }: outputs = { nixpkgs, rust-overlay, ... }:
flake-utils.lib.eachDefaultSystem (system:
let let
lib = nixpkgs.lib;
systems = ["x86_64-linux"];
forEachSystem = fn: lib.genAttrs systems (system: let
overlays = [ (import rust-overlay) ]; overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; }; pkgs = import nixpkgs { inherit system overlays; };
lib = nixpkgs.lib; rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
rust = pkgs.rust-bin; in fn { inherit pkgs rustToolchain; } );
in {
rustToolchain = rust.fromRustupToolchainFile ./rust-toolchain.toml; packages = forEachSystem ({ pkgs, rustToolchain }: let
rustNightlyToolchain = rust.selectLatestNightlyWith (t: t.minimal.override {
extensions = [ "rustfmt" ];
});
rustPlatform = pkgs.makeRustPlatform { rustPlatform = pkgs.makeRustPlatform {
cargo = rustToolchain; cargo = rustToolchain;
rustc = rustToolchain; rustc = rustToolchain;
}; };
buildTools = [
rustToolchain
rustNightlyToolchain
];
manifest = lib.importTOML ./Cargo.toml; manifest = lib.importTOML ./Cargo.toml;
packageName = manifest.package.name; packageName = manifest.package.name;
packageVersion = manifest.package.version; packageVersion = manifest.package.version;
package = rustPlatform.buildRustPackage { package = rustPlatform.buildRustPackage {
nativeBuildInputs = buildTools; nativeBuildInputs = [ rustToolchain ];
pname = packageName; pname = packageName;
version = packageVersion; version = packageVersion;
@ -55,15 +48,23 @@
}; };
}; };
in { in {
packages = {
default = package; default = package;
${packageName} = package; ${packageName} = package;
}; });
devShells.default = pkgs.mkShell { devShells = forEachSystem ({ pkgs, rustToolchain }: let
rustNightlyToolchain = pkgs.rust-bin.selectLatestNightlyWith (t: t.minimal.override {
extensions = [ "rustfmt" ];
});
in {
default = pkgs.mkShell {
name = "projtool"; name = "projtool";
nativeBuildInputs = buildTools; nativeBuildInputs = [
rustToolchain
rustNightlyToolchain
];
}; };
}); });
};
} }