-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
85 lines (80 loc) · 2.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
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
{
description = "A cli for the Firefly keyboard customization";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {nixpkgs, ...} @ inputs:
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux"];
perSystem = {
config,
system,
lib,
...
}: let
overlays = [(import inputs.rust-overlay)];
pkgs = import nixpkgs {
inherit system overlays;
};
rustPlatform = pkgs.makeRustPlatform {
rustc = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default);
cargo = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default);
};
graphicLibs = with pkgs; [
libGL
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
xorg.libXxf86vm
xorg.libxcb
libxkbcommon
wayland
];
in {
devShells.default = pkgs.mkShell rec {
inputsFrom = [config.packages.firefly-cli];
packages = with pkgs;
[
pre-commit
glxinfo
vscode-extensions.llvm-org.lldb-vscode
taplo
glib-networking
wireshark
usbutils
]
++ graphicLibs;
LD_LIBRARY_PATH = "${lib.makeLibraryPath packages}";
GIO_MODULE_DIR = "${pkgs.glib-networking}/lib/gio/modules/";
};
packages =
{
firefly-cli= rustPlatform.buildRustPackage {
pname = "firefly-cli";
version = "0.1.0";
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
};
nativeBuildInputs = with pkgs; [
pkg-config
];
buildInputs = with pkgs; [
systemd
];
};
}
// {default = config.packages.firefly-cli;};
formatter = pkgs.alejandra;
};
};
}