forked from mycitadel/mycitadel-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
76 lines (65 loc) · 1.89 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
{
description = "MyCitadel Wallet app for Linux, Windows & MacOS desktop made with GTK+ ";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
crane.url = "github:ipetkov/crane";
crane.inputs.nixpkgs.follows = "nixpkgs";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
naersk = {
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, naersk, nixpkgs, flake-utils, flake-compat, fenix, crane }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
fenix-pkgs = fenix.packages.${system};
fenix-channel = (fenix-pkgs.stable);
craneLib = (crane.mkLib pkgs).overrideScope' (final: prev: {
cargo = fenix-channel.cargo;
rustc = fenix-channel.rustc;
});
commonArgs = {
src = ./.;
buildInputs = [
pkgs.pango
pkgs.atk
pkgs.gtk3
];
nativeBuildInputs = [
pkgs.pkgconfig
fenix-channel.rustc
pkgs.lld
];
};
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // {
pname = "mycitadel-deps";
});
mycitadel = craneLib.buildPackage (commonArgs // {
pname = "mycitadel";
});
in {
defaultPackage = mycitadel;
devShell = pkgs.mkShell {
buildInputs = cargoArtifacts.buildInputs;
nativeBuildInputs = cargoArtifacts.nativeBuildInputs ++ [
fenix-pkgs.rust-analyzer
fenix-channel.rustfmt
fenix-channel.rustc
fenix-channel.cargo
];
RUST_SRC_PATH = "${fenix-channel.rust-src}/lib/rustlib/src/rust/library";
};
});
}