Compare commits

..

No commits in common. "3df1ec76ff33e27ce6e1b074b18e9630aa95cd3c" and "e94bf62ec1ce938b9c975195d696640f8deaceab" have entirely different histories.

63 changed files with 492 additions and 534 deletions

View File

@ -6,7 +6,7 @@ in {
options.bordervm = { options.bordervm = {
keys = mkOption { keys = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = [ ]; default = [];
}; };
l2tp = { l2tp = {
host = mkOption { host = mkOption {
@ -55,17 +55,18 @@ in {
<nixpkgs/nixos/modules/virtualisation/qemu-vm.nix> <nixpkgs/nixos/modules/virtualisation/qemu-vm.nix>
]; ];
config = { config = {
boot.kernelParams = [ "loglevel=9" ]; boot.kernelParams = [
"loglevel=9"
];
systemd.services.pppoe = systemd.services.pppoe =
let let conf = pkgs.writeText "kpppoed.toml"
conf = pkgs.writeText "kpppoed.toml" '' ''
interface_name = "eth1" interface_name = "eth1"
services = [ "myservice" ] services = [ "myservice" ]
lns_ipaddr = "${cfg.l2tp.host}:${builtins.toString cfg.l2tp.port}" lns_ipaddr = "${cfg.l2tp.host}:${builtins.toString cfg.l2tp.port}"
ac_name = "kpppoed-1.0" ac_name = "kpppoed-1.0"
''; '';
in in {
{
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" ]; after = [ "network-online.target" ];
serviceConfig = { serviceConfig = {
@ -91,17 +92,17 @@ in {
systemd.services.sshd.wantedBy = pkgs.lib.mkForce [ "multi-user.target" ]; systemd.services.sshd.wantedBy = pkgs.lib.mkForce [ "multi-user.target" ];
virtualisation = { virtualisation = {
qemu = { qemu = {
networkingOptions = [ ]; networkingOptions = [];
options = options = [] ++
[ ] optional cfg.ethernet.pci.enable
++ optional cfg.ethernet.pci.enable "-device vfio-pci,host=${cfg.ethernet.pci.id}" "-device vfio-pci,host=${cfg.ethernet.pci.id}" ++
++ optionals cfg.ethernet.usb.enable [ optionals cfg.ethernet.usb.enable [
"-device usb-ehci,id=ehci" "-device usb-ehci,id=ehci"
"-device usb-host,bus=ehci.0,vendorid=${cfg.ethernet.usb.vendor},productid=${cfg.ethernet.usb.product}" "-device usb-host,bus=ehci.0,vendorid=${cfg.ethernet.usb.vendor},productid=${cfg.ethernet.usb.product}"
] ] ++ [
++ [
"-nographic" "-nographic"
"-serial mon:stdio" "-serial mon:stdio"
]; ];
@ -135,13 +136,13 @@ in {
nat = { nat = {
enable = true; enable = true;
internalInterfaces = [ "eth1" ]; internalInterfaces = [ "eth1" ];
externalInterface = "eth0"; externalInterface ="eth0";
}; };
}; };
users.users.liminix = { users.users.liminix = {
isNormalUser = true; isNormalUser = true;
uid = 1000; uid = 1000;
extraGroups = [ "wheel" ]; extraGroups = [ "wheel"];
openssh.authorizedKeys.keys = cfg.keys; openssh.authorizedKeys.keys = cfg.keys;
}; };
services.getty.autologinUser = "liminix"; services.getty.autologinUser = "liminix";

View File

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

35
ci.nix
View File

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

View File

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

View File

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

View File

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

View File

@ -119,7 +119,7 @@ in rec {
secrets_file secrets_file
services.mount_external_disk services.mount_external_disk
config.hardware.networkInterfaces.lan config.hardware.networkInterfaces.lan
]; ] ;
}; };
users.root = { users.root = {
@ -128,15 +128,11 @@ in rec {
}; };
users.backup = { users.backup = {
uid = 500; uid=500; gid=500; gecos="Storage owner"; dir="/srv";
gid = 500; shell="/dev/null";
gecos = "Storage owner";
dir = "/srv";
shell = "/dev/null";
}; };
groups.backup = { groups.backup = {
gid = 500; gid=500; usernames = ["backup"];
usernames = [ "backup" ];
}; };
defaultProfile.packages = with pkgs; [ defaultProfile.packages = with pkgs; [

View File

@ -5,7 +5,7 @@
# wherever the text "EDIT" appears - please consult the tutorial # wherever the text "EDIT" appears - please consult the tutorial
# documentation for details. # documentation for details.
{ config, pkgs, ... }: { config, pkgs, ... } :
let let
inherit (pkgs.liminix.services) bundle oneshot; inherit (pkgs.liminix.services) bundle oneshot;
inherit (pkgs) serviceFns; inherit (pkgs) serviceFns;
@ -49,7 +49,7 @@ in rec {
country_code = "GB"; country_code = "GB";
wpa_passphrase = "not a real wifi password"; wpa_passphrase = "not a real wifi password";
hw_mode = "g"; hw_mode="g";
ieee80211n = 1; ieee80211n = 1;
auth_algs = 1; # 1=wpa2, 2=wep, 3=both auth_algs = 1; # 1=wpa2, 2=wep, 3=both
wpa = 2; # 1=wpa, 2=wpa2, 3=both wpa = 2; # 1=wpa, 2=wpa2, 3=both
@ -62,27 +62,18 @@ in rec {
services.int = svc.network.address.build { services.int = svc.network.address.build {
interface = svc.bridge.primary.build { ifname = "int"; }; interface = svc.bridge.primary.build { ifname = "int"; };
family = "inet"; family = "inet"; address = "${ipv4LocalNet}.1"; prefixLength = 16;
address = "${ipv4LocalNet}.1";
prefixLength = 16;
}; };
services.bridge = svc.bridge.members.build { services.bridge = svc.bridge.members.build {
primary = services.int; primary = services.int;
members = with config.hardware.networkInterfaces; [ members = with config.hardware.networkInterfaces;
wlan [ wlan lan ];
lan
];
}; };
services.ntp = svc.ntp.build { services.ntp = svc.ntp.build {
pools = { pools = { "pool.ntp.org" = ["iburst"]; };
"pool.ntp.org" = [ "iburst" ]; makestep = { threshold = 1.0; limit = 3; };
};
makestep = {
threshold = 1.0;
limit = 3;
};
}; };
services.sshd = svc.ssh.build { }; services.sshd = svc.ssh.build { };
@ -166,7 +157,8 @@ in rec {
interface = services.wan; interface = services.wan;
}; };
services.firewall = svc.firewall.build { }; services.firewall = svc.firewall.build {
};
services.packet_forwarding = svc.network.forward.build { }; services.packet_forwarding = svc.network.forward.build { };
@ -203,5 +195,7 @@ in rec {
]; ];
}; };
defaultProfile.packages = with pkgs; [ min-collect-garbage ]; defaultProfile.packages = with pkgs; [
min-collect-garbage
];
} }

View File

@ -4,7 +4,7 @@ let
svc = config.system.service; svc = config.system.service;
inherit (pkgs.pseudofile) dir symlink; inherit (pkgs.pseudofile) dir symlink;
inherit (pkgs.liminix.services) oneshot target; inherit (pkgs.liminix.services) oneshot target;
some-util-linux = pkgs.runCommand "some-util-linux" { } '' some-util-linux = pkgs.runCommand "some-util-linux" {} ''
mkdir -p $out/bin mkdir -p $out/bin
cd ${pkgs.util-linux-small}/bin cd ${pkgs.util-linux-small}/bin
cp fdisk sfdisk mkswap $out/bin cp fdisk sfdisk mkswap $out/bin
@ -53,7 +53,7 @@ in rec {
services.defaultroute4 = svc.network.route.build { services.defaultroute4 = svc.network.route.build {
via = "$(output ${services.dhcpc} router)"; via = "$(output ${services.dhcpc} router)";
target = "default"; target = "default";
dependencies = [ services.dhcpc ]; dependencies = [services.dhcpc];
}; };
services.resolvconf = oneshot rec { services.resolvconf = oneshot rec {

View File

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

View File

@ -10,7 +10,7 @@
let let
secrets = { secrets = {
domainName = "fake.liminix.org"; domainName = "fake.liminix.org";
firewallRules = { }; firewallRules = {};
} // (import ./rotuer-secrets.nix); } // (import ./rotuer-secrets.nix);
svc = config.system.service; svc = config.system.service;
wirelessConfig = { wirelessConfig = {
@ -70,13 +70,13 @@ in rec {
wireless.networks = { wireless.networks = {
"${secrets.ssid}" = { "${secrets.ssid}" = {
interface = config.hardware.networkInterfaces.wlan; interface = config.hardware.networkInterfaces.wlan;
hw_mode = "g"; hw_mode="g";
channel = "2"; channel = "2";
ieee80211n = 1; ieee80211n = 1;
} // wirelessConfig; } // wirelessConfig;
"${secrets.ssid}5" = rec { "${secrets.ssid}5" = rec {
interface = config.hardware.networkInterfaces.wlan5; interface = config.hardware.networkInterfaces.wlan5;
hw_mode = "a"; hw_mode="a";
channel = 36; channel = 36;
ht_capab = "[HT40+]"; ht_capab = "[HT40+]";
vht_oper_chwidth = 1; vht_oper_chwidth = 1;

View File

@ -4,7 +4,7 @@
{ lib, pkgs, config, ...}: { lib, pkgs, config, ...}:
let let
inherit (lib) mkOption types; inherit (lib) mkOption types ;
inherit (pkgs.pseudofile) dir symlink; inherit (pkgs.pseudofile) dir symlink;
type_service = pkgs.liminix.lib.types.service; type_service = pkgs.liminix.lib.types.service;
@ -54,29 +54,20 @@ in {
boot = { boot = {
commandLine = mkOption { commandLine = mkOption {
type = types.listOf types.nonEmptyStr; type = types.listOf types.nonEmptyStr;
default = [ ]; default = [];
description = "Kernel command line"; description = "Kernel command line";
}; };
commandLineDtbNode = mkOption { commandLineDtbNode = mkOption {
type = types.enum [ type = types.enum [ "bootargs" "bootargs-override" ];
"bootargs"
"bootargs-override"
];
default = "bootargs"; default = "bootargs";
description = "Kernel command line's devicetree node"; description = "Kernel command line's devicetree node";
}; };
imageType = mkOption { imageType = mkOption {
type = types.enum [ type = types.enum [ "primary" "secondary" ];
"primary"
"secondary"
];
default = "primary"; default = "primary";
}; };
imageFormat = mkOption { imageFormat = mkOption {
type = types.enum [ type = types.enum ["fit" "uimage"];
"fit"
"uimage"
];
default = "uimage"; default = "uimage";
}; };
tftp = { tftp = {

View File

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

View File

@ -5,13 +5,14 @@
## you want to run on it, and would usually be set in the "device" file: ## you want to run on it, and would usually be set in the "device" file:
## :file:`devices/manuf-model/default.nix` ## :file:`devices/manuf-model/default.nix`
{ lib, ... }:
{ lib, ...}:
let let
inherit (lib) mkOption types; inherit (lib) mkOption types ;
in in {
{
options = { options = {
boot = { }; boot = {
};
hardware = { hardware = {
dts = { dts = {
src = mkOption { src = mkOption {
@ -25,7 +26,7 @@ in
''; '';
}; };
includes = mkOption { includes = mkOption {
default = [ ]; default = [];
description = "List of directories to search for DTS includes (.dtsi files)"; description = "List of directories to search for DTS includes (.dtsi files)";
type = types.listOf types.path; type = types.listOf types.path;
}; };

View File

@ -14,16 +14,13 @@ in {
run = "exec ${pkgs.devout}/bin/devout /run/devout.sock 4"; run = "exec ${pkgs.devout}/bin/devout /run/devout.sock 4";
}; };
coldplug = oneshot { coldplug = oneshot {
name = "coldplug"; name ="coldplug";
# would love to know what mdevd-coldplug/udevadm trigger does # would love to know what mdevd-coldplug/udevadm trigger does
# that this doesn't # that this doesn't
up = '' up = ''
for i in $(find /sys -name uevent); do ( echo change > $i ) ; done for i in $(find /sys -name uevent); do ( echo change > $i ) ; done
''; '';
dependencies = [ dependencies = [devout mdevd];
devout
mdevd
];
}; };
}; };
}; };

View File

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

View File

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

View File

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

View File

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

View File

@ -18,15 +18,9 @@ let
inherit (builtins) toString; inherit (builtins) toString;
inherit (pkgs.pseudofile) dir; inherit (pkgs.pseudofile) dir;
passwd-file = passwd-file =
let 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" )
lines = mapAttrsToList ( config.users;
name: u: in concatStrings lines;
"${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 = group-file =
let lines = mapAttrsToList let lines = mapAttrsToList
(name: {gid, usernames ? []}: (name: {gid, usernames ? []}:

View File

@ -4,7 +4,7 @@ let
inherit (pkgs) stdenv wireless-regdb; inherit (pkgs) stdenv wireless-regdb;
regulatory = stdenv.mkDerivation { regulatory = stdenv.mkDerivation {
name = "regulatory.db"; name = "regulatory.db";
phases = [ "installPhase" ]; phases = ["installPhase"];
installPhase = '' installPhase = ''
mkdir -p $out mkdir -p $out
cp ${wireless-regdb}/lib/firmware/regulatory.db $out/ cp ${wireless-regdb}/lib/firmware/regulatory.db $out/

View File

@ -46,7 +46,7 @@ in
extraPkgs // { extraPkgs // {
# liminix library functions # liminix library functions
lim = { lim = {
parseInt = s: (builtins.fromTOML "r=${s}").r; parseInt = s : (builtins.fromTOML "r=${s}").r;
}; };
# keep these alphabetical # keep these alphabetical
@ -74,6 +74,7 @@ extraPkgs // {
# should texinfo be in nativeBuildInputs instead of # should texinfo be in nativeBuildInputs instead of
# buildInputs? # buildInputs?
texinfo = null; texinfo = null;
}; };
# luarocks wants a cross-compiled cmake (which seems like a bug, # luarocks wants a cross-compiled cmake (which seems like a bug,
@ -185,12 +186,9 @@ extraPkgs // {
# done. Do it the ugly way.. # done. Do it the ugly way..
postPatch = postPatch =
o.postPatch o.postPatch
+ ( + (with final;
with final; lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform)
lib.optionalString ( "\nsed -i.bak 's/linux.*-mips/linux-mops/' Configure\n");
stdenv.buildPlatform != stdenv.hostPlatform
) "\nsed -i.bak 's/linux.*-mips/linux-mops/' Configure\n"
);
}); });
pppBuild = prev.ppp; pppBuild = prev.ppp;
@ -202,12 +200,13 @@ extraPkgs // {
}); in q.override { nixosTestRunner = true; sdlSupport = false; }; }); in q.override { nixosTestRunner = true; sdlSupport = false; };
rsyncSmall = rsyncSmall =
let let r = prev.rsync.overrideAttrs(o: {
r = prev.rsync.overrideAttrs (o: { configureFlags = o.configureFlags ++ [
configureFlags = o.configureFlags ++ [ "--disable-openssl" ]; "--disable-openssl"
];
}); });
in in r.override { openssl = null; };
r.override { openssl = null; };
inherit s6; inherit s6;
s6-linux-init = prev.s6-linux-init.override { s6-linux-init = prev.s6-linux-init.override {
@ -225,14 +224,14 @@ extraPkgs // {
ubootQemuAarch64 = final.buildUBoot { ubootQemuAarch64 = final.buildUBoot {
defconfig = "qemu_arm64_defconfig"; defconfig = "qemu_arm64_defconfig";
extraMeta.platforms = [ "aarch64-linux" ]; extraMeta.platforms = ["aarch64-linux"];
filesToInstall = [ "u-boot.bin" ]; filesToInstall = ["u-boot.bin"];
}; };
ubootQemuArm = final.buildUBoot { ubootQemuArm = final.buildUBoot {
defconfig = "qemu_arm_defconfig"; defconfig = "qemu_arm_defconfig";
extraMeta.platforms = [ "armv7l-linux" ]; extraMeta.platforms = ["armv7l-linux"];
filesToInstall = [ "u-boot.bin" ]; filesToInstall = ["u-boot.bin"];
extraConfig = '' extraConfig = ''
CONFIG_CMD_UBI=y CONFIG_CMD_UBI=y
CONFIG_CMD_UBIFS=y CONFIG_CMD_UBIFS=y
@ -246,8 +245,8 @@ extraPkgs // {
ubootQemuMips = final.buildUBoot { ubootQemuMips = final.buildUBoot {
defconfig = "malta_defconfig"; defconfig = "malta_defconfig";
extraMeta.platforms = [ "mips-linux" ]; extraMeta.platforms = ["mips-linux"];
filesToInstall = [ "u-boot.bin" ]; filesToInstall = ["u-boot.bin"];
# define the prompt to be the same as arm{32,64} so # define the prompt to be the same as arm{32,64} so
# we can use the same expect script for both # we can use the same expect script for both
extraPatches = [ ./pkgs/u-boot/0002-virtio-init-for-malta.patch ]; extraPatches = [ ./pkgs/u-boot/0002-virtio-init-for-malta.patch ];
@ -284,4 +283,5 @@ extraPkgs // {
translateManpages = false; translateManpages = false;
capabilitiesSupport = false; capabilitiesSupport = false;
}; };
} }

View File

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

View File

@ -1,4 +1,7 @@
{ callPackage, lib }: {
callPackage
, lib
}:
let let
typeChecked = caller: type: value: typeChecked = caller: type: value:
let let
@ -9,10 +12,10 @@ let
in { in {
liminix = { liminix = {
builders = { builders = {
squashfs = callPackage ./liminix-tools/builders/squashfs.nix { }; squashfs = callPackage ./liminix-tools/builders/squashfs.nix {};
dtb = callPackage ./kernel/dtb.nix { }; dtb = callPackage ./kernel/dtb.nix {};
uimage = callPackage ./kernel/uimage.nix { }; uimage = callPackage ./kernel/uimage.nix {};
kernel = callPackage ./kernel { }; kernel = callPackage ./kernel {};
}; };
callService = path : parameters : callService = path : parameters :
let pkg = callPackage path {}; let pkg = callPackage path {};
@ -46,71 +49,71 @@ in {
}; };
inherit typeChecked; inherit typeChecked;
}; };
networking = callPackage ./liminix-tools/networking { }; networking = callPackage ./liminix-tools/networking {};
services = callPackage ./liminix-tools/services { }; services = callPackage ./liminix-tools/services {};
}; };
# please keep the rest of this list alphabetised :-) # please keep the rest of this list alphabetised :-)
anoia = callPackage ./anoia { }; anoia = callPackage ./anoia {};
devout = callPackage ./devout { }; devout = callPackage ./devout {};
fennel = callPackage ./fennel { }; fennel = callPackage ./fennel {};
fennelrepl = callPackage ./fennelrepl { }; fennelrepl = callPackage ./fennelrepl {};
firewallgen = callPackage ./firewallgen { }; firewallgen = callPackage ./firewallgen {};
firmware-utils = callPackage ./firmware-utils { }; firmware-utils = callPackage ./firmware-utils {};
gen_init_cpio = callPackage ./gen_init_cpio { }; gen_init_cpio = callPackage ./gen_init_cpio {};
go-l2tp = callPackage ./go-l2tp { }; go-l2tp = callPackage ./go-l2tp {};
hi = callPackage ./hi { }; hi = callPackage ./hi {};
ifwait = callPackage ./ifwait { }; ifwait = callPackage ./ifwait {};
initramfs-peek = callPackage ./initramfs-peek { }; initramfs-peek = callPackage ./initramfs-peek {};
kernel-backport = callPackage ./kernel-backport { }; kernel-backport = callPackage ./kernel-backport {};
kmodloader = callPackage ./kmodloader { }; kmodloader = callPackage ./kmodloader {};
levitate = callPackage ./levitate { }; levitate = callPackage ./levitate {};
libubootenv = callPackage ./libubootenv { }; libubootenv = callPackage ./libubootenv {};
linotify = callPackage ./linotify { }; linotify = callPackage ./linotify {};
lualinux = callPackage ./lualinux { }; lualinux = callPackage ./lualinux {};
# we need to build real lzma instead of using xz, because the lzma # we need to build real lzma instead of using xz, because the lzma
# decoder in u-boot doesn't understand streaming lzma archives # decoder in u-boot doesn't understand streaming lzma archives
# ("Stream with EOS marker is not supported") and xz can't create # ("Stream with EOS marker is not supported") and xz can't create
# non-streaming ones. See # non-streaming ones. See
# https://sourceforge.net/p/squashfs/mailman/message/26599379/ # https://sourceforge.net/p/squashfs/mailman/message/26599379/
lzma = callPackage ./lzma { }; lzma = callPackage ./lzma {};
mac80211 = callPackage ./mac80211 { }; mac80211 = callPackage ./mac80211 {};
zyxel-bootconfig = callPackage ./zyxel-bootconfig { }; zyxel-bootconfig = callPackage ./zyxel-bootconfig {};
min-collect-garbage = callPackage ./min-collect-garbage { }; min-collect-garbage = callPackage ./min-collect-garbage {};
min-copy-closure = callPackage ./min-copy-closure { }; min-copy-closure = callPackage ./min-copy-closure {};
minisock = callPackage ./minisock { }; minisock = callPackage ./minisock {};
nellie = callPackage ./nellie { }; nellie = callPackage ./nellie {};
netlink-lua = callPackage ./netlink-lua { }; netlink-lua = callPackage ./netlink-lua {};
odhcp-script = callPackage ./odhcp-script { }; odhcp-script = callPackage ./odhcp-script {};
odhcp6c = callPackage ./odhcp6c { }; odhcp6c = callPackage ./odhcp6c {};
openwrt = callPackage ./openwrt { }; openwrt = callPackage ./openwrt {};
ppp = callPackage ./ppp { }; ppp = callPackage ./ppp {};
pppoe = callPackage ./pppoe { }; pppoe = callPackage ./pppoe {};
preinit = callPackage ./preinit { }; preinit = callPackage ./preinit {};
pseudofile = callPackage ./pseudofile { }; pseudofile = callPackage ./pseudofile {};
routeros = callPackage ./routeros { }; routeros = callPackage ./routeros {};
run-liminix-vm = callPackage ./run-liminix-vm { }; run-liminix-vm = callPackage ./run-liminix-vm {};
s6-init-bin = callPackage ./s6-init-bin { }; s6-init-bin = callPackage ./s6-init-bin {};
s6-rc-database = callPackage ./s6-rc-database { }; s6-rc-database = callPackage ./s6-rc-database {};
s6-rc-up-tree = callPackage ./s6-rc-up-tree { }; s6-rc-up-tree = callPackage ./s6-rc-up-tree {};
# schnapps is written by Turris and provides a high-level interface # schnapps is written by Turris and provides a high-level interface
# to btrfs snapshots. It may be useful on the Turris Omnia to # to btrfs snapshots. It may be useful on the Turris Omnia to
# install Liminix while retaining the ability to rollback to the # install Liminix while retaining the ability to rollback to the
# vendor OS, or even to derisk Liminix updates on that device # vendor OS, or even to derisk Liminix updates on that device
schnapps = callPackage ./schnapps { }; schnapps = callPackage ./schnapps {};
serviceFns = callPackage ./service-fns { }; serviceFns = callPackage ./service-fns {};
swconfig = callPackage ./swconfig { }; swconfig = callPackage ./swconfig {};
systemconfig = callPackage ./systemconfig { }; systemconfig = callPackage ./systemconfig {};
tufted = callPackage ./tufted { }; tufted = callPackage ./tufted {};
uevent-watch = callPackage ./uevent-watch { }; uevent-watch = callPackage ./uevent-watch {};
usb-modeswitch = callPackage ./usb-modeswitch { }; usb-modeswitch = callPackage ./usb-modeswitch {};
writeAshScript = callPackage ./write-ash-script { }; writeAshScript = callPackage ./write-ash-script {};
writeAshScriptBin = callPackage ./write-ash-script/bin.nix { }; writeAshScriptBin = callPackage ./write-ash-script/bin.nix {};
writeFennel = callPackage ./write-fennel { }; writeFennel = callPackage ./write-fennel {};
writeFennelScript = callPackage ./write-fennel-script { }; writeFennelScript = callPackage ./write-fennel-script {};
} }

View File

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

View File

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

View File

@ -1,7 +1,7 @@
{ {
buildGoModule, buildGoModule
fetchFromGitHub, , fetchFromGitHub
ppp, , ppp
}: }:
buildGoModule rec { buildGoModule rec {
@ -12,7 +12,7 @@ buildGoModule rec {
repo = "go-l2tp"; repo = "go-l2tp";
owner = "katalix"; owner = "katalix";
rev = "570d763"; rev = "570d763";
hash = "sha256-R8ImKPkPBC+FvzKOBEZ3VxQ12dEjtfRa7AH94xMsAGA="; hash= "sha256-R8ImKPkPBC+FvzKOBEZ3VxQ12dEjtfRa7AH94xMsAGA=";
}; };
patchPhase = '' patchPhase = ''
@ -23,4 +23,5 @@ buildGoModule rec {
doCheck = false; doCheck = false;
vendorHash = "sha256-hOkhJhToN/VJwjQmnQJSPGz26/YDR2Ch+1yeW51OF+U="; vendorHash = "sha256-hOkhJhToN/VJwjQmnQJSPGz26/YDR2Ch+1yeW51OF+U=";
} }

View File

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

View File

@ -1,11 +1,11 @@
{ {
busybox, busybox
pkgsBuildBuild, , pkgsBuildBuild
runCommand, , runCommand
cpio, , cpio
writeReferencesToFile, , writeReferencesToFile
writeScript, , writeScript
}: } :
let let
inherit (pkgsBuildBuild) gen_init_cpio; inherit (pkgsBuildBuild) gen_init_cpio;
script = writeScript "init" '' script = writeScript "init" ''

View File

@ -1,18 +1,17 @@
{ { stdenv
stdenv, , git
git, , python2
python2, , which
which, , fetchgit
fetchgit, , fetchFromGitHub
fetchFromGitHub, , coccinelle
coccinelle,
}: }:
let let
donorTree = fetchFromGitHub { donorTree = fetchFromGitHub {
owner = "torvalds"; owner = "torvalds";
repo = "linux"; repo = "linux";
rev = "e2c1a934fd8e4288e7a32f4088ceaccf469eb74c"; # 5.15.94 rev = "e2c1a934fd8e4288e7a32f4088ceaccf469eb74c"; # 5.15.94
hash = "sha256-Jg3EgL86CseuzYMAlUG3CDWPCo8glMSIZs10l7EuhWI="; hash= "sha256-Jg3EgL86CseuzYMAlUG3CDWPCo8glMSIZs10l7EuhWI=";
}; };
backports = stdenv.mkDerivation { backports = stdenv.mkDerivation {
name = "linux-backports"; name = "linux-backports";

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,9 +1,7 @@
{ { stdenv
stdenv, , cmake
cmake, , fetchFromGitHub
fetchFromGitHub, , ...} :
...
}:
# let switchDotH = buildPackages.fetchurl { # 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"; # 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"; # sha256 = "15kmhhcpd84y4f45rf8zai98c61jyvkc37p90pcxirna01x33wi8";

View File

@ -1,4 +1,7 @@
{ fetchFromGitHub, pkgsBuildBuild }: {
fetchFromGitHub
, pkgsBuildBuild
}:
let let
src = fetchFromGitHub { src = fetchFromGitHub {
name = "openwrt-source"; name = "openwrt-source";
@ -7,7 +10,7 @@ let
rev = "refs/tags/v23.05.2"; rev = "refs/tags/v23.05.2";
hash = "sha256-kP+cSOB6LiOMWs7g+ji7P7ehiDYDwRdmT4R5jSzw6K4="; hash = "sha256-kP+cSOB6LiOMWs7g+ji7P7ehiDYDwRdmT4R5jSzw6K4=";
}; };
doPatch = family: '' doPatch = family : ''
cp -av ${src}/target/linux/generic/files/* . cp -av ${src}/target/linux/generic/files/* .
chmod -R u+w . chmod -R u+w .
cp -av ${src}/target/linux/${family}/files/* . cp -av ${src}/target/linux/${family}/files/* .

View File

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

View File

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

View File

@ -1,9 +1,12 @@
{ stdenv, gdb }: {
stdenv
, gdb
}:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "preinit"; name = "preinit";
src = ./.; src = ./.;
# NIX_DEBUG=2; # NIX_DEBUG=2;
hardeningDisable = [ "all" ]; hardeningDisable = [ "all" ];
postBuild = '' postBuild = ''
@ -11,8 +14,8 @@ stdenv.mkDerivation {
ls -l preinit ls -l preinit
''; '';
makeFlags = [ "preinit" ]; makeFlags = ["preinit"];
stripAllList = [ "bin" ]; stripAllList = ["bin"];
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
cp preinit $out/bin cp preinit $out/bin

View File

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

View File

@ -1,9 +1,9 @@
{ {
stdenv, stdenv
python3, , python3
qemu, , qemu
fetchzip, , fetchzip
writeShellApplication, , writeShellApplication
}: }:
let let
chr-image = fetchzip { chr-image = fetchzip {
@ -14,7 +14,7 @@ let
ros-exec-script = stdenv.mkDerivation { ros-exec-script = stdenv.mkDerivation {
name = "ros-exec-script"; name = "ros-exec-script";
src = ./.; src = ./.;
buildInputs = [ python3 ]; buildInputs = [python3];
buildPhase = ":"; buildPhase = ":";
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin

View File

@ -1,19 +1,18 @@
{ {
qemuLim, qemuLim
socat, , socat
writeShellScript, , writeShellScript
writeFennel, , writeFennel
runCommand, , runCommand
lib, , lib
lua, , lua
pkgsBuildBuild, , pkgsBuildBuild
}: }: let
let
run-liminix-vm = pkgsBuildBuild.writeFennel "run-liminix-vm" { run-liminix-vm = pkgsBuildBuild.writeFennel "run-liminix-vm" {
packages = [ qemuLim lua.pkgs.luaposix lua.pkgs.fennel ]; packages = [ qemuLim lua.pkgs.luaposix lua.pkgs.fennel ];
} ./run-liminix-vm.fnl; } ./run-liminix-vm.fnl;
connect = writeShellScript "connect-vm" '' connect = writeShellScript "connect-vm" ''
export PATH="${lib.makeBinPath [ socat ]}:$PATH" export PATH="${lib.makeBinPath [socat]}:$PATH"
socat -,raw,echo=0,icanon=0,isig=0,icrnl=0,escape=0x0f unix-connect:$1 socat -,raw,echo=0,icanon=0,isig=0,icrnl=0,escape=0x0f unix-connect:$1
''; '';
in runCommand "vm" {} '' in runCommand "vm" {} ''

View File

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

View File

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

View File

@ -1,17 +1,17 @@
{ {
stdenv, stdenv
fetchFromGitLab, , fetchFromGitLab
makeWrapper, , makeWrapper
btrfs-progs, , btrfs-progs
util-linux-small, , util-linux-small
lib, , lib
}: }:
let search_path = lib.makeBinPath [btrfs-progs util-linux-small]; let search_path = lib.makeBinPath [btrfs-progs util-linux-small];
in stdenv.mkDerivation { in stdenv.mkDerivation {
pname = "schnapps"; pname = "schnapps";
version = "2.13.0"; version = "2.13.0";
src = fetchFromGitLab { src =fetchFromGitLab {
domain = "gitlab.nic.cz"; domain = "gitlab.nic.cz";
owner = "turris"; owner = "turris";
repo = "schnapps"; repo = "schnapps";

View File

@ -1,4 +1,4 @@
{ writeText }: {writeText}:
writeText "service-fns.sh" '' writeText "service-fns.sh" ''
output() { cat $1/.outputs/$2; } output() { cat $1/.outputs/$2; }
output_word() { output_word() {

View File

@ -14,8 +14,8 @@ in stdenv.mkDerivation {
name = "swconfig"; name = "swconfig";
buildInputs = [ buildPackages.pkg-config ]; buildInputs = [ buildPackages.pkg-config ];
nativeBuildInputs = [ libnl ]; nativeBuildInputs = [ libnl ];
CFLAGS = "-O2 -Ifrom_kernel -I${libnl.dev}/include/libnl3"; CFLAGS="-O2 -Ifrom_kernel -I${libnl.dev}/include/libnl3";
LDFLAGS = "-L${libnl.out}/lib"; LDFLAGS="-L${libnl.out}/lib";
patchPhase = '' patchPhase = ''
mkdir -p from_kernel/linux mkdir -p from_kernel/linux

View File

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

View File

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

View File

@ -1,17 +1,16 @@
{ { nellie
nellie, , lualinux
lualinux, , writeFennel
writeFennel, , anoia
anoia, , fennel
fennel, , stdenv
stdenv, , fennelrepl
fennelrepl, , s6-rc-up-tree
s6-rc-up-tree,
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "uevent-watch"; name = "uevent-watch";
src = ./.; src = ./.;
nativeBuildInputs = [ fennelrepl ]; nativeBuildInputs = [ fennelrepl makeWrapper ];
propagatedBuildInputs = [ s6-rc-up-tree ]; propagatedBuildInputs = [ s6-rc-up-tree ];
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin

View File

@ -1,10 +1,9 @@
# usb modeswitch without udev, tcl, coreutils, bash dependencies # usb modeswitch without udev, tcl, coreutils, bash dependencies
{ { stdenv
stdenv, , lib
lib, , fetchurl
fetchurl, , pkg-config
pkg-config, , libusb1
libusb1,
}: }:
let let
pname = "usb-modeswitch"; pname = "usb-modeswitch";
@ -35,6 +34,6 @@ in stdenv.mkDerivation {
meta = { meta = {
license = lib.licenses.gpl2; license = lib.licenses.gpl2;
maintainers = [ ]; maintainers = [];
}; };
} }

View File

@ -1,15 +1,13 @@
{ writeScript, lib }:
name:
{ {
runtimeInputs ? [ ], writeScript
}: , lib
text: }
writeScript name '' : name : { runtimeInputs ? [] } : text : writeScript name ''
#!/bin/sh #!/bin/sh
set -o errexit set -o errexit
set -o nounset set -o nounset
set -o pipefail set -o pipefail
export PATH="${lib.makeBinPath runtimeInputs}:$PATH" export PATH="${lib.makeBinPath runtimeInputs}:$PATH"
${text} ${text}
'' ''

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { config, pkgs, ... } :
let let
inherit (pkgs.liminix.services) target; inherit (pkgs.liminix.services) target;
svc = config.system.service; svc = config.system.service;
@ -31,5 +31,5 @@ in rec {
ipaddr = "192.168.8.251"; ipaddr = "192.168.8.251";
}; };
defaultProfile.packages = [ pkgs.hello ]; defaultProfile.packages = [ pkgs.hello ] ;
} }