More refactoring and added hyprlock
This commit is contained in:
@@ -81,8 +81,8 @@ case ${chosen} in
|
|||||||
$lock)
|
$lock)
|
||||||
if command -v i3lock-color; then
|
if command -v i3lock-color; then
|
||||||
i3lock-color -c 808F85 && sleep 1
|
i3lock-color -c 808F85 && sleep 1
|
||||||
# elif command -v betterlockscreen; then
|
elif command -v hyprlock; then
|
||||||
# betterlockscreen -l
|
hyprlock
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
$suspend)
|
$suspend)
|
||||||
|
|||||||
@@ -68,10 +68,12 @@ in
|
|||||||
# - Desktop ----------------------------------
|
# - Desktop ----------------------------------
|
||||||
desktop = {
|
desktop = {
|
||||||
inherit wallpaper;
|
inherit wallpaper;
|
||||||
env.grapheio.enable = true;
|
|
||||||
wm.hyprland = {
|
# Use Γραφείο (custom) desktop environment
|
||||||
kb_layout = "es,gr";
|
grapheio.enable = true;
|
||||||
};
|
|
||||||
|
# Add greek keyboard layout
|
||||||
|
wm.hyprland.kb_layout = "es,gr";
|
||||||
};
|
};
|
||||||
|
|
||||||
# - Editors and development ------------------
|
# - Editors and development ------------------
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
cfg = config.samfelag.modules.desktop.env.grapheio;
|
cfg = config.samfelag.modules.desktop.grapheio;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.samfelag.modules.desktop.env.grapheio = {
|
options.samfelag.modules.desktop.grapheio = {
|
||||||
enable = mkEnableOption "Grapheio desktop environment - hyprland based";
|
enable = mkEnableOption "Γραφείο desktop environment - hyprland based";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
@@ -14,33 +14,11 @@ in
|
|||||||
# - Packages ---------------------------------
|
# - Packages ---------------------------------
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# - System ---------------------------------
|
|
||||||
# - Audio
|
|
||||||
alsa-utils
|
|
||||||
playerctl
|
|
||||||
brightnessctl
|
|
||||||
|
|
||||||
# - Appearance -----------------------------
|
# - Appearance -----------------------------
|
||||||
# - Cursor
|
# - Cursor
|
||||||
inputs.hyprcursor-rose-pine.packages.${pkgs.system}.default
|
inputs.hyprcursor-rose-pine.packages.${pkgs.system}.default
|
||||||
# - Wallpaper
|
|
||||||
hyprpaper
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# - Audio ------------------------------------
|
|
||||||
|
|
||||||
services = {
|
|
||||||
pipewire = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# - Hyprpaper --------------------------------
|
|
||||||
hm.xdg.configFile."hypr/hyprpaper.conf".text = ''
|
|
||||||
preload = ${config.samfelag.modules.desktop.wallpaper}
|
|
||||||
wallpaper = ,${config.samfelag.modules.desktop.wallpaper}
|
|
||||||
'';
|
|
||||||
|
|
||||||
# - Cursor -----------------------------------
|
# - Cursor -----------------------------------
|
||||||
hm.home.pointerCursor = {
|
hm.home.pointerCursor = {
|
||||||
gtk.enable = true;
|
gtk.enable = true;
|
||||||
@@ -61,26 +39,30 @@ in
|
|||||||
|
|
||||||
samfelag.modules = {
|
samfelag.modules = {
|
||||||
|
|
||||||
|
system.audio.enable = true;
|
||||||
|
system.kanata.enable = true;
|
||||||
|
|
||||||
desktop = {
|
desktop = {
|
||||||
# Window Manager
|
# Window Manager
|
||||||
wm.hyprland.enable = true;
|
wm.hyprland.enable = true;
|
||||||
|
|
||||||
|
tools = {
|
||||||
# Greeter (login screen)
|
# Greeter (login screen)
|
||||||
greeter.greetd = {
|
greetd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wm_cmd = "Hyprland";
|
wm_cmd = "Hyprland";
|
||||||
};
|
};
|
||||||
|
# Locker
|
||||||
tools = {
|
hyprlock.enable = true;
|
||||||
# Status bars
|
# Status bars
|
||||||
eww.enable = true;
|
eww.enable = true;
|
||||||
# Launcher
|
# Launcher
|
||||||
rofi.enable = true;
|
rofi.enable = true;
|
||||||
|
# Wallpapper
|
||||||
|
hyprpaper.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
system.kanata.enable = true;
|
|
||||||
|
|
||||||
app = {
|
app = {
|
||||||
alacritty.enable = true;
|
alacritty.enable = true;
|
||||||
firefox.enable = true;
|
firefox.enable = true;
|
||||||
@@ -3,9 +3,6 @@
|
|||||||
let
|
let
|
||||||
cfg = config.samfelag.modules.desktop.tools.eww;
|
cfg = config.samfelag.modules.desktop.tools.eww;
|
||||||
hyprCfg = config.samfelag.modules.desktop.wm.hyprland;
|
hyprCfg = config.samfelag.modules.desktop.wm.hyprland;
|
||||||
# Paths
|
|
||||||
paths = {
|
|
||||||
};
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
options.samfelag.modules.desktop.tools.eww = {
|
options.samfelag.modules.desktop.tools.eww = {
|
||||||
@@ -29,6 +26,11 @@ in {
|
|||||||
hm.xdg.configFile."eww/widgets".source = ../../../config/eww/widgets;
|
hm.xdg.configFile."eww/widgets".source = ../../../config/eww/widgets;
|
||||||
hm.xdg.configFile."eww/scripts".source = ../../../config/eww/scripts;
|
hm.xdg.configFile."eww/scripts".source = ../../../config/eww/scripts;
|
||||||
|
|
||||||
|
# - Execute on startup -----------------------
|
||||||
|
hm.wayland.windowManager.hyprland.settings.exec-once = lib.mkIf hyprCfg.enable [
|
||||||
|
"eww open top-bar"
|
||||||
|
];
|
||||||
|
|
||||||
# - Themeing ---------------------------------
|
# - Themeing ---------------------------------
|
||||||
hm.xdg.configFile."eww/colour-scheme.scss".text = ''
|
hm.xdg.configFile."eww/colour-scheme.scss".text = ''
|
||||||
$base00: #${config.colorScheme.palette.base00};
|
$base00: #${config.colorScheme.palette.base00};
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
{ inputs, config, lib, pkgs, ... }:
|
{ inputs, config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.samfelag.modules.desktop.greeter.greetd;
|
cfg = config.samfelag.modules.desktop.tools.greetd;
|
||||||
in {
|
in {
|
||||||
|
|
||||||
options.samfelag.modules.desktop.greeter.greetd = with lib; {
|
options.samfelag.modules.desktop.tools.greetd = with lib; {
|
||||||
enable = mkEnableOption "Greetd based greeter";
|
enable = mkEnableOption "Greetd based greeter";
|
||||||
wm_cmd = lib.my.mkOpt' types.str "" "Window manager command";
|
wm_cmd = lib.my.mkOpt' types.str "" "Window manager command";
|
||||||
};
|
};
|
||||||
66
modules/desktop/tools/hyprlock.nix
Normal file
66
modules/desktop/tools/hyprlock.nix
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
{ config, lib, pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.samfelag.modules.desktop.tools.hyprlock;
|
||||||
|
hexToRGBString = inputs.nix-colors.lib-core.conversions.hexToRGBString ",";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.samfelag.modules.desktop.tools.hyprlock = {
|
||||||
|
enable = mkEnableOption "Hyprlock screen locker";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
hm.programs.hyprlock = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
general = {
|
||||||
|
# disable_loading_bar = true;
|
||||||
|
# grace = 5;
|
||||||
|
};
|
||||||
|
|
||||||
|
background = [
|
||||||
|
{
|
||||||
|
path = "${config.samfelag.modules.desktop.wallpaper}";
|
||||||
|
blur_passes = 2;
|
||||||
|
blur_size = 4;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
input-field = [
|
||||||
|
{
|
||||||
|
font_family = "Iosevka";
|
||||||
|
size = "300, 40";
|
||||||
|
position = "0, -80";
|
||||||
|
outline_thickness = 1;
|
||||||
|
fade_on_empty = "false";
|
||||||
|
placeholder_text = "";
|
||||||
|
|
||||||
|
outer_color = "rgba(${hexToRGBString config.colorScheme.palette.base02},0.9)";
|
||||||
|
inner_color = "rgba(${hexToRGBString config.colorScheme.palette.base00},0.9)";
|
||||||
|
font_color = "rgba(${hexToRGBString config.colorScheme.palette.base05},1.0)";
|
||||||
|
|
||||||
|
check_color = "rgba(${hexToRGBString config.colorScheme.palette.base07},1.0)";
|
||||||
|
fail_color = "rgba(${hexToRGBString config.colorScheme.palette.base06},1.0)";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
label = [
|
||||||
|
{
|
||||||
|
text = "$TIME";
|
||||||
|
color = "rgba(${hexToRGBString config.colorScheme.palette.base00},1.0)";
|
||||||
|
font_size = 25;
|
||||||
|
font_family = "Iosevka";
|
||||||
|
|
||||||
|
position = "0, 80";
|
||||||
|
halign = "center";
|
||||||
|
valign = "center";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
28
modules/desktop/tools/hyprpaper.nix
Normal file
28
modules/desktop/tools/hyprpaper.nix
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{ config, lib, pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.samfelag.modules.desktop.tools.hyprpaper;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.samfelag.modules.desktop.tools.hyprpaper = {
|
||||||
|
enable = mkEnableOption "Hyprpaper desktop wallpaper";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
hm.services.hyprpaper = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
preload = "${config.samfelag.modules.desktop.wallpaper}";
|
||||||
|
wallpaper = ",${config.samfelag.modules.desktop.wallpaper}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# - Execute on startup -----------------------
|
||||||
|
hm.wayland.windowManager.hyprland.settings.exec-once = [
|
||||||
|
"hyprpaper"
|
||||||
|
];
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -7,20 +7,13 @@ in {
|
|||||||
|
|
||||||
options.samfelag.modules.desktop.wm.hyprland = with lib; {
|
options.samfelag.modules.desktop.wm.hyprland = with lib; {
|
||||||
enable = mkEnableOption "hyprland window manager";
|
enable = mkEnableOption "hyprland window manager";
|
||||||
|
|
||||||
mod = my.mkOpt' types.str "Mod4" "Main modifier key for hyprland";
|
mod = my.mkOpt' types.str "Mod4" "Main modifier key for hyprland";
|
||||||
|
|
||||||
kb_layout = my.mkOpt' types.str "es" "Keyboard layout(s) for hyprland";
|
kb_layout = my.mkOpt' types.str "es" "Keyboard layout(s) for hyprland";
|
||||||
|
|
||||||
extraKeybindings = my.mkOpt (types.listOf types.str) [ ];
|
extraKeybindings = my.mkOpt (types.listOf types.str) [ ];
|
||||||
# extraStartup = my.mkOpt (types.listOf types.attrs) [ ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
];
|
|
||||||
|
|
||||||
# - Configuration -----------------------------
|
# - Configuration -----------------------------
|
||||||
|
|
||||||
# Hyprland config
|
# Hyprland config
|
||||||
@@ -31,11 +24,9 @@ in {
|
|||||||
|
|
||||||
hm.wayland.windowManager.hyprland = {
|
hm.wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
xwayland.enable = true;
|
|
||||||
|
|
||||||
package = pkgs.hyprland;
|
package = pkgs.hyprland;
|
||||||
# Optional
|
|
||||||
# Whether to enable hyprland-session.target on hyprland startup
|
xwayland.enable = true;
|
||||||
systemd.enable = true;
|
systemd.enable = true;
|
||||||
|
|
||||||
plugins = [
|
plugins = [
|
||||||
@@ -60,8 +51,6 @@ in {
|
|||||||
monitor = ",highres,auto,1";
|
monitor = ",highres,auto,1";
|
||||||
|
|
||||||
exec-once = [
|
exec-once = [
|
||||||
"hyprpaper"
|
|
||||||
"eww open top-bar"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
decoration = {
|
decoration = {
|
||||||
@@ -120,29 +109,11 @@ in {
|
|||||||
"${cfg.mod} SHIFT, 5, movetoworkspace, 5"
|
"${cfg.mod} SHIFT, 5, movetoworkspace, 5"
|
||||||
"${cfg.mod} SHIFT, 0, movetoworkspace, 6"
|
"${cfg.mod} SHIFT, 0, movetoworkspace, 6"
|
||||||
|
|
||||||
# - Media ------------------------------
|
|
||||||
|
|
||||||
# Pulse Audio controls (mute)
|
|
||||||
", XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle"
|
|
||||||
|
|
||||||
# Media player controls
|
|
||||||
", XF86AudioPlay, exec, playerctl play-pause"
|
|
||||||
", XF86AudioPause, exec, playerctl play-pause"
|
|
||||||
", XF86AudioNext, exec, playerctl next"
|
|
||||||
", XF86AudioPrev, exec, playerctl previous"
|
|
||||||
", XF86AudioStop, exec, playerctl stop"
|
|
||||||
|
|
||||||
# - Keyboard ---------------------------
|
# - Keyboard ---------------------------
|
||||||
"${cfg.mod}, Escape, exec, hyprctl switchxkblayout current next"
|
"${cfg.mod}, Escape, exec, hyprctl switchxkblayout current next"
|
||||||
|
|
||||||
] ++ cfg.extraKeybindings;
|
] ++ cfg.extraKeybindings;
|
||||||
|
|
||||||
binde = [
|
|
||||||
# Pulse Audio controls (volume)
|
|
||||||
", XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5%"
|
|
||||||
", XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -5%"
|
|
||||||
];
|
|
||||||
|
|
||||||
bindm = [
|
bindm = [
|
||||||
"${cfg.mod}, mouse:272, hy3:movewindow"
|
"${cfg.mod}, mouse:272, hy3:movewindow"
|
||||||
"${cfg.mod} SHIFT, mouse:272, resizewindow 1"
|
"${cfg.mod} SHIFT, mouse:272, resizewindow 1"
|
||||||
|
|||||||
44
modules/system/audio.nix
Normal file
44
modules/system/audio.nix
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
{ config, lib, pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.samfelag.modules.system.audio;
|
||||||
|
hyprCfg = config.samfelag.modules.desktop.wm.hyprland;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.samfelag.modules.system.audio = {
|
||||||
|
enable = mkEnableOption "Audio support";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
alsa-utils
|
||||||
|
playerctl
|
||||||
|
brightnessctl
|
||||||
|
];
|
||||||
|
|
||||||
|
services.pipewire.enable = true;
|
||||||
|
|
||||||
|
# - Hyprland keybindings ---------------------
|
||||||
|
hm.wayland.windowManager.hyprland.settings = lib.mkIf hyprCfg.enable {
|
||||||
|
bind = [
|
||||||
|
# Pulse Audio controls (mute)
|
||||||
|
", XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle"
|
||||||
|
|
||||||
|
# Media player controls
|
||||||
|
", XF86AudioPlay, exec, playerctl play-pause"
|
||||||
|
", XF86AudioPause, exec, playerctl play-pause"
|
||||||
|
", XF86AudioNext, exec, playerctl next"
|
||||||
|
", XF86AudioPrev, exec, playerctl previous"
|
||||||
|
", XF86AudioStop, exec, playerctl stop"
|
||||||
|
];
|
||||||
|
|
||||||
|
binde = [
|
||||||
|
# Pulse Audio controls (volume)
|
||||||
|
", XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5%"
|
||||||
|
", XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -5%"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user