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

Add networking options. #277

Closed kurnevsky closed 11 months ago

kurnevsky commented 11 months ago

Tested on my phone with yggdrasil - works fine :)

kurnevsky commented 11 months ago

Hm, actually I might try to replicate more options from https://github.com/NixOS/nixpkgs/blob/nixos-23.05/nixos/modules/config/networking.nix , at least hosts and hostFiles seem useful.

kurnevsky commented 11 months ago

ok, seems to work. I don't really know why nixpkgs defines 127.0.0.2 as localhost, so I didn't do that :)

kurnevsky commented 11 months ago

127.0.0.2 as localhost

It's something from nss-myhostname, but we don't have systemd so we don't really need it.

kurnevsky commented 11 months ago

Ping :)

t184256 commented 11 months ago

Sorry for a slow response.

  1. If you're borrowing from nixpkgs, you need to add attribution. grep for 'under MIT license as well' for examples.
  2. Please bump the copyright year.
  3. I'm not a fan of the overdone nixos interface, but, I guess, we shouldn't deviate.
  4. But if we stick to it, I'd like a testcase exercising all these options + assertion path. You can write one or I can write one, but it might take some time for me to find time for that.
kurnevsky commented 11 months ago

Sorry for a slow response.

No problem. Just wanted to make sure it's not forgotten.

I'm not a fan of the overdone nixos interface, but, I guess, we shouldn't deviate.

I personally use only networking.hosts, so I'm not really sure how other settings are useful. There are advantages of keeping it in sync with nixpkgs, but it's more complicated. I'm fine either way, I guess :)

But if we stick to it, I'd like a testcase exercising all these options + assertion path. You can write one or I can write one, but it might take some time for me to find time for that.

I can try to do that. It's me who wants these settings after all :)

kurnevsky commented 11 months ago

But if we stick to it

So should we? :)

t184256 commented 11 months ago

On July 26, 2023 10:07:23 AM GMT+02:00, Evgeny Kurnevsky @.***> wrote:

But if we stick to it

So should we? :)

Yeah. We shouldn't invent different override mechanisms incompatible with the NixOS interface.

If you are willing to reduce it to just the subset you use and have the subset compatible, that could be a way. But I'll be willing to accept the full one + a bit of tests.

kurnevsky commented 11 months ago

ok, added a test. Wanted to use https://github.com/bats-core/bats-assert#assert_line but couldn't figure out how to add it in shebang - I guess some more complex changes are required for it.

kurnevsky commented 11 months ago

btw, should I add myself to authors now? :)

kurnevsky commented 11 months ago

good. hope grep is available in tests.

It is.

BTW, if you know where to express this idea so that all contributors get it, I'm all ears.

Well, readme with or Contributing.md with some basic steps should be enough :)

Also, consider adding a changelog entry.

Done.

kurnevsky commented 11 months ago

It seems formatting is not correct. How do I format it properly?

Probably nixpkgs-fmt... There are a lot of different nix formatters :)