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

gphoto2: Add option for group name #296832

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

l0b0
Copy link
Contributor

@l0b0 l0b0 commented Mar 18, 2024

Description of changes

Enables referencing it in configuration dynamically, rather than with a magic string.

Closes #294871.

To do:

  • Implement test with default group name
  • Test with non-default group name

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/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (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 Mar 18, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Mar 18, 2024
@l0b0 l0b0 force-pushed the gphoto2-group-name-config branch from eafb193 to e1942fe Compare March 19, 2024 05:36
@l0b0 l0b0 force-pushed the gphoto2-group-name-config branch from e1942fe to 9f87ab8 Compare March 20, 2024 00:05
@l0b0 l0b0 requested a review from bjornfor March 20, 2024 02:42

let
inherit (nixos {}) config;
group = config.programs.gphoto2.group;
Copy link
Contributor

Choose a reason for hiding this comment

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

Won't this reference the default value and not the one from the users' nixos config? Maybe it's better to make the option read-only (I think that's possible), so that at least the magic string goes away?

@l0b0 l0b0 force-pushed the gphoto2-group-name-config branch from 9f87ab8 to 702e47d Compare April 27, 2024 07:44
@l0b0 l0b0 requested a review from bjornfor April 27, 2024 07:44
@l0b0 l0b0 marked this pull request as ready for review April 27, 2024 07:45
@l0b0 l0b0 force-pushed the gphoto2-group-name-config branch 2 times, most recently from 3e7f813 to 9cb19fb Compare April 27, 2024 08:24
Comment on lines 19 to 20
inherit (nixos {}) options;
group = options.programs.gphoto2.group.value;
Copy link
Member

Choose a reason for hiding this comment

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

I am pretty sure that this won't work on none nixos systems. We should probably just make this a string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How's the current solution?

nixos/modules/programs/gphoto2.nix Outdated Show resolved Hide resolved
nixos/tests/gphoto2/custom-group-name.nix Outdated Show resolved Hide resolved
nixos/tests/gphoto2/defaults.nix Outdated Show resolved Hide resolved
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label May 22, 2024
@l0b0 l0b0 force-pushed the gphoto2-group-name-config branch from 9cb19fb to f833ab8 Compare June 20, 2024 02:59
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 20, 2024
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 9, 2024
Enables referencing it in configuration dynamically, rather than with a
magic string.

Closes NixOS#294871.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 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: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make gphoto2 group name configurable
4 participants