From 2a7e6197f5f1eb651b7e6f33bb2f61aa9c40d4b8 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 25 Feb 2023 13:12:53 +0000 Subject: [PATCH] flake: system-specific 'homeConfigurations' --- flake.nix | 70 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/flake.nix b/flake.nix index 75aea21..1ba900d 100644 --- a/flake.nix +++ b/flake.nix @@ -158,6 +158,43 @@ finalPackages = filterPackages system flattenedPackages; in finalPackages; + + # Work-around for https://github.com/nix-community/home-manager/issues/3075 + legacyPackages = { + homeConfigurations = { + ambroisie = home-manager.lib.homeManagerConfiguration { + # Work-around for home-manager + # * not letting me set `lib` as an extraSpecialArgs + # * not respecting `nixpkgs.overlays` [1] + # [1]: https://github.com/nix-community/home-manager/issues/2954 + pkgs = import nixpkgs { + inherit system; + + overlays = (lib.attrValues self.overlays) ++ [ + nur.overlay + ]; + }; + + modules = [ + ./home + { + # The basics + home.username = "ambroisie"; + home.homeDirectory = "/home/ambroisie"; + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + # This is a generic linux install + targets.genericLinux.enable = true; + } + ]; + + extraSpecialArgs = { + # Inject inputs to use them in global registry + inherit inputs; + }; + }; + }; + }; }) // { overlays = import ./overlays // { lib = final: prev: { inherit lib; }; @@ -165,39 +202,6 @@ ambroisie = prev.recurseIntoAttrs (import ./pkgs { pkgs = prev; }); }; }; - homeConfigurations = - let - system = "x86_64-linux"; - pkgs = import nixpkgs { - inherit system; - overlays = (lib.attrValues self.overlays) ++ [ - nur.overlay - ]; - }; - in - { - ambroisie = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - - modules = [ - ./home - { - # The basics - home.username = "ambroisie"; - home.homeDirectory = "/home/ambroisie"; - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; - # This is a generic linux install - targets.genericLinux.enable = true; - } - ]; - - extraSpecialArgs = { - # Inject inputs to use them in global registry - inherit inputs; - }; - }; - }; nixosConfigurations = lib.mapAttrs buildHost { aramis = "x86_64-linux";