mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 15:11:34 +01:00
Migrate services from wrappers to systemd services
This commit is contained in:
parent
e1ba06a5fb
commit
aceeeef689
13 changed files with 291 additions and 247 deletions
25
modules/home/de/cliphist.nix
Normal file
25
modules/home/de/cliphist.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
wrappers,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.myConfig.de.cliphist.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.de.cliphist.enable {
|
||||
services.cliphist = {
|
||||
enable = true;
|
||||
allowImages = false;
|
||||
};
|
||||
|
||||
systemd.user.services.cliphist.Service.ExecStartPre = "${lib.getExe config.services.cliphist.package} wipe";
|
||||
|
||||
home.packages = [
|
||||
(wrappers.rofi { inherit (config.myConfig) theme; })
|
||||
pkgs.wl-clipboard
|
||||
(pkgs.writeScriptBin "rofi-clipboard" "cliphist list | rofi -dmenu -display-columns 2 | cliphist decode | wl-copy")
|
||||
];
|
||||
};
|
||||
}
|
||||
46
modules/home/de/hypridle.nix
Normal file
46
modules/home/de/hypridle.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
wrappers,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.myConfig.de.hypridle.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.de.hypridle.enable {
|
||||
home.packages = [
|
||||
wrappers.hyprlock
|
||||
pkgs.brightnessctl
|
||||
(pkgs.writeScriptBin "lock-suspend" "loginctl lock-session && sleep 0.5 && systemctl suspend")
|
||||
];
|
||||
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
general = {
|
||||
lock_cmd = "pidof hyprlock || hyprlock";
|
||||
after_sleep_cmd = "hyprctl dispatch dpms on";
|
||||
};
|
||||
|
||||
listener = [
|
||||
{
|
||||
timeout = 300;
|
||||
on-timeout = "brightnessctl -s && brightnessctl -e set 10%";
|
||||
on-resume = "brightnessctl -r";
|
||||
}
|
||||
{
|
||||
timeout = 600;
|
||||
on-timeout = "hyprctl dispatch dpms off";
|
||||
on-resume = "hyprctl dispatch dpms on";
|
||||
}
|
||||
{
|
||||
timeout = 610;
|
||||
on-timeout = "loginctl lock-session";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
33
modules/home/de/hyprland/default.nix
Normal file
33
modules/home/de/hyprland/default.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
wrappers,
|
||||
...
|
||||
}@moduleArgs:
|
||||
{
|
||||
options.myConfig.de.hyprland.enable = lib.mkEnableOption "" // {
|
||||
default = moduleArgs.osConfig.myConfig.de.hyprland.enable or false;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.myConfig.de.hyprland.enable {
|
||||
wayland.windowManager.hyprland.enable = true;
|
||||
|
||||
home.packages = [
|
||||
(wrappers.rofi { inherit (config.myConfig) theme; })
|
||||
pkgs.wl-clipboard
|
||||
pkgs.playerctl
|
||||
pkgs.brightnessctl
|
||||
pkgs.grimblast
|
||||
];
|
||||
|
||||
myConfig.de = {
|
||||
hyprpaper.enable = true;
|
||||
hypridle.enable = true;
|
||||
waybar.enable = true;
|
||||
cliphist.enable = true;
|
||||
};
|
||||
|
||||
services.dunst.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,20 +1,6 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
wrappers,
|
||||
...
|
||||
}:
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
config = lib.mkIf config.myConfig.de.hyprland.enable {
|
||||
home.packages = [
|
||||
(wrappers.rofi { inherit (config.myConfig) theme; })
|
||||
pkgs.wl-clipboard
|
||||
pkgs.playerctl
|
||||
pkgs.brightnessctl
|
||||
pkgs.grimblast
|
||||
];
|
||||
|
||||
wayland.windowManager.hyprland.extraConfig = ''
|
||||
# Bindflags:
|
||||
# r = release
|
||||
|
|
@ -22,8 +8,6 @@
|
|||
# l = locked
|
||||
|
||||
# Variables
|
||||
$rofi-clipboard = cliphist list | rofi -dmenu -display-columns 2 | cliphist decode | wl-copy
|
||||
$lock-suspend = loginctl lock-session && sleep 0.5 && systemctl suspend
|
||||
$play-pause = playerctl --ignore-player=firefox play-pause
|
||||
$play-next = playerctl --ignore-player=firefox next
|
||||
$play-previous = playerctl --ignore-player=firefox previous
|
||||
|
|
@ -40,7 +24,7 @@
|
|||
# Launch programs
|
||||
bind = SUPER, R, exec, rofi -show drun
|
||||
bind = SUPER, RETURN, exec, kitty
|
||||
bind = SUPER, V, exec, $rofi-clipboard
|
||||
bind = SUPER, V, exec, rofi-clipboard
|
||||
bind = SUPER, B, exec, firefox
|
||||
bind = SUPER, F, exec, nemo
|
||||
bind = SUPER, C, exec, codium
|
||||
|
|
@ -87,8 +71,8 @@
|
|||
bindrl = SUPER CONTROL, Q, exit,
|
||||
bindrl = SUPER CONTROL, P, exec, poweroff
|
||||
bindrl = SUPER CONTROL, R, exec, reboot
|
||||
bindrl = SUPER CONTROL, S, exec, $lock-suspend
|
||||
bindl = , switch:on:Lid Switch, exec, $lock-suspend
|
||||
bindrl = SUPER CONTROL, S, exec, lock-suspend
|
||||
bindl = , switch:on:Lid Switch, exec, lock-suspend
|
||||
bindrl = SUPER CONTROL, L, exec, loginctl lock-session
|
||||
bindrl = SUPER CONTROL, B, exec, sleep 1 && hyprctl dispatch dpms off
|
||||
bind = SUPER CONTROL, W, exec, pkill waybar && hyprctl dispatch exec waybar
|
||||
54
modules/home/de/hyprland/settings.nix
Normal file
54
modules/home/de/hyprland/settings.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config = lib.mkIf config.myConfig.de.hyprland.enable {
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
input = {
|
||||
kb_layout = "de";
|
||||
kb_variant = "nodeadkeys";
|
||||
accel_profile = "flat";
|
||||
};
|
||||
|
||||
device = [
|
||||
{
|
||||
name = "logitech-usb-receiver-mouse";
|
||||
sensitivity = "0.2";
|
||||
}
|
||||
{
|
||||
name = "dell0b9f:00-27c6:0d43-touchpad";
|
||||
accel_profile = "adaptive";
|
||||
disable_while_typing = true;
|
||||
natural_scroll = true;
|
||||
middle_button_emulation = true;
|
||||
}
|
||||
];
|
||||
|
||||
gestures.workspace_swipe = true;
|
||||
|
||||
general = {
|
||||
gaps_in = 5;
|
||||
gaps_out = 10;
|
||||
border_size = 1;
|
||||
layout = "master";
|
||||
};
|
||||
|
||||
master = {
|
||||
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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
15
modules/home/de/hyprpaper.nix
Normal file
15
modules/home/de/hyprpaper.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.myConfig.de.hyprpaper.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.de.hyprpaper.enable {
|
||||
services.hyprpaper = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
preload = [ "~/Pictures/.wallpaper" ];
|
||||
wallpaper = [ ", ~/Pictures/.wallpaper" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
114
modules/home/de/waybar.nix
Normal file
114
modules/home/de/waybar.nix
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.myConfig.de.waybar.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.de.waybar.enable {
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
systemd.enable = true;
|
||||
|
||||
settings.mainBar = {
|
||||
output = [
|
||||
"DP-1"
|
||||
"eDP-1"
|
||||
];
|
||||
layer = "top";
|
||||
position = "bottom";
|
||||
spacing = 10;
|
||||
|
||||
modules-left = [ "clock" ];
|
||||
modules-center = [ "hyprland/workspaces" ];
|
||||
modules-right = [
|
||||
"tray"
|
||||
"network"
|
||||
"wireplumber"
|
||||
"backlight"
|
||||
"battery"
|
||||
];
|
||||
|
||||
clock = {
|
||||
format = " {:%H:%M}";
|
||||
tooltip-format = "{:%d.%m.%Y}";
|
||||
};
|
||||
|
||||
"hyprland/workspaces" = {
|
||||
active-only = false;
|
||||
all-outputs = true;
|
||||
};
|
||||
|
||||
tray = {
|
||||
icon-size = 20;
|
||||
spacing = 6;
|
||||
};
|
||||
|
||||
network = {
|
||||
interval = 10;
|
||||
format = "";
|
||||
format-disconnected = "";
|
||||
format-ethernet = "";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
format-wifi = "{icon}";
|
||||
tooltip-format-disconnected = "Disconnected";
|
||||
tooltip-format-ethernet = " {bandwidthDownBits} {bandwidthUpBits}";
|
||||
tooltip-format-wifi = "{essid} {bandwidthDownBits} {bandwidthUpBits}";
|
||||
};
|
||||
|
||||
wireplumber = {
|
||||
format = "{icon} {volume}%";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
format-muted = "";
|
||||
scroll-step = "5";
|
||||
};
|
||||
|
||||
backlight = {
|
||||
device = "amdgpu_bl1";
|
||||
format = "{icon} {percent}%";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
|
||||
battery = {
|
||||
format = "{icon} {capacity}%";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
states = {
|
||||
critical = 5;
|
||||
warning = 15;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
style = ''
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0px;
|
||||
font-family: "Open Sans, Symbols Nerd Font Mono";
|
||||
font-size: 15px;
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
wrappers,
|
||||
...
|
||||
}@moduleArgs:
|
||||
{
|
||||
options.myConfig.de.hyprland.enable = lib.mkEnableOption "" // {
|
||||
default = moduleArgs.osConfig.myConfig.de.hyprland.enable or false;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.myConfig.de.hyprland.enable {
|
||||
home.packages = [
|
||||
wrappers.hyprpaper
|
||||
wrappers.hyprlock
|
||||
wrappers.hypridle
|
||||
wrappers.waybar
|
||||
pkgs.dunst
|
||||
pkgs.cliphist
|
||||
];
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
exec-once = [
|
||||
"hyprpaper"
|
||||
"hypridle"
|
||||
"sleep 3 && waybar"
|
||||
"dunst"
|
||||
"cliphist wipe && wl-paste --watch cliphist store"
|
||||
];
|
||||
|
||||
input = {
|
||||
kb_layout = "de";
|
||||
kb_variant = "nodeadkeys";
|
||||
accel_profile = "flat";
|
||||
};
|
||||
|
||||
device = [
|
||||
{
|
||||
name = "logitech-usb-receiver-mouse";
|
||||
sensitivity = "0.2";
|
||||
}
|
||||
{
|
||||
name = "dell0b9f:00-27c6:0d43-touchpad";
|
||||
accel_profile = "adaptive";
|
||||
disable_while_typing = true;
|
||||
natural_scroll = true;
|
||||
middle_button_emulation = true;
|
||||
}
|
||||
];
|
||||
|
||||
gestures.workspace_swipe = true;
|
||||
|
||||
general = {
|
||||
gaps_in = 5;
|
||||
gaps_out = 10;
|
||||
border_size = 1;
|
||||
layout = "master";
|
||||
};
|
||||
|
||||
master = {
|
||||
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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue