Skip to content

Commit

Permalink
generic-extlinux-compatible: generate build-time and host-time extlin…
Browse files Browse the repository at this point in the history
…ux builders
  • Loading branch information
illegalprime committed May 3, 2019
1 parent c7a4e04 commit 118faa3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ let

timeoutStr = if blCfg.timeout == null then "-1" else toString blCfg.timeout;

builder = import ./extlinux-conf-builder.nix { pkgs = pkgs.buildPackages; };
makeBuilder = pkgs: pkgs.callPackage ./extlinux-conf-builder.nix { };
builder = makeBuilder pkgs;
nativeBuilder = makeBuilder pkgs.buildPackages;
in
{
options = {
Expand Down Expand Up @@ -38,7 +40,12 @@ in
};

config = mkIf cfg.enable {
system.build.installBootLoader = "${builder} -g ${toString cfg.configurationLimit} -t ${timeoutStr} -c";
system.build = let
makeInstaller = b: "${b} -g ${toString cfg.configurationLimit} -t ${timeoutStr} -c";
in {
installBootLoader = makeInstaller builder;
installBootLoaderNative = makeInstaller nativeBuilder;
};
system.boot.loader.id = "generic-extlinux-compatible";
};
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{ pkgs }:
{ substituteAll, bash, coreutils, gnused, gnugrep }:

pkgs.substituteAll {
substituteAll {
src = ./extlinux-conf-builder.sh;
isExecutable = true;
path = [pkgs.buildPackages.coreutils pkgs.buildPackages.gnused pkgs.buildPackages.gnugrep];
inherit (pkgs.buildPackages) bash;
path = [coreutils gnused gnugrep];
inherit bash;
}

0 comments on commit 118faa3

Please sign in to comment.