Let hyprland do the services starting

This commit is contained in:
SebastianStork 2024-05-21 20:22:53 +02:00
parent a9e83e15ad
commit 905d55db30
13 changed files with 92 additions and 138 deletions

View file

@ -1,6 +1,9 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [ ../modules/system ]; imports = [
../modules/system
../wrappers
];
system.stateVersion = "23.11"; system.stateVersion = "23.11";

View file

@ -1,22 +0,0 @@
{
config,
pkgs,
lib,
wrappers,
...
}:
{
options.myConfig.clipboard.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.clipboard.enable {
services.cliphist.enable = true;
home.packages = [
(pkgs.writeScriptBin "clipboard" ''
${lib.getExe pkgs.cliphist} list | ${
lib.getExe (wrappers.rofi { inherit (config.myConfig.de) theme; })
} -dmenu -display-columns 2 | ${lib.getExe pkgs.cliphist} decode | ${lib.getExe' pkgs.wl-clipboard "wl-copy"}
'')
];
};
}

View file

@ -2,7 +2,5 @@
imports = [ imports = [
./hyprland ./hyprland
./theme.nix ./theme.nix
./waybar.nix
./hypridlelock.nix
]; ];
} }

View file

@ -1,17 +0,0 @@
{
config,
pkgs,
lib,
wrappers,
...
}:
{
options.myConfig.de.hypridlelock.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.de.hypridlelock.enable {
services.hypridle = {
enable = true;
package = wrappers.hypridle { };
};
};
}

View file

@ -1,61 +0,0 @@
{
config,
lib,
wrappers,
...
}:
{
config = lib.mkIf config.myConfig.de.hyprland.enable {
wayland.windowManager.hyprland = {
enable = true;
settings = {
exec-once = [ "${lib.getExe wrappers.hyprpaper}" ];
input = {
kb_layout = "de";
kb_variant = "nodeadkeys";
accel_profile = "flat";
};
device = {
name = "dell0b9f:00-27c6:0d43-touchpad";
accel_profile = "adaptive";
disable_while_typing = true;
natural_scroll = true;
middle_button_emulation = true;
};
general = {
gaps_in = 5;
gaps_out = 10;
border_size = 1;
layout = "master";
};
master = {
new_is_master = false;
no_gaps_when_only = 1;
mfact = "0.5";
};
decoration = {
rounding = 6;
drop_shadow = false;
};
animations.enabled = false;
misc = {
disable_hyprland_logo = true;
disable_splash_rendering = true;
force_default_wallpaper = 0;
key_press_enables_dpms = true;
};
};
};
};
}

View file

@ -1,16 +1,82 @@
{ config, lib, ... }:
{ {
imports = [ config,
./config.nix pkgs,
./keybinds.nix lib,
]; wrappers,
...
}:
{
imports = [ ./keybinds.nix ];
options.myConfig.de.hyprland.enable = lib.mkEnableOption ""; options.myConfig.de.hyprland.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.de.hyprland.enable { config = lib.mkIf config.myConfig.de.hyprland.enable {
myConfig.de = { home.packages = [
hypridlelock.enable = true; wrappers.hyprpaper
waybar.enable = true; wrappers.waybar
wrappers.hyprlock
(wrappers.rofi { inherit (config.myConfig.de) theme; })
pkgs.cliphist
pkgs.wl-clipboard
(pkgs.writeScriptBin "clipboard" "cliphist list | rofi -dmenu -display-columns 2 | cliphist decode | wl-copy")
];
wayland.windowManager.hyprland = {
enable = true;
settings = {
exec-once = [
"hyprpaper"
"sleep 3 && waybar"
"hypridle"
"cliphist wipe && wl-paste --watch cliphist store"
];
input = {
kb_layout = "de";
kb_variant = "nodeadkeys";
accel_profile = "flat";
};
device = {
name = "dell0b9f:00-27c6:0d43-touchpad";
accel_profile = "adaptive";
disable_while_typing = true;
natural_scroll = true;
middle_button_emulation = true;
};
general = {
gaps_in = 5;
gaps_out = 10;
border_size = 1;
layout = "master";
};
master = {
new_is_master = false;
no_gaps_when_only = 1;
mfact = "0.5";
};
decoration = {
rounding = 6;
drop_shadow = false;
};
animations.enabled = false;
misc = {
disable_hyprland_logo = true;
disable_splash_rendering = true;
force_default_wallpaper = 0;
key_press_enables_dpms = true;
};
};
}; };
}; };
} }

