build for Nix with naersk

This commit is contained in:
Brian Hicks 2024-05-14 07:10:21 -05:00
parent 84080e8048
commit 72d1ae5896
No known key found for this signature in database
GPG Key ID: C4F324B9CAAB0D50
2 changed files with 36 additions and 3 deletions

View File

@ -18,6 +18,26 @@
"type": "github"
}
},
"naersk": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1713520724,
"narHash": "sha256-CO8MmVDmqZX2FovL75pu5BvwhW+Vugc7Q6ze7Hj8heI=",
"owner": "nmattia",
"repo": "naersk",
"rev": "c5037590290c6c7dae2e42e7da1e247e54ed2d49",
"type": "github"
},
"original": {
"owner": "nmattia",
"repo": "naersk",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1714314149,
@ -37,6 +57,7 @@
"root": {
"inputs": {
"flake-utils": "flake-utils",
"naersk": "naersk",
"nixpkgs": "nixpkgs"
}
},

View File

@ -1,15 +1,27 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
naersk = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:nmattia/naersk";
};
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = inputs:
inputs.flake-utils.lib.eachDefaultSystem (system:
let pkgs = import inputs.nixpkgs { inherit system; };
in {
let
pkgs = import inputs.nixpkgs { inherit system; };
naersk-lib = inputs.naersk.lib."${system}";
in
rec {
formatter = pkgs.nixpkgs-fmt;
packages.elm-duet = naersk-lib.buildPackage {
root = ./.;
};
defaultPackage = packages.elm-duet;
devShell = pkgs.mkShell {
packages = [
pkgs.cargo