-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
95 lines (86 loc) · 2.24 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
{
description = "a custom discord client written in rust";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
crane.url = "github:ipetkov/crane";
};
outputs = {
self,
nixpkgs,
crane,
flake-utils,
rust-overlay,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [(import rust-overlay)];
};
inherit (pkgs) lib;
craneLib = crane.mkLib pkgs;
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
(craneLib.fileset.commonCargoSources ./.)
# ./public/.
(lib.fileset.fileFilter (file: lib.any file.hasExt ["html" "css"]) ./.)
];
};
cargoArtifacts = craneLib.buildDepsOnly {
inherit src;
CARGO_BUILD_TARGET = "wasm32-unknown-unknown";
doCheck = false;
};
nativeBuildInputs = with pkgs; [
pkg-config
gobject-introspection
cargo-tauri
(rust-bin.stable.latest.default.override {
targets = ["wasm32-unknown-unknown"];
})
];
buildInputs = with pkgs; [
at-spi2-atk
atkmm
cairo
gdk-pixbuf
glib
gtk3
harfbuzz
librsvg
libsoup_3
pango
webkitgtk_4_1
openssl
librsvg
];
discidium = craneLib.buildPackage {
name = "discidium";
inherit buildInputs nativeBuildInputs cargoArtifacts src;
postInstall = ''
# cargo tauri build
# wrapProgram $out/bin/discidium \
# --prefix LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath buildInputs}"
'';
};
in {
packages.default = discidium;
apps.default = flake-utils.lib.mkApp {
drv = discidium;
};
devShell = pkgs.mkShell {
inherit buildInputs nativeBuildInputs;
# LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
packages = with pkgs; [
trunk
];
# RUST_BACKTRACE = 1;
};
});
}