depot/ops/home-manager-ext.nix

39 lines
991 B
Nix
Raw Permalink Normal View History

2021-03-20 20:46:56 +00:00
# SPDX-FileCopyrightText: 2021 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
{ depot, lib, pkgs, ... }@args:
let
cfg = configName: configPath: { ... }: {
_module.args = args // {
inherit configName;
};
imports = [ configPath ];
};
configs = {
base = nixos/lib/home-manager/common.nix;
client = nixos/lib/home-manager/client.nix;
2022-02-27 19:32:48 +00:00
porcorosso-wsl = nixos/lib/home-manager/porcorosso-wsl.nix;
};
configModules = lib.mapAttrs cfg configs;
builtModules = lib.mapAttrs (name: value: (import ../third_party/home-manager/modules {
inherit pkgs;
2022-02-27 19:32:48 +00:00
configuration = {
imports = [ value ];
config._module.args.pkgs = lib.mkForce pkgs;
2022-02-27 19:32:48 +00:00
config.nixpkgs.config = pkgs.config;
config.home.sessionVariablesExtra = ''
export PATH="$HOME/.nix-profile/bin''${PATH:+:}$PATH"
'';
};
check = true;
}).activationPackage) configModules;
in
configModules // {
built = builtModules;
}