From e46abbccca2063f887b2b9eab7d3a93b1262843e Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Thu, 22 Sep 2022 11:10:41 +0100 Subject: [PATCH] put liminix-tools in package overlay --- default.nix | 1 - overlay.nix | 1 + {tools => pkgs/liminix-tools}/builder.sh | 0 {tools => pkgs/liminix-tools}/default.nix | 6 ++---- pkgs/liminix-tools/networking/udhcpc.nix | 10 ++++++++++ tests/smoke/configuration.nix | 6 +++--- 6 files changed, 16 insertions(+), 8 deletions(-) rename {tools => pkgs/liminix-tools}/builder.sh (100%) rename {tools => pkgs/liminix-tools}/default.nix (93%) create mode 100644 pkgs/liminix-tools/networking/udhcpc.nix diff --git a/default.nix b/default.nix index aad4100..f768fc5 100644 --- a/default.nix +++ b/default.nix @@ -11,7 +11,6 @@ let }; config = baseConfig // (import ) { config = baseConfig; - tools = nixpkgs.pkgs.callPackage ./tools {}; inherit (nixpkgs) pkgs; }; finalConfig = config // { diff --git a/overlay.nix b/overlay.nix index f252960..bf6e47c 100644 --- a/overlay.nix +++ b/overlay.nix @@ -2,4 +2,5 @@ final: prev: { pseudofile = final.callPackage ./pkgs/pseudofile {}; s6-init-files = final.callPackage ./pkgs/s6-init-files {}; strace = prev.strace.override { libunwind = null; }; + liminix = final.callPackage ./pkgs/liminix-tools {}; } diff --git a/tools/builder.sh b/pkgs/liminix-tools/builder.sh similarity index 100% rename from tools/builder.sh rename to pkgs/liminix-tools/builder.sh diff --git a/tools/default.nix b/pkgs/liminix-tools/default.nix similarity index 93% rename from tools/default.nix rename to pkgs/liminix-tools/default.nix index 23fee9a..0b7d30e 100644 --- a/tools/default.nix +++ b/pkgs/liminix-tools/default.nix @@ -3,6 +3,7 @@ , s6-rc , lib , busybox +, callPackage } :let inherit (builtins) concatStringsSep; longrun = { @@ -71,10 +72,7 @@ in { up = "ip address add ${addr} dev ${interface.device} "; down = "ip address del ${addr} dev ${interface.device} "; }; - udhcpc = interface: { ... } @ args: longrun { - name = "${interface.device}.udhcp"; - run = "${busybox}/bin/udhcpc -f -i ${interface.device}"; - }; + udhcpc = callPackage ./networking/udhcpc.nix {}; odhcpc = interface: { ... } @ args: longrun { name = "${interface.device}.odhcp"; run = "odhcpcd ${interface.device}"; diff --git a/pkgs/liminix-tools/networking/udhcpc.nix b/pkgs/liminix-tools/networking/udhcpc.nix new file mode 100644 index 0000000..ffdecb8 --- /dev/null +++ b/pkgs/liminix-tools/networking/udhcpc.nix @@ -0,0 +1,10 @@ +{ + liminix +, busybox +} : +let inherit (liminix.services) longrun; +in +interface: { ... } @ args: longrun { + name = "${interface.device}.udhcp"; + run = "${busybox}/bin/udhcpc -f -i ${interface.device}"; +} diff --git a/tests/smoke/configuration.nix b/tests/smoke/configuration.nix index eb5d94a..c384e47 100644 --- a/tests/smoke/configuration.nix +++ b/tests/smoke/configuration.nix @@ -1,7 +1,7 @@ -{ config, tools, pkgs } : +{ config, pkgs } : let - inherit (tools.networking) interface address udhcpc odhcpc; - inherit (tools.services) oneshot longrun bundle target output; + inherit (pkgs.liminix.networking) interface address udhcpc odhcpc; + inherit (pkgs.liminix.services) oneshot longrun bundle target output; in rec { services.loopback = let iface = interface { type = "loopback"; device = "lo";};