add homeManagerFlakeModule for declaring homeManager flake outputs

This commit is contained in:
ulic-youthlic 2025-03-13 20:11:08 +08:00
parent f7c4a7d830
commit 0ff80a7596
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
3 changed files with 11 additions and 8 deletions

View file

@ -41,8 +41,8 @@ Hey, you. This is my nixos configurations.
| `overlays.additions` | the ovelrays add packages in `<nixpkgs>` | ./overlays/additions |
| `nixosModules.default` | nixos modules shared on different nixos machines | ./nixos/modules |
| `nixosConfigurations.${machine}` | machine-local nixos config | ./nixos/configurations/${machine} |
| `homeManagerModules.default` | home-manager modules shared between different user and machine combinations | ./home/modules |
| `homeManagerModules.extra` | home-manager modules only for non-nixos | ./home/extra |
| `homeManagerModules.${user}` | home-manager modules shared between different users | ./home/${user}/modules |
| `homeModules.default` | home-manager modules shared between different user and machine combinations | ./home/modules |
| `homeModules.extra` | home-manager modules only for non-nixos | ./home/extra |
| `homeModules.${user}` | home-manager modules shared between different users | ./home/${user}/modules |
| `homeConfigurations."${user}@${machine}"` | home-manager config for different user and machine combinations | ./home/${user}/configurations/${machine} |
| `deploy.nodes.${machine}.system` | deploy-rs profile for deploying `nixosConfiguration.${machine}` remotely | - |

View file

@ -181,6 +181,9 @@
in
flake-parts.lib.mkFlake { inherit inputs; } {
systems = flake-utils.lib.defaultSystems;
imports = [
inputs.home-manager.flakeModules.home-manager
];
perSystem = (
{ pkgs, system, ... }@args:
{
@ -272,12 +275,12 @@
[
"${toString ./home}/${unixName}/configurations/${hostName}"
]
++ (with outputs.homeManagerModules; [
++ (with outputs.homeModules; [
default
extra
])
++ [
outputs.homeManagerModules."${unixName}"
outputs.homeModules."${unixName}"
];
extraSpecialArgs = {
inherit
@ -304,7 +307,7 @@
hostName = "Cape";
unixName = "alice";
};
homeManagerModules =
homeModules =
{
default = import ./home/modules;
extra = import ./home/extra;

View file

@ -47,7 +47,7 @@
{ ... }:
{
imports = [
outputs.homeManagerModules."${unixName}"
outputs.homeModules."${unixName}"
(rootPath + "/home/${unixName}/configurations/${hostName}")
];
}
@ -58,7 +58,7 @@
inherit (pkgs) system;
};
backupFileExtension = "backup";
sharedModules = [ outputs.homeManagerModules.default ];
sharedModules = [ outputs.homeModules.default ];
};
};
}