nixfmt-rfc-style

There is nothing in this commit except for the changes made by
nix-shell -p nixfmt-rfc-style --run "nixfmt ."

If this has mucked up your open branches then sorry about that. You
can probably nixfmt them to match before merging
This commit is contained in:
Daniel Barlow
2025-02-10 21:55:08 +00:00
parent 13cc5a8992
commit 7e2b0068e6
211 changed files with 6049 additions and 4355 deletions

View File

@@ -1,11 +1,14 @@
{ config, pkgs, ... } :
{ config, pkgs, ... }:
let
inherit (pkgs.liminix.services) target;
svc = config.system.service;
in rec {
in
rec {
services.lan4 = svc.network.address.build {
interface = config.hardware.networkInterfaces.lan;
family = "inet"; address ="192.168.19.1"; prefixLength = 24;
family = "inet";
address = "192.168.19.1";
prefixLength = 24;
};
imports = [
@@ -14,12 +17,11 @@ in rec {
../../modules/network
];
services.pppoe =
svc.pppoe.build {
interface = config.hardware.networkInterfaces.wan;
username = "db123@a.1";
password= "NotReallyTheSecret";
};
services.pppoe = svc.pppoe.build {
interface = config.hardware.networkInterfaces.wan;
username = "db123@a.1";
password = "NotReallyTheSecret";
};
services.defaultroute4 = svc.network.route.build {
via = "$(output ${services.pppoe} address)";
@@ -28,15 +30,14 @@ in rec {
};
services.packet_forwarding = svc.network.forward.build {
dependencies = [services.pppoe];
dependencies = [ services.pppoe ];
};
services.dns =
svc.dnsmasq.build {
interface = services.lan4;
ranges = ["192.168.19.10,192.168.19.253"];
domain = "fake.liminix.org";
};
services.dns = svc.dnsmasq.build {
interface = services.lan4;
ranges = [ "192.168.19.10,192.168.19.253" ];
domain = "fake.liminix.org";
};
defaultProfile.packages = [ pkgs.hello ] ;
defaultProfile.packages = [ pkgs.hello ];
}

View File

@@ -1,34 +1,39 @@
let img = (import <liminix> {
let
img =
(import <liminix> {
device = import <liminix/devices/qemu>;
liminix-config = ./configuration.nix;
}).outputs.default;
pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; };
inherit (pkgs.pkgsBuildBuild) routeros;
in pkgs.runCommand "check" {
nativeBuildInputs = with pkgs; [
python3Packages.scapy
expect
jq
socat
routeros.routeros
] ;
} ''
serverstatedir=$(mktemp -d -t routeros-XXXXXX)
# python scapy drags in matplotlib which doesn't enjoy running in
# a sandbox with no $HOME, hence this environment variable
export MPLCONFIGDIR=$(mktemp -d -t routeros-XXXXXX)
export XDG_CONFIG_HOME=/tmp
export XDG_CACHE_HOME=/tmp
pkgs = import <nixpkgs> { overlays = [ (import ../../overlay.nix) ]; };
inherit (pkgs.pkgsBuildBuild) routeros;
in
pkgs.runCommand "check"
{
nativeBuildInputs = with pkgs; [
python3Packages.scapy
expect
jq
socat
routeros.routeros
];
}
''
serverstatedir=$(mktemp -d -t routeros-XXXXXX)
# python scapy drags in matplotlib which doesn't enjoy running in
# a sandbox with no $HOME, hence this environment variable
export MPLCONFIGDIR=$(mktemp -d -t routeros-XXXXXX)
export XDG_CONFIG_HOME=/tmp
export XDG_CACHE_HOME=/tmp
. ${../test-helpers.sh}
. ${../test-helpers.sh}
routeros $serverstatedir
mkdir vm
${img}/run.sh --background ./vm
expect ${./getaddress.expect}
routeros $serverstatedir
mkdir vm
${img}/run.sh --background ./vm
expect ${./getaddress.expect}
set -o pipefail
response=$(python ${./test-dhcp-service.py})
echo "$response" | jq -e 'select((.router == "192.168.19.1") and (.server_id=="192.168.19.1"))'
echo $response > $out
''
set -o pipefail
response=$(python ${./test-dhcp-service.py})
echo "$response" | jq -e 'select((.router == "192.168.19.1") and (.server_id=="192.168.19.1"))'
echo $response > $out
''