From cc7daeabb31107c6e25489635fc5299ea2721ca9 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Wed, 8 Feb 2023 18:10:11 +0000 Subject: [PATCH] add routeros to overlay --- default.nix | 16 +++++++--------- overlay.nix | 9 ++++++--- .../ppp-server => pkgs/routeros}/README.md | 0 .../ppp-server => pkgs/routeros}/default.nix | 0 .../routeros}/ros-exec-script.py | 0 .../ppp-server => pkgs/routeros}/routeros.config | 0 tests/pppoe/test.nix | 4 ++-- 7 files changed, 15 insertions(+), 14 deletions(-) rename {tests/support/ppp-server => pkgs/routeros}/README.md (100%) rename {tests/support/ppp-server => pkgs/routeros}/default.nix (100%) rename {tests/support/ppp-server => pkgs/routeros}/ros-exec-script.py (100%) rename {tests/support/ppp-server => pkgs/routeros}/routeros.config (100%) diff --git a/default.nix b/default.nix index fa42321..4a3b6c0 100644 --- a/default.nix +++ b/default.nix @@ -97,13 +97,11 @@ in { # cross-compiling nix-shell for any package we're customizing inherit pkgs; - buildEnv = - let routeros = pkgs.pkgsBuildBuild.callPackage ./tests/support/ppp-server {}; - in pkgs.mkShell { - packages = [ - pkgs.pkgsBuildBuild.tufted - routeros.routeros - routeros.ros-exec-script - ]; - }; + buildEnv = pkgs.mkShell { + packages = with pkgs.pkgsBuildBuild; [ + tufted + routeros.routeros + routeros.ros-exec-script + ]; + }; } diff --git a/overlay.nix b/overlay.nix index d7bf8a0..e00aac4 100644 --- a/overlay.nix +++ b/overlay.nix @@ -25,9 +25,6 @@ final: prev: { nettle = null; }; - - tufted = final.callPackage ./pkgs/tufted {}; - pppoe = final.callPackage ./pkgs/pppoe {}; ppp = (prev.ppp.override { @@ -83,4 +80,10 @@ final: prev: { sha256 = "0b03bdvm388kwlcz97aflpr3ir1zpa3m0bq3s6cd3pp5a667lcwz"; }; }; + + # these are packages for the build system not the host/target + + tufted = final.callPackage ./pkgs/tufted {}; + routeros = final.callPackage ./pkgs/routeros {}; + } diff --git a/tests/support/ppp-server/README.md b/pkgs/routeros/README.md similarity index 100% rename from tests/support/ppp-server/README.md rename to pkgs/routeros/README.md diff --git a/tests/support/ppp-server/default.nix b/pkgs/routeros/default.nix similarity index 100% rename from tests/support/ppp-server/default.nix rename to pkgs/routeros/default.nix diff --git a/tests/support/ppp-server/ros-exec-script.py b/pkgs/routeros/ros-exec-script.py similarity index 100% rename from tests/support/ppp-server/ros-exec-script.py rename to pkgs/routeros/ros-exec-script.py diff --git a/tests/support/ppp-server/routeros.config b/pkgs/routeros/routeros.config similarity index 100% rename from tests/support/ppp-server/routeros.config rename to pkgs/routeros/routeros.config diff --git a/tests/pppoe/test.nix b/tests/pppoe/test.nix index 4ac2df2..258bb47 100644 --- a/tests/pppoe/test.nix +++ b/tests/pppoe/test.nix @@ -6,8 +6,8 @@ let img = (import liminix { device = import "${liminix}/devices/qemu/"; liminix-config = ./configuration.nix; }).outputs.default; - pkgs = import {}; - ros = pkgs.callPackage ../support/ppp-server {}; + pkgs = import { overlays = [(import ../../overlay.nix)]; }; + ros = pkgs.pkgsBuildBuild.routeros; run-qemu = pkgs.writeShellScriptBin "run-qemu" '' export PATH="${pkgs.lib.makeBinPath [pkgs.qemu]}:$PATH" ${builtins.readFile ../../scripts/run-qemu.sh}