2021-04-06 19:20:39 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2021-04-05 23:27:20 +02:00
|
|
|
let
|
|
|
|
mkRelatedOption = description: relatedWMs:
|
|
|
|
let
|
|
|
|
isActivatedWm = wm: config.my.home.wm.windowManager == wm;
|
|
|
|
in
|
|
|
|
(lib.mkEnableOption description) // {
|
|
|
|
default = builtins.any isActivatedWm relatedWMs;
|
|
|
|
};
|
|
|
|
in
|
2021-04-02 21:03:29 +02:00
|
|
|
{
|
|
|
|
imports = [
|
2022-06-10 16:19:44 +02:00
|
|
|
./cursor
|
2021-09-25 15:29:07 +02:00
|
|
|
./dunst
|
|
|
|
./i3
|
|
|
|
./i3bar
|
|
|
|
./rofi
|
|
|
|
./screen-lock
|
2021-04-02 21:03:29 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
options.my.home.wm = with lib; {
|
|
|
|
windowManager = mkOption {
|
|
|
|
type = with types; nullOr (enum [ "i3" ]);
|
|
|
|
default = null;
|
|
|
|
example = "i3";
|
|
|
|
description = "Which window manager to use for home session";
|
|
|
|
};
|
2021-04-05 23:27:20 +02:00
|
|
|
|
2022-06-10 16:19:44 +02:00
|
|
|
cursor = {
|
|
|
|
enable = mkRelatedOption "dunst configuration" [ "i3" ];
|
|
|
|
};
|
|
|
|
|
2021-04-06 17:52:41 +02:00
|
|
|
dunst = {
|
|
|
|
enable = mkRelatedOption "dunst configuration" [ "i3" ];
|
|
|
|
};
|
|
|
|
|
2021-04-05 23:27:20 +02:00
|
|
|
i3bar = {
|
|
|
|
enable = mkRelatedOption "i3bar configuration" [ "i3" ];
|
2023-12-14 12:42:03 +01:00
|
|
|
|
|
|
|
vpn = {
|
|
|
|
enable = my.mkDisableOption "VPN configuration";
|
|
|
|
|
|
|
|
blockConfigs = mkOption {
|
|
|
|
type = with types; listOf (attrsOf str);
|
|
|
|
default = [
|
|
|
|
{
|
|
|
|
active_format = " VPN ";
|
|
|
|
service = "wg-quick-wg";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
active_format = " VPN (LAN) ";
|
|
|
|
service = "wg-quick-lan";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
example = [
|
|
|
|
{
|
|
|
|
active_format = " WORK ";
|
|
|
|
service = "some-service-name";
|
|
|
|
}
|
|
|
|
];
|
2024-09-27 15:48:26 +02:00
|
|
|
description = "list of block configurations, merged with the defaults";
|
2023-12-14 12:42:03 +01:00
|
|
|
};
|
|
|
|
};
|
2021-04-05 23:27:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
rofi = {
|
|
|
|
enable = mkRelatedOption "rofi menu" [ "i3" ];
|
|
|
|
};
|
2021-04-06 19:20:39 +02:00
|
|
|
|
|
|
|
screen-lock = {
|
|
|
|
enable = mkRelatedOption "automatic X screen locker" [ "i3" ];
|
|
|
|
|
|
|
|
command = mkOption {
|
|
|
|
type = types.str;
|
2023-07-23 19:58:40 +02:00
|
|
|
default = "${lib.getExe pkgs.i3lock} -n -c 000000";
|
|
|
|
example = "\${lib.getExe pkgs.i3lock} -n -i lock.png";
|
2021-04-06 19:20:39 +02:00
|
|
|
description = "Locker command to run";
|
|
|
|
};
|
|
|
|
|
2021-04-19 18:17:57 +02:00
|
|
|
cornerLock = {
|
|
|
|
enable = my.mkDisableOption ''
|
|
|
|
Move mouse to upper-left corner to lock instantly, lower-right corner to
|
|
|
|
disable auto-lock.
|
|
|
|
'';
|
|
|
|
|
|
|
|
delay = mkOption {
|
|
|
|
type = types.int;
|
|
|
|
default = 5;
|
|
|
|
example = 15;
|
|
|
|
description = "How many seconds before locking this way";
|
|
|
|
};
|
|
|
|
};
|
2021-04-06 19:54:26 +02:00
|
|
|
|
2021-04-19 18:44:28 +02:00
|
|
|
notify = {
|
|
|
|
enable = my.mkDisableOption "Notify when about to lock the screen";
|
|
|
|
|
|
|
|
delay = mkOption {
|
2021-06-15 17:45:17 +02:00
|
|
|
type = types.int;
|
2021-04-19 18:44:28 +02:00
|
|
|
default = 5;
|
|
|
|
example = 15;
|
|
|
|
description = ''
|
|
|
|
How many seconds in advance should there be a notification.
|
|
|
|
This value must be at lesser than or equal to `cornerLock.delay`
|
|
|
|
when both options are enabled.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2021-04-06 19:54:26 +02:00
|
|
|
|
2021-04-06 19:20:39 +02:00
|
|
|
timeout = mkOption {
|
|
|
|
type = types.ints.between 1 60;
|
2022-01-07 08:52:30 +01:00
|
|
|
default = 15;
|
2021-04-06 19:20:39 +02:00
|
|
|
example = 1;
|
|
|
|
description = "Inactive time interval to lock the screen automatically";
|
|
|
|
};
|
|
|
|
};
|
2021-04-02 21:03:29 +02:00
|
|
|
};
|
|
|
|
}
|