cleanup whitespace and commas

* [] is now [ ]
* {} is now { }
* commas in arglists go at end of line not beginning

In short, I ran the whole thing through nixfmt-rfc-style but only
accepted about 30% of its changes. I might grow accustomed to more
of it over time
This commit is contained in:
Daniel Barlow 2024-06-30 16:58:29 +01:00
parent 0d3218127f
commit 3df1ec76ff
63 changed files with 533 additions and 491 deletions

View File

@ -55,18 +55,17 @@ in {
<nixpkgs/nixos/modules/virtualisation/qemu-vm.nix>
];
config = {
boot.kernelParams = [
"loglevel=9"
];
boot.kernelParams = [ "loglevel=9" ];
systemd.services.pppoe =
let conf = pkgs.writeText "kpppoed.toml"
''
let
conf = pkgs.writeText "kpppoed.toml" ''
interface_name = "eth1"
services = [ "myservice" ]
lns_ipaddr = "${cfg.l2tp.host}:${builtins.toString cfg.l2tp.port}"
ac_name = "kpppoed-1.0"
'';
in {
in
{
wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" ];
serviceConfig = {
@ -92,17 +91,17 @@ in {
systemd.services.sshd.wantedBy = pkgs.lib.mkForce [ "multi-user.target" ];
virtualisation = {
qemu = {
networkingOptions = [ ];
options = [] ++
optional cfg.ethernet.pci.enable
"-device vfio-pci,host=${cfg.ethernet.pci.id}" ++
optionals cfg.ethernet.usb.enable [
options =
[ ]
++ optional cfg.ethernet.pci.enable "-device vfio-pci,host=${cfg.ethernet.pci.id}"
++ optionals cfg.ethernet.usb.enable [
"-device usb-ehci,id=ehci"
"-device usb-host,bus=ehci.0,vendorid=${cfg.ethernet.usb.vendor},productid=${cfg.ethernet.usb.product}"
] ++ [
]
++ [
"-nographic"
"-serial mon:stdio"
];

View File

@ -2,7 +2,11 @@
{
bordervm = {
# ethernet.pci = { id = "01:00.0"; enable = true; };
ethernet.usb = { vendor = "0x0bda"; product = "0x8153"; enable = true; };
ethernet.usb = {
vendor = "0x0bda";
product = "0x8153";
enable = true;
};
l2tp = {
host = "l2tp.aa.net.uk";
};

33
ci.nix
View File

@ -1,8 +1,9 @@
{
nixpkgs
, unstable
, liminix
, ... }:
nixpkgs,
unstable,
liminix,
...
}:
let
pkgs = (import nixpkgs { });
borderVmConf = ./bordervm.conf-example.nix;
@ -26,27 +27,35 @@ let
}).outputs.default;
tests = import ./tests/ci.nix;
jobs =
(genAttrs devices for-device) //
tests //
{
buildEnv = (import liminix {
(genAttrs devices for-device)
// tests
// {
buildEnv =
(import liminix {
inherit nixpkgs borderVmConf;
device = import (liminix + "/devices/qemu");
liminix-config = vanilla;
}).buildEnv;
doc =
let json =
let
json =
(import liminix {
inherit nixpkgs borderVmConf;
device = import (liminix + "/devices/qemu");
liminix-config = {...} : {
liminix-config =
{ ... }:
{
imports = [ ./modules/all-modules.nix ];
};
}).outputs.optionsJson;
in pkgs.stdenv.mkDerivation {
in
pkgs.stdenv.mkDerivation {
name = "liminix-doc";
nativeBuildInputs = with pkgs; [
gnumake sphinx fennel luaPackages.lyaml
gnumake
sphinx
fennel
luaPackages.lyaml
];
src = ./.;
buildPhase = ''

View File

@ -1,15 +1,17 @@
{
deviceName ? null
, device ? (import ./devices/${deviceName} )
, liminix-config ? <liminix-config>
, nixpkgs ? <nixpkgs>
, borderVmConf ? ./bordervm.conf.nix
, imageType ? "primary"
deviceName ? null,
device ? (import ./devices/${deviceName}),
liminix-config ? <liminix-config>,
nixpkgs ? <nixpkgs>,
borderVmConf ? ./bordervm.conf.nix,
imageType ? "primary",
}:
let
overlay = import ./overlay.nix;
pkgs = import nixpkgs (device.system // {
pkgs = import nixpkgs (
device.system
// {
overlays = [ overlay ];
config = {
allowUnsupportedSystem = true; # mipsel
@ -18,7 +20,8 @@ let
"python-2.7.18.7"
];
};
});
}
);
eval = pkgs.lib.evalModules {
specialArgs = {

View File

@ -2,8 +2,7 @@
let
conf = eval.config;
rootDir = builtins.toPath ./..;
stripAnyPrefixes = lib.flip (lib.fold lib.removePrefix)
["${rootDir}/"];
stripAnyPrefixes = lib.flip (lib.fold lib.removePrefix) [ "${rootDir}/" ];
optToDoc = name: opt: {
inherit name;
description = opt.description or null;
@ -27,5 +26,4 @@ let
else
item // { declarations = map stripAnyPrefixes item.declarations; };
in
builtins.map spliceServiceDefn
(pkgs.lib.optionAttrSetToDocList eval.options)
builtins.map spliceServiceDefn (pkgs.lib.optionAttrSetToDocList eval.options)

View File

@ -2,15 +2,17 @@ with import <nixpkgs> {} ;
let
inherit (builtins) stringLength readDir filter;
devices = filter (n: n != "families")
(lib.mapAttrsToList (n: t: n) (readDir ../devices));
texts = map (n:
let d = import ../devices/${n}/default.nix;
devices = filter (n: n != "families") (lib.mapAttrsToList (n: t: n) (readDir ../devices));
texts = map (
n:
let
d = import ../devices/${n}/default.nix;
d' = {
description = "${n}\n${substring 0 (stringLength n) "********************************"}\n";
} // d;
in d'.description)
devices;
in
d'.description
) devices;
in
writeText "hwdoc" ''
Supported hardware

View File

@ -128,11 +128,15 @@ in rec {
};
users.backup = {
uid=500; gid=500; gecos="Storage owner"; dir="/srv";
uid = 500;
gid = 500;
gecos = "Storage owner";
dir = "/srv";
shell = "/dev/null";
};
groups.backup = {
gid=500; usernames = ["backup"];
gid = 500;
usernames = [ "backup" ];
};
defaultProfile.packages = with pkgs; [

View File

@ -62,18 +62,27 @@ in rec {
services.int = svc.network.address.build {
interface = svc.bridge.primary.build { ifname = "int"; };
family = "inet"; address = "${ipv4LocalNet}.1"; prefixLength = 16;
family = "inet";
address = "${ipv4LocalNet}.1";
prefixLength = 16;
};
services.bridge = svc.bridge.members.build {
primary = services.int;
members = with config.hardware.networkInterfaces;
[ wlan lan ];
members = with config.hardware.networkInterfaces; [
wlan
lan
];
};
services.ntp = svc.ntp.build {
pools = { "pool.ntp.org" = ["iburst"]; };
makestep = { threshold = 1.0; limit = 3; };
pools = {
"pool.ntp.org" = [ "iburst" ];
};
makestep = {
threshold = 1.0;
limit = 3;
};
};
services.sshd = svc.ssh.build { };
@ -157,8 +166,7 @@ in rec {
interface = services.wan;
};
services.firewall = svc.firewall.build {
};
services.firewall = svc.firewall.build { };
services.packet_forwarding = svc.network.forward.build { };
@ -195,7 +203,5 @@ in rec {
];
};
defaultProfile.packages = with pkgs; [
min-collect-garbage
];
defaultProfile.packages = with pkgs; [ min-collect-garbage ];
}

View File

@ -8,12 +8,10 @@
root = {
# mkpasswd -m sha512crypt
passwd = "$6$6pt0mpbgcB7kC2RJ$kSBoCYGyi1.qxt7dqmexLj1l8E6oTZJZmfGyJSsMYMW.jlsETxdgQSdv6ptOYDM7DHAwf6vLG0pz3UD31XBfC1";
openssh.authorizedKeys.keys = [
];
openssh.authorizedKeys.keys = [ ];
};
lan = {
prefix = "10.8.0";
};
}

View File

@ -58,16 +58,25 @@ in {
description = "Kernel command line";
};
commandLineDtbNode = mkOption {
type = types.enum [ "bootargs" "bootargs-override" ];
type = types.enum [
"bootargs"
"bootargs-override"
];
default = "bootargs";
description = "Kernel command line's devicetree node";
};
imageType = mkOption {
type = types.enum [ "primary" "secondary" ];
type = types.enum [
"primary"
"secondary"
];
default = "primary";
};
imageFormat = mkOption {
type = types.enum ["fit" "uimage"];
type = types.enum [
"fit"
"uimage"
];
default = "uimage";
};
tftp = {

View File

@ -85,10 +85,13 @@ in {
};
};
filesystem = dir {
bin = dir ({
bin = dir (
{
busybox = symlink "${busybox}/bin/busybox";
sh = symlink "${busybox}/bin/busybox";
} // makeLinks);
}
// makeLinks
);
};
};
}

View File

@ -5,14 +5,13 @@
## you want to run on it, and would usually be set in the "device" file:
## :file:`devices/manuf-model/default.nix`
{ lib, ... }:
let
inherit (lib) mkOption types;
in {
in
{
options = {
boot = {
};
boot = { };
hardware = {
dts = {
src = mkOption {

View File

@ -20,7 +20,10 @@ in {
up = ''
for i in $(find /sys -name uevent); do ( echo change > $i ) ; done
'';
dependencies = [devout mdevd];
dependencies = [
devout
mdevd
];
};
};
};

View File

@ -1,8 +1,8 @@
{
config
, pkgs
, lib
, ...
config,
pkgs,
lib,
...
}:
let
inherit (lib) mkOption types concatStringsSep;

View File

@ -1,8 +1,4 @@
{
config
, lib
, ...
}:
{ config, lib, ... }:
let
inherit (lib) mkIf mkEnableOption; # types concatStringsSep;
in {

View File

@ -1,8 +1,8 @@
{
config
, pkgs
, lib
, ...
config,
pkgs,
lib,
...
}:
let
inherit (pkgs) liminix;

View File

@ -24,8 +24,6 @@
EXT4_FS = "y";
EXT4_USE_FOR_EXT2 = "y";
FS_ENCRYPTION = "y";
};
};
}

View File

@ -18,9 +18,15 @@ let
inherit (builtins) toString;
inherit (pkgs.pseudofile) dir;
passwd-file =
let lines = mapAttrsToList (name: u: "${name}:${if u ? passwd then u.passwd else "!!"}:${toString u.uid}:${toString u.gid}:${u.gecos}:${u.dir}:${u.shell}\n" )
config.users;
in concatStrings lines;
let
lines = mapAttrsToList (
name: u:
"${name}:${
if u ? passwd then u.passwd else "!!"
}:${toString u.uid}:${toString u.gid}:${u.gecos}:${u.dir}:${u.shell}\n"
) config.users;
in
concatStrings lines;
group-file =
let lines = mapAttrsToList
(name: {gid, usernames ? []}:

View File

@ -74,7 +74,6 @@ extraPkgs // {
# should texinfo be in nativeBuildInputs instead of
# buildInputs?
texinfo = null;
};
# luarocks wants a cross-compiled cmake (which seems like a bug,
@ -186,9 +185,12 @@ extraPkgs // {
# done. Do it the ugly way..
postPatch =
o.postPatch
+ (with final;
lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform)
"\nsed -i.bak 's/linux.*-mips/linux-mops/' Configure\n");
+ (
with final;
lib.optionalString (
stdenv.buildPlatform != stdenv.hostPlatform
) "\nsed -i.bak 's/linux.*-mips/linux-mops/' Configure\n"
);
});
pppBuild = prev.ppp;
@ -200,13 +202,12 @@ extraPkgs // {
}); in q.override { nixosTestRunner = true; sdlSupport = false; };
rsyncSmall =
let r = prev.rsync.overrideAttrs(o: {
configureFlags = o.configureFlags ++ [
"--disable-openssl"
];
let
r = prev.rsync.overrideAttrs (o: {
configureFlags = o.configureFlags ++ [ "--disable-openssl" ];
});
in r.override { openssl = null; };
in
r.override { openssl = null; };
inherit s6;
s6-linux-init = prev.s6-linux-init.override {
@ -283,5 +284,4 @@ extraPkgs // {
translateManpages = false;
capabilitiesSupport = false;
};
}

View File

@ -1,10 +1,10 @@
{
fennel
, stdenv
, linotify
, lua
, lualinux
, cpio
fennel,
stdenv,
linotify,
lua,
lualinux,
cpio,
}:
let pname = "anoia";
in stdenv.mkDerivation {

View File

@ -1,7 +1,4 @@
{
callPackage
, lib
}:
{ callPackage, lib }:
let
typeChecked = caller: type: value:
let

View File

@ -1,10 +1,11 @@
{ nellie
, writeFennel
, anoia
, fennel
, stdenv
, fennelrepl
, lualinux
{
nellie,
writeFennel,
anoia,
fennel,
stdenv,
fennelrepl,
lualinux,
}:
stdenv.mkDerivation {
name = "devout";

View File

@ -1,7 +1,7 @@
{
stdenv
, lua
, fetchFromSourcehut
stdenv,
lua,
fetchFromSourcehut,
}:
let pname = "fennel";
in stdenv.mkDerivation {

View File

@ -1,7 +1,7 @@
{
buildGoModule
, fetchFromGitHub
, ppp
buildGoModule,
fetchFromGitHub,
ppp,
}:
buildGoModule rec {
@ -23,5 +23,4 @@ buildGoModule rec {
doCheck = false;
vendorHash = "sha256-hOkhJhToN/VJwjQmnQJSPGz26/YDR2Ch+1yeW51OF+U=";
}

View File

@ -1,9 +1,15 @@
{ netlink-lua
, writeFennelScript
, runCommand
, anoia
{
netlink-lua,
writeFennelScript,
runCommand,
anoia,
}:
runCommand "ifwait" { } ''
mkdir -p $out/bin
cp -p ${writeFennelScript "ifwait" [anoia netlink-lua] ./ifwait.fnl} $out/bin/ifwait
cp -p ${
writeFennelScript "ifwait" [
anoia
netlink-lua
] ./ifwait.fnl
} $out/bin/ifwait
''

View File

@ -1,10 +1,10 @@
{
busybox
, pkgsBuildBuild
, runCommand
, cpio
, writeReferencesToFile
, writeScript
busybox,
pkgsBuildBuild,
runCommand,
cpio,
writeReferencesToFile,
writeScript,
}:
let
inherit (pkgsBuildBuild) gen_init_cpio;

View File

@ -1,10 +1,11 @@
{ stdenv
, git
, python2
, which
, fetchgit
, fetchFromGitHub
, coccinelle
{
stdenv,
git,
python2,
which,
fetchgit,
fetchFromGitHub,
coccinelle,
}:
let
donorTree = fetchFromGitHub {

View File

@ -1,28 +1,37 @@
{ stdenv
, buildPackages
, writeText
, lib
{
stdenv,
buildPackages,
writeText,
lib,
, config
, src
, version ? "0"
, extraPatchPhase ? "echo"
, targets ? ["vmlinux"]
config,
src,
version ? "0",
extraPatchPhase ? "echo",
targets ? [ "vmlinux" ],
}:
let
writeConfig = import ./write-kconfig.nix { inherit lib writeText; };
kconfigFile = writeConfig "kconfig" config;
arch = stdenv.hostPlatform.linuxArch;
targetNames = map baseNameOf targets;
inherit lib; in
inherit lib;
in
stdenv.mkDerivation rec {
name = "kernel";
inherit src extraPatchPhase;
hardeningDisable = [ "all" ];
nativeBuildInputs = [buildPackages.stdenv.cc] ++
(with buildPackages.pkgs; [
rsync bc bison flex pkg-config
openssl ncurses.all perl
nativeBuildInputs =
[ buildPackages.stdenv.cc ]
++ (with buildPackages.pkgs; [
rsync
bc
bison
flex
pkg-config
openssl
ncurses.all
perl
]);
CC = "${stdenv.cc.bintools.targetPrefix}gcc";
HOSTCC = with buildPackages.pkgs;

View File

@ -1,11 +1,11 @@
{
liminix
, lib
, targets ? []
, kernel ? null
, runCommand
, pkgsBuildBuild
, dependencies ? []
liminix,
lib,
targets ? [ ],
kernel ? null,
runCommand,
pkgsBuildBuild,
dependencies ? [ ],
}:
let
inherit (liminix.services) oneshot;

View File

@ -1,13 +1,13 @@
{
writeScriptBin
, writeScript
, systemconfig
, execline
, lib
, config ? {}
, liminix
, pseudofile
, pkgs
writeScriptBin,
writeScript,
systemconfig,
execline,
lib,
config ? { },
liminix,
pseudofile,
pkgs,
}:
let
inherit (pseudofile) dir symlink;

View File

@ -1,8 +1,9 @@
{ stdenv
, cmake
, zlib
, libyaml
, fetchFromGitHub
{
stdenv,
cmake,
zlib,
libyaml,
fetchFromGitHub,
}:
stdenv.mkDerivation {
name = "libubootenv";

View File

@ -15,5 +15,4 @@ in lua.pkgs.buildLuaPackage {
mkdir -p "$out/lib/lua/${lua.luaversion}"
cp inotify.so "$out/lib/lua/${lua.luaversion}/"
'';
}

View File

@ -21,5 +21,4 @@ in lua.pkgs.buildLuaPackage {
mkdir -p "$out/lib/lua/${lua.luaversion}"
cp ${pname}.so "$out/lib/lua/${lua.luaversion}/"
'';
}

View File

@ -1,7 +1,4 @@
{
stdenv
, fetchurl
}:
{ stdenv, fetchurl }:
stdenv.mkDerivation {
pname = "lzma";
version = "4.32.7";

View File

@ -1,17 +1,17 @@
# make out-of-tree modules given a backported kernel source tree
{
extraConfig ? {}
, drivers ? [ ]
, kernel-backport
, stdenv
, writeText
, klibBuild ? null
, buildPackages
, fetchFromGitHub
extraConfig ? { },
drivers ? [ ],
kernel-backport,
stdenv,
writeText,
klibBuild ? null,
buildPackages,
fetchFromGitHub,
, liminix
, lib
liminix,
lib,
}:
let
arch = stdenv.hostPlatform.linuxArch;

View File

@ -1,9 +1,10 @@
{
stdenv
, nix
, cpio
, openssh
}: stdenv.mkDerivation {
stdenv,
nix,
cpio,
openssh,
}:
stdenv.mkDerivation {
name = "min-copy-closure";
buildInputs = [ ];
propagatedBuildInputs = [ cpio openssh nix ];

View File

@ -1,6 +1,6 @@
{
writeFennelScript
, anoia
, lualinux
writeFennelScript,
anoia,
lualinux,
}:
writeFennelScript "odhcpc-script" [anoia lualinux] ./odhcp6-script.fnl

View File

@ -1,7 +1,9 @@
{ stdenv
, cmake
, fetchFromGitHub
, ...} :
{
stdenv,
cmake,
fetchFromGitHub,
...
}:
# let switchDotH = buildPackages.fetchurl {
# url = "https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob_plain;f=target/linux/generic/files/include/uapi/linux/switch.h;hb=99a188828713d6ff9c541590b08d4e63ef52f6d7";
# sha256 = "15kmhhcpd84y4f45rf8zai98c61jyvkc37p90pcxirna01x33wi8";

View File

@ -1,7 +1,4 @@
{
fetchFromGitHub
, pkgsBuildBuild
}:
{ fetchFromGitHub, pkgsBuildBuild }:
let
src = fetchFromGitHub {
name = "openwrt-source";

View File

@ -1,8 +1,8 @@
{
fetchFromGitHub
, stdenv
, autoreconfHook
, substituteAll
fetchFromGitHub,
stdenv,
autoreconfHook,
substituteAll,
# , openssl
}: stdenv.mkDerivation {
pname = "ppp";
@ -35,6 +35,4 @@
"man"
"dev"
];
}

View File

@ -1,7 +1,9 @@
{ lib
, stdenv
, fetchFromGitHub
, ppp } :
{
lib,
stdenv,
fetchFromGitHub,
ppp,
}:
stdenv.mkDerivation rec {
pname = "rp-pppoe";
version = "3.15";
@ -20,7 +22,9 @@ stdenv.mkDerivation rec {
export PPPD=${ppp}/sbin/pppd
'';
configureFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "rpppoe_cv_pack_bitfields=rev" ];
configureFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"rpppoe_cv_pack_bitfields=rev"
];
postConfigure = ''
sed -i Makefile -e 's@DESTDIR)/etc/ppp@out)/etc/ppp@'

View File

@ -1,7 +1,4 @@
{
stdenv
, gdb
}:
{ stdenv, gdb }:
stdenv.mkDerivation {
name = "preinit";
src = ./.;

View File

@ -1,7 +1,4 @@
{
writeText
, lib
}:
{ writeText, lib }:
let
inherit (lib.attrsets) mapAttrsToList;
visit = prefix: attrset:

View File

@ -1,9 +1,9 @@
{
stdenv
, python3
, qemu
, fetchzip
, writeShellApplication
stdenv,
python3,
qemu,
fetchzip,
writeShellApplication,
}:
let
chr-image = fetchzip {

View File

@ -1,13 +1,14 @@
{
qemuLim
, socat
, writeShellScript
, writeFennel
, runCommand
, lib
, lua
, pkgsBuildBuild
}: let
qemuLim,
socat,
writeShellScript,
writeFennel,
runCommand,
lib,
lua,
pkgsBuildBuild,
}:
let
run-liminix-vm = pkgsBuildBuild.writeFennel "run-liminix-vm" {
packages = [ qemuLim lua.pkgs.luaposix lua.pkgs.fennel ];
} ./run-liminix-vm.fnl;

View File

@ -1,10 +1,10 @@
{
s6-linux-init
, execline
, writeScript
, stdenvNoCC
, lib
, s6-rc
s6-linux-init,
execline,
writeScript,
stdenvNoCC,
lib,
s6-rc,
}:
let
hpr = name: arg: writeScript name ''

View File

@ -2,11 +2,11 @@
# config.services and calling s6-rc-compile on them
{
stdenvNoCC
, buildPackages
, closureInfo
, writeText
, services ? []
stdenvNoCC,
buildPackages,
closureInfo,
writeText,
services ? [ ],
}:
let closure-info = closureInfo { rootPaths = services; };
in stdenvNoCC.mkDerivation {

View File

@ -1,10 +1,10 @@
{
stdenv
, fetchFromGitLab
, makeWrapper
, btrfs-progs
, util-linux-small
, lib
stdenv,
fetchFromGitLab,
makeWrapper,
btrfs-progs,
util-linux-small,
lib,
}:
let search_path = lib.makeBinPath [btrfs-progs util-linux-small];
in stdenv.mkDerivation {

View File

@ -5,12 +5,12 @@
# they should contain
{
writeText
, writeFennelScript
, lib
, s6-init-bin
, closureInfo
, stdenv
writeText,
writeFennelScript,
lib,
s6-init-bin,
closureInfo,
stdenv,
}:
let
inherit (lib.attrsets) mapAttrsToList;

View File

@ -1,7 +1,7 @@
{
lua5_3
, stdenv
, makeWrapper
lua5_3,
stdenv,
makeWrapper,
}:
let
lua = lua5_3.withPackages (ps: with ps; [

View File

@ -1,11 +1,12 @@
{ nellie
, lualinux
, writeFennel
, anoia
, fennel
, stdenv
, fennelrepl
, s6-rc-up-tree
{
nellie,
lualinux,
writeFennel,
anoia,
fennel,
stdenv,
fennelrepl,
s6-rc-up-tree,
}:
stdenv.mkDerivation {
name = "uevent-watch";

View File

@ -1,9 +1,10 @@
# usb modeswitch without udev, tcl, coreutils, bash dependencies
{ stdenv
, lib
, fetchurl
, pkg-config
, libusb1
{
stdenv,
lib,
fetchurl,
pkg-config,
libusb1,
}:
let
pname = "usb-modeswitch";

View File

@ -1,8 +1,10 @@
{ writeScript, lib }:
name:
{
writeScript
, lib
}
: name : { runtimeInputs ? [] } : text : writeScript name ''
runtimeInputs ? [ ],
}:
text:
writeScript name ''
#!/bin/sh
set -o errexit
set -o nounset

View File

@ -1,5 +1,3 @@
{ writeFennel
, stdenv
}:
{ writeFennel, stdenv }:
name: packages: source:
writeFennel name { inherit packages; } source

View File

@ -1,24 +1,24 @@
{
lua
, lib
, fennel
, stdenv
lua,
lib,
fennel,
stdenv,
}:
name:
{
packages ? [ ],
correlate ? false,
mainFunction ? null
} : source :
mainFunction ? null,
}:
source:
let
luapath = builtins.map
(f:
"${f}/share/lua/${lua.luaversion}/?.lua;" +
"${f}/share/lua/${lua.luaversion}/?/init.lua;")
packages;
luapath = builtins.map (
f: "${f}/share/lua/${lua.luaversion}/?.lua;" + "${f}/share/lua/${lua.luaversion}/?/init.lua;"
) packages;
luacpath = builtins.map (f: "${f}/lib/lua/${lua.luaversion}/?.so;") packages;
luaFlags = lib.optionalString (mainFunction != null) "-e dofile(arg[0]).${mainFunction}()";
in stdenv.mkDerivation {
in
stdenv.mkDerivation {
inherit name;
src = ./.;
nativeBuildInputs = [ fennel ];

View File

@ -1,7 +1,4 @@
{
stdenv
, openwrt
}:
{ stdenv, openwrt }:
stdenv.mkDerivation {
name = "zyxel-bootconfig";
inherit (openwrt) src;