nix-community / NUR

Nix User Repository: User contributed nix packages [maintainer=@Mic92]
https://nur.nix-community.org/
MIT License
1.28k stars 339 forks source link

repoOverrides when using flake #254

Open moritzschaefer opened 4 years ago

moritzschaefer commented 4 years ago

I am using flake for my nixos configuration and was able to add NUR as described in the README.

However, as I am starting my own NUR at the moment, and want to test packages locally first, I would like to use the repoOverrides attribute to add my local NUR repository.

Unfortunately, I don't see a way to pass the repoOverrides attribute to NUR's default.nix when using flakes.

Is it possible to support this feature?

Mic92 commented 4 years ago

Not yet. This would be nice to have. I would say flake support is not set in stone yet. There might be better ways how this could be integrated into NUR. After all we could just have an open registry like https://github.com/NixOS/flake-registry

augu5te commented 3 years ago

By transposing the initial "Overriding repositories" below the ways I obtained with packageOverrides or overlay :

Mic92 commented 3 years ago

We could also have these snippets in the README. They look useful.

milahu commented 1 year ago
{
  inputs.kapack.url = "path:/home/auguste/dev/nur-kapack";

this breaks when the last component of the path is a symlink

{
  # last component is symlink
  # $ readlink /home/user/src/symlink-to-nur-packages
  # nur-packages
  # $ sudo nixos-rebuild switch
  # error: getting status of '/nix/store/nur-packages': No such file or directory
  inputs.nur-packages-local.url = "path:/home/user/src/symlink-to-nur-packages";

  # ok
  #inputs.nur-packages-local.url = "path:/home/user/src/nur-packages";

may be fixed by https://github.com/NixOS/nix/pull/6530

milahu commented 1 year ago
-  inputs.nur-packages-local.url = "path:/home/user/src/nur-packages"
+  inputs.nur-packages-local.url = "git+file:///home/user/src/nur-packages"

is better, because it will copy only files tracked by git

aacebedo commented 1 month ago

Is this solution still working? I I tried to apply it and facing an error. Posted tgi question with details in the discourse https://discourse.nixos.org/t/cannot-use-nur-modules-in-nixos-flake/49402 and in the NUR element channel.

I am also searching in repos of NUR contributors to find out how they use it but without success for the moment

augu5te commented 1 month ago

Yes I works have a look to: https://github.com/oar-team/regale-nixos-compose/blob/main/bebida/flake.nix

aacebedo commented 1 month ago

Yes I works have a look to: https://github.com/oar-team/regale-nixos-compose/blob/main/bebida/flake.nix

Thanks for the answer. However the integration in the link is not done the same way as in the Readme, I don't see the overlays and the imports of the module.