-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
80 lines (71 loc) · 2.03 KB
/
Copy pathflake.nix
File metadata and controls
80 lines (71 loc) · 2.03 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
{
description = "qmtui - TUI frontend for QueryMT agent";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = inputs @ {
self,
flake-parts,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = inputs.nixpkgs.lib.systems.flakeExposed;
perSystem = {system, ...}: let
overlays = [inputs.rust-overlay.overlays.default];
pkgs = import inputs.nixpkgs {
inherit system overlays;
};
rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
qmtui = pkgs.rustPlatform.buildRustPackage {
pname = "qmtui";
version = cargoToml.package.version;
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
};
nativeBuildInputs = [
pkgs.pkg-config
];
buildInputs = [
pkgs.openssl
];
auditable = false;
doCheck = false;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -Dm755 target/${pkgs.stdenv.hostPlatform.rust.rustcTarget}/release/qmtui $out/bin/qmtui
runHook postInstall
'';
};
in {
packages = {
qmtui = qmtui;
default = qmtui;
};
apps = {
qmtui = {
type = "app";
program = "${self.packages.${system}.qmtui}/bin/qmtui";
};
default = {
type = "app";
program = "${self.packages.${system}.qmtui}/bin/qmtui";
};
};
devShells.default = pkgs.mkShell {
packages = [
rustToolchain
pkgs.pkg-config
pkgs.openssl
];
shellHook = ''
export PS1="(dev:qmtui) $PS1"
'';
};
};
};
}