Wrap hyprpaper

This commit is contained in:
SebastianStork 2024-05-11 17:36:32 +02:00
parent 554b05c33b
commit 97b608bf9a
4 changed files with 22 additions and 23 deletions

View file

@ -1,6 +1,5 @@
{
config,
pkgs,
lib,
...
}: let
@ -13,16 +12,7 @@ in {
options.myConfig.de.hyprland.enable = lib.mkEnableOption "";
config = lib.mkIf cfg.hyprland.enable {
home.packages = [pkgs.hyprpaper];
xdg.configFile."hypr/hyprpaper.conf".text = ''
preload=${cfg.wallpaper}
wallpaper=,${cfg.wallpaper}
splash=false
'';
services.dunst.enable = true;
config = lib.mkIf config.myConfig.de.hyprland.enable {
myConfig.de = {
hypridlelock.enable = true;
waybar.enable = true;

View file

@ -6,14 +6,7 @@
}: let
cfg = config.myConfig.de;
in {
options.myConfig.de = {
theme = lib.mkOption {
type = lib.types.str;
};
wallpaper = lib.mkOption {
type = lib.types.path;
};
};
options.myConfig.de.theme = lib.mkOption {type = lib.types.str;};
config = lib.mkMerge [
(lib.mkIf (cfg.theme == "dark") {

View file

@ -8,10 +8,7 @@
xdg.userDirs.extraConfig.XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
myConfig = {
de = {
hyprland.enable = osConfig.myConfig.de.hyprland.enable;
wallpaper = ./wallpaper;
};
de.hyprland.enable = osConfig.myConfig.de.hyprland.enable;
shell = {
bash.enable = true;

19
wrappers/hyprpaper.nix Normal file
View file

@ -0,0 +1,19 @@
{
assembleWrapper,
pkgs,
...
}:
assembleWrapper {
basePackage = pkgs.hyprpaper;
flags = let
hyprpaper-config = pkgs.writeText "hyprpaper-config" ''
preload = ~/Pictures/.wallpaper
wallpaper = , ~/Pictures/.wallpaper
splash = false
'';
in [
"--config"
hyprpaper-config
];
}