-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use with home manager #15
Comments
Can you try it with this change? { config, pkgs, ... }:
let
android-sdk =
let
android-nixpkgs = fetchTarball "https://github.com/tadfisher/android-nixpkgs/archive/main.tar.gz";
in
import (android-nixpkgs + "/hm-module.nix");
in
{
imports = [ android-sdk ];
# ...
} |
I guess this got me one step further but: I have: { config, pkgs, ... }:
let
android-sdk =
let
android-nixpkgs = fetchTarball "https://github.com/tadfisher/android-nixpkgs/archive/main.tar.gz";
in
import (android-nixpkgs + "/hm-module.nix");
in
{
imports = [ android-sdk ];
android-sdk.enable = true;
# Optional; default path is "~/.local/share/android".
android-sdk.path = "${config.home.homeDirectory}/.android/sdk";
android-sdk.packages = sdk: with sdk; [
build-tools-30-0-2
cmdline-tools-latest
emulator
platforms-android-30
sources-android-30
];
programs.home-manager.enable = true;
... but I get error when building: ➜ ~ home-manager switch
error: attribute 'androidSdk' missing
at /nix/store/dvslxnzg6j93qad6y2s8b5m5k1zjaanz-source/hm-module.nix:48:32:
47| config = mkIf (cfg.enable) {
48| android-sdk.finalPackage = pkgs.androidSdk cfg.packages;
| ^
49|
(use '--show-trace' to show detailed location information) |
Ah, you need the overlay installed, which isn't exposed outside of the flake. I'll try and make this possible, or avoid requiring an overlay. |
Hey, I just ran into the same error. I'm not using the nixpkgs Anrdoid setup since it doesn't include |
machine.nix { config, lib, pkgs, inputs, ... }:
{
# android-nixpkgs overlay
nixpkgs.overlays = [
inputs.android-nixpkgs.overlay
];
} |
I was able to access the overlay and add it to my nixpkg config with the following: outputs = { self, darwin, nixpkgs, ... }@inputs:
let
inherit (darwin.lib) darwinSystem;
inherit (nixpkgs.lib) attrValues makeOverridable optionalAttrs singleton;
nixpkgsConfig = {
config = {
allowUnfree = true;
};
overlays = attrValues self.overlays
++ singleton inputs.android-nixpkgs.overlay
} Once I added the overlay, I was able to configure android-sdk via home-manager and flakes. |
Edit: Turns out the overlay isn't needed if you use |
Would you have some example please? I'm new to nix and these notions start to be blurry to me |
yeah, very unclear to me too |
I am trying to follow example https://github.com/tadfisher/android-nixpkgs#home-manager and include this into my
home.nix
but I get the following error:Anyone willing to help me?
The text was updated successfully, but these errors were encountered: