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

nixos/samba: revert default values #340500

Merged
merged 1 commit into from
Sep 8, 2024

Conversation

anthonyroussel
Copy link
Member

@anthonyroussel anthonyroussel commented Sep 8, 2024

Description of changes

See #302681 (review)

Reorganizing the module options with RFC0042 and breaking the default values at the time, makes the migration too complicated.

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.11 Release Notes (or backporting 23.11 and 24.05 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 Sep 8, 2024
@anthonyroussel anthonyroussel requested a review from bachp September 8, 2024 11:15
@anthonyroussel anthonyroussel force-pushed the fix-samba-default-values branch from fd7b691 to e3e84e1 Compare September 8, 2024 11:23
@anthonyroussel
Copy link
Member Author

anthonyroussel commented Sep 8, 2024

@ofborg test samba

@anthonyroussel anthonyroussel force-pushed the fix-samba-default-values branch from e3e84e1 to 79c1fd3 Compare September 8, 2024 11:24
@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 Sep 8, 2024
@yshui
Copy link
Contributor

yshui commented Sep 8, 2024

looks reasonable, but I can't say I am too familiar with option type definitions.

did you check the generated smb.conf without any user settings? if that works that's good enough for me.

@anthonyroussel
Copy link
Member Author

anthonyroussel commented Sep 8, 2024

Test 1 with default values

services.samba = {
  enable = true;
  settings = {
    "public" = {
      "path" = "/public";
      "read only" = true;
      "browseable" = "yes";
      "guest ok" = "yes";
      "comment" = "Public samba share.";
    };
  };
};

results in /etc/samba/smb.conf

[global]
invalid users=root
passwd program=/run/wrappers/bin/passwd %u
security=user

[public]
browseable=yes
comment=Public samba share.
guest ok=yes
path=/public
read only=true

Test 2 with global setting overrides

services.samba = {
  enable = true;
  settings = {
    "global" = {
      "invalid users" = [ "root" "nixos-user" ];
      "passwd program" = "/dev/null";
      "security" = "ads";
    };
    "public" = {
      "path" = "/public";
      "read only" = true;
      "browseable" = "yes";
      "guest ok" = "yes";
      "comment" = "Public samba share.";
    };
  };
};

results in /etc/samba/smb.conf

[global]
invalid users=root nixos-user
passwd program=/dev/null
security=ads

[public]
browseable=yes
comment=Public samba share.
guest ok=yes
path=/public
read only=true

Default values are now back ✔️

@bachp bachp merged commit 6031597 into NixOS:master Sep 8, 2024
27 of 29 checks passed
@anthonyroussel anthonyroussel deleted the fix-samba-default-values branch September 9, 2024 05:31
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: 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.

3 participants