1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-30 06:59:45 +01:00

flake.nix: Add packages and defaultPackages outputs (#1913)

This commit is contained in:
Imran Hossain 2021-04-11 17:46:27 -04:00 committed by GitHub
parent 7cf69a3b8d
commit 0a6227d667
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,26 +1,43 @@
{ {
description = "Home Manager for Nix"; description = "Home Manager for Nix";
outputs = { self, nixpkgs }: rec { outputs = { self, nixpkgs }:
nixosModules.home-manager = import ./nixos; let
nixosModule = self.nixosModules.home-manager; # List of systems supported by home-manager binary
supportedSystems = nixpkgs.lib.platforms.unix;
darwinModules.home-manager = import ./nix-darwin; # Function to generate a set based on supported systems
darwinModule = self.darwinModules.home-manager; forAllSystems = f:
nixpkgs.lib.genAttrs supportedSystems (system: f system);
lib = { nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
hm = import ./modules/lib { lib = nixpkgs.lib; }; in rec {
homeManagerConfiguration = { configuration, system, homeDirectory nixosModules.home-manager = import ./nixos;
, username, extraSpecialArgs ? { } nixosModule = self.nixosModules.home-manager;
, pkgs ? builtins.getAttr system nixpkgs.outputs.legacyPackages
, check ? true }@args: darwinModules.home-manager = import ./nix-darwin;
import ./modules { darwinModule = self.darwinModules.home-manager;
inherit pkgs check extraSpecialArgs;
configuration = { ... }: { packages = forAllSystems (system: {
imports = [ configuration ]; home-manager = nixpkgsFor.${system}.callPackage ./home-manager { };
home = { inherit homeDirectory username; }; });
defaultPackage =
forAllSystems (system: self.packages.${system}.home-manager);
lib = {
hm = import ./modules/lib { lib = nixpkgs.lib; };
homeManagerConfiguration = { configuration, system, homeDirectory
, username, extraSpecialArgs ? { }
, pkgs ? builtins.getAttr system nixpkgs.outputs.legacyPackages
, check ? true }@args:
import ./modules {
inherit pkgs check extraSpecialArgs;
configuration = { ... }: {
imports = [ configuration ];
home = { inherit homeDirectory username; };
};
}; };
}; };
}; };
};
} }