From 9248259708bd6ade5e334a2cdfb29d2a20acb0dd Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 3 Oct 2022 17:15:36 +0200 Subject: ... --- modules/netns.nix | 14 +++++++------- modules/zfssnap/default.nix | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'modules') diff --git a/modules/netns.nix b/modules/netns.nix index d4f07feb..dca3c0db 100644 --- a/modules/netns.nix +++ b/modules/netns.nix @@ -1,6 +1,6 @@ { pkgs, config, lib, ... }: -with lib; +with lib; let cfg = config.networking.namespaces; @@ -56,12 +56,12 @@ let wants = ["network.target"]; conflicts = ["shutdown.target"]; - path = with pkgs; [ iproute config.systemd.package ]; + path = with pkgs; [ iproute2 config.systemd.package ]; serviceConfig = { SyslogIdentifier = "netns container ${containerName}"; Type = "notify"; - + RestartForceExitStatus = "133"; SuccessExitStatus = "133"; @@ -114,7 +114,7 @@ let --capability=CAP_SYS_TTY_CONFIG,CAP_NET_ADMIN,CAP_NET_RAW,CAP_SYS_ADMIN \ --ephemeral \ --network-namespace-path=/run/netns/${containerCfg.netns} \ - ${containerInit} "${containerCfg.config.system.build.toplevel}/init" + ${containerInit} "${containerCfg.config.system.build.toplevel}/init" ''; }; in { @@ -133,13 +133,13 @@ in { assertions = [ { assertion = cfg.containers != {} -> cfg.enable; message = "netns containers require netns@ service template"; } ]; - + systemd.services = { "netns@" = mkIf cfg.enable { description = "%I network namspace"; before = [ "network-pre.target" ]; wants = [ "network-pre.target" ]; - path = with pkgs; [ iproute utillinux ]; + path = with pkgs; [ iproute2 util-linux ]; serviceConfig = { Type = "oneshot"; RemainAfterExit = true; @@ -149,7 +149,7 @@ in { umount /var/run/netns/"$1" mount --bind /proc/self/ns/net /var/run/netns/"$1" ''} %I"; - ExecStop = "${pkgs.iproute}/bin/ip netns del %I"; + ExecStop = "${pkgs.iproute2}/bin/ip netns del %I"; }; }; } // mapAttrs' mkContainerService cfg.containers; diff --git a/modules/zfssnap/default.nix b/modules/zfssnap/default.nix index f3e2f9c2..42cdf46f 100644 --- a/modules/zfssnap/default.nix +++ b/modules/zfssnap/default.nix @@ -11,7 +11,7 @@ let buildInputs = with pkgs; [makeWrapper]; - python = pkgs.python39.withPackages (ps: with ps; [pyxdg pytimeparse dateutil]); + python = pkgs.python39.withPackages (ps: with ps; [pyxdg pytimeparse python-dateutil]); buildPhase = '' substitute $src zfssnap \ -- cgit v1.2.3