2020-08-26 08:13:05 +02:00
|
|
|
{
|
|
|
|
description = "Home Manager for Nix";
|
|
|
|
|
2021-04-11 23:46:27 +02:00
|
|
|
outputs = { self, nixpkgs }:
|
|
|
|
let
|
|
|
|
# List of systems supported by home-manager binary
|
|
|
|
supportedSystems = nixpkgs.lib.platforms.unix;
|
2020-08-26 08:13:05 +02:00
|
|
|
|
2021-04-11 23:46:27 +02:00
|
|
|
# Function to generate a set based on supported systems
|
|
|
|
forAllSystems = f:
|
|
|
|
nixpkgs.lib.genAttrs supportedSystems (system: f system);
|
2020-08-27 18:38:15 +02:00
|
|
|
|
2021-04-11 23:46:27 +02:00
|
|
|
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;
|
|
|
|
|
2021-09-18 04:33:20 +02:00
|
|
|
packages = forAllSystems (system:
|
|
|
|
let docs = import ./docs { pkgs = nixpkgsFor.${system}; };
|
|
|
|
in {
|
|
|
|
home-manager = nixpkgsFor.${system}.callPackage ./home-manager { };
|
|
|
|
docs-html = docs.manual.html;
|
|
|
|
docs-manpages = docs.manPages;
|
|
|
|
docs-json = docs.options.json;
|
|
|
|
});
|
2021-04-11 23:46:27 +02:00
|
|
|
|
|
|
|
defaultPackage =
|
|
|
|
forAllSystems (system: self.packages.${system}.home-manager);
|
|
|
|
|
|
|
|
lib = {
|
|
|
|
hm = import ./modules/lib { lib = nixpkgs.lib; };
|
|
|
|
homeManagerConfiguration = { configuration, system, homeDirectory
|
2021-04-20 22:19:24 +02:00
|
|
|
, username, extraModules ? [ ], extraSpecialArgs ? { }
|
2021-04-11 23:46:27 +02:00
|
|
|
, pkgs ? builtins.getAttr system nixpkgs.outputs.legacyPackages
|
2021-04-20 22:19:24 +02:00
|
|
|
, check ? true, stateVersion ? "20.09" }@args:
|
|
|
|
assert nixpkgs.lib.versionAtLeast stateVersion "20.09";
|
|
|
|
|
2021-04-11 23:46:27 +02:00
|
|
|
import ./modules {
|
|
|
|
inherit pkgs check extraSpecialArgs;
|
|
|
|
configuration = { ... }: {
|
2021-04-20 22:19:24 +02:00
|
|
|
imports = [ configuration ] ++ extraModules;
|
|
|
|
home = { inherit homeDirectory stateVersion username; };
|
|
|
|
nixpkgs = { inherit (pkgs) config overlays; };
|
2021-04-11 23:46:27 +02:00
|
|
|
};
|
2020-08-26 08:13:05 +02:00
|
|
|
};
|
2021-04-11 23:46:27 +02:00
|
|
|
};
|
2020-08-26 08:13:05 +02:00
|
|
|
};
|
|
|
|
}
|