diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index 8a31ed769736..9e999832d324 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -99,6 +99,8 @@ - [Bat](https://github.com/sharkdp/bat), a {manpage}`cat(1)` clone with wings. Available as [programs.bat](options.html#opt-programs.bat). +- [Autotier](https://github.com/45Drives/autotier), a passthrough FUSE filesystem. Available as [services.autotierfs](options.html#opt-services.autotierfs.enable). + - [µStreamer](https://github.com/pikvm/ustreamer), a lightweight MJPEG-HTTP streamer. Available as [services.ustreamer](options.html#opt-services.ustreamer). - [Whoogle Search](https://github.com/benbusby/whoogle-search), a self-hosted, ad-free, privacy-respecting metasearch engine. Available as [services.whoogle-search](options.html#opt-services.whoogle-search.enable). diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index f54772e0e3a9..05418ae2764e 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -417,6 +417,7 @@ ./services/audio/squeezelite.nix ./services/audio/tts.nix ./services/audio/ympd.nix + ./services/autotierfs.nix ./services/backup/automysqlbackup.nix ./services/backup/bacula.nix ./services/backup/borgbackup.nix diff --git a/nixos/modules/services/autotierfs.nix b/nixos/modules/services/autotierfs.nix new file mode 100644 index 000000000000..62200708bbb4 --- /dev/null +++ b/nixos/modules/services/autotierfs.nix @@ -0,0 +1,95 @@ +{ + config, + lib, + pkgs, + ... +}: +let + cfg = config.services.autotierfs; + ini = pkgs.formats.ini { }; + format = lib.types.attrsOf ini.type; + stateDir = "/var/lib/autotier"; + + generateConfigName = + name: builtins.replaceStrings [ "/" ] [ "-" ] (lib.strings.removePrefix "/" name); + configFiles = builtins.mapAttrs ( + name: val: ini.generate "${generateConfigName name}.conf" val + ) cfg.settings; + + getMountDeps = + settings: builtins.concatStringsSep " " (builtins.catAttrs "Path" (builtins.attrValues settings)); + + mountPaths = builtins.attrNames cfg.settings; +in +{ + options.services.autotierfs = { + enable = lib.mkEnableOption "the autotier passthrough tiering filesystem"; + package = lib.mkPackageOption pkgs "autotier" { }; + settings = lib.mkOption { + type = lib.types.submodule { + freeformType = format; + }; + default = { }; + description = '' + The contents of the configuration file for autotier. + See the [autotier repo](https://github.com/45Drives/autotier#configuration) for supported values. + ''; + example = lib.literalExpression '' + { + "/mnt/autotier" = { + Global = { + "Log Level" = 1; + "Tier Period" = 1000; + "Copy Buffer Size" = "1 MiB"; + }; + "Tier 1" = { + Path = "/mnt/tier1"; + Quota = "30GiB"; + }; + "Tier 2" = { + Path = "/mnt/tier2"; + Quota = "200GiB"; + }; + }; + } + ''; + }; + }; + + config = lib.mkIf cfg.enable { + assertions = [ + { + assertion = cfg.settings != { }; + message = "`services.autotierfs.settings` must be configured."; + } + ]; + + system.fsPackages = [ cfg.package ]; + + # Not necessary for module to work but makes it easier to pass config into cli + environment.etc = lib.attrsets.mapAttrs' ( + name: value: + lib.attrsets.nameValuePair "autotier/${(generateConfigName name)}.conf" { source = value; } + ) configFiles; + + systemd.tmpfiles.rules = (map (path: "d ${path} 0770 - autotier - -") mountPaths) ++ [ + "d ${stateDir} 0774 - autotier - -" + ]; + + users.groups.autotier = { }; + + systemd.services = lib.attrsets.mapAttrs' ( + path: values: + lib.attrsets.nameValuePair (generateConfigName path) { + description = "Mount autotierfs virtual path ${path}"; + unitConfig.RequiresMountsFor = getMountDeps values; + wantedBy = [ "local-fs.target" ]; + serviceConfig = { + Type = "forking"; + ExecStart = "${lib.getExe' cfg.package "autotierfs"} -c /etc/autotier/${generateConfigName path}.conf ${path} -o allow_other,default_permissions"; + ExecStop = "umount ${path}"; + }; + } + ) cfg.settings; + }; +} diff --git a/pkgs/by-name/au/autotier/package.nix b/pkgs/by-name/au/autotier/package.nix new file mode 100644 index 000000000000..a6d8836eed35 --- /dev/null +++ b/pkgs/by-name/au/autotier/package.nix @@ -0,0 +1,88 @@ +{ + stdenv, + lib, + fetchFromGitHub, + fetchpatch, + pkg-config, + rocksdb, + boost, + fuse3, + lib45d, + tbb_2021_11, + liburing, + installShellFiles, +}: +stdenv.mkDerivation (finalAttrs: { + name = "autotier"; + version = "1.2.0"; + src = fetchFromGitHub { + owner = "45Drives"; + repo = "autotier"; + tag = "v${finalAttrs.version}"; + hash = "sha256-Pf1baDJsyt0ScASWrrgMu8+X5eZPGJSu0/LDQNHe1Ok="; + }; + + patches = [ + # https://github.com/45Drives/autotier/pull/70 + # fix "error: 'uintmax_t' has not been declared" build failure until next release + (fetchpatch { + url = "https://github.com/45Drives/autotier/commit/d447929dc4262f607d87cbc8ad40a54d64f5011a.patch"; + hash = "sha256-0ab8YBgdJMxBHfOgUsgPpyUE1GyhAU3+WCYjYA2pjqo="; + }) + # Unvendor rocksdb (nixpkgs already applies RTTI and PORTABLE flags) and use pkg-config for flags + (fetchpatch { + url = "https://github.com/45Drives/autotier/commit/fa282f5079ff17c144a7303d64dad0e44681b87f.patch"; + hash = "sha256-+W3RwSe8zJKgZIXOaawHuI6xRzedYIcZundPC8eHuwM="; + }) + # Add missing list import to src/incl/config.hpp + (fetchpatch { + url = "https://github.com/45Drives/autotier/commit/1f97703f4dfbfe093f5c18c4ee01dcc1c8fe04f3.patch"; + hash = "sha256-3+KOh7JvbujCMbMqnZ5SGopAuOKHitKq6XV6a/jkcog="; + }) + ]; + + buildInputs = [ + rocksdb + boost + fuse3 + lib45d + tbb_2021_11 + liburing + ]; + + nativeBuildInputs = [ + pkg-config + installShellFiles + ]; + + installPhase = '' + runHook preInstall + + # binaries + installBin dist/from_source/* + + # docs + installManPage doc/man/autotier.8 + + # Completions + installShellCompletion --bash doc/completion/autotier.bash-completion + installShellCompletion --bash doc/completion/autotierfs.bash-completion + + # Scripts + installBin script/autotier-init-dirs + + # Default config + install -Dm755 -t $out/etc/autotier.conf doc/autotier.conf.template + + runHook postInstall + ''; + + meta = { + homepage = "https://github.com/45Drives/autotier"; + description = "Passthrough FUSE filesystem that intelligently moves files between storage tiers based on frequency of use, file age, and tier fullness"; + license = lib.licenses.gpl3; + maintainers = with lib.maintainers; [ philipwilk ]; + mainProgram = "autotier"; # cli, for file system use autotierfs + platforms = lib.platforms.linux; # uses io_uring so only available on linux not unix + }; +}) diff --git a/pkgs/by-name/ki/kimai/package.nix b/pkgs/by-name/ki/kimai/package.nix index 266ba0f87a9e..f038f7d3b079 100644 --- a/pkgs/by-name/ki/kimai/package.nix +++ b/pkgs/by-name/ki/kimai/package.nix @@ -5,14 +5,14 @@ nixosTests, }: -php.buildComposerProject (finalAttrs: { +php.buildComposerProject2 (finalAttrs: { pname = "kimai"; version = "2.28.0"; src = fetchFromGitHub { owner = "kimai"; repo = "kimai"; - rev = finalAttrs.version; + tag = finalAttrs.version; hash = "sha256-z8NyPpaG6wNxQ7SSEdtVM/gFTOzxjclhE/Y++M4wN5I="; }; @@ -26,7 +26,6 @@ php.buildComposerProject (finalAttrs: { mbstring pdo tokenizer - xml xsl zip ]) @@ -39,7 +38,7 @@ php.buildComposerProject (finalAttrs: { ''; }; - vendorHash = "sha256-xa0vdlCxKe5QPsqVZ61HcUcxnYYbb7w+Qn3PBEmUkH0="; + vendorHash = "sha256-E0l6eeMlXFmsZ1v27/v4DbbmiINxXf+t2H/Xcr/hocs="; composerNoPlugins = false; composerNoScripts = false; diff --git a/pkgs/by-name/li/lib45d/package.nix b/pkgs/by-name/li/lib45d/package.nix new file mode 100644 index 000000000000..26c1a86711c9 --- /dev/null +++ b/pkgs/by-name/li/lib45d/package.nix @@ -0,0 +1,44 @@ +{ + stdenv, + fetchFromGitHub, + fetchpatch, + lib, +}: +stdenv.mkDerivation (finalAttrs: { + name = "lib45d"; + version = "0.3.6"; + src = fetchFromGitHub { + owner = "45Drives"; + repo = "lib45d"; + tag = "v${finalAttrs.version}"; + hash = "sha256-42xB30Iu2WxNrBxomVBKd/uyIRt27y/Y1ah5mckOrc0="; + }; + + patches = [ + # https://github.com/45Drives/lib45d/issues/3 + # fix "error: 'uintmax_t' has not been declared" build failure until next release + (fetchpatch { + url = "https://github.com/45Drives/lib45d/commit/a607e278182a3184c004c45c215aa22c15d6941d.patch"; + hash = "sha256-sMAvOp4EjBXGHa9PGuuEqJvpEvUlMuzRKCfq9oqQLgY="; + }) + ]; + + installPhase = '' + runHook preInstall + + install -Dm755 -t $out/lib dist/shared/lib45d.so + + mkdir -p $out/include/45d + cp -f -r src/incl/45d/* $out/include/45d/ + + runHook postInstall + ''; + + meta = { + homepage = "https://github.com/45Drives/lib45d"; + description = "45Drives C++ Library"; + license = lib.licenses.gpl3; + maintainers = with lib.maintainers; [ philipwilk ]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/by-name/si/simplesamlphp/package.nix b/pkgs/by-name/si/simplesamlphp/package.nix index 35ae0774f99a..835c007c7afe 100644 --- a/pkgs/by-name/si/simplesamlphp/package.nix +++ b/pkgs/by-name/si/simplesamlphp/package.nix @@ -3,18 +3,18 @@ fetchFromGitHub, lib, }: -php.buildComposerProject (finalAttrs: { +php.buildComposerProject2 (finalAttrs: { pname = "simplesamlphp"; version = "1.19.7"; src = fetchFromGitHub { owner = "simplesamlphp"; repo = "simplesamlphp"; - rev = "v${finalAttrs.version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-Qmy9fuZq8MBqvYV6/u3Dg92pHHicuUhdNeB22u4hwwA="; }; - vendorHash = "sha256-FMFD0AXmD7Rq4d9+aNtGVk11YuOt40FWEqxvf+gBjmI="; + vendorHash = "sha256-kFRvOxSfqlM+xzFFlEm9YrbQDOvC4AA0BtztFQ1xxDU="; meta = { description = "SimpleSAMLphp is an application written in native PHP that deals with authentication (SQL, .htpasswd, YubiKey, LDAP, PAPI, Radius)"; diff --git a/pkgs/development/python-modules/ailment/default.nix b/pkgs/development/python-modules/ailment/default.nix index f7fe6970a33a..2e2645e304f4 100644 --- a/pkgs/development/python-modules/ailment/default.nix +++ b/pkgs/development/python-modules/ailment/default.nix @@ -10,7 +10,7 @@ buildPythonPackage rec { pname = "ailment"; - version = "9.2.137"; + version = "9.2.138"; pyproject = true; disabled = pythonOlder "3.11"; @@ -19,7 +19,7 @@ buildPythonPackage rec { owner = "angr"; repo = "ailment"; tag = "v${version}"; - hash = "sha256-5/dJFjqLIDafjzapsuSNz5YnaA9faDAgkW01tpHUHrA="; + hash = "sha256-EFynGM265FNUgBrofp0nFhamom26yse9sMDympXM1rk="; }; build-system = [ setuptools ]; diff --git a/pkgs/development/python-modules/angr/default.nix b/pkgs/development/python-modules/angr/default.nix index 3bfeffe564ba..e514838c4d6a 100644 --- a/pkgs/development/python-modules/angr/default.nix +++ b/pkgs/development/python-modules/angr/default.nix @@ -36,7 +36,7 @@ buildPythonPackage rec { pname = "angr"; - version = "9.2.137"; + version = "9.2.138"; pyproject = true; disabled = pythonOlder "3.11"; @@ -45,7 +45,7 @@ buildPythonPackage rec { owner = "angr"; repo = "angr"; tag = "v${version}"; - hash = "sha256-RIsgE/WE7QEmOIyujLObnpTpUR0GgUbavPmgs9QwakE="; + hash = "sha256-zJH54+IoMhYNpJE8CJF/Eq2Re152QO1K0JEN2JlFg5c="; }; postPatch = '' diff --git a/pkgs/development/python-modules/archinfo/default.nix b/pkgs/development/python-modules/archinfo/default.nix index 22af7df5bbdf..e30c41f015d5 100644 --- a/pkgs/development/python-modules/archinfo/default.nix +++ b/pkgs/development/python-modules/archinfo/default.nix @@ -10,7 +10,7 @@ buildPythonPackage rec { pname = "archinfo"; - version = "9.2.137"; + version = "9.2.138"; pyproject = true; disabled = pythonOlder "3.8"; @@ -19,7 +19,7 @@ buildPythonPackage rec { owner = "angr"; repo = "archinfo"; tag = "v${version}"; - hash = "sha256-NVOq1yiyjuDVwcgkHS1z2cgG0PipR34hV1DWODhvgtY="; + hash = "sha256-BnmYUvXji+YFBGXyJ0P1y+OIREsT2RYa/hdxwpUacT0="; }; build-system = [ setuptools ]; diff --git a/pkgs/development/python-modules/claripy/default.nix b/pkgs/development/python-modules/claripy/default.nix index 558059d4e083..09c00fea692a 100644 --- a/pkgs/development/python-modules/claripy/default.nix +++ b/pkgs/development/python-modules/claripy/default.nix @@ -14,7 +14,7 @@ buildPythonPackage rec { pname = "claripy"; - version = "9.2.137"; + version = "9.2.138"; pyproject = true; disabled = pythonOlder "3.11"; @@ -23,7 +23,7 @@ buildPythonPackage rec { owner = "angr"; repo = "claripy"; tag = "v${version}"; - hash = "sha256-XyOowwIHlGKKJ3IAdvr9LAzNA6jr/P1qzscCr9Z2Pmk="; + hash = "sha256-1nIREzUeUzfMu7gqrbAMJvKNnboavQRL8c2GDhH0Xs0="; }; # z3 does not provide a dist-info, so python-runtime-deps-check will fail diff --git a/pkgs/development/python-modules/cle/default.nix b/pkgs/development/python-modules/cle/default.nix index db4635ca46d9..aa9c703f1313 100644 --- a/pkgs/development/python-modules/cle/default.nix +++ b/pkgs/development/python-modules/cle/default.nix @@ -16,14 +16,14 @@ let # The binaries are following the argr projects release cycle - version = "9.2.137"; + version = "9.2.138"; # Binary files from https://github.com/angr/binaries (only used for testing and only here) binaries = fetchFromGitHub { owner = "angr"; repo = "binaries"; rev = "refs/tags/v${version}"; - hash = "sha256-pvjxP237GUfWh5weGTtIH+RI/vzsg+L2xJvKNTh7ACE="; + hash = "sha256-Dfo8JTTjq4JsMx3OjFn8G/3PBlLCRVRkEjJdEroSp/c="; }; in buildPythonPackage rec { @@ -37,7 +37,7 @@ buildPythonPackage rec { owner = "angr"; repo = "cle"; rev = "refs/tags/v${version}"; - hash = "sha256-nWkzJZXvMj7Pj6A2RgWVZSkXazzmi+exirzYiCchkD8="; + hash = "sha256-NVDLKA2BMgCB0k0LNPqYVIVWyiqdOHssIT/7Vx2/oWo="; }; build-system = [ setuptools ]; diff --git a/pkgs/development/python-modules/iopath/default.nix b/pkgs/development/python-modules/iopath/default.nix index ffc33c52f882..2f18e9de0744 100644 --- a/pkgs/development/python-modules/iopath/default.nix +++ b/pkgs/development/python-modules/iopath/default.nix @@ -13,7 +13,7 @@ }: let pname = "iopath"; - version = "0.1.9"; + version = "0.1.10"; in buildPythonPackage { inherit pname version; @@ -25,7 +25,7 @@ buildPythonPackage { owner = "facebookresearch"; repo = "iopath"; tag = "v${version}"; - hash = "sha256-Qubf/mWKMgYz9IVoptMZrwy4lQKsNGgdqpJB1j/u5s8="; + hash = "sha256-vJV0c+dCFO0wOHahKJ8DbwT2Thx3YjkNLVSpQv9H69g="; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/pyvex/default.nix b/pkgs/development/python-modules/pyvex/default.nix index db95245c55f1..af7113835a74 100644 --- a/pkgs/development/python-modules/pyvex/default.nix +++ b/pkgs/development/python-modules/pyvex/default.nix @@ -13,14 +13,14 @@ buildPythonPackage rec { pname = "pyvex"; - version = "9.2.137"; + version = "9.2.138"; pyproject = true; disabled = pythonOlder "3.11"; src = fetchPypi { inherit pname version; - hash = "sha256-EEdBG1eZxljN5WDvSDECrL9CoFd7sx+TztawXjaDAW0="; + hash = "sha256-2cO6uTlD2IuufCSBpoyP7JsK+0ON06yn2tuV004NjaU="; }; build-system = [ setuptools ]; diff --git a/pkgs/development/tools/parsing/tree-sitter/grammars/default.nix b/pkgs/development/tools/parsing/tree-sitter/grammars/default.nix index 37288631397c..070dc6279edb 100644 --- a/pkgs/development/tools/parsing/tree-sitter/grammars/default.nix +++ b/pkgs/development/tools/parsing/tree-sitter/grammars/default.nix @@ -100,6 +100,7 @@ tree-sitter-svelte = lib.importJSON ./tree-sitter-svelte.json; tree-sitter-talon = lib.importJSON ./tree-sitter-talon.json; tree-sitter-templ = lib.importJSON ./tree-sitter-templ.json; + tree-sitter-tera = lib.importJSON ./tree-sitter-tera.json; tree-sitter-tiger = lib.importJSON ./tree-sitter-tiger.json; tree-sitter-tlaplus = lib.importJSON ./tree-sitter-tlaplus.json; tree-sitter-toml = lib.importJSON ./tree-sitter-toml.json; diff --git a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-tera.json b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-tera.json new file mode 100644 index 000000000000..8624f790709e --- /dev/null +++ b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-tera.json @@ -0,0 +1,12 @@ +{ + "url": "https://github.com/uncenter/tree-sitter-tera", + "rev": "e8d679a29c03e64656463a892a30da626e19ed8e", + "date": "2024-12-29T18:16:18-05:00", + "path": "/nix/store/r0cf0nb4r9wvy0f1pb207f3yj0sx3j4z-tree-sitter-tera", + "sha256": "0lz6x2yd9rjklc1821x6jd577820izv5bmwhf957gxj0nlrixhj7", + "hash": "sha256-R8IeM7VA9ndKcpDXVfaPQKBzSpOmB4ECo1Pm1Lzo5lM=", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/pkgs/development/tools/parsing/tree-sitter/update.nix b/pkgs/development/tools/parsing/tree-sitter/update.nix index 075ce4756b30..3e78029a0074 100644 --- a/pkgs/development/tools/parsing/tree-sitter/update.nix +++ b/pkgs/development/tools/parsing/tree-sitter/update.nix @@ -470,6 +470,10 @@ let orga = "tree-sitter-grammars"; repo = "tree-sitter-kdl"; }; + "tree-sitter-tera" = { + orga = "uncenter"; + repo = "tree-sitter-tera"; + }; }; allGrammars =