forked from jD91mZM2/xidlehook
-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
40 lines (34 loc) · 1.08 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
{
description = "A rust program";
inputs = {
utils.url = "github:numtide/flake-utils";
naersk.url = "github:nmattia/naersk";
};
outputs = { self, nixpkgs, utils, naersk }:
utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
naersk-lib = naersk.lib."${system}";
nativeBuildInputs = with pkgs; [ pkgconfig python3 ];
buildInputs = with pkgs; [ libpulseaudio xorg.libxcb xorg.libXScrnSaver x11 ];
in
rec {
# `nix build`
packages.xidlehook = naersk-lib.buildPackage {
name = "xidlehook";
src = ./.;
inherit nativeBuildInputs buildInputs;
};
defaultPackage = packages.xidlehook;
# `nix run`
apps.xidlehook = utils.lib.mkApp {
drv = packages.xidlehook;
};
defaultApp = apps.xidlehook;
# `nix develop`
devShell = pkgs.mkShell {
buildInputs = buildInputs;
nativeBuildInputs = nativeBuildInputs ++ (with pkgs; [ rustc cargo gnome3.zenity pipes ]);
};
});
}