More refactoring and added hyprlock
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.samfelag.modules.desktop.env.grapheio;
|
||||
cfg = config.samfelag.modules.desktop.grapheio;
|
||||
in
|
||||
{
|
||||
options.samfelag.modules.desktop.env.grapheio = {
|
||||
enable = mkEnableOption "Grapheio desktop environment - hyprland based";
|
||||
options.samfelag.modules.desktop.grapheio = {
|
||||
enable = mkEnableOption "Γραφείο desktop environment - hyprland based";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
@@ -14,33 +14,11 @@ in
|
||||
# - Packages ---------------------------------
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
# - System ---------------------------------
|
||||
# - Audio
|
||||
alsa-utils
|
||||
playerctl
|
||||
brightnessctl
|
||||
|
||||
# - Appearance -----------------------------
|
||||
# - Cursor
|
||||
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 -----------------------------------
|
||||
hm.home.pointerCursor = {
|
||||
gtk.enable = true;
|
||||
@@ -61,26 +39,30 @@ in
|
||||
|
||||
samfelag.modules = {
|
||||
|
||||
system.audio.enable = true;
|
||||
system.kanata.enable = true;
|
||||
|
||||
desktop = {
|
||||
# Window Manager
|
||||
wm.hyprland.enable = true;
|
||||
|
||||
# Greeter (login screen)
|
||||
greeter.greetd = {
|
||||
enable = true;
|
||||
wm_cmd = "Hyprland";
|
||||
};
|
||||
|
||||
tools = {
|
||||
# Greeter (login screen)
|
||||
greetd = {
|
||||
enable = true;
|
||||
wm_cmd = "Hyprland";
|
||||
};
|
||||
# Locker
|
||||
hyprlock.enable = true;
|
||||
# Status bars
|
||||
eww.enable = true;
|
||||
# Launcher
|
||||
rofi.enable = true;
|
||||
# Wallpapper
|
||||
hyprpaper.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
system.kanata.enable = true;
|
||||
|
||||
app = {
|
||||
alacritty.enable = true;
|
||||
firefox.enable = true;
|
||||
@@ -3,9 +3,6 @@
|
||||
let
|
||||
cfg = config.samfelag.modules.desktop.tools.eww;
|
||||
hyprCfg = config.samfelag.modules.desktop.wm.hyprland;
|
||||
# Paths
|
||||
paths = {
|
||||
};
|
||||
in {
|
||||
|
||||
options.samfelag.modules.desktop.tools.eww = {
|
||||
@@ -29,6 +26,11 @@ in {
|
||||
hm.xdg.configFile."eww/widgets".source = ../../../config/eww/widgets;
|
||||
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 ---------------------------------
|
||||
hm.xdg.configFile."eww/colour-scheme.scss".text = ''
|
||||
$base00: #${config.colorScheme.palette.base00};
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{ inputs, config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.samfelag.modules.desktop.greeter.greetd;
|
||||
cfg = config.samfelag.modules.desktop.tools.greetd;
|
||||
in {
|
||||
|
||||
options.samfelag.modules.desktop.greeter.greetd = with lib; {
|
||||
options.samfelag.modules.desktop.tools.greetd = with lib; {
|
||||
enable = mkEnableOption "Greetd based greeter";
|
||||
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; {
|
||||
enable = mkEnableOption "hyprland window manager";
|
||||
|
||||
mod = my.mkOpt' types.str "Mod4" "Main modifier key for hyprland";
|
||||
|
||||
kb_layout = my.mkOpt' types.str "es" "Keyboard layout(s) for hyprland";
|
||||
|
||||
extraKeybindings = my.mkOpt (types.listOf types.str) [ ];
|
||||
# extraStartup = my.mkOpt (types.listOf types.attrs) [ ];
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
];
|
||||
|
||||
# - Configuration -----------------------------
|
||||
|
||||
# Hyprland config
|
||||
@@ -31,11 +24,9 @@ in {
|
||||
|
||||
hm.wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
|
||||
package = pkgs.hyprland;
|
||||
# Optional
|
||||
# Whether to enable hyprland-session.target on hyprland startup
|
||||
|
||||
xwayland.enable = true;
|
||||
systemd.enable = true;
|
||||
|
||||
plugins = [
|
||||
@@ -60,8 +51,6 @@ in {
|
||||
monitor = ",highres,auto,1";
|
||||
|
||||
exec-once = [
|
||||
"hyprpaper"
|
||||
"eww open top-bar"
|
||||
];
|
||||
|
||||
decoration = {
|
||||
@@ -120,29 +109,11 @@ in {
|
||||
"${cfg.mod} SHIFT, 5, movetoworkspace, 5"
|
||||
"${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 ---------------------------
|
||||
"${cfg.mod}, Escape, exec, hyprctl switchxkblayout current next"
|
||||
|
||||
] ++ 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 = [
|
||||
"${cfg.mod}, mouse:272, hy3:movewindow"
|
||||
"${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