forked from max-niederman/ttyper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
45 lines (41 loc) · 1.15 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
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "nixpkgs/nixos-unstable";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
naersk.url = "github:nmattia/naersk";
};
outputs = { self, nixpkgs, flake-utils, fenix, naersk }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
rust = with fenix.packages.${system}; stable;
naersk-lib = naersk.lib.${system}.override {
inherit (rust) rustc cargo;
};
in
rec {
# `nix build`
packages.ttyper = naersk-lib.buildPackage {
pname = "ttyper";
root = ./.;
};
defaultPackage = packages.ttyper;
# `nix run`
apps.ttyper = flake-utils.lib.mkApp {
drv = packages.ttyper;
};
defaultApp = apps.ttyper;
# `nix develop`
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
(rust.withComponents [ "rustc" "cargo" "rust-src" "rustfmt" "clippy" ])
rust-analyzer
];
};
}
);
}