aboutsummaryrefslogtreecommitdiffstats
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix74
1 files changed, 4 insertions, 70 deletions
diff --git a/flake.nix b/flake.nix
index 0e2472a..bc8eedb 100644
--- a/flake.nix
+++ b/flake.nix
@@ -11,28 +11,10 @@
};
};
- crane = {
- url = "github:ipetkov/crane";
- inputs = {
- nixpkgs.follows = "nixpkgs";
- };
- };
- rust-overlay = {
- url = "github:oxalica/rust-overlay";
- inputs = {
- nixpkgs.follows = "nixpkgs";
- flake-utils.follows = "flake-utils";
- };
- };
-
# inputs for following
systems = {
url = "github:nix-systems/x86_64-linux"; # only evaluate for this system
};
- flake-compat = {
- url = "github:edolstra/flake-compat";
- flake = false;
- };
flake-utils = {
url = "github:numtide/flake-utils";
inputs = {
@@ -46,64 +28,19 @@
nixpkgs,
flake-utils,
treefmt-nix,
- crane,
- rust-overlay,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
- pkgs = import nixpkgs {
- inherit system;
- overlays = [(import rust-overlay)];
- };
-
- nightly = false;
- rust_minimal =
- if nightly
- then pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.minimal)
- else pkgs.rust-bin.stable.latest.minimal;
- rust_default =
- if nightly
- then pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default)
- else pkgs.rust-bin.stable.latest.default;
-
- cargo_toml = craneLib.cleanCargoToml {cargoToml = ./Cargo.toml;};
- pname = cargo_toml.package.name;
-
- craneLib = (crane.mkLib pkgs).overrideToolchain rust_minimal;
- craneBuild = craneLib.buildPackage {
- src = craneLib.cleanCargoSource ./.;
-
- doCheck = true;
- };
-
- manual = pkgs.stdenv.mkDerivation {
- name = "${pname}-manual";
- inherit (cargo_toml.package) version;
-
- src = ./docs;
- nativeBuildInputs = with pkgs; [pandoc];
-
- buildPhase = ''
- mkdir --parents $out/docs;
-
- pandoc "./${pname}.1.md" -s -t man > $out/docs/${pname}.1
- '';
-
- installPhase = ''
- install -D $out/docs/${pname}.1 $out/share/man/man1/${pname};
- '';
- };
+ pkgs = nixpkgs.legacyPackages.${system};
treefmtEval = import ./treefmt.nix {inherit treefmt-nix pkgs;};
in {
- packages.default = pkgs.symlinkJoin {
- inherit (cargo_toml.package) name;
-
- paths = [manual craneBuild];
+ packages = {
+ # TODO(@bpeetz): Support the 'simple' wkd configuration <2024-05-25>
+ default = ./src;
};
checks = {
- inherit craneBuild;
formatting = treefmtEval.config.build.check self;
};
@@ -113,9 +50,6 @@
packages = with pkgs; [
cocogitto
- rust_default
- cargo-edit
-
licensure
];
};