nixos: home: import common modules

This commit is contained in:
Bruno BELANYI 2024-01-03 16:50:05 +00:00
parent aa1336bb8d
commit 70d6f6f760
2 changed files with 10 additions and 3 deletions

View file

@ -3,9 +3,9 @@
{ lib, type ? null, ... }: { lib, type ? null, ... }:
let let
allowedTypes = [ allowedTypes = [
"nixos"
"home"
"darwin" "darwin"
"home"
"nixos"
]; ];
allowedTypesString = lib.concatStringSep ", " (builtins.map lib.escapeNixString allowedTypes); allowedTypesString = lib.concatStringSep ", " (builtins.map lib.escapeNixString allowedTypes);

View file

@ -14,7 +14,12 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home-manager = { home-manager = {
# Not a fan of out-of-directory imports, but this is a good exception # Not a fan of out-of-directory imports, but this is a good exception
users.${config.my.user.name} = import "${inputs.self}/modules/home"; users.${config.my.user.name} = {
imports = [
"${inputs.self}/modules/common"
"${inputs.self}/modules/home"
];
};
# Nix Flakes compatibility # Nix Flakes compatibility
useGlobalPkgs = true; useGlobalPkgs = true;
@ -23,6 +28,8 @@ in
# Forward inputs to home-manager configuration # Forward inputs to home-manager configuration
extraSpecialArgs = { extraSpecialArgs = {
inherit inputs; inherit inputs;
# For consumption by common modules
type = "home";
}; };
}; };
}; };