mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-14 12:48:42 +00:00
security: add enableAccessibilityAccess option
This commit is contained in:
parent
aebf57d677
commit
fa843a70ca
3 changed files with 9 additions and 15 deletions
modules
|
@ -15,6 +15,12 @@ in
|
||||||
|
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
|
security.enableAccessibilityAccess = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Wether to configure programs that are allowed control through the accessibility APIs.";
|
||||||
|
};
|
||||||
|
|
||||||
security.accessibilityPrograms = mkOption {
|
security.accessibilityPrograms = mkOption {
|
||||||
type = types.listOf types.path;
|
type = types.listOf types.path;
|
||||||
default = [];
|
default = [];
|
||||||
|
@ -25,7 +31,7 @@ in
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
system.activationScripts.accessibility.text = ''
|
system.activationScripts.accessibility.text = mkIf cfg.enableAccessibilityAccess ''
|
||||||
# Set up programs that require accessibility permissions
|
# Set up programs that require accessibility permissions
|
||||||
echo "setting up accessibility programs..." >&2
|
echo "setting up accessibility programs..." >&2
|
||||||
|
|
||||||
|
|
|
@ -25,12 +25,6 @@ in
|
||||||
description = "This option specifies the khd package to use.";
|
description = "This option specifies the khd package to use.";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.khd.enableAccessibilityAccess = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "Whether to enable accessibility permissions for the khd daemon.";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.khd.khdConfig = mkOption {
|
services.khd.khdConfig = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = "";
|
default = "";
|
||||||
|
@ -48,7 +42,7 @@ in
|
||||||
|
|
||||||
services.khd.khdConfig = mkIf cfg.i3Keybindings i3Config;
|
services.khd.khdConfig = mkIf cfg.i3Keybindings i3Config;
|
||||||
|
|
||||||
security.accessibilityPrograms = mkIf cfg.enableAccessibilityAccess [ "${cfg.package}/bin/khd" ];
|
security.accessibilityPrograms = [ "${cfg.package}/bin/khd" ];
|
||||||
|
|
||||||
environment.etc."khdrc".text = cfg.khdConfig;
|
environment.etc."khdrc".text = cfg.khdConfig;
|
||||||
|
|
||||||
|
|
|
@ -23,12 +23,6 @@ in
|
||||||
description = "This option specifies the kwm package to use";
|
description = "This option specifies the kwm package to use";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.kwm.enableAccessibilityAccess = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "Whether to enable accessibility permissions for the kwm daemon.";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.kwm.kwmConfig = mkOption {
|
services.kwm.kwmConfig = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = "";
|
default = "";
|
||||||
|
@ -38,7 +32,7 @@ in
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
security.accessibilityPrograms = mkIf cfg.enableAccessibilityAccess [ "${cfg.package}/kwm" ];
|
security.accessibilityPrograms = [ "${cfg.package}/kwm" ];
|
||||||
|
|
||||||
environment.etc."kwmrc".text = cfg.kwmConfig;
|
environment.etc."kwmrc".text = cfg.kwmConfig;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue