Hey all — I’ve having trouble diagnosing what I’ve done wrong in configuring home-manager.
I’d love to know both what I’ve done wrong and how to more easily find the actual issue. Thanks!
I’m by no means a master of the nix language, and have likely made a rookie mistake, but it’s not obvious to me how to debug it either. The --show-trace
option isn’t giving me enough info.
I’ve pushed the branch feature/team-manager
here for full code (if that helps).
So I have the following helper functions in home.nix
:
let
helpers = rec {
...
defaultPath = name: "${env.baseDir}/defaults}/${name}.nix";
mePath = name: "${env.meDir}/${name}.nix";
optCallPackage = package: args: default:
if builtins.pathExists package
then pkgs.callPackage package args
else default;
};
and I’m calling it as follows:
functionArgs = {
pkgs = pkgs;
env = env;
helpers = helpers;
};
defaultHome = with helpers; optCallPackage (defaultPath "home") functionArgs {};
customHomeArgs = { defaults = defaultHome; } // functionArgs;
customHome = with helpers; optCallPackage (mePath "home") customHomeArgs {};
The defaults/home.nix
file or overlaid home.nix file looks like:
{ lib, stdenv, pkgs, env, helpers, ... }:
let
...
in
{
...
packages = with pkgs; [...];
}
The output is as follows:
nix-home % nix-shell --run "home-manager switch --show-trace"
error: while evaluating the attribute 'text' of the derivation 'news-info.sh' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/pkgs/stdenv/generic/make-derivation.nix:201:11:
while evaluating the attribute 'newsEntries' at /nix/store/jaakqrmc4pz36676pwcsj05hrrp91wg4-home-manager-src/modules/default.nix:60:3:
while evaluating anonymous function at /nix/store/jaakqrmc4pz36676pwcsj05hrrp91wg4-home-manager-src/modules/default.nix:62:15, called from undefined position:
while evaluating the attribute 'condition' at undefined position:
while evaluating 'g' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/attrsets.nix:298:19, called from undefined position:
while evaluating anonymous function at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:140:72, called from /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/attrsets.nix:301:20:
while evaluating the attribute 'value' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:525:9:
while evaluating the option `news.entries.[definition 1-entry 26].condition':
while evaluating the attribute 'mergedValue' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:557:5:
while evaluating the attribute 'values' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:551:9:
while evaluating the attribute 'values' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:650:7:
while evaluating anonymous function at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:537:28, called from /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:537:17:
while evaluating definitions from `/nix/store/jaakqrmc4pz36676pwcsj05hrrp91wg4-home-manager-src/modules/misc/news.nix':
while evaluating 'dischargeProperties' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:609:25, called from /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:538:137:
while evaluating the attribute 'value' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:392:44:
while evaluating the attribute 'home.activation' at undefined position:
while evaluating 'g' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/attrsets.nix:298:19, called from undefined position:
while evaluating anonymous function at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:140:72, called from /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/attrsets.nix:301:20:
while evaluating the attribute 'value' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:525:9:
while evaluating the option `home.activation':
while evaluating the attribute 'mergedValue' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:557:5:
while evaluating the attribute 'values' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:551:9:
while evaluating the attribute 'values' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:650:7:
while evaluating 'byName' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:364:25, called from /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:391:22:
while evaluating the attribute 'home' at undefined position:
while evaluating anonymous function at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:377:38, called from undefined position:
while evaluating anonymous function at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:387:46, called from /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:378:56:
while evaluating 'pushDownProperties' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:589:24, called from /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:388:69:
while evaluating 'optCallPackage' at /Users/ldeck/tools/nix-home/home.nix:39:37, called from /Users/ldeck/tools/nix-home/home.nix:63:30:
while evaluating anonymous function at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:303:44, called from undefined position:
while evaluating the module argument `pkgs' in "/Users/ldeck/tools/nix-home/home.nix":
while evaluating the attribute '_module.args.pkgs' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/attrsets.nix:366:7:
while evaluating anonymous function at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/types.nix:410:29, called from /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/attrsets.nix:366:15:
while evaluating the attribute 'optionalValue.value' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:569:5:
while evaluating the attribute 'values' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:551:9:
while evaluating anonymous function at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:547:19, called from /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:547:14:
while evaluating the attribute 'value._type' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:648:73:
while evaluating the attribute 'value.content' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:708:14:
while evaluating anonymous function at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:303:44, called from undefined position:
while evaluating the module argument `pkgsPath' in "/nix/store/jaakqrmc4pz36676pwcsj05hrrp91wg4-home-manager-src/modules/misc/nixpkgs.nix":
while evaluating the attribute '_module.args.pkgsPath' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/attrsets.nix:366:7:
while evaluating anonymous function at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/types.nix:410:29, called from /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/attrsets.nix:366:15:
while evaluating the attribute 'optionalValue.value' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:569:5:
while evaluating the attribute 'values' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:551:9:
while evaluating anonymous function at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:547:19, called from /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:547:14:
while evaluating the attribute 'value._type' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:648:73:
while evaluating the attribute 'value.content' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:708:14:
while evaluating 'versionAtLeast' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/strings.nix:503:24, called from /nix/store/jaakqrmc4pz36676pwcsj05hrrp91wg4-home-manager-src/modules/modules.nix:248:12:
while evaluating 'versionOlder' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/strings.nix:491:22, called from /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/strings.nix:503:29:
while evaluating the attribute 'home.stateVersion' at undefined position:
while evaluating 'g' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/attrsets.nix:298:19, called from undefined position:
while evaluating anonymous function at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:140:72, called from /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/attrsets.nix:301:20:
while evaluating the attribute 'value' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:525:9:
while evaluating the option `home.stateVersion':
while evaluating the attribute 'mergedValue' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:557:5:
while evaluating the attribute 'values' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:551:9:
while evaluating the attribute 'values' at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:650:7:
infinite recursion encountered, at /nix/store/cc5ylc3i1h4dsh4a81cz4l6nsk6b5mvg-nixpkgs-unstable-src/lib/modules.nix:400:20