Skip to content

Commit

Permalink
Move wallpapers into a flake input
Browse files Browse the repository at this point in the history
  • Loading branch information
rake5k committed Sep 28, 2024
1 parent 2fe0a91 commit c8d0f08
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 20 deletions.
19 changes: 18 additions & 1 deletion flake.lock

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

9 changes: 9 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};

# Misc

wallpapers = {
type = "gitlab";
owner = "rake5k";
repo = "wallpapers";
flake = false;
};
};

outputs = { self, nixpkgs, ... } @ inputs:
Expand Down
6 changes: 0 additions & 6 deletions home/roles/desktop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ in
description = "Font config";
};
};

wallpapersDir = mkOption {
type = types.path;
default = config.home.homeDirectory + "/Pictures/wallpapers";
description = "Directory containing wallpapers";
};
};
};

Expand Down
1 change: 1 addition & 0 deletions home/roles/desktop/xserver/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ in
xserver = {
cursors.enable = true;
grobi.enable = true;
locker.enable = true;
redshift.enable = true;

xmonad = {
Expand Down
8 changes: 3 additions & 5 deletions home/roles/desktop/xserver/grobi/default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{ config, lib, pkgs, ... }:
{ config, lib, inputs, pkgs, ... }:

with lib;

let

desktopCfg = config.custom.roles.desktop;
xCfg = desktopCfg.xserver;
cfg = xCfg.grobi;
cfg = config.custom.roles.desktop.xserver.grobi;

in

Expand Down Expand Up @@ -35,7 +33,7 @@ in
inherit (cfg) rules;
enable = true;
executeAfter = [
"${lib.getExe pkgs.feh} --no-fehbg --bg-fill --randomize ${desktopCfg.wallpapersDir}"
"${lib.getExe pkgs.feh} --no-fehbg --bg-fill --randomize ${inputs.wallpapers}"
"${pkgs.polybar}/bin/polybar-msg cmd restart"
];
};
Expand Down
12 changes: 6 additions & 6 deletions home/roles/desktop/xserver/locker/default.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{ config, lib, pkgs, ... }:
{ config, lib, inputs, pkgs, ... }:

with lib;

let

desktopCfg = config.custom.roles.desktop;
xCfg = desktopCfg.xserver;
cfg = xCfg.locker;
cfg = config.custom.roles.desktop.xserver.locker;

in

{
options = {
custom.roles.desktop.xserver.locker = {
enable = mkEnableOption "Xorg screen locker";

package = mkOption {
type = types.package;
default = pkgs.betterlockscreen;
Expand All @@ -27,7 +27,7 @@ in
};
};

config = mkIf xCfg.enable {
config = mkIf cfg.enable {
home.packages = [
cfg.package
] ++ (with pkgs; [
Expand Down Expand Up @@ -58,7 +58,7 @@ in

# Update random lock image on login
xsession.initExtra = ''
${lib.getExe pkgs.betterlockscreen} --update ${desktopCfg.wallpapersDir} --fx dim &
${lib.getExe pkgs.betterlockscreen} --update ${inputs.wallpapers} --fx dim &
'';
};
}
2 changes: 0 additions & 2 deletions home/roles/desktop/xserver/spectrwm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ in

config = mkIf cfg.enable {
custom.programs.spectrwm = {
inherit (xCfg) locker;

autoruns = {
"alacritty" = 1;
};
Expand Down

0 comments on commit c8d0f08

Please sign in to comment.