Add hyprland utilities
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
12
hosts/common/configs/brightnessctl/default.nix
Normal file
12
hosts/common/configs/brightnessctl/default.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [ brightnessctl ];
|
||||
|
||||
services.udev.extraRules = ''
|
||||
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils-full}/bin/chgrp video /sys/class/backlight/%k/brightness"
|
||||
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils-full}/bin/chmod g+w /sys/class/backlight/%k/brightness"
|
||||
ACTION=="add", SUBSYSTEM=="leds", RUN+="${pkgs.coreutils-full}/bin/chgrp input /sys/class/leds/%k/brightness"
|
||||
ACTION=="add", SUBSYSTEM=="leds", RUN+="${pkgs.coreutils-full}/bin/chmod g+w /sys/class/leds/%k/brightness"
|
||||
'';
|
||||
}
|
5
hosts/common/configs/btop/default.nix
Normal file
5
hosts/common/configs/btop/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [ btop ];
|
||||
}
|
5
hosts/common/configs/fastfetch/default.nix
Normal file
5
hosts/common/configs/fastfetch/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [ fastfetch ];
|
||||
}
|
5
hosts/common/configs/ranger/default.nix
Normal file
5
hosts/common/configs/ranger/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [ ranger ];
|
||||
}
|
5
hosts/common/configs/tree/default.nix
Normal file
5
hosts/common/configs/tree/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [ tree ];
|
||||
}
|
@@ -4,6 +4,7 @@
|
||||
imports = [
|
||||
./configs/persist
|
||||
./configs/sops
|
||||
./configs/brightnessctl
|
||||
./configs/pipewire
|
||||
./configs/zsh
|
||||
./configs/neovim
|
||||
@@ -12,6 +13,10 @@
|
||||
./configs/nix-ld
|
||||
./configs/git
|
||||
./configs/gpg-agent
|
||||
./configs/tree
|
||||
./configs/ranger
|
||||
./configs/btop
|
||||
./configs/fastfetch
|
||||
./scripts/cleanup
|
||||
];
|
||||
|
||||
@@ -32,13 +37,6 @@
|
||||
networking.networkmanager.enable = true;
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
tree
|
||||
ranger
|
||||
btop
|
||||
fastfetch
|
||||
];
|
||||
|
||||
users = {
|
||||
mutableUsers = false;
|
||||
defaultUserShell = pkgs.zsh;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
{ config, inputs, pkgs, ... }:
|
||||
{ config, inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
@@ -21,14 +21,7 @@
|
||||
./options/home-manager/theme
|
||||
];
|
||||
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
pavucontrol
|
||||
];
|
||||
|
||||
stateVersion = "24.05";
|
||||
};
|
||||
|
||||
home.stateVersion = "24.05";
|
||||
systemd.user.startServices = "sd-switch";
|
||||
nix.settings = config.nix.settings;
|
||||
}];
|
||||
|
@@ -7,6 +7,11 @@ let
|
||||
runtimeInputs = with pkgs; [ coreutils-full ];
|
||||
bashOptions = [ "nounset" "pipefail" ];
|
||||
text = ''
|
||||
if [ -z "$WAYLAND_DISPLAY" ]; then
|
||||
echo "No Wayland session active. Exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
[ ! -L "${cfg.configDir}/wallpaper" ] && ln -sf "${cfg.wallpaper}" "${cfg.configDir}/wallpaper"
|
||||
[ ! -f "${cfg.configDir}/mode" ] && echo "${cfg.mode}" > "${cfg.configDir}/mode"
|
||||
|
||||
|
10
users/configs/brightnessctl/default.nix
Normal file
10
users/configs/brightnessctl/default.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ user ? throw "user argument is required" }: { pkgs, ... }:
|
||||
|
||||
{
|
||||
home-manager.users."${user.name}" = {
|
||||
wayland.windowManager.hyprland.settings.bindle = [
|
||||
", XF86MonBrightnessUp, exec, ${pkgs.brightnessctl}/bin/brightnessctl -q s 5%+"
|
||||
", XF86MonBrightnessDown, exec, ${pkgs.brightnessctl}/bin/brightnessctl -q s 5%-"
|
||||
];
|
||||
};
|
||||
}
|
@@ -88,6 +88,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland.settings.bind = [
|
||||
"$mod, b, exec, ${pkgs.firefox}/bin/firefox"
|
||||
];
|
||||
|
||||
home.persistence = {
|
||||
"/persist${user.home}".directories = [ ".mozilla" ];
|
||||
"/cache${user.home}".directories = [ ".cache/mozilla" ];
|
||||
|
@@ -32,7 +32,7 @@ in
|
||||
theme.extraConfig = let name = "theme-gtk"; in
|
||||
"${pkgs.writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = with pkgs; [ glib ];
|
||||
runtimeInputs = with pkgs; [ dconf ];
|
||||
text = ''
|
||||
MODE=$(cat "${hmConfig.theme.configDir}/mode")
|
||||
|
||||
@@ -42,8 +42,8 @@ in
|
||||
GTK_THEME="adw-gtk3-dark"
|
||||
fi
|
||||
|
||||
gsettings set org.gnome.desktop.interface gtk-theme "$GTK_THEME"
|
||||
gsettings set org.gnome.desktop.interface color-scheme "prefer-$MODE"
|
||||
dconf write /org/gnome/desktop/interface/gtk-theme "'$GTK_THEME'"
|
||||
dconf write /org/gnome/desktop/interface/color-scheme "'prefer-$MODE'"
|
||||
'';
|
||||
}}/bin/${name} &";
|
||||
};
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
@define-color accent_bg_color {{colors.primary_container.default.hex}};
|
||||
@define-color accent_fg_color {{colors.on_primary.default.hex}};
|
||||
@define-color accent_color @accent_bg_color;
|
||||
@define-color accent_color {{colors.primary.default.hex}};
|
||||
|
||||
@define-color headerbar_bg_color @window_bg_color;
|
||||
@define-color headerbar_fg_color @window_fg_color;
|
||||
@@ -30,19 +30,19 @@
|
||||
|
||||
@define-color warning_bg_color {{colors.warning_container.default.hex}};
|
||||
@define-color warning_fg_color {{colors.on_warning.default.hex}};
|
||||
@define-color warning_color @warning_bg_color;
|
||||
@define-color warning_color {{colors.warning.default.hex}};
|
||||
|
||||
@define-color error_bg_color {{colors.error_container.default.hex}};
|
||||
@define-color error_fg_color {{colors.on_error.default.hex}};
|
||||
@define-color error_color @error_bg_color;
|
||||
@define-color error_color {{colors.error.default.hex}};
|
||||
|
||||
@define-color success_bg_color {{colors.success_container.default.hex}};
|
||||
@define-color success_fg_color {{colors.on_success.default.hex}};
|
||||
@define-color success_color @success_bg_color;
|
||||
@define-color success_color {{colors.success.default.hex}};
|
||||
|
||||
@define-color destructive_bg_color {{colors.danger_container.default.hex}};
|
||||
@define-color destructive_fg_color {{colors.on_danger.default.hex}};
|
||||
@define-color destructive_color @destructive_bg_color;
|
||||
@define-color destructive_color {{colors.danger.default.hex}};
|
||||
|
||||
@panel_bg_color @window_bg_color
|
||||
@panel_fg_color @window_fg_color
|
||||
@define-color panel_bg_color @window_bg_color;
|
||||
@define-color panel_fg_color @window_fg_color;
|
||||
|
@@ -1,8 +1,5 @@
|
||||
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }:
|
||||
{ user ? throw "user argument is required" }: { lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
hmConfig = config.home-manager.users."${user.name}";
|
||||
in
|
||||
{
|
||||
programs.hyprland.enable = true;
|
||||
|
||||
@@ -15,9 +12,8 @@ in
|
||||
|
||||
bind = [
|
||||
"$mod, Return, exec, $term"
|
||||
"$mod, r, exec, ${pkgs.rofi-wayland}/bin/rofi -cache-dir ${hmConfig.xdg.cacheHome}/rofi -show drun"
|
||||
"$mod, b, exec, ${pkgs.firefox}/bin/firefox"
|
||||
|
||||
"$mod, `, togglespecialworkspace"
|
||||
"$mod, 1, workspace, 1"
|
||||
"$mod, 2, workspace, 2"
|
||||
"$mod, 3, workspace, 3"
|
||||
@@ -29,6 +25,7 @@ in
|
||||
"$mod, 9, workspace, 9"
|
||||
"$mod, 0, workspace, 10"
|
||||
|
||||
"$mod_SHIFT, `, movetoworkspacesilent, special"
|
||||
"$mod_SHIFT, 1, movetoworkspacesilent, 1"
|
||||
"$mod_SHIFT, 2, movetoworkspacesilent, 2"
|
||||
"$mod_SHIFT, 3, movetoworkspacesilent, 3"
|
||||
@@ -75,6 +72,7 @@ in
|
||||
"$mod_SHIFT, Tab, bringactivetotop"
|
||||
|
||||
"$mod, f, fullscreen, 0"
|
||||
"$mod, m, fullscreen, 1"
|
||||
"$mod, p, pin"
|
||||
"$mod, Space, togglefloating"
|
||||
"$mod, Space, centerwindow"
|
||||
@@ -100,7 +98,7 @@ in
|
||||
};
|
||||
|
||||
programs.zsh.loginExtra = lib.mkAfter ''
|
||||
if [ -z "''${WAYLAND_DISPLAY}" ] && [ -n "''${XDG_VTNR}" ] && [ "''${XDG_VTNR}" -eq 1 ]; then
|
||||
if [ -z "$WAYLAND_DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then
|
||||
hyprland &> /tmp/hyprland.log
|
||||
fi
|
||||
'';
|
||||
|
5
users/configs/pavucontrol/default.nix
Normal file
5
users/configs/pavucontrol/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ user ? throw "user argument is required" }: { pkgs, ... }:
|
||||
|
||||
{
|
||||
home-manager.users."${user.name}".home.packages = with pkgs; [ pavucontrol ];
|
||||
}
|
19
users/configs/pipewire/default.nix
Normal file
19
users/configs/pipewire/default.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ user ? throw "user argument is required" }: { pkgs, ... }:
|
||||
|
||||
{
|
||||
home-manager.users."${user.name}" = {
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
bindle = [
|
||||
", XF86AudioRaiseVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ -l 2.0 2%+"
|
||||
", XF86AudioLowerVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ -l 2.0 2%-"
|
||||
"CTRL, XF86AudioRaiseVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SOURCE@ -l 1.0 2%+"
|
||||
"CTRL, XF86AudioLowerVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SOURCE@ -l 1.0 2%-"
|
||||
];
|
||||
|
||||
bindl = [
|
||||
", XF86AudioMute, exec, ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
", XF86AudioMicMute, exec, ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
17
users/configs/playerctl/default.nix
Normal file
17
users/configs/playerctl/default.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{ user ? throw "user argument is required" }: { pkgs, ... }:
|
||||
|
||||
{
|
||||
home-manager.users."${user.name}" = {
|
||||
home.packages = with pkgs; [ playerctl ];
|
||||
services.playerctld.enable = true;
|
||||
|
||||
wayland.windowManager.hyprland.settings.bindle = [
|
||||
", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause"
|
||||
", XF86AudioStop, exec, ${pkgs.playerctl}/bin/playerctl stop"
|
||||
", XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl next"
|
||||
", XF86AudioPrev, exec, ${pkgs.playerctl}/bin/playerctl previous"
|
||||
"CTRL, XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl position 10+"
|
||||
"CTRL, XF86AudioPrev, exec, ${pkgs.playerctl}/bin/playerctl position 10-"
|
||||
];
|
||||
};
|
||||
}
|
11
users/configs/qalculate/default.nix
Normal file
11
users/configs/qalculate/default.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{ user ? throw "user argument is required" }: { config, pkgs, ... }:
|
||||
|
||||
{
|
||||
home-manager.users."${user.name}" = {
|
||||
home.packages = with pkgs; [ qalculate-gtk ];
|
||||
|
||||
wayland.windowManager.hyprland.settings.bind = [
|
||||
", XF86Calculator, exec, ${pkgs.qalculate-gtk}/bin/qalculate-gtk"
|
||||
];
|
||||
};
|
||||
}
|
@@ -9,5 +9,9 @@ in
|
||||
packages = with pkgs; [ rofi-wayland ];
|
||||
persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/rofi" ];
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland.settings.bind = [
|
||||
"$mod, r, exec, ${pkgs.rofi-wayland}/bin/rofi -cache-dir ${hmConfig.xdg.cacheHome}/rofi -show drun"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
{ user ? throw "user argument is required" }: { config, pkgs, ... }:
|
||||
{ user ? throw "user argument is required" }: { config, inputs, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
hmConfig = config.home-manager.users."${user.name}";
|
||||
@@ -6,7 +6,24 @@ in
|
||||
{
|
||||
home-manager.users."${user.name}" = {
|
||||
theme.enable = true;
|
||||
wayland.windowManager.hyprland.initExtraConfig = "${hmConfig.theme.pkg}/bin/theme &";
|
||||
home.persistence."/persist${user.home}".directories = [ "${hmConfig.xdg.relativeConfigHome}/theme" ];
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
initExtraConfig = ''
|
||||
${hmConfig.theme.pkg}/bin/theme &
|
||||
'';
|
||||
|
||||
settings.bind = [
|
||||
"CTRL_ALT, r, exec, ${hmConfig.theme.pkg}/bin/theme"
|
||||
"CTRL_ALT, t, exec, ${hmConfig.theme.pkg}/bin/theme toggle"
|
||||
];
|
||||
};
|
||||
|
||||
home = {
|
||||
activation.themeInit = inputs.home-manager.lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
run ${hmConfig.theme.pkg}/bin/theme
|
||||
'';
|
||||
|
||||
persistence."/persist${user.home}".directories = [ "${hmConfig.xdg.relativeConfigHome}/theme" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
5
users/configs/wev/default.nix
Normal file
5
users/configs/wev/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ user ? throw "user argument is required" }: { pkgs, ... }:
|
||||
|
||||
{
|
||||
home-manager.users."${user.name}".home.packages = with pkgs; [ wev ];
|
||||
}
|
@@ -10,12 +10,18 @@ in
|
||||
(import ../configs/matugen { inherit user; })
|
||||
(import ../configs/firefox { inherit user; })
|
||||
(import ../configs/hyprland { inherit user; })
|
||||
(import ../configs/wev { inherit user; })
|
||||
(import ../configs/brightnessctl { inherit user; })
|
||||
(import ../configs/pavucontrol { inherit user; })
|
||||
(import ../configs/pipewire { inherit user; })
|
||||
(import ../configs/playerctl { inherit user; })
|
||||
(import ../configs/rofi { inherit user; })
|
||||
(import ../configs/swww { inherit user; })
|
||||
(import ../configs/kitty { inherit user; })
|
||||
(import ../configs/vscode { inherit user; })
|
||||
(import ../configs/gtk { inherit user; })
|
||||
(import ../configs/x { inherit user; })
|
||||
(import ../configs/vscode { inherit user; })
|
||||
(import ../configs/qalculate { inherit user; })
|
||||
];
|
||||
|
||||
home-manager.users.nick = {
|
||||
|
@@ -25,7 +25,7 @@ in
|
||||
fullName = "Nikolaos Karaolidis";
|
||||
description = user.fullName;
|
||||
hashedPasswordFile = config.sops.secrets.nick-password.path;
|
||||
extraGroups = [ "wheel" ];
|
||||
extraGroups = [ "wheel" "video" ];
|
||||
linger = true;
|
||||
uid = 1000;
|
||||
};
|
||||
|
Reference in New Issue
Block a user