integrated hyprland into systemd

This commit is contained in:
Rouven Seifert 2023-02-21 12:24:34 +01:00
parent 2bb4bc7e38
commit adc6afca11
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09
7 changed files with 51 additions and 12 deletions

View file

@ -6,6 +6,7 @@
[ [
./hardware-configuration.nix ./hardware-configuration.nix
./modules/networks ./modules/networks
./modules/greetd
./modules/snapper ./modules/snapper
../../shared/vim.nix ../../shared/vim.nix
../../shared/sops.nix ../../shared/sops.nix

View file

@ -0,0 +1,11 @@
{ config, pkgs, ...}:
{
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.greetd.greetd}/bin/agreety --cmd Hyprland";
};
};
};
}

View file

@ -9,6 +9,8 @@
ALLOW_USERS="rouven" ALLOW_USERS="rouven"
TIMELINE_CREATE=yes TIMELINE_CREATE=yes
TIMELINE_CLEANUP=yes TIMELINE_CLEANUP=yes
NUMBER_LIMIT=10
NUMBER_CLEANUP=yes
''; '';
}; };
home = { home = {

View file

@ -1,6 +1,9 @@
{ config, pkgs, hyprpaper, ... }: { config, pkgs, ... }:
{ {
imports = [ ./waybar.nix ]; imports = [
./hyprpaper.nix
./waybar.nix
];
wayland.windowManager.hyprland.enable = true; wayland.windowManager.hyprland.enable = true;
home.sessionVariables = { home.sessionVariables = {
GRIM_DEFAULT_DIR = "~/Pictures/Screenshots/"; GRIM_DEFAULT_DIR = "~/Pictures/Screenshots/";
@ -15,19 +18,12 @@
slurp slurp
swappy swappy
font-awesome font-awesome
hyprpaper.packages.x86_64-linux.default
swaylock-effects swaylock-effects
]; ];
xdg.configFile = { xdg.configFile = {
"hypr/hyprland.conf".source = ./hyprland.conf; "hypr/hyprland.conf".source = ./hyprland.conf;
"hypr/hyprpaper.conf".text = ''
preload = ${../../../../images/wallpaper.png}
wallpaper =eDP-1, ${../../../../images/wallpaper.png}
wallpaper =HDMI-A-1, ${../../../../images/wallpaper.png}
'';
"swaylock/config".text = '' "swaylock/config".text = ''
indicator-radius=200 indicator-radius=200
indicator-thickness=3 indicator-thickness=3

View file

@ -4,10 +4,11 @@ monitor=eDP-1, 1920x1080, 0x0, 1
# See https://wiki.hyprland.org/Configuring/Keywords/ for more # See https://wiki.hyprland.org/Configuring/Keywords/ for more
# Execute your favorite apps at launch # Execute your favorite apps at launch
exec-once = waybar & hyprpaper #exec-once = waybar & hyprpaper
#exec-once = hyprpaper
# temp fix since the foot service starts too early # manually start the systemd target
exec-once = systemctl --user restart foot exec-once = systemctl --user start hyprland-session.target
# Source a file (multi-file configs) # Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf # source = ~/.config/hypr/myColors.conf

View file

@ -0,0 +1,27 @@
{ config, hyprpaper, ... }:
let
hyprpaper-pkg = hyprpaper.packages.x86_64-linux.default;
in
{
home.packages = [
hyprpaper-pkg
];
xdg.configFile."hypr/hyprpaper.conf".text = ''
preload = ${../../../../images/wallpaper.png}
wallpaper =eDP-1, ${../../../../images/wallpaper.png}
wallpaper =HDMI-A-1, ${../../../../images/wallpaper.png}
'';
systemd.user.services.hyprpaper = {
Install.WantedBy = ["graphical-session.target"];
Service = {
ExecStart = "${hyprpaper-pkg}/bin/hyprpaper";
Restart = "on-failure";
};
Unit = {
After = "graphical-session.target";
Descriptipon = "Blazing fast wayland wallpaper utility with IPC controls";
Documentation = "https://github.com/hyprwm/hyprpaper";
PartOf = "graphical-session.target";
};
};
}

View file

@ -2,6 +2,7 @@
{ {
programs.waybar = { programs.waybar = {
enable = true; enable = true;
systemd.enable = true;
package = pkgs.waybar.overrideAttrs (oldAttrs: { package = pkgs.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
}); });