Compare commits
No commits in common. "dbe6b1b135acf53f7cef678a46c1211554b621ac" and "013e4c396c97767beed3051c51a6eb6780397b8f" have entirely different histories.
dbe6b1b135
...
013e4c396c
19 changed files with 22 additions and 103 deletions
|
@ -17,24 +17,4 @@ jobs:
|
||||||
- name: Build VM QEMU MIPS
|
- name: Build VM QEMU MIPS
|
||||||
run: |
|
run: |
|
||||||
# Enter the shell
|
# Enter the shell
|
||||||
nix-build ci.nix -A qemu
|
nix-build -I liminix-config=./examples/hello-from-qemu.nix --arg device "import ./devices/qemu" -A outputs.default
|
||||||
|
|
||||||
build_zyxel-nwa50ax_mips:
|
|
||||||
runs-on: nix
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Build VM QEMU MIPS
|
|
||||||
run: |
|
|
||||||
# Enter the shell
|
|
||||||
nix-build ci.nix -A qemu
|
|
||||||
|
|
||||||
test_hostapd:
|
|
||||||
runs-on: nix
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Build VM QEMU MIPS
|
|
||||||
run: |
|
|
||||||
# Enter the shell
|
|
||||||
nix-build ci.nix -A wlan
|
|
||||||
|
|
4
ci.nix
4
ci.nix
|
@ -7,7 +7,7 @@
|
||||||
let
|
let
|
||||||
pkgs = (import nixpkgs { });
|
pkgs = (import nixpkgs { });
|
||||||
borderVmConf = ./bordervm.conf-example.nix;
|
borderVmConf = ./bordervm.conf-example.nix;
|
||||||
inherit (pkgs.lib.attrsets) genAttrs mapAttrs;
|
inherit (pkgs.lib.attrsets) genAttrs;
|
||||||
devices = [
|
devices = [
|
||||||
"qemu"
|
"qemu"
|
||||||
"zyxel-nwa50ax"
|
"zyxel-nwa50ax"
|
||||||
|
@ -19,7 +19,7 @@ let
|
||||||
device = import (liminix + "/devices/${name}");
|
device = import (liminix + "/devices/${name}");
|
||||||
liminix-config = vanilla;
|
liminix-config = vanilla;
|
||||||
}).outputs.default;
|
}).outputs.default;
|
||||||
tests = mapAttrs (_: v: v { inherit liminix nixpkgs; }) (import ./tests/ci.nix);
|
tests = import ./tests/ci.nix;
|
||||||
jobs =
|
jobs =
|
||||||
(genAttrs devices for-device) //
|
(genAttrs devices for-device) //
|
||||||
tests //
|
tests //
|
||||||
|
|
10
default.nix
10
default.nix
|
@ -26,13 +26,9 @@ let
|
||||||
eval = evalModules {
|
eval = evalModules {
|
||||||
modules = [
|
modules = [
|
||||||
{
|
{
|
||||||
nixpkgs = {
|
nixpkgs.overlays = [
|
||||||
source = nixpkgs;
|
overlay
|
||||||
overlays = [ overlay ];
|
];
|
||||||
config.permittedInsecurePackages = [
|
|
||||||
"python-2.7.18.8"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
device.module
|
device.module
|
||||||
liminix-config
|
liminix-config
|
||||||
|
|
|
@ -194,11 +194,7 @@ extraPkgs // {
|
||||||
});
|
});
|
||||||
in h.override { openssl = null; sqlite = null; };
|
in h.override { openssl = null; sqlite = null; };
|
||||||
|
|
||||||
wpa_supplicant = prev.wpa_supplicant.override {
|
|
||||||
dbusSupport = false;
|
|
||||||
withPcsclite = false;
|
|
||||||
wpa_supplicant_gui = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
kexec-tools-static = prev.kexec-tools.overrideAttrs(o: {
|
kexec-tools-static = prev.kexec-tools.overrideAttrs(o: {
|
||||||
# For kexecboot we copy kexec into a ramdisk on the system being
|
# For kexecboot we copy kexec into a ramdisk on the system being
|
||||||
|
|
|
@ -6,7 +6,7 @@ let img = (import liminix {
|
||||||
device = import "${liminix}/devices/qemu/";
|
device = import "${liminix}/devices/qemu/";
|
||||||
liminix-config = ./configuration.nix;
|
liminix-config = ./configuration.nix;
|
||||||
}).outputs.vmroot;
|
}).outputs.vmroot;
|
||||||
pkgs = import nixpkgs { overlays = [(import ../../overlay.nix)]; };
|
pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; };
|
||||||
in pkgs.runCommand "check" {
|
in pkgs.runCommand "check" {
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
expect
|
expect
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
overlay = import "${liminix}/overlay.nix";
|
overlay = import "${liminix}/overlay.nix";
|
||||||
pkgs = import nixpkgs { overlays = [overlay]; };
|
pkgs = import <nixpkgs> { overlays = [overlay]; };
|
||||||
script = pkgs.writeFennelScript "foo" [] ./hello.fnl;
|
script = pkgs.writeFennelScript "foo" [] ./hello.fnl;
|
||||||
inherit (pkgs.lua.pkgs) fifo;
|
inherit (pkgs.lua.pkgs) fifo;
|
||||||
netlink = pkgs.netlink-lua;
|
netlink = pkgs.netlink-lua;
|
||||||
|
|
|
@ -6,7 +6,7 @@ let img = (import liminix {
|
||||||
device = import "${liminix}/devices/qemu/";
|
device = import "${liminix}/devices/qemu/";
|
||||||
liminix-config = ./configuration.nix;
|
liminix-config = ./configuration.nix;
|
||||||
}).outputs.vmroot;
|
}).outputs.vmroot;
|
||||||
pkgs = import nixpkgs { overlays = [(import ../../overlay.nix)]; };
|
pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; };
|
||||||
in pkgs.runCommand "check" {
|
in pkgs.runCommand "check" {
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
expect
|
expect
|
||||||
|
|
|
@ -5,6 +5,7 @@ in {
|
||||||
imports = [
|
imports = [
|
||||||
../../vanilla-configuration.nix
|
../../vanilla-configuration.nix
|
||||||
../../modules/squashfs.nix
|
../../modules/squashfs.nix
|
||||||
|
../../modules/outputs/jffs2.nix
|
||||||
];
|
];
|
||||||
config.rootfsType = "jffs2";
|
config.rootfsType = "jffs2";
|
||||||
config.filesystem = dir {
|
config.filesystem = dir {
|
||||||
|
|
|
@ -6,7 +6,7 @@ let img = (import liminix {
|
||||||
device = import "${liminix}/devices/qemu/";
|
device = import "${liminix}/devices/qemu/";
|
||||||
liminix-config = ./configuration.nix;
|
liminix-config = ./configuration.nix;
|
||||||
}).outputs.vmroot;
|
}).outputs.vmroot;
|
||||||
pkgs = import nixpkgs { overlays = [(import ../../overlay.nix)]; };
|
pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; };
|
||||||
in pkgs.runCommand "check" {
|
in pkgs.runCommand "check" {
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
expect
|
expect
|
||||||
|
|
|
@ -13,6 +13,7 @@ let
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
../../vanilla-configuration.nix
|
../../vanilla-configuration.nix
|
||||||
|
../../modules/outputs/jffs2.nix
|
||||||
];
|
];
|
||||||
config = {
|
config = {
|
||||||
services.sshd = longrun {
|
services.sshd = longrun {
|
||||||
|
|
|
@ -8,7 +8,7 @@ let lmx = (import liminix {
|
||||||
});
|
});
|
||||||
rogue = lmx.pkgs.rogue;
|
rogue = lmx.pkgs.rogue;
|
||||||
img = lmx.outputs.vmroot;
|
img = lmx.outputs.vmroot;
|
||||||
pkgs = import nixpkgs { overlays = [(import ../../overlay.nix)]; };
|
pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; };
|
||||||
in pkgs.runCommand "check" {
|
in pkgs.runCommand "check" {
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
expect
|
expect
|
||||||
|
|
|
@ -6,7 +6,7 @@ let img = (import liminix {
|
||||||
device = import "${liminix}/devices/qemu";
|
device = import "${liminix}/devices/qemu";
|
||||||
liminix-config = ./configuration.nix;
|
liminix-config = ./configuration.nix;
|
||||||
}).outputs.default;
|
}).outputs.default;
|
||||||
pkgs = import nixpkgs { overlays = [(import ../../overlay.nix)]; };
|
pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; };
|
||||||
inherit (pkgs.pkgsBuildBuild) routeros;
|
inherit (pkgs.pkgsBuildBuild) routeros;
|
||||||
in pkgs.runCommand "check" {
|
in pkgs.runCommand "check" {
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
liminix,
|
liminix
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
let check = deviceName : config :
|
let check = deviceName : config :
|
||||||
let derivation = (import liminix {
|
let derivation = (import liminix {
|
||||||
|
|
|
@ -6,7 +6,7 @@ let img = (import liminix {
|
||||||
device = import "${liminix}/devices/qemu/";
|
device = import "${liminix}/devices/qemu/";
|
||||||
liminix-config = ./configuration.nix;
|
liminix-config = ./configuration.nix;
|
||||||
}).outputs.vmroot;
|
}).outputs.vmroot;
|
||||||
pkgs = import nixpkgs { overlays = [(import ../../overlay.nix)]; };
|
pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; };
|
||||||
in pkgs.runCommand "check" {
|
in pkgs.runCommand "check" {
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
expect
|
expect
|
||||||
|
|
|
@ -7,7 +7,6 @@ in rec {
|
||||||
../../modules/wlan.nix
|
../../modules/wlan.nix
|
||||||
../../modules/hostapd
|
../../modules/hostapd
|
||||||
../../modules/network
|
../../modules/network
|
||||||
./wpa_supplicant.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
services.hostap = config.system.service.hostapd.build {
|
services.hostap = config.system.service.hostapd.build {
|
||||||
|
@ -28,21 +27,5 @@ in rec {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.wpa_supplicant = config.system.service.wpa_supplicant.build {
|
defaultProfile.packages = with pkgs; [ tcpdump ] ;
|
||||||
interface = "wlan1";
|
|
||||||
driver = "nl80211";
|
|
||||||
config-file = pkgs.writeText "wpa_supplicant.conf" ''
|
|
||||||
country=us
|
|
||||||
update_config=1
|
|
||||||
ctrl_interface=/run/wpa_supplicant
|
|
||||||
|
|
||||||
network={
|
|
||||||
scan_ssid=1
|
|
||||||
ssid="liminix"
|
|
||||||
psk="colourless green ideas"
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
defaultProfile.packages = with pkgs; [ tcpdump wpa_supplicant ];
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,10 @@
|
||||||
, nixpkgs
|
, nixpkgs
|
||||||
}:
|
}:
|
||||||
let img = (import liminix {
|
let img = (import liminix {
|
||||||
inherit nixpkgs;
|
device = import "${liminix}/devices/qemu-armv7l/";
|
||||||
device = import "${liminix}/devices/qemu/";
|
|
||||||
liminix-config = ./configuration.nix;
|
liminix-config = ./configuration.nix;
|
||||||
}).outputs.default;
|
}).outputs.default;
|
||||||
pkgs = import nixpkgs { overlays = [(import ../../overlay.nix)]; };
|
pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; };
|
||||||
in pkgs.runCommand "check" {
|
in pkgs.runCommand "check" {
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
expect socat
|
expect socat
|
||||||
|
|
|
@ -14,10 +14,10 @@ expect {
|
||||||
}
|
}
|
||||||
expect "#"
|
expect "#"
|
||||||
while { $FINISHED < 10 } {
|
while { $FINISHED < 10 } {
|
||||||
send "date && grep CTRL-EVENT-CONNECTED /run/uncaught-logs/* || echo \$NOT\r\n"
|
send "date && grep AP-ENABLED /run/uncaught-logs/* || echo \$NOT\r\n"
|
||||||
|
|
||||||
expect {
|
expect {
|
||||||
"wlan1: CTRL-EVENT-CONNECTED" { set FINISHED 999; set EXIT 0; }
|
"wlan0: AP-ENABLED" { set FINISHED 999; set EXIT 0; }
|
||||||
"not_present" { send_user "waiting ...\n" ; sleep 5 }
|
"not_present" { send_user "waiting ...\n" ; sleep 5 }
|
||||||
}
|
}
|
||||||
set FINISHED [ expr $FINISHED + 1 ]
|
set FINISHED [ expr $FINISHED + 1 ]
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
{
|
|
||||||
liminix,
|
|
||||||
wpa_supplicant,
|
|
||||||
lib,
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
interface,
|
|
||||||
driver,
|
|
||||||
config-file,
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
inherit (liminix.services) longrun;
|
|
||||||
inherit (lib.strings) escapeShellArg;
|
|
||||||
in
|
|
||||||
longrun {
|
|
||||||
name = "wpa_supplicant";
|
|
||||||
run =
|
|
||||||
''
|
|
||||||
${wpa_supplicant}/bin/wpa_supplicant -D${driver} -i${interface} -c ${config-file}
|
|
||||||
'';
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
{ config, lib, pkgs, ... }:
|
|
||||||
with lib; {
|
|
||||||
options.system.service.wpa_supplicant = mkOption { type = pkgs.liminix.lib.types.serviceDefn; };
|
|
||||||
config.system.service.wpa_supplicant = config.system.callService ./wpa_service.nix {
|
|
||||||
interface = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
driver = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
config-file = mkOption {
|
|
||||||
type = types.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in a new issue