NUR icon indicating copy to clipboard operation
NUR copied to clipboard

repoOverrides when using flake

Open moritzschaefer opened this issue 5 years ago • 8 comments

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?

moritzschaefer avatar Aug 02 '20 15:08 moritzschaefer

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

Mic92 avatar Aug 03 '20 09:08 Mic92

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

  • with packageOverrides
  inputs.nur.url = "github:nix-community/NUR";
  inputs.kapack.url = "path:/home/auguste/dev/nur-kapack"; # my local nur.repos.kapack

  outputs = {self, nixpkgs, nur, kapack }: {
 
  nurpkgs = import nixpkgs { inherit system; };

  system = "x86_64-linux";
 ...
  modules = [
       {
         nixpkgs.config.packageOverrides = pkgs: {
            nur = import nur {
              inherit pkgs nurpkgs;
              repoOverrides = { kapack = import kapack { inherit pkgs; }; };
            };
          };
        }
  ];
...
  • with overlay
 ...
 modules = [
 {
    nixpkgs.overlays = [
      (final: prev: {
        nur = import nur {
          nurpkgs = prev;
          pkgs = prev;
          repoOverrides = { kapack = import kapack { pkgs = prev; }; };
        };
      })
    ];
   } 
 ...

augu5te avatar Apr 03 '21 13:04 augu5te

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

Mic92 avatar Apr 04 '21 07:04 Mic92

{
  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 avatar Feb 24 '23 14:02 milahu

-  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

milahu avatar Feb 24 '23 14:02 milahu