-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
41 lines (35 loc) · 1.27 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
{
description = "uwuland is a highly customizable compositor that actually looks good";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
parts.url = "github:hercules-ci/flake-parts";
# not sure about crane but it is what it is
crane.url = "github:ipetkov/crane";
rust.url = "github:oxalica/rust-overlay";
};
outputs = inputs @ { self, nixpkgs, parts, crane, rust, ... }:
parts.lib.mkFlake { inherit inputs; } {
systems = ["aarch64-linux" "x86_64-linux" "aarch64-darwin"];
perSystem = { self', lib, system, ... }:
let
pkgs = nixpkgs.legacyPackages.${system}.extend rust.overlays.default;
rust-toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
craneLib = crane.lib.${system}.overrideToolchain rust-toolchain;
craneArgs = {
pname = "uwuland";
version = self.rev or "dirty";
src = craneLib.cleanCargoSource ./.;
cmakeFlags = [ "PREFIX=~/.local" ];
};
cargoArtifacts = craneLib.buildDepsOnly craneArgs;
uwuland = craneLib.buildPackage (craneArgs // { inherit cargoArtifacts; });
in {
apps.uwuland = {
type = "app";
program = lib.getExe self'.packages.default;
};
checks.uwuland = uwuland;
packages.default = uwuland;
};
};
}