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

11
Cargo.lock generated
View file

@ -199,7 +199,6 @@ dependencies = [
"libc",
"num-integer",
"num-traits",
"time",
"winapi",
]
@ -1265,16 +1264,6 @@ dependencies = [
"once_cell",
]
[[package]]
name = "time"
version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
dependencies = [
"libc",
"winapi",
]
[[package]]
name = "tinyvec"
version = "1.1.1"

View file

@ -30,13 +30,44 @@
"type": "github"
}
},
"naersk": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1613655351,
"narHash": "sha256-BLBnt3BYsh92qKgqZljckM9s5sZUt30cBQF5b/5pVCU=",
"owner": "nmattia",
"repo": "naersk",
"rev": "1a9e5ddc51bc44c1bf872e02fe2702dc40e8af48",
"type": "github"
},
"original": {
"owner": "nmattia",
"repo": "naersk",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1612996220,
"narHash": "sha256-l2kzWXxL3vXr8VxUzRtORPJS0nFQ3E5kBPF/AYAK0wI=",
"lastModified": 1613917044,
"narHash": "sha256-YvBBwtvrnove51SXQ67OVQHctYjEEpFu6GEzRe0pp5I=",
"path": "/nix/store/8mfw3h418igbhn3kh2fglr3nm96x3117-source",
"rev": "aed173ff9707387b238c1c7e143152ca9d8878e9",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1613761605,
"narHash": "sha256-lUF6UPR96ZzQC0faNXBHLoLhNAdxZqYqDwz0PaIZ/7Y=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "758b29b5a28b818e311ad540637a5c1e40867489",
"rev": "9816b99e71c3504b0b4c1f8b2e004148460029d4",
"type": "github"
},
"original": {
@ -46,7 +77,7 @@
"type": "github"
}
},
"nixpkgs_2": {
"nixpkgs_3": {
"locked": {
"lastModified": 1609079092,
"narHash": "sha256-KhyKfxBHtZlAgudpZ0EJVzeuqROjKfVOwj8j0cuhU50=",
@ -62,21 +93,22 @@
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"naersk": "naersk",
"nixpkgs": "nixpkgs_2",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1613096734,
"narHash": "sha256-ttHv5tlL8JGn26V2xMQMjNy5Om6WKN1RhB2OxXhF4rY=",
"lastModified": 1613960870,
"narHash": "sha256-SvBexW2AGCaiNGXVaQ/6f31vSttrJs1K8VVVhuvkXeA=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "0ae7d76e9f72ef5c225710946c79c50a9eafe2f9",
"rev": "455f57703929bb5dc6e965cc6933c0e6f005a236",
"type": "github"
},
"original": {

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 {};
});
}