-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.nix
77 lines (66 loc) · 1.48 KB
/
package.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
{
version,
lib,
installShellFiles,
makeWrapper,
rustPlatform,
pkg-config,
ascii-image-converter,
fastfetch,
glib,
gexiv2,
iynaixos ? false,
}:
rustPlatform.buildRustPackage {
pname = "wfetch";
inherit version;
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.difference ./. (
# don't include in build
lib.fileset.unions [
./README.md
./LICENSE
# ./PKGBUILD
]
);
};
env.NIX_RELEASE_VERSION = version;
cargoLock.lockFile = ./Cargo.lock;
buildNoDefaultFeatures = true;
buildFeatures = [ "nixos" ] ++ lib.optionals iynaixos [ "iynaixos" ];
# create files for shell autocomplete
nativeBuildInputs = [
installShellFiles
makeWrapper
pkg-config
];
buildInputs = lib.optionals iynaixos [
glib
gexiv2
];
postInstall = ''
cp -r $src/assets $out
installShellCompletion --cmd wfetch \
--bash <($out/bin/wfetch --generate bash) \
--fish <($out/bin/wfetch --generate fish) \
--zsh <($out/bin/wfetch --generate zsh)
installManPage target/man/*
'';
postFixup = ''
wrapProgram $out/bin/wfetch \
--prefix PATH : "${
lib.makeBinPath [
ascii-image-converter
fastfetch
]
}"
'';
meta = with lib; {
description = "iynaix's custom fetch";
homepage = "https://github.com/iynaix/dotfiles";
mainProgram = "wfetch";
license = licenses.mit;
maintainers = [ maintainers.iynaix ];
};
}