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

Exceptions for external URLs #571

Open
ilya-fedin opened this issue Jun 16, 2023 · 9 comments
Open

Exceptions for external URLs #571

ilya-fedin opened this issue Jun 16, 2023 · 9 comments

Comments

@ilya-fedin
Copy link
Contributor

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

Mic92 commented Jun 16, 2023

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.

@ilya-fedin
Copy link
Contributor Author

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

@Mic92
Copy link
Member

Mic92 commented Jun 16, 2023

You can have a separate entry point for NUR:

NUR/repos.json

Line 50 in 6f1156d

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

@ilya-fedin
Copy link
Contributor Author

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

@ilya-fedin
Copy link
Contributor Author

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

@Mic92
Copy link
Member

Mic92 commented Jun 18, 2023

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

Yes.

@ilya-fedin
Copy link
Contributor Author

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

Mic92 commented Jul 11, 2023

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.

@ilya-fedin
Copy link
Contributor Author

why not using flakes instead

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

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

2 participants