lol

Merge pull request #242309 from Artturin/ananicyextraxadd

authored by

Artturi and committed by
GitHub
d1abbbd9 3afe31e0

+93 -22
+2
nixos/doc/manual/release-notes/rl-2311.section.md
··· 46 46 47 47 - `getent` has been moved from `glibc`'s `bin` output to its own dedicated output, reducing closure size for many dependents. Dependents using the `getent` alias should not be affected; others should move from using `glibc.bin` or `getBin glibc` to `getent` (which also improves compatibility with non-glibc platforms). 48 48 49 + - The `services.ananicy.extraRules` option now has the type of `listOf attrs` instead of `string`. 50 + 49 51 - `etcd` has been updated to 3.5, you will want to read the [3.3 to 3.4](https://etcd.io/docs/v3.5/upgrades/upgrade_3_4/) and [3.4 to 3.5](https://etcd.io/docs/v3.5/upgrades/upgrade_3_5/) upgrade guides 50 52 51 53 - `consul` has been updated to `1.16.0`. See the [release note](https://github.com/hashicorp/consul/releases/tag/v1.16.0) for more details. Once a new Consul version has started and upgraded its data directory, it generally cannot be downgraded to the previous version.
+54 -13
nixos/modules/services/misc/ananicy.nix
··· 5 5 let 6 6 cfg = config.services.ananicy; 7 7 configFile = pkgs.writeText "ananicy.conf" (generators.toKeyValue { } cfg.settings); 8 - extraRules = pkgs.writeText "extraRules" cfg.extraRules; 8 + extraRules = pkgs.writeText "extraRules" (concatMapStringsSep "\n" (l: builtins.toJSON l) cfg.extraRules); 9 + extraTypes = pkgs.writeText "extraTypes" (concatMapStringsSep "\n" (l: builtins.toJSON l) cfg.extraTypes); 10 + extraCgroups = pkgs.writeText "extraCgroups" (concatMapStringsSep "\n" (l: builtins.toJSON l) cfg.extraCgroups); 9 11 servicename = if ((lib.getName cfg.package) == (lib.getName pkgs.ananicy-cpp)) then "ananicy-cpp" else "ananicy"; 10 12 in 11 13 { ··· 23 25 ''; 24 26 }; 25 27 28 + rulesProvider = mkOption { 29 + type = types.package; 30 + default = pkgs.ananicy; 31 + defaultText = literalExpression "pkgs.ananicy"; 32 + example = literalExpression "pkgs.ananicy-cpp"; 33 + description = lib.mdDoc '' 34 + Which package to copy default rules,types,cgroups from. 35 + ''; 36 + }; 37 + 26 38 settings = mkOption { 27 39 type = with types; attrsOf (oneOf [ int bool str ]); 28 40 default = { }; ··· 35 47 }; 36 48 37 49 extraRules = mkOption { 38 - type = types.str; 39 - default = ""; 50 + type = with types; listOf attrs; 51 + default = [ ]; 40 52 description = lib.mdDoc '' 41 - Extra rules in json format on separate lines. See: 53 + Rules to write in 'nixRules.rules'. See: 42 54 <https://github.com/Nefelim4ag/Ananicy#configuration> 43 55 <https://gitlab.com/ananicy-cpp/ananicy-cpp/#global-configuration> 44 56 ''; 45 - example = literalExpression '' 46 - ''' 47 - { "name": "eog", "type": "Image-View" } 48 - { "name": "fdupes", "type": "BG_CPUIO" } 49 - ''' 57 + example = [ 58 + { name = "eog"; type = "Image-Viewer"; } 59 + { name = "fdupes"; type = "BG_CPUIO"; } 60 + ]; 61 + }; 62 + extraTypes = mkOption { 63 + type = with types; listOf attrs; 64 + default = [ ]; 65 + description = lib.mdDoc '' 66 + Types to write in 'nixTypes.types'. See: 67 + <https://gitlab.com/ananicy-cpp/ananicy-cpp/#types> 68 + ''; 69 + example = [ 70 + { type = "my_type"; nice = 19; other_parameter = "value"; } 71 + { type = "compiler"; nice = 19; sched = "batch"; ioclass = "idle"; } 72 + ]; 73 + }; 74 + extraCgroups = mkOption { 75 + type = with types; listOf attrs; 76 + default = [ ]; 77 + description = lib.mdDoc '' 78 + Cgroups to write in 'nixCgroups.cgroups'. See: 79 + <https://gitlab.com/ananicy-cpp/ananicy-cpp/#cgroups> 50 80 ''; 51 - 81 + example = [ 82 + { cgroup = "cpu80"; CPUQuota = 80; } 83 + ]; 52 84 }; 53 85 }; 54 86 }; ··· 59 91 etc."ananicy.d".source = pkgs.runCommandLocal "ananicyfiles" { } '' 60 92 mkdir -p $out 61 93 # ananicy-cpp does not include rules or settings on purpose 62 - cp -r ${pkgs.ananicy}/etc/ananicy.d/* $out 63 - rm $out/ananicy.conf 94 + if [[ -d "${cfg.rulesProvider}/etc/ananicy.d/00-default" ]]; then 95 + cp -r ${cfg.rulesProvider}/etc/ananicy.d/* $out 96 + else 97 + cp -r ${cfg.rulesProvider}/* $out 98 + fi 99 + 100 + # configured through .setings 101 + rm -f $out/ananicy.conf 64 102 cp ${configFile} $out/ananicy.conf 65 - ${optionalString (cfg.extraRules != "") "cp ${extraRules} $out/nixRules.rules"} 103 + ${optionalString (cfg.extraRules != [ ]) "cp ${extraRules} $out/nixRules.rules"} 104 + ${optionalString (cfg.extraTypes != [ ]) "cp ${extraTypes} $out/nixTypes.types"} 105 + ${optionalString (cfg.extraCgroups != [ ]) "cp ${extraCgroups} $out/nixCgroups.cgroups"} 66 106 ''; 67 107 }; 68 108 ··· 85 125 # https://gitlab.com/ananicy-cpp/ananicy-cpp/-/blob/master/src/config.cpp#L12 86 126 loglevel = mkOD "warn"; # default is info but its spammy 87 127 cgroup_realtime_workaround = mkOD config.systemd.enableUnifiedCgroupHierarchy; 128 + log_applied_rule = mkOD false; 88 129 } else { 89 130 # https://github.com/Nefelim4ag/Ananicy/blob/master/ananicy.d/ananicy.conf 90 131 check_disks_schedulers = mkOD true;
+32
pkgs/misc/ananicy-rules-cachyos/default.nix
··· 1 + { lib, stdenv, fetchFromGitHub }: 2 + 3 + stdenv.mkDerivation rec { 4 + pname = "ananicy"; 5 + version = "unstable-2023-06-28"; 6 + 7 + src = fetchFromGitHub { 8 + owner = "CachyOS"; 9 + repo = "ananicy-rules"; 10 + rev = "b2b4342d769bc3c6abc4ce77bd53d6ca06d659e5"; 11 + sha256 = "sha256-TGX7GlfSeKu68mVM71/kdJH31gzMmhzCAqA390aEq8U="; 12 + }; 13 + 14 + dontConfigure = true; 15 + dontBuild = true; 16 + 17 + installPhase = '' 18 + runHook preBuild 19 + mkdir -p $out 20 + cp -r * $out 21 + rm $out/README.md 22 + runHook postBuild 23 + ''; 24 + 25 + meta = with lib; { 26 + homepage = "https://github.com/CachyOS/ananicy-rules"; 27 + description = "ananicy-cpp-rules for CachyOS "; 28 + license = licenses.gpl3Only; 29 + platforms = platforms.linux; 30 + maintainers = with maintainers; [ artturin ]; 31 + }; 32 + }
+3 -9
pkgs/misc/ananicy/default.nix
··· 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "ananicy"; 5 - version = "unstable-2021-11-05"; 5 + version = "unstable-2023-03-21"; 6 6 7 7 src = fetchFromGitHub { 8 8 owner = "nefelim4ag"; 9 9 repo = "ananicy"; 10 - rev = "b8968e9b32b0e4e6a01dc2314e43de8fee9da691"; 11 - sha256 = "sha256-tlPY81xdUpZrDYdApXooZ0Mst0n7ARVHyUrmymqg0rk="; 10 + rev = "1e2cc9a62ba3b6793e59da66aa0039f89e1ad49f"; 11 + sha256 = "sha256-nHp47eYI36edka+cBMzayPHEflAzpgLx0VehhsyYpwI="; 12 12 }; 13 13 14 14 patches = [ ··· 19 19 sha256 = "sha256-vMcJxekg2QUbm253CLAv3tmo5kedSlw+/PI/LamNWwc="; 20 20 # only used for debian packaging. lets exclude it so the patch applies even when that file is changed 21 21 excludes = [ "package.sh" ]; 22 - }) 23 - # https://github.com/Nefelim4ag/Ananicy/pull/439 24 - # fix syntax error 25 - (fetchpatch { 26 - url = "https://github.com/Nefelim4ag/Ananicy/commit/0f8b809298ccfd88d0e2ab952d6e4131865246da.patch"; 27 - sha256 = "sha256-PWE4F0G97gecgc9HnG7ScA78+QVc8u8aF9u74qVChX0="; 28 22 }) 29 23 ]; 30 24
+2
pkgs/top-level/all-packages.nix
··· 28550 28550 28551 28551 ananicy-cpp = callPackage ../misc/ananicy-cpp { }; 28552 28552 28553 + ananicy-rules-cachyos = callPackage ../misc/ananicy-rules-cachyos { }; 28554 + 28553 28555 andagii = callPackage ../data/fonts/andagii { }; 28554 28556 28555 28557 andika = callPackage ../data/fonts/andika { };