flake: Packaging definition.

This commit is contained in:
Blaž Hrastnik 2021-02-22 17:02:59 +09:00
parent def949e509
commit 41c0d5828f
3 changed files with 51 additions and 23 deletions

View file

@ -5,15 +5,22 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
naersk.url = "github:nmattia/naersk";
};
outputs = inputs@{ self, nixpkgs, rust-overlay, flake-utils, ... }:
outputs = inputs@{ self, nixpkgs, naersk, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; overlays = [ rust-overlay.overlay ]; };
naerskLib = pkgs.callPackage naersk {
inherit (pkgs.rust-bin.nightly.latest) rustc cargo;
};
in rec {
# packages.helix = pkgs.callPackage ./default.nix {};
# defaultPackage = packages.helix;
packages.helix = naerskLib.buildPackage {
pname = "helix";
root = ./.;
};
defaultPackage = packages.helix;
devShell = pkgs.callPackage ./shell.nix {};
});
}