View file

@ -16,7 +16,6 @@
bind = SUPER SHIFT, C, killactive, bind = SUPER SHIFT, C, killactive,
bind = SUPER SHIFT, V, togglefloating, bind = SUPER SHIFT, V, togglefloating,
bind = SUPER SHIFT, F, fullscreen, 0 bind = SUPER SHIFT, F, fullscreen, 0
bind = SUPER, TAB, cyclenext,
# Launch programs # Launch programs
bind = SUPER, R, exec, rofi -show drun bind = SUPER, R, exec, rofi -show drun
@ -31,6 +30,7 @@
bind = SUPER, right, movefocus, r bind = SUPER, right, movefocus, r
bind = SUPER, up, movefocus, u bind = SUPER, up, movefocus, u
bind = SUPER, down, movefocus, d bind = SUPER, down, movefocus, d
bind = SUPER, TAB, cyclenext,
# Move window # Move window
bind = SUPER SHIFT, left, movewindow, l bind = SUPER SHIFT, left, movewindow, l
@ -72,6 +72,7 @@
bindrl = SUPER CONTROL, S, exec, systemctl suspend bindrl = SUPER CONTROL, S, exec, systemctl suspend
bindrl = SUPER CONTROL, L, exec, loginctl lock-session bindrl = SUPER CONTROL, L, exec, loginctl lock-session
bindrl = SUPER CONTROL, B, exec, sleep 1 && hyprctl dispatch dpms off bindrl = SUPER CONTROL, B, exec, sleep 1 && hyprctl dispatch dpms off
bind = SUPER CONTROL, R, exec, pkill waybar && hyprctl dispatch exec waybar
bindl = , switch:on:Lid Switch, exec, systemctl suspend bindl = , switch:on:Lid Switch, exec, systemctl suspend
# Control media # Control media

View file

@ -1,19 +0,0 @@
{
config,
lib,
wrappers,
...
}:
{
options.myConfig.de.waybar.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.de.waybar.enable {
programs.waybar = {
enable = true;
package = wrappers.waybar;
systemd.enable = true;
};
systemd.user.services.waybar.Unit.After = [ "sound.target" ];
};
}

View file

@ -7,6 +7,5 @@
./git.nix ./git.nix
./equalizer ./equalizer
./sops.nix ./sops.nix
./clipboard.nix
]; ];
} }

View file

@ -6,8 +6,7 @@
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = { extraSpecialArgs = {
inherit self; inherit self inputs;
inherit inputs;
}; };
}; };

View file

@ -1,8 +1,10 @@
{ ... }: { wrappers, ... }:
{ {
imports = [ ./default.nix ]; imports = [ ./default.nix ];
home-manager.users.seb = { home-manager.users.seb = {
home.packages = [ (wrappers.hypridle { lockOnSleep = true; }) ];
myConfig.de.theme = "light"; myConfig.de.theme = "light";
wayland.windowManager.hyprland.settings.monitor = "eDP-1,1920x1080@60,0x0,1"; wayland.windowManager.hyprland.settings.monitor = "eDP-1,1920x1080@60,0x0,1";

View file

@ -1,4 +1,9 @@
{ pkgs, lib, ... }: {
pkgs,
lib,
wrappers,
...
}:
{ {
imports = [ ./default.nix ]; imports = [ ./default.nix ];
@ -7,6 +12,8 @@
pkgs.obs-studio pkgs.obs-studio
pkgs.libsForQt5.kdenlive pkgs.libsForQt5.kdenlive
pkgs.gimp pkgs.gimp
(wrappers.hypridle { lockOnSleep = false; })
]; ];
myConfig.de.theme = "dark"; myConfig.de.theme = "dark";

View file

@ -18,7 +18,6 @@
vscode.enable = true; vscode.enable = true;
equalizer.enable = true; equalizer.enable = true;
sops.enable = false; sops.enable = false;
clipboard.enable = true;
}; };
home.packages = [ home.packages = [
@ -40,6 +39,5 @@
wrappers.marktext wrappers.marktext
wrappers.webcord wrappers.webcord
(wrappers.kitty { inherit (config.myConfig.de) theme; }) (wrappers.kitty { inherit (config.myConfig.de) theme; })
(wrappers.rofi { inherit (config.myConfig.de) theme; })
]; ];
} }