Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
104 lines (91 loc) · 2.47 KB
/
Copy pathflake.nix
File metadata and controls
104 lines (91 loc) · 2.47 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
{
description = "nmrs-gui development flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
naersk.url = "github:nix-community/naersk/master";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
flake-utils,
naersk,
rust-overlay,
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {
inherit system;
overlays = [(import rust-overlay)];
};
inherit (pkgs) lib;
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
cargoToml = lib.importTOML ./Cargo.toml;
nativeBuildInputs = with pkgs; [
pkg-config
];
buildInputs = with pkgs; [
glib-networking
gobject-introspection
gtk4
libadwaita
libxkbcommon
wayland
glib
];
naersk-package = pkgs.callPackage naersk {
cargo = toolchain;
rustc = toolchain;
clippy = toolchain;
};
in {
devShells.default = with pkgs;
mkShell {
packages =
[
toolchain
cargo-info
rust-analyzer
just
eza
fd
fzf
bat
]
++ nativeBuildInputs
++ buildInputs;
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";
shellHook = ''
alias ls=eza
alias find=fd
'';
};
devShell = self.devShells.${system}.default;
packages.default = naersk-package.buildPackage {
pname = "nmrs-gui";
version = cargoToml.package.version;
src = ./.;
nativeBuildInputs =
nativeBuildInputs
++ (with pkgs; [
wrapGAppsHook4
]);
inherit buildInputs;
postInstall = ''
install -D nmrs.desktop -t $out/share/applications
'';
meta = with lib; {
description = cargoToml.package.description;
homepage = cargoToml.package.repository;
license = licenses.mit;
mainProgram = "nmrs-gui";
platforms = platforms.linux;
};
};
}
);
}