-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds support for Nix Flakes. Signed-off-by: Dom Rodriguez <[email protected]>
- Loading branch information
Showing
3 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ lib | ||
, pkgs ? import <nixpkgs> | ||
, rustPlatform | ||
, | ||
}: | ||
rustPlatform.buildRustPackage { | ||
name = "bestool"; | ||
|
||
src = lib.cleanSource ./.; | ||
|
||
cargoLock = { | ||
lockFile = ./Cargo.lock; | ||
# Allow dependencies to be fetched from git and avoid having to set the outputHashes manually | ||
allowBuiltinFetchGit = true; | ||
}; | ||
|
||
nativeBuildInputs = with pkgs; [ pkg-config ]; | ||
buildInputs = with pkgs; [ systemd.dev ]; | ||
|
||
meta = with lib; { | ||
description = ""; | ||
homepage = "https://github.com/Ralim/bestool"; | ||
license = licenses.mit; | ||
}; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
flake-compat = { | ||
url = "github:edolstra/flake-compat"; | ||
flake = false; | ||
}; | ||
}; | ||
outputs = | ||
{ self | ||
, nixpkgs | ||
, flake-utils | ||
, ... | ||
}: | ||
flake-utils.lib.eachDefaultSystem | ||
(system: | ||
let | ||
pkgs = nixpkgs.outputs.legacyPackages.${system}; | ||
in | ||
{ | ||
packages.bestool = pkgs.callPackage ./.bestool.nix { }; | ||
packages.default = self.outputs.packages.${system}.bestool; | ||
|
||
devShells.default = self.packages.${system}.default.overrideAttrs (super: { | ||
nativeBuildInputs = with pkgs; | ||
super.nativeBuildInputs | ||
++ [ | ||
cargo-edit | ||
clippy | ||
rustfmt | ||
]; | ||
RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}"; | ||
}); | ||
}) | ||
// { | ||
overlays.default = final: prev: { | ||
inherit (self.packages.${final.system}) bestool; | ||
}; | ||
}; | ||
} |