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

autotier: init at 1.2.0, lib45d: init at 0.3.6, nixos/autotierfs: init module #335846

Merged
merged 3 commits into from
Jan 31, 2025

Conversation

philipwilk
Copy link
Contributor

@philipwilk philipwilk commented Aug 19, 2024

Description of changes

lib45d is a direct dependency of autotier and nothing else afaik so merging them in one pr is appropriate imo. The new module lets you enable/configure autotier.

The option is as simple as possible:.

services.autotierfs.enable
services.autotierfs.package 
services.autotierfs.settings

The setting option expects an attrset of INIs, with each attr being one autotier tier.
Such as:

services.autotierfs.settings = {
  "/mnt/autotier" = {
    Global = {
      "Log Level" = 1;
      "Tier Period" = 1000;
      "Copy Buffer Size" = "1 MiB";
    };
    "Tier 1" = {
       Path = "/mnt/tier";
       Quota = "30GiB";
     };
     "Tier 2" = {
       Path = "/pool/tier";
       Quota = "200GiB";
     };
  };
  "/mnt/autotier2" = {
    Global = {
      "Log Level" = 1;
      "Tier Period" = 1000;
      "Copy Buffer Size" = "1 MiB";
    };
    "Tier 1" = {
       Path = "/mnt/tier2";
       Quota = "30GiB";
     };
     "Tier 2" = {
       Path = "/pool/tier2";
       Quota = "200GiB";
     };
   };
};

etc. Configurations are put int /etc/autotier/ for easy access for use with the autotier command. Adding your user to the autotier group lets you use it without root.

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.

@philipwilk philipwilk force-pushed the autotier branch 3 times, most recently from 162a889 to 236d67e Compare August 19, 2024 16:51
@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 Aug 19, 2024
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Aug 19, 2024
@philipwilk philipwilk force-pushed the autotier branch 20 times, most recently from 2acfe23 to 9a6d3f3 Compare September 3, 2024 14:13
@philipwilk philipwilk changed the title autotier: init at 1.2.0. lib45d: init at 0.3.6 autotier: init at 1.2.0, lib45d: init at 0.3.6, nixos/autotierfs: init module Sep 3, 2024
@philipwilk philipwilk force-pushed the autotier branch 6 times, most recently from e172a5e to 8b46c26 Compare December 24, 2024 23:18
@philipwilk
Copy link
Contributor Author

The service generator works! Uses wantedBy = [ "local-fs.target" ]; to get automounted at boot/system rebuild etc.
Here it is using the sample config from the pr description.
Using the sample config from the pr description

I havent done speed/balancing tests to validate that autotier itself is working as intended, but creating files is working, and the nixos module is now working as expected.

nixos/modules/services/autotierfs.nix Outdated Show resolved Hide resolved
nixos/modules/services/autotierfs.nix Outdated Show resolved Hide resolved
nixos/modules/services/autotierfs.nix Outdated Show resolved Hide resolved
nixos/modules/services/autotierfs.nix Show resolved Hide resolved
nixos/modules/services/autotierfs.nix Outdated Show resolved Hide resolved
pkgs/by-name/au/autotier/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/au/autotier/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/au/autotier/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/au/autotier/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/au/autotier/package.nix Show resolved Hide resolved
@philipwilk philipwilk force-pushed the autotier branch 6 times, most recently from 368c965 to 0d07c58 Compare January 28, 2025 15:33
@philipwilk
Copy link
Contributor Author

philipwilk commented Jan 29, 2025

Tested after applying changes and it is working locally on one disk on my pc. Late February I am building a new nas so will be able to test it in prod at that point across hard drives+ssds.

This MR is ready for testing now, the pr can be applied to your local nixpkgs via

url = "https://github.com/NixOS/nixpkgs/pull/335846.patch";
hash = "sha256-mafTBM6zk4KnyVPtzhAUbeR7B8JRhrGitYk25afwr6U=";

pkgs/by-name/au/autotier/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/li/lib45d/package.nix Outdated Show resolved Hide resolved
nixos/modules/services/autotierfs.nix Outdated Show resolved Hide resolved
Copy link
Member

@getchoo getchoo left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM. Feel free to ping in a couple days if there are no other reviews -- or whenever you have finished testing ;)

Edit: This should also go into the new modules section of the release notes

nixos/modules/services/autotierfs.nix Outdated Show resolved Hide resolved
@getchoo getchoo added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Jan 29, 2025
@getchoo getchoo dismissed Scrumplex’s stale review January 31, 2025 22:06

Changes were addressed

Copy link
Member

@getchoo getchoo left a comment

Choose a reason for hiding this comment

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

Could this get a mention in the release notes?

@github-actions github-actions bot added 8.has: documentation This PR adds or changes documentation 8.has: changelog labels Jan 31, 2025
@getchoo getchoo merged commit b721076 into NixOS:master Jan 31, 2025
25 of 28 checks passed
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: changelog 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: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants