nix-community / nix-on-droid

Nix-enabled environment for your Android device. [maintainers=@t184256,@Gerschtli]
https://nix-on-droid.unboiled.info
MIT License
1.33k stars 74 forks source link

"programs" options from nixpkgs don't exist #400

Closed czarkoff closed 3 months ago

czarkoff commented 3 months ago

When I define "programs.*" options in my nix-on-droid.nix, nix-on-droid build fails.

Eg. I have the following in my config:

programs.ssh.startAgent = true;
  programs.neovim = {
    enabled = true;
    defaultEditor = true;
    withPython3 = true;
    vimAlias = true;
    viAlias = true;
  };
}

Terminal output:

-bash-5.2$ nix-on-droid switch
Building activation package...
error:
       … while evaluating a branch condition

         at /data/data/com.termux.nix/files/home/.nix-defexpr/channels/nix-on-droid/modules/default.nix:33:5:

           32|   module =
           33|     if failedAssertions != [ ]
             |     ^
           34|     then throw "\nFailed assertions:\n${concatMapStringsSep "\n" (x: "- ${x}") failedAssertions}"

       … while calling the 'map' builtin

         at /data/data/com.termux.nix/files/home/.nix-defexpr/channels/nix-on-droid/modules/default.nix:30:22:

           29|
           30|   failedAssertions = map (x: x.message) (filter (x: !x.assertion) rawModule.config.assertions);
             |                      ^
           31|

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: The option `programs' does not exist. Definition values:
       - In `/data/data/com.termux.nix/files/home/.config/nixpkgs/nix-on-droid.nix':
           {
             neovim = {
               defaultEditor = true;
               enabled = true;
               viAlias = true;
           ...

Nix-on-droid version 0.118.0_v0.3.6_nix, juat installed from F-Droid. The output above is from channels-based configuration, but flakes configuration yields the same result. The quoted block was added to the bottom of the default "nix-on-droid.nix" in both cases.

t184256 commented 3 months ago

What you're trying to use are NixOS options. nix-on-droid isn't NixOS.

Here's the list of available nix-on-droid options: https://nix-community.github.io/nix-on-droid/nix-on-droid-options.html

Here's the list of available home-manager options: https://nix-community.github.io/home-manager/options.xhtml

For neovim, I recommend nixvim module for home-manager or something similar.

Hope that helps.