home.activation seems to be a way to run arbitrary shell commands. In my case (for test purposes, just to get this working), I want to create an empty directory in my home directory. According to the documentation, I think this should do the trick:
home-manager.users.media = { pkgs, ... }: {
<SNIP>
home.activation = {
test = lib.hm.dag.entryAfter ["writeBoundary"] ''
mkdir testdir
'';
};
However, I get this error:
<SNIP>
error: attribute 'hm' missing
at /etc/nixos/media.nix:55:14:
54| home.activation = {
55| test = lib.hm.dag.entryAfter ["writeBoundary"] ''
| ^
56| mkdir testdir
Did you mean one of id or or?
I did some searching and found this reddit post that indicates I should add home-manager before lib:
home-manager.users.media = { pkgs, ... }: {
<SNIP>
home.activation = {
test = home-manager.lib.hm.dag.entryAfter ["writeBoundary"] ''
mkdir testdir
'';
};
However:
<SNIP>
error: undefined variable 'home-manager'
at /etc/nixos/media.nix:55:14:
54| home.activation = {
55| test = home-manager.lib.hm.dag.entryAfter ["writeBoundary"] ''
| ^
56| mkdir testdir
What am I missing or doing wrong?