feat(nixos): finish Zeus desktop onboarding #9
@@ -1,4 +1,9 @@
|
|||||||
{ lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
# zeus — Ryzen desktop with AMD graphics.
|
# zeus — Ryzen desktop with AMD graphics.
|
||||||
# Disk layout is in ./disk.nix.
|
# Disk layout is in ./disk.nix.
|
||||||
# `fileSystems` are derived from it, none declared here.
|
# `fileSystems` are derived from it, none declared here.
|
||||||
@@ -43,7 +48,14 @@
|
|||||||
|
|
||||||
modules.desktop.enable = true;
|
modules.desktop.enable = true;
|
||||||
modules.desktop.apps.obsidian.enable = true;
|
modules.desktop.apps.obsidian.enable = true;
|
||||||
|
modules.desktop.apps.signal.enable = true;
|
||||||
modules.desktop.apps.steam.enable = true;
|
modules.desktop.apps.steam.enable = true;
|
||||||
|
modules.desktop.apps.vencord.enable = true;
|
||||||
|
|
||||||
|
home-manager.users.${config.user.name}.wayland.windowManager.hyprland.settings.monitor = [
|
||||||
|
"HDMI-A-1,1920x1080@120,0x0,1,transform,3"
|
||||||
|
"DP-3,2560x1440@239.96,1080x0,1"
|
||||||
|
];
|
||||||
|
|
||||||
time.timeZone = "America/New_York";
|
time.timeZone = "America/New_York";
|
||||||
i18n.defaultLocale = "en_GB.UTF-8";
|
i18n.defaultLocale = "en_GB.UTF-8";
|
||||||
|
|||||||
18
configs/nixos/modules/desktop/apps/signal.nix
Normal file
18
configs/nixos/modules/desktop/apps/signal.nix
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
# Signal desktop messenger.
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.apps.signal;
|
||||||
|
user = config.user.name;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.modules.desktop.apps.signal.enable = lib.mkEnableOption "Signal desktop messenger";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home-manager.users.${user}.home.packages = [ pkgs.signal-desktop ];
|
||||||
|
};
|
||||||
|
}
|
||||||
18
configs/nixos/modules/desktop/apps/vencord.nix
Normal file
18
configs/nixos/modules/desktop/apps/vencord.nix
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
# Vesktop, a Discord client with Vencord built in.
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.apps.vencord;
|
||||||
|
user = config.user.name;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.modules.desktop.apps.vencord.enable = lib.mkEnableOption "Vesktop, a Discord client with Vencord built in";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home-manager.users.${user}.home.packages = [ pkgs.vesktop ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -47,6 +47,38 @@ let
|
|||||||
printf '{"text":"","class":"idle"}\n'
|
printf '{"text":"","class":"idle"}\n'
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
networkStatus = pkgs.writeShellScript "waybar-network-status" ''
|
||||||
|
active=$(
|
||||||
|
${pkgs.networkmanager}/bin/nmcli -t -f DEVICE,TYPE,STATE,CONNECTION device status \
|
||||||
|
| ${pkgs.gawk}/bin/awk -F: '$3 == "connected" && $2 != "loopback" { print; exit }'
|
||||||
|
)
|
||||||
|
|
||||||
|
if [ -z "$active" ]; then
|
||||||
|
${pkgs.jq}/bin/jq -cn \
|
||||||
|
--arg text "${g "f127"} off" \
|
||||||
|
--arg tooltip "Network disconnected" \
|
||||||
|
--arg class "disconnected" \
|
||||||
|
'{ text: $text, tooltip: $tooltip, class: $class }'
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
IFS=: read -r device type _state connection <<< "$active"
|
||||||
|
|
||||||
|
case "$type" in
|
||||||
|
wifi) icon="${g "f1eb"}" ;;
|
||||||
|
ethernet) icon="LAN" ;;
|
||||||
|
*) icon="NET" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
ipaddr=$(${pkgs.iproute2}/bin/ip -4 -o addr show dev "$device" | ${pkgs.gawk}/bin/awk '{ print $4; exit }')
|
||||||
|
|
||||||
|
${pkgs.jq}/bin/jq -cn \
|
||||||
|
--arg text "$icon $connection" \
|
||||||
|
--arg tooltip "$device: ''${ipaddr:-no IPv4}" \
|
||||||
|
--arg class "$type" \
|
||||||
|
'{ text: $text, tooltip: $tooltip, class: $class }'
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.modules.desktop.session.waybar.enable = lib.mkEnableOption "the Waybar status bar";
|
options.modules.desktop.session.waybar.enable = lib.mkEnableOption "the Waybar status bar";
|
||||||
@@ -63,10 +95,21 @@ in
|
|||||||
# so the bar comes up with the session and no compositor exec-once.
|
# so the bar comes up with the session and no compositor exec-once.
|
||||||
systemd.enable = true;
|
systemd.enable = true;
|
||||||
|
|
||||||
|
style = ''
|
||||||
|
.modules-right {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#custom-dnd {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
settings.mainBar = {
|
settings.mainBar = {
|
||||||
layer = "top";
|
layer = "top";
|
||||||
position = "top";
|
position = "top";
|
||||||
height = 30;
|
height = 30;
|
||||||
|
spacing = 8;
|
||||||
|
|
||||||
modules-left = [ "hyprland/workspaces" ];
|
modules-left = [ "hyprland/workspaces" ];
|
||||||
modules-center = [ "clock" ];
|
modules-center = [ "clock" ];
|
||||||
@@ -75,7 +118,7 @@ in
|
|||||||
"custom/idle-lock"
|
"custom/idle-lock"
|
||||||
"mpris"
|
"mpris"
|
||||||
"wireplumber"
|
"wireplumber"
|
||||||
"network"
|
"custom/network"
|
||||||
"battery"
|
"battery"
|
||||||
"custom/dnd"
|
"custom/dnd"
|
||||||
];
|
];
|
||||||
@@ -94,7 +137,9 @@ in
|
|||||||
"class<chromium.*>" = g "f268";
|
"class<chromium.*>" = g "f268";
|
||||||
"class<[Cc]ode>" = g "f121";
|
"class<[Cc]ode>" = g "f121";
|
||||||
"class<obsidian>" = g "f02d";
|
"class<obsidian>" = g "f02d";
|
||||||
|
"class<[Ss]ignal>" = g "f4ad";
|
||||||
"class<[Ss]team>" = g "f1b6";
|
"class<[Ss]team>" = g "f1b6";
|
||||||
|
"class<[Vv]esktop>" = g "f1ff";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -128,11 +173,10 @@ in
|
|||||||
on-click = "${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
on-click = "${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||||
};
|
};
|
||||||
|
|
||||||
network = {
|
"custom/network" = {
|
||||||
format-wifi = "${g "f1eb"} {essid}";
|
return-type = "json";
|
||||||
format-ethernet = "${g "f796"} {ifname}";
|
exec = "${networkStatus}";
|
||||||
format-disconnected = "${g "f127"} off";
|
interval = 5;
|
||||||
tooltip-format = "{ipaddr} via {gwaddr}";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
battery = {
|
battery = {
|
||||||
|
|||||||
Reference in New Issue
Block a user