Open moritzschaefer opened 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
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; }; };
};
};
}
];
...
...
modules = [
{
nixpkgs.overlays = [
(final: prev: {
nur = import nur {
nurpkgs = prev;
pkgs = prev;
repoOverrides = { kapack = import kapack { pkgs = prev; }; };
};
})
];
}
...
We could also have these snippets in the README. They look useful.
{ 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
- 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
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
Yes I works have a look to: https://github.com/oar-team/regale-nixos-compose/blob/main/bebida/flake.nix
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.
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?