commit a7b5f8067486f3a51372c6431f64a3bc6f2cc653
parent 5c78338d71240e20fe1532964198a25214e42f4e
Author: Daniel Barlow <dan@telent.net>
Date: Mon, 23 Dec 2024 00:09:31 +0000
rename extlinux output to bootfiles
this is in preparation for introducing other non-extlinux
modules that populate /boot
Diffstat:
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/modules/outputs.nix b/modules/outputs.nix
@@ -64,6 +64,12 @@ in
directory of files to package into root filesystem
'';
};
+ bootfiles = mkOption {
+ type = types.nullOr types.package;
+ internal = true;
+ default = null;
+ # description = "";
+ };
bootablerootdir = mkOption {
type = types.package;
internal = true;
@@ -107,8 +113,8 @@ in
let inherit (pkgs.pkgsBuildBuild) runCommand;
in runCommand "add-slash-boot" { } ''
cp -a ${o.rootdir} $out
- ${if config.boot.loader.extlinux.enable
- then "(cd $out && chmod -R +w . && rmdir boot && cp -a ${o.extlinux} boot)"
+ ${if o.bootfiles != null
+ then "(cd $out && chmod -R +w . && rmdir boot && cp -a ${o.bootfiles} boot)"
else ""
}
'';
diff --git a/modules/outputs/extlinux.nix b/modules/outputs/extlinux.nix
@@ -12,14 +12,10 @@ let
cmdline = concatStringsSep " " config.boot.commandLine;
wantsDtb = config.hardware.dts ? src && config.hardware.dts.src != null;
in {
- options.system.outputs.extlinux = mkOption {
- type = types.package;
- # description = "";
- };
options.boot.loader.extlinux.enable = mkEnableOption "extlinux";
config = mkIf cfg.enable {
- system.outputs.extlinux = pkgs.runCommand "extlinux" {} ''
+ system.outputs.bootfiles = pkgs.runCommand "extlinux" {} ''
mkdir $out
cd $out
${if wantsDtb then "cp ${o.dtb} dtb" else "true"}
@@ -37,7 +33,7 @@ in {
_EOF
'';
filesystem = dir {
- boot = symlink config.system.outputs.extlinux;
+ boot = symlink config.system.outputs.bootfiles;
};
};
}