-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
53 lines (47 loc) · 1.61 KB
/
Copy pathflake.nix
File metadata and controls
53 lines (47 loc) · 1.61 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
{
description = "cpolar tunnel info query scripts";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/e7a3ca8092b61ff85b6a45bf863ea2b2d6a661b3";
};
outputs = { self, nixpkgs }:
let
systems = [ "x86_64-linux" "aarch64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs systems;
in
{
packages = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
default = pkgs.stdenv.mkDerivation {
pname = "cpolar-status";
version = "0.1.0";
src = self;
meta.mainProgram = "cpolar-status";
nativeBuildInputs = [ pkgs.makeWrapper pkgs.gettext ];
buildInputs = [ pkgs.bash pkgs.jq pkgs.curl pkgs.gettext ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/locale/zh_CN/LC_MESSAGES
install -m755 cpolar-status.sh $out/bin/cpolar-status
msgfmt po/zh_CN.po -o $out/share/locale/zh_CN/LC_MESSAGES/cpolar-status.mo
wrapProgram $out/bin/cpolar-status \
--set TEXTDOMAIN cpolar-status \
--set TEXTDOMAINDIR $out/share/locale \
--prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.bash pkgs.jq pkgs.curl pkgs.gettext ]}
runHook postInstall
'';
};
});
devShells = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
default = pkgs.mkShell {
packages = [ pkgs.jq pkgs.curl pkgs.gettext ];
};
});
};
}