bootstrap: inject nixOnDroidFlakeURL

This commit is contained in:
Tobias Happ 2022-10-03 15:17:03 +02:00
parent c4365ef010
commit 5900404627
3 changed files with 25 additions and 11 deletions

View file

@ -10,7 +10,8 @@ with lib;
options = {
build.channel = {
build = {
channel = {
nixpkgs = mkOption {
type = types.str;
default = "https://nixos.org/channels/nixos-22.05";
@ -24,6 +25,15 @@ with lib;
};
};
flake = {
nix-on-droid = mkOption {
type = types.str;
default = "github:t184256/nix-on-droid/release-22.05";
description = "Flake URL for nix-on-droid.";
};
};
};
};

View file

@ -5,6 +5,7 @@
, arch ? "aarch64"
, nixOnDroidChannelURL ? null
, nixpkgsChannelURL ? null
, nixOnDroidFlakeURL ? null
}:
let
@ -28,13 +29,15 @@ let
# Fix invoking bash after initial build.
user.shell = "${initialPackageInfo.bash}/bin/bash";
build = {
build = with pkgs.lib; {
inherit arch;
channel = with pkgs.lib; {
channel = {
nixpkgs = mkIf (nixpkgsChannelURL != null) nixpkgsChannelURL;
nix-on-droid = mkIf (nixOnDroidChannelURL != null) nixOnDroidChannelURL;
};
flake.nix-on-droid = mkIf (nixOnDroidFlakeURL != null) nixOnDroidFlakeURL;
};
};
};

View file

@ -6,6 +6,7 @@ let
bootstrap = import ../pkgs {
inherit nixpkgs system;
nixOnDroidChannelURL = "file:///n-o-d/archive.tar.gz";
nixOnDroidFlakeURL = "/n-o-d/unpacked";
};
in