Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repoOverrides when using flake #254

Open
moritzschaefer opened this issue Aug 2, 2020 · 8 comments
Open

repoOverrides when using flake #254

moritzschaefer opened this issue Aug 2, 2020 · 8 comments

Comments

@moritzschaefer
Copy link

moritzschaefer commented Aug 2, 2020

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
Copy link
Member

Mic92 commented Aug 3, 2020

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
Copy link
Contributor

augu5te commented Apr 3, 2021

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; }; };
        };
      })
    ];
   } 
 ...

@Mic92
Copy link
Member

Mic92 commented Apr 4, 2021

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

@milahu
Copy link
Contributor

milahu commented Feb 24, 2023

{
  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 NixOS/nix#6530

@milahu
Copy link
Contributor

milahu commented Feb 24, 2023

-  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
Copy link
Contributor

aacebedo commented Jul 22, 2024

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
Copy link
Contributor

augu5te commented Jul 22, 2024

@aacebedo
Copy link
Contributor

aacebedo commented Jul 22, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants