mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-18 14:28:15 +00:00
* nixos: remove with lib * nix-darwin: remove with lib * home-manager: remove with lib * modules/accounts: remove with lib * modules/config: remove with lib * modules/i18n: remove with lib * modules/misc: remove with lib * modules: remove with lib * modules/targets: remove with lib * tests/modules/firefox: remove with lib * tests/modules/services: remove with lib
29 lines
922 B
Nix
29 lines
922 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.home-manager;
|
|
|
|
in {
|
|
imports = [ ../nixos/common.nix ];
|
|
|
|
config = lib.mkMerge [
|
|
{ home-manager.extraSpecialArgs.darwinConfig = config; }
|
|
(lib.mkIf (cfg.users != { }) {
|
|
system.activationScripts.postActivation.text = lib.concatStringsSep "\n"
|
|
(lib.mapAttrsToList (username: usercfg: ''
|
|
echo Activating home-manager configuration for ${username}
|
|
sudo -u ${username} --set-home ${
|
|
pkgs.writeShellScript "activation-${username}" ''
|
|
${lib.optionalString (cfg.backupFileExtension != null)
|
|
"export HOME_MANAGER_BACKUP_EXT=${
|
|
lib.escapeShellArg cfg.backupFileExtension
|
|
}"}
|
|
${lib.optionalString cfg.verbose "export VERBOSE=1"}
|
|
exec ${usercfg.home.activationPackage}/activate
|
|
''
|
|
}
|
|
'') cfg.users);
|
|
})
|
|
];
|
|
}
|