flake: home-manager: use 'hosts' option

This commit is contained in:
Bruno BELANYI 2023-12-07 21:41:05 +00:00
parent e33357f72e
commit d94c9da1c1

View file

@ -1,5 +1,7 @@
{ self, inputs, lib, ... }: { self, config, inputs, lib, ... }:
let let
inherit (config) hosts;
defaultModules = [ defaultModules = [
# Include generic settings # Include generic settings
"${self}/modules/home" "${self}/modules/home"
@ -43,18 +45,19 @@ let
}; };
}; };
homes = { in
{
hosts.homes = {
"ambroisie@bazin" = "x86_64-linux"; "ambroisie@bazin" = "x86_64-linux";
"ambroisie@mousqueton" = "x86_64-linux"; "ambroisie@mousqueton" = "x86_64-linux";
}; };
in
{
perSystem = { system, ... }: { perSystem = { system, ... }: {
# Work-around for https://github.com/nix-community/home-manager/issues/3075 # Work-around for https://github.com/nix-community/home-manager/issues/3075
legacyPackages = { legacyPackages = {
homeConfigurations = homeConfigurations =
let let
filteredHomes = lib.filterAttrs (_: v: v == system) homes; filteredHomes = lib.filterAttrs (_: v: v == system) hosts.homes;
allHomes = filteredHomes // { allHomes = filteredHomes // {
# Default configuration # Default configuration
ambroisie = system; ambroisie = system;