Skip to content

Commit

Permalink
feat: try to use remote wallpapaers
Browse files Browse the repository at this point in the history
  • Loading branch information
sbulav committed Apr 4, 2024
1 parent fc93925 commit 8ec0fbe
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 5 deletions.
3 changes: 3 additions & 0 deletions nix/homes/x86_64-linux/sab@nz/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ with lib.custom; {
enable = true;
name = config.snowfallorg.user.name;
};
theme = {
enable = true;
};

desktop = {
hyprland = enabled;
Expand Down
6 changes: 5 additions & 1 deletion nix/modules/home/desktop/addons/hyprlock/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
with lib;
with lib.custom; let
cfg = config.custom.desktop.addons.hyprlock;
wallpaper = builtins.fetchurl {
url = config.custom.theme.wallpaper_url;
sha256 = config.custom.theme.wallpaper_sha256;
};
inherit (inputs) hyprlock;
in {
imports = [hyprlock.homeManagerModules.default];
Expand Down Expand Up @@ -43,7 +47,7 @@ in {

backgrounds = [
{
path = "/home/sab/Pictures/wallpaper.png";
path = wallpaper;
}
];
};
Expand Down
4 changes: 2 additions & 2 deletions nix/modules/home/desktop/addons/hyprpaper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ with lib.custom; let
cfg = config.custom.desktop.addons.hyprpaper;
inherit (inputs) hyprpaper;
wallpaper = builtins.fetchurl {
url = "https://github.com/Vinetos/dotnix/blob/main/home/themes/catpuccin/backgrounds/deer.jpg?raw=true";
sha256 = "1494bkhakk72xk8hcy1mw7b1m6rr4bda3aspblz6ml6325fx796x";
url = config.custom.theme.wallpaper_url;
sha256 = config.custom.theme.wallpaper_sha256;
};
in {
imports = [hyprpaper.homeManagerModules.default];
Expand Down
6 changes: 5 additions & 1 deletion nix/modules/home/desktop/addons/swaylock/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
with lib;
with lib.custom; let
cfg = config.custom.desktop.addons.swaylock;
wallpaper = builtins.fetchurl {
url = config.custom.theme.wallpaper_url;
sha256 = config.custom.theme.wallpaper_sha256;
};
in {
options.custom.desktop.addons.swaylock = with types; {
enable = mkBoolOpt false "Whether to enable the swaylock";
Expand All @@ -18,7 +22,7 @@ in {
enable = true;
package = pkgs.swaylock-effects;
settings = {
image = "$HOME/Pictures/wallpaper.png";
image = wallpaper;
color = "000000ff";
font-size = "24";
indicator-idle-visible = true;
Expand Down
25 changes: 25 additions & 0 deletions nix/modules/home/theme/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
lib,
pkgs,
inputs,
config,
options,
...
}:
with lib;
with lib.custom; let
cfg = config.custom.theme;
in {
options.custom.theme = with types; {
enable = mkBoolOpt false "Whether or not to enable the wallpaper .";
wallpaper_url = mkOpt types.str "https://github.com/Vinetos/dotnix/blob/main/home/themes/catpuccin/backgrounds/deer.jpg?raw=true" "The URL of the wallpaper";
wallpaper_sha256 = mkOpt types.str "1494bkhakk72xk8hcy1mw7b1m6rr4bda3aspblz6ml6325fx796x" "The SHA256 of the wallpaper";
};

config = mkIf cfg.enable {
custom.theme = {
enable = mkDefault true;
# wallpaper_ = [wallpaper];
};
};
}
6 changes: 5 additions & 1 deletion nix/modules/nixos/desktop/addons/regreet/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
with lib;
with lib.custom; let
cfg = config.custom.desktop.addons.regreet;
wallpaper = builtins.fetchurl {
url = config.custom.theme.wallpaper_url;
sha256 = config.custom.theme.wallpaper_sha256;
};
greetdSwayConfig = pkgs.writeText "greetd-sway-config" ''
exec "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP"
input "type:touchpad" {
Expand Down Expand Up @@ -45,7 +49,7 @@ in {

settings = {
background = {
path = /home/sab/Pictures/wallpaper.png;
path = wallpaper;
fit = "Cover";
};
GTK = {
Expand Down

0 comments on commit 8ec0fbe

Please sign in to comment.