Merge pull request #1 from zaphar/nix-flake

Nix flakes
This commit is contained in:
Jeremy Wall 2021-12-31 13:56:32 -05:00 committed by GitHub
commit 77ed227b69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 0 deletions

25
flake.nix Normal file
View File

@ -0,0 +1,25 @@
{
description = "kitchen";
inputs.nixpkgs = {
type = "indirect";
id = "nixpkgs";
};
inputs.gitignore = { url = "github:hercules-ci/gitignore.nix"; flake = false; };
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = {self, nixpkgs, flake-utils, gitignore}:
let
kitchenGen = import ./kitchen.nix;
in
flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; }; in
{
defaultPackage = (kitchenGen {
nixpkgs = pkgs;
gitignoreSrc = pkgs.callPackage gitignore { };
});
}
);
}

8
kitchen.nix Normal file
View File

@ -0,0 +1,8 @@
{nixpkgs, gitignoreSrc}:
with nixpkgs;
rustPlatform.buildRustPackage {
pname = "kitchen";
version = "0.0.2";
src = gitignoreSrc.gitignoreSource ./.;
cargoSha256 = "sha256-aSw+BX90rmcagVOkLVEfjlqTi+dv4QVT7JPZQd3eKjA=";
}