-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
flake: switch to cached nixpkgs channel #1714
base: master
Are you sure you want to change the base?
Conversation
@@ -36,7 +36,7 @@ | |||
nixpkgs-update.inputs.mmdoc.follows = "empty"; | |||
nixpkgs-update.inputs.treefmt-nix.follows = "treefmt-nix"; | |||
nixpkgs-update.url = "github:nix-community/nixpkgs-update/infra"; | |||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small"; | |||
nixpkgs.url = "https://nixos.org/channels/nixos-unstable-small/nixexprs.tar.xz"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually shallow clone are faster if you regularly switch between nixpkgs versions:
--- flake.nix
+++ flake.nix
@@ -2,7 +2,7 @@
description = "A universal nixos installer, just needs ssh access to the target system";
inputs = {
- nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
+ nixpkgs.url = "git+https://github.com/NixOS/nixpkgs?shallow=1&ref=nixos-unstable-small";
flake-parts = { url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs"; };
# used for testing
That cache should work both locally and in buildbot. For fresh clones it's almost as fast as downloading the github archive (tested in github actions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC github has asked projects (homebrew and others) to stop using shallow clones because they are expensive to run on the servers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's only a shallow clone on the first run because than the cache takes over and it's just a handful commit that is fetched (which should be way cheaper than the github archive, especially if the internet isn't great). For this repository no one is using this flake in CIs where we would run into this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That isn't what I was referring to, just using it in this repo isn't the issue, other people copying the pattern is.
Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/b89a821293c3872992137114d0db9a791243a41b?narHash=sha256-D2waFyJkaepTchTrGVAIfCd/YP%2B37bgXWg9cXwuxuT0%3D' (2025-02-26) → 'https://releases.nixos.org/nixos/unstable-small/nixos-25.05beta760628.624ad1673840/nixexprs.tar.xz?narHash=sha256-rKGoPQ7y4rEU7i03lq7sQDHibJ2z97DhwCcvpfR/5L0%3D' (2025-02-28)
|
No description provided.