forked from elkowar/eww
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
47 lines (41 loc) · 1.57 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
{
inputs = {
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
naersk.url = "github:nmattia/naersk";
};
outputs = { self, flake-utils, fenix, nixpkgs, naersk, flake-compat, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
# Add rust nightly to pkgs
pkgs = nixpkgs.legacyPackages.${system} // { inherit (fenix.packages.${system}.latest) cargo rustc rust-src clippy-preview rustfmt-preview; };
naersk-lib = (naersk.lib."${system}".override {
cargo = pkgs.cargo;
rustc = pkgs.rustc;
});
eww = { wayland ? false }:
naersk-lib.buildPackage {
pname = "eww";
buildInputs = pkgs.lib.optional wayland pkgs.gtk-layer-shell;
nativeBuildInputs = with pkgs; [ pkg-config gtk3 ];
cargoBuildOptions = opts: opts ++ pkgs.lib.optionals wayland [ "--no-default-features" "--features=wayland" ];
root = ./.;
};
in rec {
packages.eww = eww {};
packages.eww-wayland = eww {wayland=true;};
defaultPackage = self.packages.${system}.eww;
apps.eww = flake-utils.lib.mkApp { drv = packages.eww; };
apps.eww-wayland = flake-utils.lib.mkApp { drv = packages.eww-wayland; };
defaultApp = apps.eww;
devShell = import ./shell.nix { inherit pkgs; };
});
}