Merge commit '9361b7eb85045c7e7dd20d2ddd716a9d10bf4bd4' into ericson2314-cross-base

This commit is contained in:
John Ericson 2018-01-03 17:20:40 -05:00
commit 0e23478a7e
3 changed files with 33 additions and 7 deletions

View File

@ -19,6 +19,8 @@ let
iptables -w -t nat -D POSTROUTING -j nixos-nat-post 2>/dev/null || true iptables -w -t nat -D POSTROUTING -j nixos-nat-post 2>/dev/null || true
iptables -w -t nat -F nixos-nat-post 2>/dev/null || true iptables -w -t nat -F nixos-nat-post 2>/dev/null || true
iptables -w -t nat -X nixos-nat-post 2>/dev/null || true iptables -w -t nat -X nixos-nat-post 2>/dev/null || true
${cfg.extraStopCommands}
''; '';
setupNat = '' setupNat = ''
@ -59,6 +61,8 @@ let
--to-destination ${cfg.dmzHost} --to-destination ${cfg.dmzHost}
''} ''}
${cfg.extraCommands}
# Append our chains to the nat tables # Append our chains to the nat tables
iptables -w -t nat -A PREROUTING -j nixos-nat-pre iptables -w -t nat -A PREROUTING -j nixos-nat-pre
iptables -w -t nat -A POSTROUTING -j nixos-nat-post iptables -w -t nat -A POSTROUTING -j nixos-nat-post
@ -170,6 +174,28 @@ in
''; '';
}; };
networking.nat.extraCommands = mkOption {
type = types.lines;
default = "";
example = "iptables -A INPUT -p icmp -j ACCEPT";
description =
''
Additional shell commands executed as part of the nat
initialisation script.
'';
};
networking.nat.extraStopCommands = mkOption {
type = types.lines;
default = "";
example = "iptables -D INPUT -p icmp -j ACCEPT || true";
description =
''
Additional shell commands executed as part of the nat
teardown script.
'';
};
}; };

View File

@ -1,19 +1,19 @@
{ stdenv, fetchFromGitHub, pythonPackages }: { stdenv, fetchFromGitHub, python3Packages }:
pythonPackages.buildPythonApplication rec { python3Packages.buildPythonApplication rec {
version = "0.15.0"; version = "0.16.2";
name = "toot-${version}"; name = "toot-${version}";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "ihabunek"; owner = "ihabunek";
repo = "toot"; repo = "toot";
rev = "${version}"; rev = "${version}";
sha256 = "08k913gw0ip2q686z9k63bcn1n5s4w6b7jj6jmmamm427xmibkph"; sha256 = "19n6rmm44y24zvkpk56vd2xmx49sn6wc5qayi1jm83jlnlbbwfh7";
}; };
checkInputs = with pythonPackages; [ pytest ]; checkInputs = with python3Packages; [ pytest ];
propagatedBuildInputs = with pythonPackages; propagatedBuildInputs = with python3Packages;
[ requests beautifulsoup4 future ]; [ requests beautifulsoup4 future ];
checkPhase = '' checkPhase = ''

View File

@ -72,7 +72,7 @@ in rec {
sphinx = pkgs.python27Packages.sphinx; sphinx = pkgs.python27Packages.sphinx;
}; };
ghc822 = callPackage ../development/compilers/ghc/8.2.2.nix rec { ghc822 = callPackage ../development/compilers/ghc/8.2.2.nix rec {
bootPkgs = packages.ghc7103Binary; bootPkgs = packages.ghc821Binary;
inherit (bootPkgs) hscolour alex happy; inherit (bootPkgs) hscolour alex happy;
inherit buildPlatform targetPlatform; inherit buildPlatform targetPlatform;
sphinx = pkgs.python3Packages.sphinx; sphinx = pkgs.python3Packages.sphinx;