fix: use m3ta-home.paths.srcRoot for wallpapers (pure eval compatible)
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
in {
|
||||
# Home-Manager modules — import in nixos-config via:
|
||||
# imports = [ inputs.m3ta-home.homeManagerModules.default ];
|
||||
homeManagerModules = import ./modules inputs;
|
||||
homeManagerModules = import ./modules { inherit inputs; selfPath = self.outPath; };
|
||||
|
||||
# Library functions — use in nixos-config via:
|
||||
# m3ta-lib = inputs.m3ta-home.lib;
|
||||
|
||||
@@ -5,17 +5,17 @@
|
||||
#
|
||||
# Individual modules declare their own options (mkEnableOption etc.)
|
||||
# and are activated by mkHome's import mechanism.
|
||||
inputs: let
|
||||
{
|
||||
inputs,
|
||||
selfPath,
|
||||
}: let
|
||||
lib = inputs.nixpkgs.lib;
|
||||
|
||||
# Collect all .nix files recursively from a directory
|
||||
collectModules = dir:
|
||||
builtins.filterSource (path: _type:
|
||||
lib.hasSuffix ".nix" (builtins.baseNameOf path))
|
||||
dir;
|
||||
in {
|
||||
default = {
|
||||
imports = [
|
||||
# Paths — must be first, provides m3ta-home.paths.srcRoot
|
||||
./paths.nix
|
||||
|
||||
# Profiles
|
||||
./../profiles/base
|
||||
./../profiles/contexts/desktop
|
||||
@@ -29,5 +29,8 @@ in {
|
||||
./../users/m3tam3re/identities/private.nix
|
||||
./../users/m3tam3re/identities/work.nix
|
||||
];
|
||||
|
||||
# Set the source root for asset path resolution
|
||||
m3ta-home.paths.srcRoot = selfPath;
|
||||
};
|
||||
}
|
||||
|
||||
13
modules/paths.nix
Normal file
13
modules/paths.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
# modules/paths.nix — Provides m3ta-home source paths for pure evaluation mode.
|
||||
#
|
||||
# Relative paths with ../.. break in the Nix store during pure evaluation.
|
||||
# This module exposes the flake source root so other modules can reference
|
||||
# assets via config.m3ta-home.paths.srcRoot.
|
||||
{lib, ...}: {
|
||||
options.m3ta-home.paths = {
|
||||
srcRoot = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = "Root path of the m3ta-home flake source (set by flake.nix).";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -11,8 +11,8 @@ in {
|
||||
|
||||
config = mkIf cfg {
|
||||
xdg.configFile."hypr/wallpapers" = {
|
||||
# Wallpapers stored in m3ta-home/assets/wallpapers/
|
||||
source = ./../../../../assets/wallpapers;
|
||||
# Use the flake source root for pure evaluation compatibility
|
||||
source = "${config.m3ta-home.paths.srcRoot}/assets/wallpapers";
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user