Skip to content

nixos/alist: init #355716

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

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

nixos/alist: init #355716

wants to merge 4 commits into from

Conversation

Moraxyc
Copy link
Member

@Moraxyc Moraxyc commented Nov 13, 2024

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 Nov 13, 2024
@Moraxyc Moraxyc mentioned this pull request Nov 13, 2024
13 tasks
@Moraxyc Moraxyc force-pushed the add-alist-module branch 4 times, most recently from 011d2ab to 78c989d Compare November 13, 2024 18:01
@yunfachi yunfachi self-requested a review November 13, 2024 18:03
Copy link
Member

@yunfachi yunfachi left a comment

Choose a reason for hiding this comment

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

Many descriptions do not end with a period, and some are not capitalized correctly. Please fix this.

I believe null would be more appropriate for the logic that disables http_port and https_port. However, you might need to change these null values to -1 specifically for the genJqSecretsReplacementSnippet context.

Additionally, you need to add a new module in the NixOS 24.11 release notes in alphabetical order.

@Moraxyc Moraxyc force-pushed the add-alist-module branch 2 times, most recently from 00fab24 to d1e8f96 Compare November 14, 2024 06:07
@github-actions github-actions bot added 8.has: documentation This PR adds or changes documentation 8.has: changelog This PR adds or changes release notes labels Nov 14, 2024
@Moraxyc Moraxyc requested review from jian-lin and yunfachi November 14, 2024 06:08
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Nov 14, 2024
@Moraxyc Moraxyc requested a review from pluiedev November 15, 2024 03:40
@h7x4 h7x4 added 8.has: module (new) This PR adds a module in `nixos/` 8.has: tests This PR has tests labels Nov 15, 2024
@Moraxyc Moraxyc force-pushed the add-alist-module branch 2 times, most recently from 486161e to c447faa Compare November 23, 2024 07:14
@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Nov 23, 2024
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 16, 2025
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 20, 2025

user = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
default = null;
default = "alist";

Copy link
Member Author

Choose a reason for hiding this comment

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

I followed @pluiedev's suggestion for setting the user in this module — setting the default to null and creating the user only when it's not null. I’ve been using this pattern in all my modules where DynamicUser isn’t an option. Just wondering, is there a specific reason we shouldn’t do it this way?


group = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
default = null;
default = "alist";

Comment on lines +267 to +234
User = if cfg.user == null then "alist" else cfg.user;
Group = if cfg.group == null then "alist" else cfg.group;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
User = if cfg.user == null then "alist" else cfg.user;
Group = if cfg.group == null then "alist" else cfg.group;
User = cfg.user;
Group = cfg.group;

Comment on lines +56 to +48
machine.succeed("""
echo '{"scheme": {"force_https": true}}' > /var/lib/alist/config.json
""")
Copy link
Member

Choose a reason for hiding this comment

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

Can't this be placed with systemd-tmpfiles?

Copy link
Member Author

Choose a reason for hiding this comment

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

Could you please provide some explanation? I'm not quite sure how systemd-tmpfiles is related here.

The reason we're writing to /var/lib/alist/config.json is to forcibly overwrite the previously generated config file and set a specific option in it. This is to test whether, with mutableConfig enabled, the script in preStart can make the previous settings persist.

Comment on lines +62 to +53
result = json.loads(machine.succeed("cat /var/lib/alist/config.json"))
assert result['scheme']['force_https'] is True
Copy link
Member

Choose a reason for hiding this comment

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

Can this be overwriten?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm still not sure I understand what you mean. Could you explain it in more detail?

@Moraxyc Moraxyc force-pushed the add-alist-module branch 3 times, most recently from 563ef3d to 170162e Compare March 24, 2025 07:25
@Moraxyc Moraxyc force-pushed the add-alist-module branch from 170162e to 901dda4 Compare April 3, 2025 09:47
@Moraxyc Moraxyc force-pushed the add-alist-module branch 3 times, most recently from 93861e8 to e51fc71 Compare April 7, 2025 08:33
@qbisi
Copy link
Contributor

qbisi commented Apr 7, 2025

DLGM. services.alist.enable = true and everything is fine.

@wegank wegank added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Apr 7, 2025
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label May 17, 2025
@Moraxyc Moraxyc force-pushed the add-alist-module branch from e51fc71 to 34fa937 Compare May 24, 2025 09:44
@Moraxyc Moraxyc removed the 2.status: merge conflict This PR has merge conflicts with the target branch label May 24, 2025
@github-actions github-actions bot removed the 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. label May 24, 2025
@Moraxyc Moraxyc mentioned this pull request May 24, 2025
13 tasks
@Moraxyc Moraxyc force-pushed the add-alist-module branch from 34fa937 to 3f01166 Compare July 29, 2025 19:36
@nixpkgs-ci nixpkgs-ci bot added 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
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: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: tests This PR has tests 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants