Skip to content

Commit

Permalink
feat(nix): use my own github based wallpapers
Browse files Browse the repository at this point in the history
  • Loading branch information
sbulav committed May 8, 2024
1 parent 5e0b78b commit 7218897
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 13 deletions.
34 changes: 33 additions & 1 deletion nix/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions nix/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
url = "github:kamadorueda/alejandra/3.0.0";
inputs.nixpkgs.follows = "nixpkgs";
};

wallpapers-nix = {
url = "github:sbulav/wallpapers-nix";
};
};

outputs = inputs: let
Expand Down
11 changes: 7 additions & 4 deletions nix/homes/x86_64-linux/sab@nz/default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
lib,
pkgs,
config,
osConfig ? {},
format ? "unknown",
inputs,
pkgs,
...
}:
with lib.custom; {
with lib.custom; let
wallpapers = inputs.wallpapers-nix.packages.${pkgs.system}.catppuccin;
in {
custom = {
user = {
enable = true;
Expand All @@ -26,6 +27,7 @@ with lib.custom; {
wlogout = enabled;
hyprlock = disabled;
wezterm = enabled;
wallpaper = "${wallpapers}/share/wallpapers/catppuccin/bench.png";
};
};

Expand All @@ -47,4 +49,5 @@ with lib.custom; {
vault = enabled;
};
};
home.stateVersion = "23.11";
}
4 changes: 1 addition & 3 deletions nix/modules/home/desktop/addons/hyprlock/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
inputs,
options,
config,
lib,
pkgs,
...
}:
with lib;
Expand Down Expand Up @@ -43,7 +41,7 @@ in {

backgrounds = [
{
path = "/home/sab/Pictures/wallpaper.png";
path = config.custom.desktop.addons.wallpaper;
}
];
};
Expand Down
2 changes: 1 addition & 1 deletion nix/modules/home/desktop/addons/hyprpaper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
with lib;
with lib.custom; let
cfg = config.custom.desktop.addons.hyprpaper;
wallpaper = /home/sab/Pictures/cityscape2.jpg;
wallpaper = config.custom.desktop.addons.wallpaper;
in {
options.custom.desktop.addons.hyprpaper = with types; {
enable = mkBoolOpt false "Whether to enable the hyprpaper config";
Expand Down
2 changes: 1 addition & 1 deletion nix/modules/home/desktop/addons/swaylock/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ in {
enable = true;
package = pkgs.swaylock-effects;
settings = {
image = "$HOME/Pictures/wallpaper.png";
image = config.custom.desktop.addons.wallpaper;
color = "000000ff";
font-size = "24";
indicator-idle-visible = true;
Expand Down
17 changes: 17 additions & 0 deletions nix/modules/home/desktop/addons/wallpaper/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
inputs,
pkgs,
config,
lib,
...
}:
with lib;
with lib.custom; let
# cfg = config.system.wallpaper;
in {
options.custom.desktop.addons.wallpaper = mkOption {
type = types.oneOf [types.package types.path types.str];
default = inputs.wallpapers-nix.packages.${pkgs.system}.catppuccin;
description = "The wallpaper to use.";
};
}
3 changes: 2 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,7 @@
with lib;
with lib.custom; let
cfg = config.custom.desktop.addons.regreet;
wallpaper = options.system.wallpaper.value;
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 +46,7 @@ in {

settings = {
background = {
path = /home/sab/Pictures/wallpaper.png;
path = wallpaper;
fit = "Cover";
};
GTK = {
Expand Down
17 changes: 17 additions & 0 deletions nix/modules/nixos/system/wallpaper/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
inputs,
pkgs,
config,
lib,
...
}:
with lib;
with lib.custom; let
# cfg = config.system.wallpaper;
in {
options.system.wallpaper = mkOption {
type = types.oneOf [types.package types.path types.str];
default = inputs.wallpapers-nix.packages.${pkgs.system}.catppuccin;
description = "The wallpaper to use.";
};
}
10 changes: 8 additions & 2 deletions nix/systems/x86_64-linux/nz/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{pkgs, ...}: {
{
pkgs,
inputs,
...
}: let
wallpapers = inputs.wallpapers-nix.packages.${pkgs.system}.catppuccin;
in {
imports = [./hardware-configuration.nix];

system.wallpaper = "${wallpapers}/share/wallpapers/catppuccin/bench.png";
# Enable Bootloader
system.boot.efi.enable = true;
system.battery.enable = true; # Only for laptops, they will still work without it, just improves battery life
Expand Down

0 comments on commit 7218897

Please sign in to comment.