diff mbox series

[bug#67017] gnu: Add iptables-nft.

Message ID 6655067807f1485e3a8e9bea0c8319c691c40340.1699540137.git.hako@ultrarare.space
State New
Headers show
Series [bug#67017] gnu: Add iptables-nft. | expand

Commit Message

Hilton Chain Nov. 9, 2023, 2:36 p.m. UTC
* gnu/packages/linux.scm (iptables-nft): New variable.

Change-Id: I281514fcf05e70b4d62f374269c50c76bb676f78
---
 gnu/packages/linux.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)


base-commit: 960d7ac5a56155895543e03622f6555cc162d13a
diff mbox series

Patch

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 95a66e3d6a..596019ae5b 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -3101,6 +3101,33 @@  (define-public iptables
      '((release-monitoring-url . "https://www.netfilter.org/pub/iptables/")))
     (license license:gpl2+)))
 
+(define-public iptables-nft
+  (package/inherit iptables
+    (name "iptables-nft")
+    (arguments
+     (substitute-keyword-arguments (package-arguments iptables)
+       ((#:phases phases '%standard-phases)
+        #~(modify-phases #$phases
+            (add-after 'install 'symlink-xtables-nft-multi
+              (lambda _
+                (for-each
+                 (lambda (command-path)
+                   (let ((link-path (string-append #$output command-path)))
+                     (when (file-exists? link-path)
+                       (delete-file link-path))
+                     (symlink (string-append #$output "/sbin/xtables-nft-multi")
+                              link-path)))
+                 (apply append
+                        '("/bin/iptables-xml")
+                        (map (lambda (xtables)
+                               (list (string-append "/sbin/" xtables)
+                                     (string-append "/sbin/" xtables "-restore")
+                                     (string-append "/sbin/" xtables "-save")))
+                             '("arptables"
+                               "ebtables"
+                               "iptables"
+                               "ip6tables"))))))))))))
+
 (define-public bolt
   (package
     (name "bolt")