Skip to content

Commit

Permalink
Add nix flake (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
jurraca authored Jun 8, 2022
1 parent b93da8f commit f04b3bf
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 0 deletions.
74 changes: 74 additions & 0 deletions flake.lock

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

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

outputs = { self, nixpkgs, flake-utils, naersk }:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = nixpkgs.legacyPackages."${system}";
naersk-lib = naersk.lib."${system}";
in
rec {
# `nix build`
packages.ord = naersk-lib.buildPackage {
pname = "ord";
root = ./.;
nativeBuildInputs = with pkgs; [ rustc cargo openssl pkg-config ];
};
defaultPackage = packages.ord;

# `nix run`
apps.ord = flake-utils.lib.mkApp {
drv = packages.ord;
};
defaultApp = apps.ord;

# `nix develop`
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ rustc cargo openssl pkg-config ];
};
}
);
}

0 comments on commit f04b3bf

Please sign in to comment.