Moved assets into separate module

This commit is contained in:
2026-04-05 14:00:34 -04:00
parent fa0e950c34
commit 6d3b315eb7
5 changed files with 51 additions and 8 deletions

View File

@@ -0,0 +1,29 @@
{
flake.modules.homeManager.assets =
{ config, lib, ... }:
{
options = {
profilePicture = lib.mkOption {
type = lib.types.path;
default = null;
description = "The user's profile picture, to be used as ~/.face";
};
wallpaperDir = lib.mkOption {
type = lib.types.path;
default = null;
description = "The path to a directory containing wallpapers to being linked to XDG_WALLPAPERS_DIR";
};
};
config.xdg.userDirs.extraConfig.WALLPAPERS = "${config.xdg.userDirs.pictures}/Wallpapers";
config.home.file.".face".source = lib.mkIf (config.profilePicture != null) config.profilePicture;
config.home.file."${config.xdg.userDirs.extraConfig.WALLPAPERS}" =
lib.mkIf (config.wallpaperDir != null)
{
source = config.wallpaperDir;
recursive = true;
};
};
}

View File

@@ -13,17 +13,9 @@
createDirectories = true;
extraConfig = {
DEV = "${config.home.homeDirectory}/Dev";
WALLPAPERS = "${config.xdg.userDirs.pictures}/Wallpapers";
SCREENSHOTS = "${config.xdg.userDirs.pictures}/Screenshots";
};
};
};
home.file.".face".source = ../../assets/profile-picture.jpg;
home.file."${config.xdg.userDirs.extraConfig.WALLPAPERS}" = {
source = ../../assets/wallpapers;
recursive = true;
};
};
}

View File

@@ -38,6 +38,7 @@ in
{
imports = with self.modules.homeManager; [
inputs.nix-jmu-cs345.homeManagerModules.bernstdh
assets
direnv
fastfetch
firefox
@@ -68,6 +69,9 @@ in
stateVersion = "25.05";
};
profilePicture = "${inputs.assets}/profile-picture.jpg";
wallpaperDir = "${inputs.assets}/wallpapers";
programs.home-manager.enable = true;
programs.nix-jmu-cs345.enable = true;