ark/modules/base/hm-system-defaults.nix

48 lines
1.3 KiB
Nix
Raw Normal View History

2022-06-10 21:36:34 +03:00
{
config,
inputs,
2022-08-11 05:44:58 +03:00
tlib,
2022-06-10 21:36:34 +03:00
...
}: {
2022-04-09 21:33:13 +03:00
home-manager.useGlobalPkgs = true;
2022-04-10 08:18:19 +03:00
home-manager.useUserPackages = true;
2021-07-09 18:17:05 +03:00
home-manager.sharedModules = [
2022-09-12 03:32:23 +03:00
"${inputs.self}/users/modules/settings"
2021-07-09 18:17:05 +03:00
{
2022-08-11 05:44:58 +03:00
home = {
inherit (config.environment) shellAliases sessionVariables;
stateVersion = config.system.stateVersion;
};
2022-02-18 20:31:01 +03:00
xdg.configFile."nix/registry.json".text = config.environment.etc."nix/registry.json".text;
2022-04-10 08:18:19 +03:00
xdg.configFile."nix/nix.conf".source = config.environment.etc."nix/nix.conf".source;
2022-09-29 23:34:57 +03:00
# xdg.configFile."nix/netrc".source = config.environment.etc."nix/netrc".source;
2021-07-09 18:17:05 +03:00
}
2022-10-04 02:08:44 +03:00
({
config,
pkgs,
lib,
...
}: {
home.packages = [
(
pkgs.writeShellScriptBin "apply-hm-env" ''
${lib.optionalString (config.home.sessionPath != []) ''
export PATH=${builtins.concatStringsSep ":" config.home.sessionPath}:$PATH
''}
${builtins.concatStringsSep "\n" (lib.mapAttrsToList (k: v: ''
export ${k}="${v}"
'')
config.home.sessionVariables)}
${config.home.sessionVariablesExtra}
exec "$@"
''
)
];
})
2021-07-09 18:17:05 +03:00
];
2022-11-27 01:04:43 +03:00
home-manager.extraSpecialArgs = {
inherit inputs tlib;
nixosConfig = config;
};
2021-07-09 18:17:05 +03:00
}