upower: load config from /etc
In the process of making UPower.conf customizable (#73968), it came up that UPower doesn't load its config from /etc by default. The UPower derivation is modified to make it load its config from /etc at runtime, but still install the default config to its nix store path as before. The UPower module is modified to put the config in /etc.
This commit is contained in:
parent
aecfea098e
commit
f83a83f964
@ -220,22 +220,19 @@ in
|
|||||||
|
|
||||||
systemd.packages = [ cfg.package ];
|
systemd.packages = [ cfg.package ];
|
||||||
|
|
||||||
systemd.services.upower.environment.UPOWER_CONF_FILE_NAME = pkgs.writeTextFile {
|
environment.etc."UPower/UPower.conf".text = generators.toINI {} {
|
||||||
name = "UPower.conf";
|
UPower = {
|
||||||
text = generators.toINI {} {
|
EnableWattsUpPro = cfg.enableWattsUpPro;
|
||||||
UPower = {
|
NoPollBatteries = cfg.noPollBatteries;
|
||||||
EnableWattsUpPro = cfg.enableWattsUpPro;
|
IgnoreLid = cfg.ignoreLid;
|
||||||
NoPollBatteries = cfg.noPollBatteries;
|
UsePercentageForPolicy = cfg.usePercentageForPolicy;
|
||||||
IgnoreLid = cfg.ignoreLid;
|
PercentageLow = cfg.percentageLow;
|
||||||
UsePercentageForPolicy = cfg.usePercentageForPolicy;
|
PercentageCritical = cfg.percentageCritical;
|
||||||
PercentageLow = cfg.percentageLow;
|
PercentageAction = cfg.percentageAction;
|
||||||
PercentageCritical = cfg.percentageCritical;
|
TimeLow = cfg.timeLow;
|
||||||
PercentageAction = cfg.percentageAction;
|
TimeCritical = cfg.timeCritical;
|
||||||
TimeLow = cfg.timeLow;
|
TimeAction = cfg.timeAction;
|
||||||
TimeCritical = cfg.timeCritical;
|
CriticalPowerAction = cfg.criticalPowerAction;
|
||||||
TimeAction = cfg.timeAction;
|
|
||||||
CriticalPowerAction = cfg.criticalPowerAction;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -52,12 +52,14 @@ stdenv.mkDerivation {
|
|||||||
"--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
|
"--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
|
||||||
"--with-systemdutildir=${placeholder "out"}/lib/systemd"
|
"--with-systemdutildir=${placeholder "out"}/lib/systemd"
|
||||||
"--with-udevrulesdir=${placeholder "out"}/lib/udev/rules.d"
|
"--with-udevrulesdir=${placeholder "out"}/lib/udev/rules.d"
|
||||||
|
"--sysconfdir=/etc"
|
||||||
];
|
];
|
||||||
|
|
||||||
doCheck = false; # fails with "env: './linux/integration-test': No such file or directory"
|
doCheck = false; # fails with "env: './linux/integration-test': No such file or directory"
|
||||||
|
|
||||||
installFlags = [
|
installFlags = [
|
||||||
"historydir=$(TMPDIR)/foo"
|
"historydir=$(TMPDIR)/foo"
|
||||||
|
"sysconfdir=${placeholder "out"}/etc"
|
||||||
];
|
];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
Loading…
Reference in New Issue
Block a user