2eafb8192e
GitOrigin-RevId: 176e455371a8371586e8a3ff0d56ee9f3ca2324e
31 lines
917 B
Nix
31 lines
917 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.home-manager;
|
|
|
|
in {
|
|
imports = [ ../nixos/common.nix ];
|
|
|
|
config = mkMerge [
|
|
{ home-manager.extraSpecialArgs.darwinConfig = config; }
|
|
(mkIf (cfg.users != { }) {
|
|
system.activationScripts.postActivation.text = concatStringsSep "\n"
|
|
(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);
|
|
})
|
|
];
|
|
}
|