From 18216b8874b2d78037bd5c6ee3453701c8971a1d Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 23 Sep 2024 01:58:59 -0400 Subject: [PATCH] fix(droid): make new overlay changes work --- lib/flake-lib.nix | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/flake-lib.nix b/lib/flake-lib.nix index b9705948..e602f4a6 100644 --- a/lib/flake-lib.nix +++ b/lib/flake-lib.nix @@ -14,7 +14,7 @@ inputs: rec { }; allowModularOverrides = { - cudaSupport, + cudaSupport ? false, system, }: ({config, ...}: let pkgs = mkPkgs { @@ -43,26 +43,31 @@ inputs: rec { ++ extraModules; }; - mkNixOnDroid = mods: + mkNixOnDroid = mods: let + system = "aarch64-linux"; + in inputs.nix-on-droid.lib.nixOnDroidConfiguration rec { extraSpecialArgs = inputs; home-manager-path = inputs.home-manager.outPath; - inherit (extraSpecialArgs) pkgs; + pkgs = mkPkgs { + inherit system; + inherit (inputs) nixpkgs; + }; modules = [ - (allowModularOverrides {system = "aarch64-linux";}) + (allowModularOverrides {inherit system;}) ({ config, lib, ... }: let - inherit (lib) mkOption types; + inherit (lib) mkForce mkOption types; in { # Adapt NixOnDroid to NixOS options - options.environment.variables = { - FLAKE = mkOption { + options.environment = { + variables.FLAKE = mkOption { type = with types; nullOr str; }; systemPackages = mkOption { @@ -72,6 +77,8 @@ inputs: rec { }; config.environment.packages = config.environment.systemPackages; + # This disables the assertion that fails because of nixpkgs.overlays + config._module.args.isFlake = mkForce false; }) {home-manager = {inherit extraSpecialArgs;};}