Change:
# configured through .setings rm -f $out/ananicy.conf cp ${configFile} $out/ananicy.conf <del> ${optionalString (cfg.extraRules != [ ]) "cp ${extraRules} $out/nixRules.rules"} ${optionalString (cfg.extraTypes != [ ]) "cp ${extraTypes} $out/nixTypes.types"} ${optionalString (cfg.extraCgroups != [ ]) "cp ${extraCgroups} $out/nixCgroups.cgroups"} </del> <ins> ${lib.optionalString (cfg.extraRules != [ ]) "cp ${extraRules} $out/nixRules.rules"} ${lib.optionalString (cfg.extraTypes != [ ]) "cp ${extraTypes} $out/nixTypes.types"} ${lib.optionalString (cfg.extraCgroups != [ ]) "cp ${extraCgroups} $out/nixCgroups.cgroups"} </ins> ''; }; # ananicy and ananicy-cpp have different default settings services.ananicy.settings = let <del> mkOD = mkOptionDefault; </del> <ins> mkOD = lib.mkOptionDefault; </ins> in { cgroup_load = mkOD true;

Discussion:
Ananicy systemd service fails. Here's the log from journal: The service gets auto-restarted after that failure and the next error is different: Also, here's the stack trace from coredump: Please run and paste the result. Add a :+1: [reaction] to [issues you find important]. [reaction]: [issues you find important]:
Works fine on non-hardened linux.
This also works fine: Seems like the issue is with ananicy-cpp.
Could you try with the latest kernel, though I am not sure how a kernel change could be impacting this. EDIT: it is failing to load BPF programs, using the latest kernel (6.9+ as of now) should fix things.
I can't check 6.9 because I'm on zfs. With 6.8 hardened the error is still there.
You could try 's cachyos hardended kernel. That is on 6.9 AFAIK.
on regular linux-cachyos (6.9) works fine. i suppose will work on cachyos-hardenedas well, but if you mind - i'll test.
core dumped..
so. after some tests we came to a suggestion that this is hardened kernel issue: ! i've and Luis tested it out. on on my end nothing gone wrong, benchmark done and done well. as suggested - you can try from chaotic-nyx flake, but not hardened one. :D
To be honest any non-hardened kernel should work.
Yeah, works fine with default . I think it's possible to build with netlink instead of bpf. Maybe this would work on hardened? nvm, it's
That's not it. On nixos I have in with .
'k!
ones might be important? <details</details
In order ananicy-cpp to function, make sure that kernelparams "debugfs=off" is not set.
Thanks is the default on hardened. Adding to cmdline fixes the issue. Doesn't work with .
Compiling with cmake flag also makes it work (with the default ).
Seems like debugfs is not required, only tracefs, which can be enabled with
Good to know. Maybe i'll disable once again debugfs.
So I think the fix should be to disable on hardened kernel?

I've realized that we cannot do the check whether kernel is hardened or not in package itself. I was thinking, that the best course of action would be to create nixos module for ananicy-cpp.
sounds actually good, i agree with it. :D
Please test , just override
I disabled debugfs and tracefs, and tested it like this: No more errors.
The problem with debugs/tracefs is that it seems like there's no nixos way to check for debufs/tracefs. I was thinking of adding option which would default to false on hardened and true otherwise. With we could add an assert for .
No need to add an additional module. You can check if 's pname == 's pname AND , then the override should be applied. You could send the patch here and I'll commit it for you, or send another PR after I merge this.
I think it would be better to expose withBpf as module option so it can be documented properly for the users.
should disable BPF in Ananicy-CPP by default if hardened is enabled.