nix-community / nix-on-droid

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

[WIP] nix.nix: split, align and reuse macros from NixOS #329

Open ShamrockLee opened 4 months ago

ShamrockLee commented 4 months ago

This PR demonstrates the possibility to reuse/inherit NixOS macros.

The original Nix-related options and config in the NixOS modules are mostly inside nixos/modules/services/system/nix-daemon.nix, making it hard to reuse without also getting those privilege-required part of implementation. The good news is that the configuration-related part has been split out and become nixos/modules/config/nix.nix, nixos/modules/config/nix-flakes.nix, nixos/modules/config/nix-channel.nix and nixos/modules/config/nix-remote-build.nix, making it much easier to reuse.

This PR first align the behavior of nix.nix with the NixOS upstream, and then split out nix-flakes.nix and nix-channel.nix. Finally, it imports the upstream nix.nix and nix-flakes.nix to replace the local interface and implementation.

ShamrockLee commented 4 months ago

fakedroid now builds and runs.

The check failure might indicate the need to update the test interface (to supply with the nixpkgs argument, etc.).

@t184256 Could you give me some hint where the test cases resides and which file is likely to be responsible for injecting the arguments?