refactor(home:polkit): move options
This commit is contained in:
parent
5590c8a951
commit
3799825448
2 changed files with 18 additions and 11 deletions
|
|
@ -1,21 +1,14 @@
|
||||||
{ lib, config, pkgs, ... }:
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf types mkOption;
|
inherit (lib) mkIf;
|
||||||
inherit (builtins) elem;
|
polkit = config.ooknet.security.polkit;
|
||||||
cfg = config.ooknet.desktop.security.polkit;
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
options.ooknet.desktop.security.polkit = mkOption {
|
|
||||||
type = types.enum ["gnome" "pantheon"]; # TODO: add kde agent
|
|
||||||
default = "";
|
|
||||||
description = "Type of polkit agent module to use";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
systemd.user.services = {
|
systemd.user.services = {
|
||||||
polkit-pantheon-authentication-agent-1 = mkIf (elem cfg ["pantheon"]) {
|
polkit-pantheon-authentication-agent-1 = mkIf (polkit == "pantheon") {
|
||||||
Unit.Description = "polkit-pantheon-authentication-agent-1";
|
Unit.Description = "polkit-pantheon-authentication-agent-1";
|
||||||
|
|
||||||
Install = {
|
Install = {
|
||||||
|
|
@ -33,7 +26,7 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
polkit-gnome-authentication-agent-1 = mkIf (elem cfg ["gnome"]) {
|
polkit-gnome-authentication-agent-1 = mkIf (polkit == "gnome") {
|
||||||
Unit.Description = "polkit-pantheon-authentication-agent-1";
|
Unit.Description = "polkit-pantheon-authentication-agent-1";
|
||||||
Install = {
|
Install = {
|
||||||
WantedBy = [ "graphical-session.target" ];
|
WantedBy = [ "graphical-session.target" ];
|
||||||
|
|
|
||||||
14
home/modules/options/desktop/security.nix
Normal file
14
home/modules/options/desktop/security.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkOption types;
|
||||||
|
inherit (types) nullOr enum;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
options.ooknet.security.polkit = mkOption {
|
||||||
|
type = nullOr (enum ["gnome" "pantheon"]); # TODO: add kde agent
|
||||||
|
default = "gnome";
|
||||||
|
description = "Type of polkit agent module to use";
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue