nix-community/NUR

Exceptions for external URLs

ilya-fedin opened this issue · 9 comments

Is it possible to have exception for the following URLs?

The thing is my NUR repo is a flake and I use Chrome OS fonts which were removed from latest nixpkgs yet I want to have them. I have the following code:

  ttf-croscore = (import (import ./flake-compat.nix).inputs.nixpkgs-croscore {
    system = stdenv.system;
  }).noto-fonts.overrideAttrs(oldAttrs: {
    pname = "ttf-croscore";

    installPhase = ''
      install -m444 -Dt $out/share/fonts/truetype/croscore hinted/*/{Arimo,Cousine,Tinos}/*.ttf
    '';

    meta = oldAttrs.meta // {
      description = "Chrome OS core fonts";
      longDescription = "This package includes the Arimo, Cousine, and Tinos fonts.";
    };
  });

flake-compat.nix:

(import
  (
    let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
    fetchTarball {
      url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
      sha256 = lock.nodes.flake-compat.locked.narHash;
    }
  )
  { src = ./.; }
).defaultNix

nixpkgs-croscore is nixpkgs pinned before removation of croscore fonts. The code couldn't use nixpkgs fetchers as they don't let to import the result which is needed for both flake-compat and nixpkgs.

Mic92 commented

I think flake-compat is fine. nixpkgs might be a problem though. It's a really big repository and the evaluation infrastructure will run into scaling issues when suddenly everyone pins there own nixpkgs version.

Can I somehow exclude it only from evaluation in your CI?

Mic92 commented

You can have a separate entry point for NUR:

NUR/repos.json

Line 50 in 6f1156d

"file": "pkgs/default.nix",

this would change it not only for CI but also for users?

The idea is to avoid evaluation only on the CI so it doesn't overload yet have it accessible via NUR

Mic92 commented

this would change it not only for CI but also for users?

Yes.

It feels to me the current NUR architecture and restrictions really lag behind the mainstream flake world. I have nixpkgs in the flake and I have binary cache using that commit of nixpkgs. Yet NUR forces to use the global nixpkgs which is most likely of different commit and binary cache doesn't do its thing.

Mic92 commented

Question is if you want pinning and custom binary caches, why not using flakes instead which has better support for this.
Without pinning you have the advantage that your evaluation memory requirements does not explode if you add packages from many different upstream repos and also your final result will share more dependencies.
NUR predates flakes and I am not really sure where to take this project now they exist.
As of now I am mainly maintaining the status quo but not really adding any new features.

why not using flakes instead

I use but NUR goes in the way by restrict-eval and by not being able to import flakes