mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-12 05:16:25 +03:00
37 lines
773 B
Nix
37 lines
773 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
cfg = config.services.powerstation;
|
|
in
|
|
{
|
|
options.services.powerstation = {
|
|
enable = lib.mkEnableOption "PowerStation";
|
|
package = lib.mkPackageOption pkgs "powerstation" { };
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
systemd.services.powerstation = {
|
|
description = "PowerStation Service";
|
|
wantedBy = [ "multi-user.target" ];
|
|
after = [ "graphical-session.target" ];
|
|
environment = {
|
|
XDG_DATA_DIRS = "/run/current-system/sw/share";
|
|
};
|
|
|
|
serviceConfig = {
|
|
User = "root";
|
|
Group = "root";
|
|
ExecStart = lib.getExe cfg.package;
|
|
};
|
|
};
|
|
};
|
|
|
|
meta.maintainers = with lib.maintainers; [ shadowapex ];
|
|
}
|