add config option for kernel commmand line

This commit is contained in:
Daniel Barlow 2022-10-07 00:21:04 +01:00
parent af79e1e9e9
commit 58c287ef6a
2 changed files with 10 additions and 1 deletions

View file

@ -5,6 +5,7 @@ let
overlay = import ./overlay.nix; overlay = import ./overlay.nix;
nixpkgs = import <nixpkgs> ( device.system // {overlays = [overlay]; }); nixpkgs = import <nixpkgs> ( device.system // {overlays = [overlay]; });
inherit (nixpkgs.pkgs) callPackage writeText liminix; inherit (nixpkgs.pkgs) callPackage writeText liminix;
inherit (nixpkgs.lib) concatStringsSep;
config = (import ./merge-modules.nix) [ config = (import ./merge-modules.nix) [
./modules/base.nix ./modules/base.nix
({ lib, ... } : { config = { inherit (device) kernel; }; }) ({ lib, ... } : { config = { inherit (device) kernel; }; })
@ -24,7 +25,7 @@ let
}; };
uimage = kernel.uimage { uimage = kernel.uimage {
commandLine = "earlyprintk=serial,ttyS0 console=ttyS0,115200 panic=10 oops=panic init=/bin/init loglevel=8 rootfstype=squashfs"; commandLine = concatStringsSep " " config.boot.commandLine;
inherit (device.boot) loadAddress entryPoint; inherit (device.boot) loadAddress entryPoint;
inherit (kernel) vmlinux; inherit (kernel) vmlinux;
inherit dtb; inherit dtb;

View file

@ -34,6 +34,9 @@ in {
default = {}; default = {};
}; };
}; };
boot.commandLine = mkOption {
type = types.listOf types.nonEmptyStr;
};
groups = mkOption { groups = mkOption {
type = types.attrsOf types.anything; type = types.attrsOf types.anything;
}; };
@ -50,9 +53,14 @@ in {
IKCONFIG = "y"; IKCONFIG = "y";
IKCONFIG_PROC = "y"; IKCONFIG_PROC = "y";
PROC_FS = "y"; PROC_FS = "y";
# s6-linux-init mounts this on /dev
DEVTMPFS = "y";
}; };
checkedConfig = config; checkedConfig = config;
}; };
boot.commandLine = [
"earlyprintk=serial,ttyS0 console=ttyS0,115200 panic=10 oops=panic init=/bin/init loglevel=8 rootfstype=squashfs"
];
users.root = { users.root = {
uid = 0; gid= 0; gecos = "Root of all evaluation"; uid = 0; gid= 0; gecos = "Root of all evaluation";
dir = "/"; dir = "/";