forked from elkowar/eww
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
76 lines (68 loc) · 2.06 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
inputs = {
flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
rust-overlay.url = "github:oxalica/rust-overlay";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, rust-overlay, flake-compat, ... }:
let
pkgsFor = system: import nixpkgs {
inherit system;
overlays = [
self.overlays.default
rust-overlay.overlays.default
];
};
targetSystems = [ "aarch64-linux" "x86_64-linux" ];
mkRustToolchain = pkgs: pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
in
{
overlays.default = final: prev:
let
rust = mkRustToolchain final;
rustPlatform = prev.makeRustPlatform {
cargo = rust;
rustc = rust;
};
in
{
eww = (prev.eww.override { inherit rustPlatform; }).overrideAttrs (old: {
version = self.rev or "dirty";
src = builtins.path { name = "eww"; path = prev.lib.cleanSource ./.; };
cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; };
patches = [ ];
});
eww-wayland = final.eww.override { withWayland = true; };
};
packages = nixpkgs.lib.genAttrs targetSystems (system:
let
pkgs = pkgsFor system;
in
(self.overlays.default pkgs pkgs) // {
default = self.packages.${system}.eww;
}
);
devShells = nixpkgs.lib.genAttrs targetSystems (system:
let
pkgs = pkgsFor system;
rust = mkRustToolchain pkgs;
in
{
default = pkgs.mkShell {
packages = with pkgs; [
rust
rust-analyzer-unwrapped
gcc
gtk3
gtk-layer-shell
pkg-config
deno
mdbook
];
RUST_SRC_PATH = "${rust}/lib/rustlib/src/rust/library";
};
}
);
};
}