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

Redundant nixpkgs instances #150

Closed
musjj opened this issue Sep 10, 2023 · 3 comments · Fixed by #157
Closed

Redundant nixpkgs instances #150

musjj opened this issue Sep 10, 2023 · 3 comments · Fixed by #157

Comments

@musjj
Copy link

musjj commented Sep 10, 2023

This flake instantiates redundant nixpkgs instances, even with follows:

• Added input 'neovim-nightly/hercules-ci-effects/flake-parts/nixpkgs-lib':
    'github:NixOS/nixpkgs/4bc72cae107788bf3f24f30db2e2f685c9298dc9?dir=lib' (2023-06-29)
• Added input 'neovim-nightly/hercules-ci-effects/hercules-ci-agent/nixpkgs':
    'github:NixOS/nixpkgs/0fbe93c5a7cac99f90b60bdf5f149383daaa615f' (2023-07-02)

Can we add follows to this flake to prevent this? I tried looking over the flake.nix, but I'm not sure where the flake-parts input is coming from.

@musjj
Copy link
Author

musjj commented Sep 10, 2023

This seems to work for me:

diff --git a/flake.nix b/flake.nix
index 40073a1..356a50d 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,8 +1,12 @@
 {
   description = "Hercules CI Effects";
 
-  inputs.nixpkgs.url = "github:NixOS/nixpkgs";
-  inputs.hercules-ci-agent.url = "hercules-ci-agent";
+  inputs = {
+    nixpkgs.url = "github:NixOS/nixpkgs";
+    hercules-ci-agent.url = "hercules-ci-agent";
+    hercules-ci-agent.inputs.nixpkgs.follows = "nixpkgs";
+    flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
+  };
 
   outputs = inputs@{ self, nixpkgs, hercules-ci-agent, flake-parts, ... }:
     flake-parts.lib.mkFlake { inherit inputs; }

I haven't tested anything beyond nix flake lock though. Any thoughts?

@roberth
Copy link
Member

roberth commented Oct 24, 2023

This will be a non-issue after

@roberth
Copy link
Member

roberth commented Oct 24, 2023

Have followed about as much as possible. You could add a follows for the remaining nixpkgs input, although that's not quite as robust as not doing it. Should be fine most of the time.

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

Successfully merging a pull request may close this issue.

2 participants