Skip to content

Conversation

Moraxyc
Copy link
Member

@Moraxyc Moraxyc commented Jun 8, 2025

  • Migrated command-not-found to pkgs/by-name
  • Introduced the programs.command-not-found.package option
    to allow users to override the default package

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Jun 8, 2025
@Moraxyc Moraxyc force-pushed the migrate-command-not-found branch from f7a9242 to fec4fb0 Compare June 8, 2025 17:10
@github-actions github-actions bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jun 8, 2025
@Moraxyc Moraxyc marked this pull request as draft June 8, 2025 17:35
@Moraxyc Moraxyc marked this pull request as ready for review June 8, 2025 18:20
@Moraxyc Moraxyc force-pushed the migrate-command-not-found branch from fec4fb0 to d4c9d70 Compare June 9, 2025 13:51
@Moraxyc
Copy link
Member Author

Moraxyc commented Jun 9, 2025

UPDATE: Added a comment in programs.command-not-found.enable to inform Flake users that they should use programs.nix-index.enable instead.

@Moraxyc Moraxyc force-pushed the migrate-command-not-found branch from d4c9d70 to 7e9991f Compare June 9, 2025 15:02
perl,
dbPath ? null,
}:
replaceVarsWith rec {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we could get rid of rec and use let/in here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

By the way, the manual generation failed. nix-build ci -A manual-nixos --argstr system x86_64-linux

       >        error: attribute 'command-not-found' missing
       >        at /nix/store/rk8wb846907wjncg6fc2ns0rx2gwnzc7-nixos/modules/programs/command-not-found/command-not-found.nix:35:17:
       >            34|     dbPath = lib.mkOption {
       >            35|       default = pkgs.command-not-found.passthru.dbPath;
       >              |                 ^
       >            36|       description = ''
       > Cacheable portion of option doc build failed.
       > Usually this means that an option attribute that ends up in documentation (eg `default` or `description`) depends on the restricted module arguments `config` or `pkgs`.
       >
       > Rebuild your configuration with `--show-trace` to find the offending location. Remove the references to restricted arguments (eg by escaping their antiquotations or adding a `defaultText`) or disable the sandboxed build for the failing module by setting `meta.buildDocsInSandbox = false`.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps my idea to use passthru.dbPath was not the best, better ask on Matrix about it?

@Moraxyc Moraxyc force-pushed the migrate-command-not-found branch from 7e9991f to dbf73f0 Compare June 9, 2025 15:52
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 18, 2025
- Migrated command-not-found to pkgs/by-name
- Introduced the `programs.command-not-found.package` option
  to allow users to override the default package
@wegank wegank force-pushed the migrate-command-not-found branch from dbf73f0 to c5111a0 Compare August 15, 2025 01:27
@nixpkgs-ci nixpkgs-ci bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants