-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
49 lines (46 loc) · 1.47 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
naersk = {
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
mozillapkgs = {
url = "github:mozilla/nixpkgs-mozilla";
flake = false;
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, naersk, mozillapkgs, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
mozilla = pkgs.callPackage (mozillapkgs + "/package-set.nix") { };
rust = (mozilla.rustChannelOf {
date = "2022-06-28"; # get the current date with `date -I`
channel = "nightly";
sha256 = "sha256-vHXJ3IqSOE55qSC0BMmCNJjgs4Bs0n0FhiKUf1yPoFQ";
}).rust;
naersk-lib = naersk.lib."${system}".override {
cargo = rust;
rustc = rust;
};
in rec {
# `nix build`
packages.ckiesite = naersk-lib.buildPackage {
pname = "ckiesite";
root = ./.;
};
defaultPackage = packages.ckiesite;
# `nix run`
apps.ckiesite = flake-utils.lib.mkApp { drv = packages.ckiesite; };
defaultApp = apps.ckiesite;
# `nix develop`
devShell = pkgs.mkShell { nativeBuildInputs = with pkgs; [ rust ]; };
});
}