error: attribute 'user' missing #91
-
|
I'm having trouble using the user context in the way demonstrated by the autologin module in the user template. This is a simplified version of what I'm doing: { den, ... }
{
den.hosts.x86_64-linux.hades.users.quasi = { };
den.aspects.quasi.includes = [ den.aspects.nushell ];
den.aspects.nushell =
{ user, ... }:
{
nixos =
{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.nushell ];
users.users.${user.userName}.shell = pkgs.bashInteractive;
};
homeManager = {
programs.bash.initExtra = ''
# https://discourse.nixos.org/t/nushell-as-default-shell/68609/17
# Some programs launch interactive shells and pretend
# to use them; such programs always expect a form of POSIX
# shell.
#
# If you don't use programs like that, you can just skip
# this conditional.
if ! [ "$TERM" = "dumb" ]; then
exec nu
fi
'';
};
};
}Building I'm sure I'm messing something up with the dependency system, but to me, it looks pretty much the same as the autologin example in the template. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 12 replies
-
|
Hey @michaelBelsanti, so glad to have you around here,and personally, quite happy that you are testing You are absolutely right!(tm) Your usage-intuition is correct, I have created an issue #92 to fix this, because I believe it is exactly what many people will try at first. I will provide a couple of workarounds, until the PR #93 fixing this lands. For now, if you are in a hurry, use one of the following approaches to define
den.aspects.utils.provides.nushell = { user, ... }: { };
den.aspects.quasi.includes = [ den.aspects.utils._.nushell ];This is basically why the A function definition on The PR fixing this, basically changes our options.den.aspects = mkOption {
type = submodule { freeformType = flake-aspects.types.providerType; };
}
An alternative is to define the den.aspects.nushell.__functor = aspect: { user, ... }: {
nixos = ...;
homeManager = ...;
} But none of these will be needed once #93 lands. |
Beta Was this translation helpful? Give feedback.
Hey @michaelBelsanti, so glad to have you around here,and personally, quite happy that you are testing
den.You are absolutely right!(tm)
Your usage-intuition is correct, I have created an issue #92 to fix this, because I believe it is exactly what many people will try at first.
I will provide a couple of workarounds, until the PR #93 fixing this lands.
For now, if you are in a hurry, use one of the following approaches to define
nushell:A)Definenushellinside any.provides.treeThis is basically why the
eg.autologinexample you mention does work.A function definit…