-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
59 lines (53 loc) · 1.49 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
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
};
outputs = { self, nixpkgs, flake-utils, naersk }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
naersk-lib = naersk.lib."${system}";
libPath = with pkgs;
lib.makeLibraryPath [
libGL
libxkbcommon
wayland
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
alsa-lib
udev
];
in rec {
# `nix build`
packages.freecell = naersk-lib.buildPackage {
pname = "freecell";
root = ./.;
buildInputs = with pkgs; [ pkg-config alsa-lib udev ];
nativeBuildInputs = with pkgs; [ makeWrapper ];
postInstall = ''
wrapProgram "$out/bin/freecell" --prefix LD_LIBRARY_PATH : "${libPath}"
'';
};
defaultPackage = packages.freecell;
# `nix run`
apps.freecell = flake-utils.lib.mkApp { drv = packages.freecell; };
defaultApp = apps.freecell;
# `nix develop`
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
rustc
cargo
rustfmt
rustPackages.clippy
rust-analyzer
pkg-config
alsa-lib
udev
];
LD_LIBRARY_PATH = libPath;
};
});
}