mirror of
https://github.com/nix-community/home-manager
synced 2024-11-22 20:53:14 +00:00
flake.nix: Add packages and defaultPackages outputs (#1913)
This commit is contained in:
parent
7cf69a3b8d
commit
0a6227d667
1 changed files with 35 additions and 18 deletions
19
flake.nix
19
flake.nix
|
@ -1,13 +1,30 @@
|
|||
{
|
||||
description = "Home Manager for Nix";
|
||||
|
||||
outputs = { self, nixpkgs }: rec {
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
# List of systems supported by home-manager binary
|
||||
supportedSystems = nixpkgs.lib.platforms.unix;
|
||||
|
||||
# Function to generate a set based on supported systems
|
||||
forAllSystems = f:
|
||||
nixpkgs.lib.genAttrs supportedSystems (system: f system);
|
||||
|
||||
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
|
||||
in rec {
|
||||
nixosModules.home-manager = import ./nixos;
|
||||
nixosModule = self.nixosModules.home-manager;
|
||||
|
||||
darwinModules.home-manager = import ./nix-darwin;
|
||||
darwinModule = self.darwinModules.home-manager;
|
||||
|
||||
packages = forAllSystems (system: {
|
||||
home-manager = nixpkgsFor.${system}.callPackage ./home-manager { };
|
||||
});
|
||||
|
||||
defaultPackage =
|
||||
forAllSystems (system: self.packages.${system}.home-manager);
|
||||
|
||||
lib = {
|
||||
hm = import ./modules/lib { lib = nixpkgs.lib; };
|
||||
homeManagerConfiguration = { configuration, system, homeDirectory
|
||||
|
|
Loading…
Reference in a new issue