-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathflake.nix
More file actions
56 lines (48 loc) · 1.65 KB
/
flake.nix
File metadata and controls
56 lines (48 loc) · 1.65 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
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
nixpkgs-mozilla = {
url = "github:mozilla/nixpkgs-mozilla";
flake = false;
};
};
outputs = { self, flake-utils, naersk, nixpkgs, nixpkgs-mozilla }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = (import nixpkgs) {
inherit system;
overlays = [ (import nixpkgs-mozilla) ];
};
toolchain = (pkgs.rustChannelOf {
channel = "1.76.0";
sha256 = "sha256-e4mlaJehWBymYxJGgnbuCObVlqMlQSilZ8FljG9zPHY=";
}).rust;
naersk' = pkgs.callPackage naersk {
cargo = toolchain;
rustc = toolchain;
};
in with pkgs; rec {
defaultPackage = naersk'.buildPackage {
src = ./.;
buildInputs = [ pkg-config glib gtk3 xdg-utils ];
nativeBuildInputs = [ pkg-config wrapGAppsHook makeWrapper ];
postInstall = ''
cp -r $src/share $out/share
wrapProgram "$out/bin/openaws-vpn-client" \
--set-default OPENVPN_FILE "${openvpn-patched}/bin/openvpn" \
--set-default SHARED_DIR "$out/share"
'';
};
overlays.default = final: prev: {
openaws-vpn-client = self.outputs.defaultPackage.${prev.system};
};
openvpn-patched =
import ./openvpn.nix { inherit (pkgs) fetchpatch openvpn; };
devShell = mkShell {
buildInputs = [ pkg-config glib gtk3 openvpn-patched ];
nativeBuildInputs =
[ pkg-config wrapGAppsHook makeWrapper toolchain ];
};
});
}