Skip to content

Commit

Permalink
Add nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
brumhard committed May 4, 2023
1 parent b3d1b0b commit b3e46e0
Show file tree
Hide file tree
Showing 2 changed files with 188 additions and 0 deletions.
145 changes: 145 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
};

outputs = { self, nixpkgs, utils, naersk, fenix }: utils.lib.eachDefaultSystem
(system:
let
name = "rl";
version = "latest";
# https://discourse.nixos.org/t/using-nixpkgs-legacypackages-system-vs-import/17462/7
pkgs = nixpkgs.legacyPackages.${system};
naersk' = naersk.lib.${system};
in
with pkgs;
rec {
packages = {
default = packages.${name};
"${name}" = naersk'.buildPackage {
inherit name version;
src = ./.;
};
};

apps = {
default = apps.${name};
"${name}" = utils.lib.mkApp {
drv = packages.default;
exePath = "/bin/${name}";
};
};

devShell = mkShell {
packages = [
cargo-audit
mask
];
};
}
);
}

0 comments on commit b3e46e0

Please sign in to comment.