-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
41 lines (35 loc) · 1.13 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
{
description = "A fully-featured minimalistic configurable rust calculator.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
cargoTOML = builtins.fromTOML (builtins.readFile ./Cargo.toml);
in
rec {
devShell = pkgs.mkShell {
inputsFrom = [ packages.calc ];
packages = [ pkgs.gnumake ];
};
formatter = pkgs.nixpkgs-fmt;
packages = rec {
default = calc;
calc = pkgs.rustPlatform.buildRustPackage {
inherit (cargoTOML.package) version;
pname = "calc";
src = ./.;
nativeBuildInputs = [ pkgs.makeWrapper ];
postFixup = ''
wrapProgram $out/bin/mini-calc \
--prefix PATH : "${pkgs.lib.makeBinPath [ pkgs.gnuplot ]}"
'';
cargoLock.lockFile = ./Cargo.lock;
meta.mainProgram = "mini-calc";
};
};
});
}