-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
63 lines (51 loc) · 1.86 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
rust-overlay.url = "github:oxalica/rust-overlay";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
gitignore.url = "github:hercules-ci/gitignore.nix";
gitignore.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, rust-overlay, gitignore }:
let
inherit (nixpkgs.lib) genAttrs;
forAllSystems = genAttrs [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
forAllPkgs = function: forAllSystems (system: function pkgs.${system});
mkApp = (program: { type = "app"; inherit program; });
pkgs = forAllSystems (system: (import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
}));
in
{
formatter = forAllPkgs (pkgs: pkgs.nixpkgs-fmt);
packages = forAllPkgs (pkgs: rec {
default = app;
app = pkgs.callPackage ./package.nix { inherit gitignore; };
});
apps = forAllSystems (system: rec {
default = app;
app = mkApp (pkgs.getExe self.packages.${system}.app);
});
devShells = forAllPkgs (pkgs:
with pkgs.lib;
let
file-rust-toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
rust-toolchain = file-rust-toolchain.override { extensions = [ "rust-analyzer" ]; };
in
{
default = pkgs.mkShell rec {
nativeBuildInputs = with pkgs; [
pkg-config
rust-toolchain
act
];
buildInputs = with pkgs; [ ];
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
LD_LIBRARY_PATH = makeLibraryPath buildInputs;
RUST_LOG = "ruspell::lookup=debug,ruspell=info,info";
HUNSPELL_DICT = "${pkgs.hunspellDicts.en_US-large}/share/hunspell/en_US";
};
});
};
}