diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2021-06-23 12:04:25 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-23 12:04:25 +0000 |
commit | b59d049598ee97a41e24dd2b60439db080885c22 (patch) | |
tree | b870280666cd39c127a3654af2b29c1ed8b7632f /nixos/modules | |
parent | c54b530a3955cdb0c3a201d3cee90c77a3b61a82 (diff) | |
parent | 46113713d4f25579e07b78116a61ab6f178f4153 (diff) | |
download | nixpkgs-b59d049598ee97a41e24dd2b60439db080885c22.tar nixpkgs-b59d049598ee97a41e24dd2b60439db080885c22.tar.gz nixpkgs-b59d049598ee97a41e24dd2b60439db080885c22.tar.bz2 nixpkgs-b59d049598ee97a41e24dd2b60439db080885c22.tar.lz nixpkgs-b59d049598ee97a41e24dd2b60439db080885c22.tar.xz nixpkgs-b59d049598ee97a41e24dd2b60439db080885c22.tar.zst nixpkgs-b59d049598ee97a41e24dd2b60439db080885c22.zip |
Merge master into staging-next
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/hardware/system-76.nix | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/nixos/modules/hardware/system-76.nix b/nixos/modules/hardware/system-76.nix index ed661fd3303..3a50c5aa0f0 100644 --- a/nixos/modules/hardware/system-76.nix +++ b/nixos/modules/hardware/system-76.nix @@ -34,6 +34,25 @@ let wantedBy = [ "multi-user.target" ]; }; }; + + power-pkg = pkgs.system76-power; + powerConfig = mkIf cfg.power-daemon.enable { + # Make system76-power usable by root from the command line. + environment.systemPackages = [ power-pkg ]; + + services.dbus.packages = [ power-pkg ]; + + systemd.services.system76-power = { + description = "System76 Power Daemon"; + serviceConfig = { + ExecStart = "${power-pkg}/bin/system76-power daemon"; + Restart = "on-failure"; + Type = "dbus"; + BusName = "com.system76.PowerDaemon"; + }; + wantedBy = [ "multi-user.target" ]; + }; + }; in { options = { hardware.system76 = { @@ -52,8 +71,15 @@ in { description = "Whether to make the system76 out-of-tree kernel modules available"; type = types.bool; }; + + power-daemon.enable = mkOption { + default = cfg.enableAll; + example = true; + description = "Whether to enable the system76 power daemon"; + type = types.bool; + }; }; }; - config = mkMerge [ moduleConfig firmwareConfig ]; + config = mkMerge [ moduleConfig firmwareConfig powerConfig ]; } |