[feat] Add hyprpaper
This commit is contained in:
@@ -47,12 +47,13 @@ in
|
||||
(nerdfonts.override { fonts = [ "Hasklig" ]; })
|
||||
mpv
|
||||
] ++ (if device.isLinux then [
|
||||
gnome.seahorse
|
||||
gnome.nautilus
|
||||
nextcloud-client
|
||||
sbctl
|
||||
gparted
|
||||
gptfdisk
|
||||
polkit-kde-agent
|
||||
polkit_gnome
|
||||
dig
|
||||
mullvad
|
||||
steam-run
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
{ pkgs, ... }: {
|
||||
imports = [ ../modules/hyprpaper.nix ];
|
||||
programs.hyprpaper =
|
||||
let
|
||||
wallpapers = [
|
||||
(builtins.fetchurl
|
||||
{
|
||||
url = "https://w.wallhaven.cc/full/zy/wallhaven-zy2x7v.png";
|
||||
sha256 =
|
||||
"1vy4knw8cdwb5gszgvjahnwa2g0hh5lmz3v2hbx1nylmjg2rzpda";
|
||||
})
|
||||
];
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
systemd.enable = true;
|
||||
systemd.target = "hyprland-session.target";
|
||||
settings.preload = wallpapers;
|
||||
settings.wallpapers = (map (wallpaper: "DP-1," + wallpaper) wallpapers);
|
||||
};
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
|
||||
@@ -32,8 +51,8 @@
|
||||
gaps_in = 5;
|
||||
gaps_out = 20;
|
||||
border_size = 2;
|
||||
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
|
||||
"col.inactive_border" = "rgba(595959aa)";
|
||||
"col.active_border" = "$mauve $mauve 45deg";
|
||||
"col.inactive_border" = "$crust";
|
||||
};
|
||||
|
||||
decoration = {
|
||||
@@ -111,7 +130,8 @@
|
||||
"QT_QPA_PLATFORM,wayland"
|
||||
];
|
||||
exec-once = [
|
||||
"${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"
|
||||
# "${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"
|
||||
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
|
||||
# "${pkgs.swayosd}/bin/swayosd-server"
|
||||
# "${pkgs.swww}/bin/swww init; swww img ~/.local/share/dotfiles/images/wallpaper.jpg"
|
||||
"${pkgs.ironbar}/bin/ironbar"
|
||||
|
||||
98
config/nix/modules/hyprpaper.nix
Normal file
98
config/nix/modules/hyprpaper.nix
Normal file
@@ -0,0 +1,98 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.programs.hyprpaper;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
programs.hyprpaper = {
|
||||
enable = mkEnableOption "Hyprpaper - Wayland wallpaper utility";
|
||||
|
||||
systemd = {
|
||||
enable = mkEnableOption "autostart service for Hyprpaper";
|
||||
|
||||
target = mkOption {
|
||||
type = types.str;
|
||||
default = "graphical-session.target";
|
||||
example = "hyprland-session.target";
|
||||
description = ''
|
||||
The systemd target that will automatically start the Hyprpaper service.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
settings = with types; {
|
||||
preload = mkOption {
|
||||
type = listOf path;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Wallpaper images that should be preloaded into memory
|
||||
'';
|
||||
example = [ ./wallpapers/tensura.png ];
|
||||
};
|
||||
|
||||
wallpapers = mkOption {
|
||||
type = listOf str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Wallpaper to monitor mapper
|
||||
'';
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = str;
|
||||
default = "";
|
||||
description = "Check https://github.com/hyprwm/hyprpaper#usage for info";
|
||||
example = ''
|
||||
newConfigOption = foo,bar
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
home.packages = mkIf cfg.enable [
|
||||
pkgs.hyprpaper
|
||||
];
|
||||
|
||||
systemd.user.services.hyprpaper = mkIf cfg.systemd.enable {
|
||||
Unit = {
|
||||
Description = "autostart service for Hyprpaper";
|
||||
Documentation = "https://github.com/hyprwm/hyprpaper";
|
||||
BindsTo = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
ExecStart = "${pkgs.hyprpaper}/bin/hyprpaper";
|
||||
ExecReload = "${pkgs.coreutils}/bin/kill -SIGUSR2 $MAINPID";
|
||||
Restart = "on-failure";
|
||||
KillMode = "mixed";
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [
|
||||
cfg.systemd.target
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
xdg.configFile = mkIf cfg.enable {
|
||||
"hypr/hyprpaper.conf".text = ''
|
||||
# Auto-generated by Nix home-manager module
|
||||
|
||||
# hyprpaper.settings.preload
|
||||
${(lists.foldl (acc: v: acc + "preload = ${v}\n") "" cfg.settings.preload)}
|
||||
|
||||
# hyprpaper.settings.wallpapers
|
||||
${(lists.foldl (acc: v: acc + "wallpaper = ${v}\n") "" cfg.settings.wallpapers)}
|
||||
|
||||
# hyprpaper.settings.extraConfig
|
||||
${cfg.settings.extraConfig}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
services.devmon.enable = true;
|
||||
services.gvfs.enable = true;
|
||||
services.udisks2.enable = true;
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
nix.settings.auto-optimise-store = true;
|
||||
nix.gc.automatic = true;
|
||||
|
||||
Reference in New Issue
Block a user