Skip to content

Add note for nixtamal in home-manager / other configs in README.md - #237

Merged
4evy merged 2 commits into
4evy:mainfrom
Username404-59:readme_other_config_note
Aug 1, 2026
Merged

Add note for nixtamal in home-manager / other configs in README.md#237
4evy merged 2 commits into
4evy:mainfrom
Username404-59:readme_other_config_note

Conversation

@Username404-59

@Username404-59 Username404-59 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

In my case I couldn't use pkgs (because of some infinite recursion error) so here's an update to the readme for people who have these kinds of niche configs
(also made the reuse text bold)

@Username404-59

Username404-59 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

By the way somewhere in the README.md there's

pkgs = import sources.nixpkgs {
  config.allowUnfree = true;
};
nixcord = import sources.nixcord { inherit pkgs; };

but I noticed in the default.nix pkgs is this by default

pkgs ? import nixpkgs {
  inherit system;
  config.allowUnfree = true;
}

So why not write this instead in the README:

nixcord = import sources.nixcord { };

?

@4evy

4evy commented Aug 1, 2026

Copy link
Copy Markdown
Owner

In my case I couldn't use pkgs (because of some infinite recursion error).

I checked this against your discord-config.nix and reproduced it using your pinned Home Manager and Nixcord revisions.

Home Manager provides pkgs through _module.args.pkgs. That value cannot be resolved while module imports are being collected, so using it to import Nixcord causes the recursion

Your nixtamal value comes from home-manager.extraSpecialArgs. Home Manager places those values in the module's specialArgs, which are available during import resolution

That is why this works:

nixcord = import nixtamal.nixcord {
  nixpkgs = nixtamal.nixpkgs;
};

So why not write this instead in the README?

nixcord = import sources.nixcord { };

That works too. When neither pkgs nor nixpkgs is provided, default.nix uses Nixcord's bundled npins Nixpkgs source to construct its package outputs.

Passing an existing pkgs is preferred when it is available outside the module graph because it reuses the exact package set, including its Nixpkgs configuration and overlays.

Passing nixpkgs creates a fresh package set and does not preserve those overlays or settings, but it still uses the configuration's chosen Nixpkgs source. An empty import instead uses Nixcord's bundled Nixpkgs revision, which may be different.

@4evy
4evy force-pushed the readme_other_config_note branch 2 times, most recently from 8d1590e to dfbbe16 Compare August 1, 2026 09:52
@4evy
4evy force-pushed the readme_other_config_note branch from dfbbe16 to a605bf6 Compare August 1, 2026 09:52
@4evy
4evy merged commit a605bf6 into 4evy:main Aug 1, 2026
@Username404-59

Copy link
Copy Markdown
Contributor Author

In my case I couldn't use pkgs (because of some infinite recursion error).

I checked this against your discord-config.nix and reproduced it using your pinned Home Manager and Nixcord revisions.

Home Manager places those values in the module's specialArgs, which are available during import resolution

Ohhh okay understood, so it was indeed home-manager's fault

Have a great day 👍

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 this pull request may close these issues.

2 participants