-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
49 lines (46 loc) · 1.43 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
cargo2nix.url = "github:cargo2nix/cargo2nix/feature/add-basic-flake-support";
};
outputs = { self, nixpkgs, flake-utils, rust-overlay, cargo2nix, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [
(import rust-overlay)
(import "${cargo2nix}/overlay")
];
pkgs = import nixpkgs {
inherit system overlays;
};
in
with pkgs;
{
devShell = mkShell {
buildInputs = [
rust-bin.stable.latest.default
cargo2nix.defaultPackage.${system}
# X
xdotool
];
};
defaultPackage =
(pkgs.rustBuilder.makePackageSet' {
rustChannel = "stable";
packageFun = import ./Cargo.nix;
packageOverrides =
let
no-sleep = pkgs.rustBuilder.rustLib.makeOverride {
name = "no-sleep";
overrideAttrs = drv: {
propagatedBuildInputs =
(drv.propagatedBuildInputs or [ ]) ++ [ pkgs.xdotool ];
};
};
in
pkgs: pkgs.rustBuilder.overrides.all ++ [ no-sleep ];
}).workspace.no-sleep {};
});
}