-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
76 lines (69 loc) · 2.09 KB
/
flake.nix
File metadata and controls
76 lines (69 loc) · 2.09 KB
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 = {
naersk.url = "github:nix-community/naersk/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils, naersk }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
libPath = with pkgs; lib.makeLibraryPath [
libxkbcommon
wayland
vulkan-loader
libxkbcommon
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libxcb
pkgs.glfw
];
desktopItem = pkgs.makeDesktopItem {
name = "se.frikod.lolitop";
exec = "lolitop";
icon = "lolitop.svg";
comment = "Eye-candy system monitor .";
desktopName = "lolitop";
genericName = "CPU Usage Visualizer";
categories = [ "Utility" ];
};
in
{
packages.default = naersk-lib.buildPackage rec {
src = ./.;
nativeBuildInputs = [ pkgs.makeWrapper ];
postInstall = ''
wrapProgram "$out/bin/lolitop" --prefix LD_LIBRARY_PATH : "${libPath}"
mkdir -p $out/share/icons/hicolor/scalable/apps
mkdir -p $out/share/applications
cp ${self}/assets/icon.svg $out/share/icons/hicolor/scalable/apps/lolitop.svg
cp ${desktopItem}/share/applications/${desktopItem.name} \
$out/share/applications
'';
};
devShell = with pkgs; mkShell {
buildInputs = [
cargo
rustc
rustfmt
pre-commit
rustPackages.clippy
rust-analyzer
wayland
libGL
wayland
vulkan-loader
libxkbcommon
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libxcb
pkgs.glfw
];
LD_LIBRARY_PATH = libPath;
RUST_SRC_PATH = rustPlatform.rustLibSrc;
};
});
}