liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit a135cb121782b5e7fc7e857e100353d17e24b3e6
parent 863045b86bc0052932d1a323b4455fed9fa25044
Author: Daniel Barlow <dan@telent.net>
Date:   Sun,  5 Nov 2023 15:13:06 +0000

introduce lim, the liminix library

so far we have lim.parseInt, which parses an integer from a string
with optional base-selecting-prefix (e.g. 0755, 0x12ab)

Diffstat:
Mdefault.nix | 2+-
Mmodules/arch/mips.nix | 4++--
Moverlay.nix | 5+++++
3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/default.nix b/default.nix @@ -19,7 +19,7 @@ let config = (pkgs.lib.evalModules { modules = [ - { _module.args = { inherit pkgs; lib = pkgs.lib; }; } + { _module.args = { inherit pkgs; inherit (pkgs) lim; }; } ./modules/hardware.nix ./modules/base.nix ./modules/busybox.nix diff --git a/modules/arch/mips.nix b/modules/arch/mips.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, config, ...}: +{ lib, pkgs, config, lim, ...}: { config = { kernel.config = { @@ -10,7 +10,7 @@ OF = "y"; USE_OF = "y"; }; - hardware.ram.startAddress = 0; + hardware.ram.startAddress = lim.parseInt "0x0"; boot.commandLine = [ "console=ttyS0,115200" # true of all mips we've yet encountered ]; diff --git a/overlay.nix b/overlay.nix @@ -191,4 +191,9 @@ extraPkgs // { }); pppBuild = prev.ppp; + + # liminix library functions + lim = { + parseInt = s : (builtins.fromTOML "r=${s}").r; + }; }