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:
parent
0d3218127f
commit
3df1ec76ff
|
@ -6,7 +6,7 @@ in {
|
|||
options.bordervm = {
|
||||
keys = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
default = [ ];
|
||||
};
|
||||
l2tp = {
|
||||
host = mkOption {
|
||||
|
@ -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"
|
||||
''
|
||||
interface_name = "eth1"
|
||||
services = [ "myservice" ]
|
||||
lns_ipaddr = "${cfg.l2tp.host}:${builtins.toString cfg.l2tp.port}"
|
||||
ac_name = "kpppoed-1.0"
|
||||
'';
|
||||
in {
|
||||
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
|
||||
{
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
serviceConfig = {
|
||||
|
@ -83,7 +82,7 @@ in {
|
|||
services.dnsmasq = {
|
||||
enable = true;
|
||||
resolveLocalQueries = false;
|
||||
settings = {
|
||||
settings = {
|
||||
# domain-needed = true;
|
||||
dhcp-range = [ "10.0.0.10,10.0.0.240" ];
|
||||
interface = "eth1";
|
||||
|
@ -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 [
|
||||
networkingOptions = [ ];
|
||||
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"
|
||||
];
|
||||
|
@ -136,13 +135,13 @@ in {
|
|||
nat = {
|
||||
enable = true;
|
||||
internalInterfaces = [ "eth1" ];
|
||||
externalInterface ="eth0";
|
||||
externalInterface = "eth0";
|
||||
};
|
||||
};
|
||||
users.users.liminix = {
|
||||
isNormalUser = true;
|
||||
uid = 1000;
|
||||
extraGroups = [ "wheel"];
|
||||
extraGroups = [ "wheel" ];
|
||||
openssh.authorizedKeys.keys = cfg.keys;
|
||||
};
|
||||
services.getty.autologinUser = "liminix";
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
{...}:
|
||||
{ ... }:
|
||||
{
|
||||
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";
|
||||
};
|
||||
|
|
53
ci.nix
53
ci.nix
|
@ -1,11 +1,12 @@
|
|||
{
|
||||
nixpkgs
|
||||
, unstable
|
||||
, liminix
|
||||
, ... }:
|
||||
nixpkgs,
|
||||
unstable,
|
||||
liminix,
|
||||
...
|
||||
}:
|
||||
let
|
||||
pkgs = (import nixpkgs {});
|
||||
borderVmConf = ./bordervm.conf-example.nix;
|
||||
pkgs = (import nixpkgs { });
|
||||
borderVmConf = ./bordervm.conf-example.nix;
|
||||
inherit (pkgs.lib.attrsets) genAttrs;
|
||||
devices = [
|
||||
"gl-ar750"
|
||||
|
@ -26,27 +27,35 @@ let
|
|||
}).outputs.default;
|
||||
tests = import ./tests/ci.nix;
|
||||
jobs =
|
||||
(genAttrs devices for-device) //
|
||||
tests //
|
||||
{
|
||||
buildEnv = (import liminix {
|
||||
inherit nixpkgs borderVmConf;
|
||||
device = import (liminix + "/devices/qemu");
|
||||
liminix-config = vanilla;
|
||||
}).buildEnv;
|
||||
(genAttrs devices for-device)
|
||||
// tests
|
||||
// {
|
||||
buildEnv =
|
||||
(import liminix {
|
||||
inherit nixpkgs borderVmConf;
|
||||
device = import (liminix + "/devices/qemu");
|
||||
liminix-config = vanilla;
|
||||
}).buildEnv;
|
||||
doc =
|
||||
let json =
|
||||
(import liminix {
|
||||
inherit nixpkgs borderVmConf;
|
||||
device = import (liminix + "/devices/qemu");
|
||||
liminix-config = {...} : {
|
||||
let
|
||||
json =
|
||||
(import liminix {
|
||||
inherit nixpkgs borderVmConf;
|
||||
device = import (liminix + "/devices/qemu");
|
||||
liminix-config =
|
||||
{ ... }:
|
||||
{
|
||||
imports = [ ./modules/all-modules.nix ];
|
||||
};
|
||||
}).outputs.optionsJson;
|
||||
in pkgs.stdenv.mkDerivation {
|
||||
}).outputs.optionsJson;
|
||||
in
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "liminix-doc";
|
||||
nativeBuildInputs = with pkgs; [
|
||||
gnumake sphinx fennel luaPackages.lyaml
|
||||
gnumake
|
||||
sphinx
|
||||
fennel
|
||||
luaPackages.lyaml
|
||||
];
|
||||
src = ./.;
|
||||
buildPhase = ''
|
||||
|
|
35
default.nix
35
default.nix
|
@ -1,24 +1,27 @@
|
|||
{
|
||||
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 // {
|
||||
overlays = [overlay];
|
||||
config = {
|
||||
allowUnsupportedSystem = true; # mipsel
|
||||
permittedInsecurePackages = [
|
||||
"python-2.7.18.6" # kernel backports needs python <3
|
||||
"python-2.7.18.7"
|
||||
];
|
||||
};
|
||||
});
|
||||
pkgs = import nixpkgs (
|
||||
device.system
|
||||
// {
|
||||
overlays = [ overlay ];
|
||||
config = {
|
||||
allowUnsupportedSystem = true; # mipsel
|
||||
permittedInsecurePackages = [
|
||||
"python-2.7.18.6" # kernel backports needs python <3
|
||||
"python-2.7.18.7"
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
eval = pkgs.lib.evalModules {
|
||||
specialArgs = {
|
||||
|
|
|
@ -2,9 +2,8 @@
|
|||
let
|
||||
conf = eval.config;
|
||||
rootDir = builtins.toPath ./..;
|
||||
stripAnyPrefixes = lib.flip (lib.fold lib.removePrefix)
|
||||
["${rootDir}/"];
|
||||
optToDoc = name: opt : {
|
||||
stripAnyPrefixes = lib.flip (lib.fold lib.removePrefix) [ "${rootDir}/" ];
|
||||
optToDoc = name: opt: {
|
||||
inherit name;
|
||||
description = opt.description or null;
|
||||
default = opt.default or null;
|
||||
|
@ -25,7 +24,6 @@ let
|
|||
let x = lib.mapAttrsToList optToDoc sd.parameters; in x;
|
||||
}
|
||||
else
|
||||
item // { declarations = map stripAnyPrefixes item.declarations; };
|
||||
item // { declarations = map stripAnyPrefixes item.declarations; };
|
||||
in
|
||||
builtins.map spliceServiceDefn
|
||||
(pkgs.lib.optionAttrSetToDocList eval.options)
|
||||
builtins.map spliceServiceDefn (pkgs.lib.optionAttrSetToDocList eval.options)
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
with import <nixpkgs> {} ;
|
||||
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;
|
||||
d' = {
|
||||
description = "${n}\n${substring 0 (stringLength n) "********************************"}\n";
|
||||
} // d;
|
||||
in d'.description)
|
||||
devices;
|
||||
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
|
||||
writeText "hwdoc" ''
|
||||
Supported hardware
|
||||
|
|
|
@ -119,7 +119,7 @@ in rec {
|
|||
secrets_file
|
||||
services.mount_external_disk
|
||||
config.hardware.networkInterfaces.lan
|
||||
] ;
|
||||
];
|
||||
};
|
||||
|
||||
users.root = {
|
||||
|
@ -128,18 +128,22 @@ in rec {
|
|||
};
|
||||
|
||||
users.backup = {
|
||||
uid=500; gid=500; gecos="Storage owner"; dir="/srv";
|
||||
shell="/dev/null";
|
||||
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; [
|
||||
e2fsprogs
|
||||
mtdutils
|
||||
(levitate.override {
|
||||
config = {
|
||||
config = {
|
||||
services = {
|
||||
inherit (config.services) dhcpc sshd watchdog;
|
||||
};
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# wherever the text "EDIT" appears - please consult the tutorial
|
||||
# documentation for details.
|
||||
|
||||
{ config, pkgs, ... } :
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
inherit (pkgs.liminix.services) bundle oneshot;
|
||||
inherit (pkgs) serviceFns;
|
||||
|
@ -49,31 +49,40 @@ in rec {
|
|||
country_code = "GB";
|
||||
wpa_passphrase = "not a real wifi password";
|
||||
|
||||
hw_mode="g";
|
||||
hw_mode = "g";
|
||||
ieee80211n = 1;
|
||||
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
|
||||
wpa_key_mgmt = "WPA-PSK";
|
||||
wpa_pairwise = "TKIP CCMP"; # auth for wpa (may not need this?)
|
||||
rsn_pairwise = "CCMP"; # auth for wpa2
|
||||
wpa_pairwise = "TKIP CCMP"; # auth for wpa (may not need this?)
|
||||
rsn_pairwise = "CCMP"; # auth for wpa2
|
||||
wmm_enabled = 1;
|
||||
};
|
||||
};
|
||||
|
||||
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 {
|
||||
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 ];
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ let
|
|||
svc = config.system.service;
|
||||
inherit (pkgs.pseudofile) dir symlink;
|
||||
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
|
||||
cd ${pkgs.util-linux-small}/bin
|
||||
cp fdisk sfdisk mkswap $out/bin
|
||||
|
@ -53,7 +53,7 @@ in rec {
|
|||
services.defaultroute4 = svc.network.route.build {
|
||||
via = "$(output ${services.dhcpc} router)";
|
||||
target = "default";
|
||||
dependencies = [services.dhcpc];
|
||||
dependencies = [ services.dhcpc ];
|
||||
};
|
||||
|
||||
services.resolvconf = oneshot rec {
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
let
|
||||
secrets = {
|
||||
domainName = "fake.liminix.org";
|
||||
firewallRules = {};
|
||||
firewallRules = { };
|
||||
} // (import ./rotuer-secrets.nix);
|
||||
svc = config.system.service;
|
||||
wirelessConfig = {
|
||||
wirelessConfig = {
|
||||
country_code = "GB";
|
||||
inherit (secrets) wpa_passphrase;
|
||||
wmm_enabled = 1;
|
||||
|
@ -70,13 +70,13 @@ in rec {
|
|||
wireless.networks = {
|
||||
"${secrets.ssid}" = {
|
||||
interface = config.hardware.networkInterfaces.wlan;
|
||||
hw_mode="g";
|
||||
hw_mode = "g";
|
||||
channel = "2";
|
||||
ieee80211n = 1;
|
||||
} // wirelessConfig;
|
||||
"${secrets.ssid}5" = rec {
|
||||
interface = config.hardware.networkInterfaces.wlan5;
|
||||
hw_mode="a";
|
||||
hw_mode = "a";
|
||||
channel = 36;
|
||||
ht_capab = "[HT40+]";
|
||||
vht_oper_chwidth = 1;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
{ lib, pkgs, config, ...}:
|
||||
let
|
||||
inherit (lib) mkOption types ;
|
||||
inherit (lib) mkOption types;
|
||||
inherit (pkgs.pseudofile) dir symlink;
|
||||
|
||||
type_service = pkgs.liminix.lib.types.service;
|
||||
|
@ -36,7 +36,7 @@ in {
|
|||
'';
|
||||
# internal = true; # probably a good case to make this internal
|
||||
};
|
||||
rootfsType = mkOption {
|
||||
rootfsType = mkOption {
|
||||
default = "squashfs";
|
||||
type = types.enum [
|
||||
"btrfs"
|
||||
|
@ -46,7 +46,7 @@ in {
|
|||
"ubifs"
|
||||
];
|
||||
};
|
||||
rootOptions = mkOption {
|
||||
rootOptions = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
|
@ -54,20 +54,29 @@ in {
|
|||
boot = {
|
||||
commandLine = mkOption {
|
||||
type = types.listOf types.nonEmptyStr;
|
||||
default = [];
|
||||
default = [ ];
|
||||
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 = {
|
||||
|
@ -83,7 +92,7 @@ in {
|
|||
};
|
||||
# These names match the uboot environment variables. I reserve
|
||||
# the right to change them if I think of better ones.
|
||||
ipaddr = mkOption {
|
||||
ipaddr = mkOption {
|
||||
type = types.str;
|
||||
description = ''
|
||||
Our IP address to use when creating scripts to
|
||||
|
|
|
@ -85,10 +85,13 @@ in {
|
|||
};
|
||||
};
|
||||
filesystem = dir {
|
||||
bin = dir ({
|
||||
busybox = symlink "${busybox}/bin/busybox";
|
||||
sh = symlink "${busybox}/bin/busybox";
|
||||
} // makeLinks);
|
||||
bin = dir (
|
||||
{
|
||||
busybox = symlink "${busybox}/bin/busybox";
|
||||
sh = symlink "${busybox}/bin/busybox";
|
||||
}
|
||||
// makeLinks
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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, ...}:
|
||||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib) mkOption types ;
|
||||
in {
|
||||
inherit (lib) mkOption types;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
boot = {
|
||||
};
|
||||
boot = { };
|
||||
hardware = {
|
||||
dts = {
|
||||
src = mkOption {
|
||||
|
@ -26,7 +25,7 @@ in {
|
|||
'';
|
||||
};
|
||||
includes = mkOption {
|
||||
default = [];
|
||||
default = [ ];
|
||||
description = "List of directories to search for DTS includes (.dtsi files)";
|
||||
type = types.listOf types.path;
|
||||
};
|
||||
|
|
|
@ -14,13 +14,16 @@ in {
|
|||
run = "exec ${pkgs.devout}/bin/devout /run/devout.sock 4";
|
||||
};
|
||||
coldplug = oneshot {
|
||||
name ="coldplug";
|
||||
name = "coldplug";
|
||||
# would love to know what mdevd-coldplug/udevadm trigger does
|
||||
# that this doesn't
|
||||
up = ''
|
||||
for i in $(find /sys -name uevent); do ( echo change > $i ) ; done
|
||||
'';
|
||||
dependencies = [devout mdevd];
|
||||
dependencies = [
|
||||
devout
|
||||
mdevd
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
config
|
||||
, pkgs
|
||||
, lib
|
||||
, ...
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkOption types concatStringsSep;
|
||||
|
@ -22,7 +22,7 @@ in
|
|||
# but only part of one.
|
||||
kernel = mkOption {
|
||||
type = types.package;
|
||||
internal = true;
|
||||
internal = true;
|
||||
description = ''
|
||||
kernel
|
||||
******
|
||||
|
@ -42,7 +42,7 @@ in
|
|||
};
|
||||
dtb = mkOption {
|
||||
type = types.package;
|
||||
internal = true;
|
||||
internal = true;
|
||||
description = ''
|
||||
dtb
|
||||
***
|
||||
|
@ -52,7 +52,7 @@ in
|
|||
};
|
||||
uimage = mkOption {
|
||||
type = types.package;
|
||||
internal = true;
|
||||
internal = true;
|
||||
description = ''
|
||||
uimage
|
||||
******
|
||||
|
@ -68,7 +68,7 @@ in
|
|||
};
|
||||
manifest = mkOption {
|
||||
type = types.package;
|
||||
internal = true;
|
||||
internal = true;
|
||||
description = ''
|
||||
Debugging aid. JSON rendition of config.filesystem, on
|
||||
which can run "nix-store -q --tree" on it and find
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
{
|
||||
config
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkEnableOption; # types concatStringsSep;
|
||||
in {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
config
|
||||
, pkgs
|
||||
, lib
|
||||
, ...
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (pkgs) liminix;
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
EXT4_FS = "y";
|
||||
EXT4_USE_FOR_EXT2 = "y";
|
||||
FS_ENCRYPTION = "y";
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -17,10 +17,16 @@ let
|
|||
concatStrings concatStringsSep mapAttrsToList mkOption types;
|
||||
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;
|
||||
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;
|
||||
group-file =
|
||||
let lines = mapAttrsToList
|
||||
(name: {gid, usernames ? []}:
|
||||
|
|
|
@ -4,7 +4,7 @@ let
|
|||
inherit (pkgs) stdenv wireless-regdb;
|
||||
regulatory = stdenv.mkDerivation {
|
||||
name = "regulatory.db";
|
||||
phases = ["installPhase"];
|
||||
phases = [ "installPhase" ];
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp ${wireless-regdb}/lib/firmware/regulatory.db $out/
|
||||
|
|
40
overlay.nix
40
overlay.nix
|
@ -46,7 +46,7 @@ in
|
|||
extraPkgs // {
|
||||
# liminix library functions
|
||||
lim = {
|
||||
parseInt = s : (builtins.fromTOML "r=${s}").r;
|
||||
parseInt = s: (builtins.fromTOML "r=${s}").r;
|
||||
};
|
||||
|
||||
# keep these alphabetical
|
||||
|
@ -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"
|
||||
];
|
||||
});
|
||||
in r.override { openssl = null; };
|
||||
|
||||
let
|
||||
r = prev.rsync.overrideAttrs (o: {
|
||||
configureFlags = o.configureFlags ++ [ "--disable-openssl" ];
|
||||
});
|
||||
in
|
||||
r.override { openssl = null; };
|
||||
|
||||
inherit s6;
|
||||
s6-linux-init = prev.s6-linux-init.override {
|
||||
|
@ -224,14 +225,14 @@ extraPkgs // {
|
|||
|
||||
ubootQemuAarch64 = final.buildUBoot {
|
||||
defconfig = "qemu_arm64_defconfig";
|
||||
extraMeta.platforms = ["aarch64-linux"];
|
||||
filesToInstall = ["u-boot.bin"];
|
||||
extraMeta.platforms = [ "aarch64-linux" ];
|
||||
filesToInstall = [ "u-boot.bin" ];
|
||||
};
|
||||
|
||||
ubootQemuArm = final.buildUBoot {
|
||||
defconfig = "qemu_arm_defconfig";
|
||||
extraMeta.platforms = ["armv7l-linux"];
|
||||
filesToInstall = ["u-boot.bin"];
|
||||
extraMeta.platforms = [ "armv7l-linux" ];
|
||||
filesToInstall = [ "u-boot.bin" ];
|
||||
extraConfig = ''
|
||||
CONFIG_CMD_UBI=y
|
||||
CONFIG_CMD_UBIFS=y
|
||||
|
@ -245,8 +246,8 @@ extraPkgs // {
|
|||
|
||||
ubootQemuMips = final.buildUBoot {
|
||||
defconfig = "malta_defconfig";
|
||||
extraMeta.platforms = ["mips-linux"];
|
||||
filesToInstall = ["u-boot.bin"];
|
||||
extraMeta.platforms = [ "mips-linux" ];
|
||||
filesToInstall = [ "u-boot.bin" ];
|
||||
# define the prompt to be the same as arm{32,64} so
|
||||
# we can use the same expect script for both
|
||||
extraPatches = [ ./pkgs/u-boot/0002-virtio-init-for-malta.patch ];
|
||||
|
@ -268,7 +269,7 @@ extraPkgs // {
|
|||
CONFIG_MIPS_BOOT_FDT=y
|
||||
CONFIG_OF_LIBFDT=y
|
||||
CONFIG_OF_STDOUT_VIA_ALIAS=y
|
||||
'';
|
||||
'';
|
||||
};
|
||||
|
||||
libusb1 = prev.libusb1.override {
|
||||
|
@ -283,5 +284,4 @@ extraPkgs // {
|
|||
translateManpages = false;
|
||||
capabilitiesSupport = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
fennel
|
||||
, stdenv
|
||||
, linotify
|
||||
, lua
|
||||
, lualinux
|
||||
, cpio
|
||||
fennel,
|
||||
stdenv,
|
||||
linotify,
|
||||
lua,
|
||||
lualinux,
|
||||
cpio,
|
||||
}:
|
||||
let pname = "anoia";
|
||||
in stdenv.mkDerivation {
|
||||
|
|
115
pkgs/default.nix
115
pkgs/default.nix
|
@ -1,7 +1,4 @@
|
|||
{
|
||||
callPackage
|
||||
, lib
|
||||
}:
|
||||
{ callPackage, lib }:
|
||||
let
|
||||
typeChecked = caller: type: value:
|
||||
let
|
||||
|
@ -11,11 +8,11 @@ let
|
|||
in (mergeDefinitions [] type' defs).mergedValue;
|
||||
in {
|
||||
liminix = {
|
||||
builders = {
|
||||
squashfs = callPackage ./liminix-tools/builders/squashfs.nix {};
|
||||
dtb = callPackage ./kernel/dtb.nix {};
|
||||
uimage = callPackage ./kernel/uimage.nix {};
|
||||
kernel = callPackage ./kernel {};
|
||||
builders = {
|
||||
squashfs = callPackage ./liminix-tools/builders/squashfs.nix { };
|
||||
dtb = callPackage ./kernel/dtb.nix { };
|
||||
uimage = callPackage ./kernel/uimage.nix { };
|
||||
kernel = callPackage ./kernel { };
|
||||
};
|
||||
callService = path : parameters :
|
||||
let pkg = callPackage path {};
|
||||
|
@ -49,71 +46,71 @@ in {
|
|||
};
|
||||
inherit typeChecked;
|
||||
};
|
||||
networking = callPackage ./liminix-tools/networking {};
|
||||
services = callPackage ./liminix-tools/services {};
|
||||
networking = callPackage ./liminix-tools/networking { };
|
||||
services = callPackage ./liminix-tools/services { };
|
||||
};
|
||||
|
||||
# please keep the rest of this list alphabetised :-)
|
||||
|
||||
anoia = callPackage ./anoia {};
|
||||
devout = callPackage ./devout {};
|
||||
fennel = callPackage ./fennel {};
|
||||
fennelrepl = callPackage ./fennelrepl {};
|
||||
firewallgen = callPackage ./firewallgen {};
|
||||
firmware-utils = callPackage ./firmware-utils {};
|
||||
gen_init_cpio = callPackage ./gen_init_cpio {};
|
||||
go-l2tp = callPackage ./go-l2tp {};
|
||||
hi = callPackage ./hi {};
|
||||
ifwait = callPackage ./ifwait {};
|
||||
initramfs-peek = callPackage ./initramfs-peek {};
|
||||
kernel-backport = callPackage ./kernel-backport {};
|
||||
kmodloader = callPackage ./kmodloader {};
|
||||
levitate = callPackage ./levitate {};
|
||||
libubootenv = callPackage ./libubootenv {};
|
||||
linotify = callPackage ./linotify {};
|
||||
lualinux = callPackage ./lualinux {};
|
||||
anoia = callPackage ./anoia { };
|
||||
devout = callPackage ./devout { };
|
||||
fennel = callPackage ./fennel { };
|
||||
fennelrepl = callPackage ./fennelrepl { };
|
||||
firewallgen = callPackage ./firewallgen { };
|
||||
firmware-utils = callPackage ./firmware-utils { };
|
||||
gen_init_cpio = callPackage ./gen_init_cpio { };
|
||||
go-l2tp = callPackage ./go-l2tp { };
|
||||
hi = callPackage ./hi { };
|
||||
ifwait = callPackage ./ifwait { };
|
||||
initramfs-peek = callPackage ./initramfs-peek { };
|
||||
kernel-backport = callPackage ./kernel-backport { };
|
||||
kmodloader = callPackage ./kmodloader { };
|
||||
levitate = callPackage ./levitate { };
|
||||
libubootenv = callPackage ./libubootenv { };
|
||||
linotify = callPackage ./linotify { };
|
||||
lualinux = callPackage ./lualinux { };
|
||||
|
||||
# we need to build real lzma instead of using xz, because the lzma
|
||||
# decoder in u-boot doesn't understand streaming lzma archives
|
||||
# ("Stream with EOS marker is not supported") and xz can't create
|
||||
# non-streaming ones. See
|
||||
# https://sourceforge.net/p/squashfs/mailman/message/26599379/
|
||||
lzma = callPackage ./lzma {};
|
||||
lzma = callPackage ./lzma { };
|
||||
|
||||
mac80211 = callPackage ./mac80211 {};
|
||||
zyxel-bootconfig = callPackage ./zyxel-bootconfig {};
|
||||
min-collect-garbage = callPackage ./min-collect-garbage {};
|
||||
min-copy-closure = callPackage ./min-copy-closure {};
|
||||
minisock = callPackage ./minisock {};
|
||||
nellie = callPackage ./nellie {};
|
||||
netlink-lua = callPackage ./netlink-lua {};
|
||||
odhcp-script = callPackage ./odhcp-script {};
|
||||
odhcp6c = callPackage ./odhcp6c {};
|
||||
openwrt = callPackage ./openwrt {};
|
||||
ppp = callPackage ./ppp {};
|
||||
pppoe = callPackage ./pppoe {};
|
||||
preinit = callPackage ./preinit {};
|
||||
pseudofile = callPackage ./pseudofile {};
|
||||
routeros = callPackage ./routeros {};
|
||||
run-liminix-vm = callPackage ./run-liminix-vm {};
|
||||
s6-init-bin = callPackage ./s6-init-bin {};
|
||||
s6-rc-database = callPackage ./s6-rc-database {};
|
||||
s6-rc-up-tree = callPackage ./s6-rc-up-tree {};
|
||||
mac80211 = callPackage ./mac80211 { };
|
||||
zyxel-bootconfig = callPackage ./zyxel-bootconfig { };
|
||||
min-collect-garbage = callPackage ./min-collect-garbage { };
|
||||
min-copy-closure = callPackage ./min-copy-closure { };
|
||||
minisock = callPackage ./minisock { };
|
||||
nellie = callPackage ./nellie { };
|
||||
netlink-lua = callPackage ./netlink-lua { };
|
||||
odhcp-script = callPackage ./odhcp-script { };
|
||||
odhcp6c = callPackage ./odhcp6c { };
|
||||
openwrt = callPackage ./openwrt { };
|
||||
ppp = callPackage ./ppp { };
|
||||
pppoe = callPackage ./pppoe { };
|
||||
preinit = callPackage ./preinit { };
|
||||
pseudofile = callPackage ./pseudofile { };
|
||||
routeros = callPackage ./routeros { };
|
||||
run-liminix-vm = callPackage ./run-liminix-vm { };
|
||||
s6-init-bin = callPackage ./s6-init-bin { };
|
||||
s6-rc-database = callPackage ./s6-rc-database { };
|
||||
s6-rc-up-tree = callPackage ./s6-rc-up-tree { };
|
||||
|
||||
# schnapps is written by Turris and provides a high-level interface
|
||||
# to btrfs snapshots. It may be useful on the Turris Omnia to
|
||||
# install Liminix while retaining the ability to rollback to the
|
||||
# vendor OS, or even to derisk Liminix updates on that device
|
||||
schnapps = callPackage ./schnapps {};
|
||||
schnapps = callPackage ./schnapps { };
|
||||
|
||||
serviceFns = callPackage ./service-fns {};
|
||||
swconfig = callPackage ./swconfig {};
|
||||
systemconfig = callPackage ./systemconfig {};
|
||||
tufted = callPackage ./tufted {};
|
||||
uevent-watch = callPackage ./uevent-watch {};
|
||||
usb-modeswitch = callPackage ./usb-modeswitch {};
|
||||
writeAshScript = callPackage ./write-ash-script {};
|
||||
writeAshScriptBin = callPackage ./write-ash-script/bin.nix {};
|
||||
writeFennel = callPackage ./write-fennel {};
|
||||
writeFennelScript = callPackage ./write-fennel-script {};
|
||||
serviceFns = callPackage ./service-fns { };
|
||||
swconfig = callPackage ./swconfig { };
|
||||
systemconfig = callPackage ./systemconfig { };
|
||||
tufted = callPackage ./tufted { };
|
||||
uevent-watch = callPackage ./uevent-watch { };
|
||||
usb-modeswitch = callPackage ./usb-modeswitch { };
|
||||
writeAshScript = callPackage ./write-ash-script { };
|
||||
writeAshScriptBin = callPackage ./write-ash-script/bin.nix { };
|
||||
writeFennel = callPackage ./write-fennel { };
|
||||
writeFennelScript = callPackage ./write-fennel-script { };
|
||||
}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
{ nellie
|
||||
, writeFennel
|
||||
, anoia
|
||||
, fennel
|
||||
, stdenv
|
||||
, fennelrepl
|
||||
, lualinux
|
||||
{
|
||||
nellie,
|
||||
writeFennel,
|
||||
anoia,
|
||||
fennel,
|
||||
stdenv,
|
||||
fennelrepl,
|
||||
lualinux,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
name = "devout";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
stdenv
|
||||
, lua
|
||||
, fetchFromSourcehut
|
||||
stdenv,
|
||||
lua,
|
||||
fetchFromSourcehut,
|
||||
}:
|
||||
let pname = "fennel";
|
||||
in stdenv.mkDerivation {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
buildGoModule
|
||||
, fetchFromGitHub
|
||||
, ppp
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
ppp,
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
|
@ -12,7 +12,7 @@ buildGoModule rec {
|
|||
repo = "go-l2tp";
|
||||
owner = "katalix";
|
||||
rev = "570d763";
|
||||
hash= "sha256-R8ImKPkPBC+FvzKOBEZ3VxQ12dEjtfRa7AH94xMsAGA=";
|
||||
hash = "sha256-R8ImKPkPBC+FvzKOBEZ3VxQ12dEjtfRa7AH94xMsAGA=";
|
||||
};
|
||||
|
||||
patchPhase = ''
|
||||
|
@ -23,5 +23,4 @@ buildGoModule rec {
|
|||
|
||||
doCheck = false;
|
||||
vendorHash = "sha256-hOkhJhToN/VJwjQmnQJSPGz26/YDR2Ch+1yeW51OF+U=";
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
{ netlink-lua
|
||||
, writeFennelScript
|
||||
, runCommand
|
||||
, anoia
|
||||
{
|
||||
netlink-lua,
|
||||
writeFennelScript,
|
||||
runCommand,
|
||||
anoia,
|
||||
}:
|
||||
runCommand "ifwait" {} ''
|
||||
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
|
||||
''
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
busybox
|
||||
, pkgsBuildBuild
|
||||
, runCommand
|
||||
, cpio
|
||||
, writeReferencesToFile
|
||||
, writeScript
|
||||
} :
|
||||
busybox,
|
||||
pkgsBuildBuild,
|
||||
runCommand,
|
||||
cpio,
|
||||
writeReferencesToFile,
|
||||
writeScript,
|
||||
}:
|
||||
let
|
||||
inherit (pkgsBuildBuild) gen_init_cpio;
|
||||
script = writeScript "init" ''
|
||||
script = writeScript "init" ''
|
||||
#!/bin/sh
|
||||
exec >/dev/console
|
||||
echo Running in initramfs
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
{ stdenv
|
||||
, git
|
||||
, python2
|
||||
, which
|
||||
, fetchgit
|
||||
, fetchFromGitHub
|
||||
, coccinelle
|
||||
{
|
||||
stdenv,
|
||||
git,
|
||||
python2,
|
||||
which,
|
||||
fetchgit,
|
||||
fetchFromGitHub,
|
||||
coccinelle,
|
||||
}:
|
||||
let
|
||||
donorTree = fetchFromGitHub {
|
||||
owner = "torvalds";
|
||||
repo = "linux";
|
||||
rev = "e2c1a934fd8e4288e7a32f4088ceaccf469eb74c"; # 5.15.94
|
||||
hash= "sha256-Jg3EgL86CseuzYMAlUG3CDWPCo8glMSIZs10l7EuhWI=";
|
||||
rev = "e2c1a934fd8e4288e7a32f4088ceaccf469eb74c"; # 5.15.94
|
||||
hash = "sha256-Jg3EgL86CseuzYMAlUG3CDWPCo8glMSIZs10l7EuhWI=";
|
||||
};
|
||||
backports = stdenv.mkDerivation {
|
||||
name = "linux-backports";
|
||||
|
|
|
@ -1,29 +1,38 @@
|
|||
{ 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
|
||||
targetNames = map baseNameOf targets;
|
||||
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
|
||||
]);
|
||||
hardeningDisable = [ "all" ];
|
||||
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;
|
||||
"gcc -I${openssl}/include -I${ncurses}/include";
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
liminix
|
||||
, lib
|
||||
, targets ? []
|
||||
, kernel ? null
|
||||
, runCommand
|
||||
, pkgsBuildBuild
|
||||
, dependencies ? []
|
||||
} :
|
||||
liminix,
|
||||
lib,
|
||||
targets ? [ ],
|
||||
kernel ? null,
|
||||
runCommand,
|
||||
pkgsBuildBuild,
|
||||
dependencies ? [ ],
|
||||
}:
|
||||
let
|
||||
inherit (liminix.services) oneshot;
|
||||
inherit (lib) concatStringsSep;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
writeScriptBin
|
||||
, writeScript
|
||||
, systemconfig
|
||||
, execline
|
||||
, lib
|
||||
, config ? {}
|
||||
, liminix
|
||||
, pseudofile
|
||||
, pkgs
|
||||
} :
|
||||
writeScriptBin,
|
||||
writeScript,
|
||||
systemconfig,
|
||||