nixos/auto-cpufreq: Avoid touching /etc

This commit is contained in:
nicoo 2023-04-09 19:15:49 +00:00
parent deab2b3bf7
commit 04b1a3f847

View file

@ -27,15 +27,18 @@ in {
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.auto-cpufreq ];
environment.etc.${cfgFilename}.source = cfgFile;
systemd = {
packages = [ pkgs.auto-cpufreq ];
services.auto-cpufreq = {
# Workaround for https://github.com/NixOS/nixpkgs/issues/81138
wantedBy = [ "multi-user.target" ];
restartTriggers = [ cfgFile ];
path = with pkgs; [ bash coreutils ];
serviceConfig.ExecStart = [
""
"${lib.getExe pkgs.auto-cpufreq} --config ${cfgFile}"
];
};
};
};