Compare commits
3 commits
1faa8d9acf
...
b679280fea
| Author | SHA1 | Date | |
|---|---|---|---|
| b679280fea | |||
| f47e66c28f | |||
| 33b94a7f9d |
3 changed files with 47 additions and 2 deletions
|
|
@ -28,6 +28,13 @@
|
|||
nm-applet.enable = true;
|
||||
# Terminal
|
||||
terminal.program = "alacritty";
|
||||
# WM configuration
|
||||
wm = {
|
||||
i3bar = {
|
||||
# Show VPN blocks
|
||||
vpn.enable = true;
|
||||
};
|
||||
};
|
||||
# Zathura document viewer
|
||||
zathura.enable = true;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -36,6 +36,31 @@ in
|
|||
|
||||
i3bar = {
|
||||
enable = mkRelatedOption "i3bar configuration" [ "i3" ];
|
||||
|
||||
vpn = {
|
||||
enable = mkEnableOption "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";
|
||||
}
|
||||
];
|
||||
description = "list of block configurations, merged with the defauls";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
rofi = {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ in
|
|||
top = {
|
||||
icons = "awesome5";
|
||||
|
||||
blocks = builtins.filter (attr: attr != { }) [
|
||||
blocks = builtins.filter (attr: attr != { }) (lib.flatten [
|
||||
{
|
||||
block = "music";
|
||||
# This format seems to remove the block when not playing, somehow
|
||||
|
|
@ -59,6 +59,19 @@ in
|
|||
{
|
||||
block = "disk_space";
|
||||
}
|
||||
(lib.optionals cfg.vpn.enable
|
||||
(
|
||||
let
|
||||
defaults = {
|
||||
block = "service_status";
|
||||
active_state = "Good";
|
||||
inactive_format = "";
|
||||
inactive_state = "Idle";
|
||||
};
|
||||
in
|
||||
builtins.map (block: defaults // block) cfg.vpn.blockConfigs
|
||||
)
|
||||
)
|
||||
{
|
||||
block = "net";
|
||||
format = " $icon{| $ssid|} $ip{| $signal_strength|} ";
|
||||
|
|
@ -92,7 +105,7 @@ in
|
|||
format = " $icon $timestamp.datetime(f:'%F %T') ";
|
||||
interval = 5;
|
||||
}
|
||||
];
|
||||
]);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue