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,17 +10,27 @@ with lib;
options = { options = {
build.channel = { build = {
nixpkgs = mkOption { channel = {
type = types.str; nixpkgs = mkOption {
default = "https://nixos.org/channels/nixos-22.05"; type = types.str;
description = "Channel URL for nixpkgs."; default = "https://nixos.org/channels/nixos-22.05";
description = "Channel URL for nixpkgs.";
};
nix-on-droid = mkOption {
type = types.str;
default = "https://github.com/t184256/nix-on-droid/archive/release-22.05.tar.gz";
description = "Channel URL for nix-on-droid.";
};
}; };
nix-on-droid = mkOption { flake = {
type = types.str; nix-on-droid = mkOption {
default = "https://github.com/t184256/nix-on-droid/archive/release-22.05.tar.gz"; type = types.str;
description = "Channel URL for nix-on-droid."; default = "github:t184256/nix-on-droid/release-22.05";
description = "Flake URL for nix-on-droid.";
};
}; };
}; };

View file

@ -5,6 +5,7 @@
, arch ? "aarch64" , arch ? "aarch64"
, nixOnDroidChannelURL ? null , nixOnDroidChannelURL ? null
, nixpkgsChannelURL ? null , nixpkgsChannelURL ? null
, nixOnDroidFlakeURL ? null
}: }:
let let
@ -28,13 +29,15 @@ let
# Fix invoking bash after initial build. # Fix invoking bash after initial build.
user.shell = "${initialPackageInfo.bash}/bin/bash"; user.shell = "${initialPackageInfo.bash}/bin/bash";
build = { build = with pkgs.lib; {
inherit arch; inherit arch;
channel = with pkgs.lib; { channel = {
nixpkgs = mkIf (nixpkgsChannelURL != null) nixpkgsChannelURL; nixpkgs = mkIf (nixpkgsChannelURL != null) nixpkgsChannelURL;
nix-on-droid = mkIf (nixOnDroidChannelURL != null) nixOnDroidChannelURL; 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 { bootstrap = import ../pkgs {
inherit nixpkgs system; inherit nixpkgs system;
nixOnDroidChannelURL = "file:///n-o-d/archive.tar.gz"; nixOnDroidChannelURL = "file:///n-o-d/archive.tar.gz";
nixOnDroidFlakeURL = "/n-o-d/unpacked";
}; };
in in