Moved assets into separate module
This commit is contained in:
13
flake.lock
generated
13
flake.lock
generated
@@ -47,6 +47,18 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"assets": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"path": "./assets",
|
||||||
|
"type": "path"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"path": "./assets",
|
||||||
|
"type": "path"
|
||||||
|
},
|
||||||
|
"parent": []
|
||||||
|
},
|
||||||
"darwin": {
|
"darwin": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -483,6 +495,7 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"agenix": "agenix",
|
"agenix": "agenix",
|
||||||
"agenix-rekey": "agenix-rekey",
|
"agenix-rekey": "agenix-rekey",
|
||||||
|
"assets": "assets",
|
||||||
"flake-parts": "flake-parts_2",
|
"flake-parts": "flake-parts_2",
|
||||||
"home-manager": "home-manager_2",
|
"home-manager": "home-manager_2",
|
||||||
"import-tree": "import-tree",
|
"import-tree": "import-tree",
|
||||||
|
|||||||
@@ -55,6 +55,11 @@
|
|||||||
|
|
||||||
nix-jmu-cs345.url = "github:Eclypsed/nix-jmu-cs345";
|
nix-jmu-cs345.url = "github:Eclypsed/nix-jmu-cs345";
|
||||||
|
|
||||||
|
assets = {
|
||||||
|
flake = false;
|
||||||
|
url = "path:./assets";
|
||||||
|
};
|
||||||
|
|
||||||
packages = {
|
packages = {
|
||||||
flake = false;
|
flake = false;
|
||||||
url = "path:./packages";
|
url = "path:./packages";
|
||||||
|
|||||||
29
modules/features/assets.nix
Normal file
29
modules/features/assets.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -13,17 +13,9 @@
|
|||||||
createDirectories = true;
|
createDirectories = true;
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
DEV = "${config.home.homeDirectory}/Dev";
|
DEV = "${config.home.homeDirectory}/Dev";
|
||||||
WALLPAPERS = "${config.xdg.userDirs.pictures}/Wallpapers";
|
|
||||||
SCREENSHOTS = "${config.xdg.userDirs.pictures}/Screenshots";
|
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;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ in
|
|||||||
{
|
{
|
||||||
imports = with self.modules.homeManager; [
|
imports = with self.modules.homeManager; [
|
||||||
inputs.nix-jmu-cs345.homeManagerModules.bernstdh
|
inputs.nix-jmu-cs345.homeManagerModules.bernstdh
|
||||||
|
assets
|
||||||
direnv
|
direnv
|
||||||
fastfetch
|
fastfetch
|
||||||
firefox
|
firefox
|
||||||
@@ -68,6 +69,9 @@ in
|
|||||||
stateVersion = "25.05";
|
stateVersion = "25.05";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
profilePicture = "${inputs.assets}/profile-picture.jpg";
|
||||||
|
wallpaperDir = "${inputs.assets}/wallpapers";
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
programs.nix-jmu-cs345.enable = true;
|
programs.nix-jmu-cs345.enable = true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user