-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
53 lines (50 loc) · 1.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
{
description = "flake for bol-van/zapret";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/master";
inputs.zapret-src = {
type = "github";
owner = "bol-van";
repo = "zapret";
flake = false;
};
outputs = inputs @ {
self,
nixpkgs,
zapret-src,
}: let
lib = nixpkgs.lib;
linux = ["x86_64-linux" "aarch64-linux"];
forEachSystem = systems: f: lib.genAttrs systems (system: f system);
forAllSystems = forEachSystem linux;
in {
nixosModules.zapret = import ./module.nix self;
packages = forAllSystems (system: let
pkgs = import nixpkgs {inherit system;};
in {
zapret = pkgs.stdenv.mkDerivation rec {
pname = "zapret";
version = "";
src = zapret-src;
buildPhase = "true";
config = ""; # for pkg overriding
installPhase = ''
mkdir -p $out
cp -r --no-preserve=mode $src $out/src
echo "$config" > $out/src/config
chmod -R +x $out/src
ls $out/src
$out/src/install_bin.sh
'';
outputs = ["out"];
propagatedBuildInputs = with pkgs; [
curl
iptables
nftables
gawk
procps
];
};
default = self.packages.${system}.zapret;
});
};
}