-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
74 lines (67 loc) · 1.93 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=24.05"; # that's 23.05
utils.url = "github:numtide/flake-utils";
utils.inputs.nixpkgs.follows = "nixpkgs";
naersk.url = "github:nmattia/naersk";
naersk.inputs.nixpkgs.follows = "nixpkgs";
rust-overlay.url = "github:oxalica/rust-overlay";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
ancient-poetry.url = "git+https://codeberg.org/TyberiusPrime/ancient-poetry.git";
ancient-poetry.inputs.nixpkgs.follows = "nixpkgs";
#mozillapkgs = {
#url = "github:mozilla/nixpkgs-mozilla";
#flake = false;
#};
};
outputs = {
self,
nixpkgs,
utils,
naersk,
rust-overlay,
ancient-poetry,
}:
utils.lib.eachDefaultSystem (system: let
#pkgs = nixpkgs.legacyPackages."${system}";
overlays = [(import rust-overlay)];
pkgs = import nixpkgs {inherit system overlays;};
rust = pkgs.rust-bin.stable."1.72.0".default.override {
targets = ["x86_64-unknown-linux-musl"];
};
# Override the version used in naersk
naersk-lib = naersk.lib."${system}".override {
cargo = rust;
rustc = rust;
};
bacon = pkgs.bacon;
in rec {
# `nix build`
packages.my-project = naersk-lib.buildPackage {
pname = "anysnake2";
root = ./.;
};
defaultPackage = packages.my-project;
# `nix run`
apps.my-project = utils.lib.mkApp {drv = packages.my-project;};
defaultApp = apps.my-project;
# `nix develop`
devShell = pkgs.mkShell {
# supply the specific rust version
nativeBuildInputs = [
rust
pkgs.rust-analyzer
pkgs.git
pkgs.cargo-udeps
pkgs.cargo-crev
pkgs.cargo-vet
pkgs.cargo-outdated
pkgs.cargo-audit
ancient-poetry.defaultPackage.x86_64-linux
bacon
pkgs.jujutsu
];
};
});
}
# {