export home-manager config from homeManagerModules

This commit is contained in:
Katherina Walshe-Grey 2024-09-17 18:40:15 +01:00
parent f4da07c4e6
commit a6359fdd36
2 changed files with 18 additions and 7 deletions

View file

@ -11,9 +11,4 @@ in {
}; };
programs.zsh.enable = true; programs.zsh.enable = true;
home-manager.users.qenya = { config, lib, pkgs, osConfig, ... }: {
home.homeDirectory = osConfig.users.users.qenya.home;
imports = [ ../../home/qenya ];
};
} }

View file

@ -27,6 +27,19 @@
}; };
outputs = inputs@{ self, nixpkgs, home-manager, plasma-manager, nur, agenix, birdsong, ... }: { outputs = inputs@{ self, nixpkgs, home-manager, plasma-manager, nur, agenix, birdsong, ... }: {
# The name of this output type is not standardised. I have picked
# "homeManagerModules" as the discussion here suggests it's the most common:
# https://github.com/nix-community/home-manager/issues/1783
#
# However, note CppNix >= 2.22.3, >= 2.24 has blessed "homeModules":
# https://github.com/NixOS/nix/pull/10858
homeManagerModules."qenya" = { config, lib, pkgs, ... }: {
imports = [
plasma-manager.homeManagerModules.plasma-manager
./home/qenya
];
};
colmena = { colmena = {
meta = { meta = {
nixpkgs = import nixpkgs { system = "x86_64-linux"; }; nixpkgs = import nixpkgs { system = "x86_64-linux"; };
@ -35,7 +48,7 @@
}; };
}; };
defaults = { name, nodes, config, ... }: { defaults = { name, nodes, ... }: {
networking.hostName = name; networking.hostName = name;
nix.settings.experimental-features = "nix-command flakes"; nix.settings.experimental-features = "nix-command flakes";
@ -43,7 +56,10 @@
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [ nur.overlay ]; nixpkgs.overlays = [ nur.overlay ];
home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ];
# TODO: make this or something like it work without infinite recursion
# home-manager.users."qenya" = lib.mkIf (config.users.users ? "qenya") self.homeManagerModules."qenya";
home-manager.users."qenya" = self.homeManagerModules."qenya";
imports = [ imports = [
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager