Skip to content

Commit f06208e

Browse files
powerstation: init at 0.4.2 (NixOS#367781)
2 parents 60f790c + daaab4b commit f06208e

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed

nixos/doc/manual/release-notes/rl-2505.section.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@
123123

124124
- [InputPlumber](https://github.com/ShadowBlip/InputPlumber/), an open source input router and remapper daemon for Linux. Available as [services.inputplumber](#opt-services.inputplumber.enable).
125125

126+
- [PowerStation](https://github.com/ShadowBlip/PowerStation/), an open source TDP control and performance daemon with DBus interface for Linux. Available as [services.powerstation](#opt-services.powerstation.enable).
127+
126128
- [echoip](https://github.com/mpolden/echoip), a simple service for looking up your IP address. Available as [services.echoip](#opt-services.echoip.enable).
127129

128130
- [Buffyboard](https://gitlab.postmarketos.org/postmarketOS/buffybox/-/tree/master/buffyboard), a framebuffer on-screen keyboard. Available as [services.buffyboard](option.html#opt-services.buffyboard).

nixos/modules/module-list.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@
631631
./services/hardware/pcscd.nix
632632
./services/hardware/pommed.nix
633633
./services/hardware/power-profiles-daemon.nix
634+
./services/hardware/powerstation.nix
634635
./services/hardware/rasdaemon.nix
635636
./services/hardware/ratbagd.nix
636637
./services/hardware/sane.nix
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
config,
3+
lib,
4+
pkgs,
5+
...
6+
}:
7+
8+
let
9+
cfg = config.services.powerstation;
10+
in
11+
{
12+
options.services.powerstation = {
13+
enable = lib.mkEnableOption "PowerStation";
14+
package = lib.mkPackageOption pkgs "powerstation" { };
15+
};
16+
17+
config = lib.mkIf cfg.enable {
18+
environment.systemPackages = [ cfg.package ];
19+
20+
systemd.services.powerstation = {
21+
description = "PowerStation Service";
22+
wantedBy = [ "multi-user.target" ];
23+
after = [ "graphical-session.target" ];
24+
environment = {
25+
XDG_DATA_DIRS = "/run/current-system/sw/share";
26+
};
27+
28+
serviceConfig = {
29+
User = "root";
30+
Group = "root";
31+
ExecStart = lib.getExe cfg.package;
32+
};
33+
};
34+
};
35+
36+
meta.maintainers = with lib.maintainers; [ shadowapex ];
37+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
lib,
3+
rustPlatform,
4+
fetchFromGitHub,
5+
pkg-config,
6+
udev,
7+
pciutils,
8+
cmake,
9+
}:
10+
11+
rustPlatform.buildRustPackage rec {
12+
pname = "powerstation";
13+
version = "0.4.2";
14+
15+
src = fetchFromGitHub {
16+
owner = "ShadowBlip";
17+
repo = "PowerStation";
18+
tag = "v${version}";
19+
hash = "sha256-R6p3zuYWggnOy60iGZ6G23ig1gzezweswAxVrCB+zvU=";
20+
};
21+
22+
useFetchCargoVendor = true;
23+
cargoHash = "sha256-3mOmDDDGW7AClG4tNuXti07lCNbK5bMnpWUnsxcxGPI=";
24+
25+
nativeBuildInputs = [
26+
cmake
27+
pkg-config
28+
rustPlatform.bindgenHook
29+
];
30+
31+
buildInputs = [
32+
udev
33+
pciutils
34+
];
35+
36+
postInstall = ''
37+
cp -r rootfs/usr/* $out/
38+
'';
39+
40+
meta = {
41+
description = "Open source TDP control and performance daemon with DBus interface";
42+
homepage = "https://github.com/ShadowBlip/PowerStation";
43+
license = lib.licenses.gpl3Plus;
44+
changelog = "https://github.com/ShadowBlip/PowerStation/releases/tag/v${version}";
45+
maintainers = with lib.maintainers; [ shadowapex ];
46+
mainProgram = "powerstation";
47+
};
48+
}

0 commit comments

Comments
 (0)