Hi!
I want to install something from github as part of my system managed home-manager configuration.
Unfortunately, It seems that i can’t get dag.entryAfter
working.
/etc/nixos/home-manager.nix
{ config, lib, pkgs, jsonConfig, ... }:
let
home-manager-src = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-${jsonConfig.system.version}.tar.gz";
home-manager = import home-manager-src { inherit pkgs; };
exampleConfig = import ./example.nix { inherit config lib pkgs jsonConfig home-manager; };
in
{
imports = [
(import "${home-manager-src}/nixos")
];
# Enable the home-manager command globally
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
# Configure home manager for the user
home-manager.users.${jsonConfig.user.username} = {
home.username = jsonConfig.user.username;
home.homeDirectory = "/home/${jsonConfig.user.username}";
home.stateVersion = jsonConfig.system.version;
home.sessionVariables = {
...
};
imports = [
exampleConfig
];
};
}
/etc/nixos/example.nix
{ config, lib, pkgs, jsonConfig, home-manager, ... }:
let
example-src = pkgs.fetchFromGitHub {
owner = "...";
repo = "...";
rev = "master";
sha256 = "...";
};
in
{
home.activation.installExample = lib.hm.dag.entryAfter ["writeBoundary"] ''
${pkgs.bash}/bin/bash ${example-src}/install.sh
'';
}
I’ve got the idea about this way of running scripts from Appendix A. Home Manager Configuration Options
When running the nixos-rebuild switch
, I get error: attribute 'hm' missing