2020-08-26 06:13:05 +00:00
|
|
|
{
|
|
|
|
description = "Home Manager for Nix";
|
|
|
|
|
2022-06-07 18:45:06 +00:00
|
|
|
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
inputs.utils.url = "github:numtide/flake-utils";
|
2020-08-27 16:38:15 +00:00
|
|
|
|
2022-06-26 18:55:07 +00:00
|
|
|
outputs = { self, nixpkgs, utils, ... }:
|
2022-06-07 18:45:06 +00:00
|
|
|
{
|
|
|
|
nixosModules = rec {
|
|
|
|
home-manager = import ./nixos;
|
|
|
|
default = home-manager;
|
|
|
|
};
|
|
|
|
# deprecated in Nix 2.8
|
|
|
|
nixosModule = self.nixosModules.default;
|
2021-11-23 06:36:55 +00:00
|
|
|
|
2022-06-07 18:45:06 +00:00
|
|
|
darwinModules = rec {
|
|
|
|
home-manager = import ./nix-darwin;
|
|
|
|
default = home-manager;
|
|
|
|
};
|
|
|
|
# unofficial; deprecated in Nix 2.8
|
|
|
|
darwinModule = self.darwinModules.default;
|
2021-11-23 06:36:55 +00:00
|
|
|
|
2022-08-27 02:37:16 +00:00
|
|
|
templates = {
|
|
|
|
standalone = {
|
|
|
|
path = ./templates/standalone;
|
|
|
|
description = "Standalone setup";
|
|
|
|
};
|
|
|
|
nixos = {
|
|
|
|
path = ./templates/nixos;
|
|
|
|
description = "Home Manager as a NixOS module,";
|
|
|
|
};
|
|
|
|
nix-darwin = {
|
|
|
|
path = ./templates/nix-darwin;
|
|
|
|
description = "Home Manager as a nix-darwin module,";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
defaultTemplate = self.templates.standalone;
|
|
|
|
|
2021-04-11 21:46:27 +00:00
|
|
|
lib = {
|
2022-07-22 19:29:04 +00:00
|
|
|
hm = (import ./modules/lib/stdlib-extended.nix nixpkgs.lib).hm;
|
2022-06-19 23:37:57 +00:00
|
|
|
homeManagerConfiguration = { modules ? [ ], pkgs, lib ? pkgs.lib
|
|
|
|
, extraSpecialArgs ? { }, check ? true
|
|
|
|
# Deprecated:
|
|
|
|
, configuration ? null, extraModules ? null, stateVersion ? null
|
|
|
|
, username ? null, homeDirectory ? null, system ? null }@args:
|
|
|
|
let
|
2022-09-27 05:07:03 +00:00
|
|
|
msgForRemovedArg = ''
|
|
|
|
The 'homeManagerConfiguration' arguments
|
2021-04-20 20:19:24 +00:00
|
|
|
|
2022-09-27 05:07:03 +00:00
|
|
|
- 'configuration',
|
|
|
|
- 'username',
|
|
|
|
- 'homeDirectory'
|
|
|
|
- 'stateVersion',
|
|
|
|
- 'extraModules', and
|
|
|
|
- 'system'
|
2022-06-19 23:37:57 +00:00
|
|
|
|
2022-09-27 05:07:03 +00:00
|
|
|
have been removed. Instead use the arguments 'pkgs' and
|
|
|
|
'modules'. See the 22.11 release notes for more.
|
|
|
|
'';
|
|
|
|
|
|
|
|
throwForRemovedArgs = v:
|
|
|
|
let
|
|
|
|
used = builtins.filter (n: (args.${n} or null) != null) [
|
|
|
|
"configuration"
|
|
|
|
"username"
|
|
|
|
"homeDirectory"
|
|
|
|
"stateVersion"
|
|
|
|
"extraModules"
|
|
|
|
"system"
|
|
|
|
];
|
|
|
|
msg = msgForRemovedArg + ''
|
|
|
|
|
|
|
|
|
|
|
|
Deprecated args passed: ''
|
|
|
|
+ builtins.concatStringsSep " " used;
|
|
|
|
in lib.throwIf (used != [ ]) msg v;
|
2022-06-19 23:37:57 +00:00
|
|
|
|
|
|
|
in throwForRemovedArgs (import ./modules {
|
2022-04-17 22:14:41 +00:00
|
|
|
inherit pkgs lib check extraSpecialArgs;
|
2021-04-11 21:46:27 +00:00
|
|
|
configuration = { ... }: {
|
2022-06-19 23:37:57 +00:00
|
|
|
imports = modules;
|
2021-04-20 20:19:24 +00:00
|
|
|
nixpkgs = { inherit (pkgs) config overlays; };
|
2021-04-11 21:46:27 +00:00
|
|
|
};
|
2022-06-19 23:37:57 +00:00
|
|
|
});
|
2021-04-11 21:46:27 +00:00
|
|
|
};
|
2022-06-07 18:45:06 +00:00
|
|
|
} // utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
2022-06-16 10:25:39 +00:00
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
2022-06-26 18:55:07 +00:00
|
|
|
docs = import ./docs { inherit pkgs; };
|
2022-06-07 18:45:06 +00:00
|
|
|
in {
|
|
|
|
packages = rec {
|
|
|
|
home-manager = pkgs.callPackage ./home-manager { };
|
|
|
|
docs-html = docs.manual.html;
|
|
|
|
docs-manpages = docs.manPages;
|
|
|
|
docs-json = docs.options.json;
|
|
|
|
default = home-manager;
|
|
|
|
};
|
|
|
|
# deprecated in Nix 2.7
|
|
|
|
defaultPackage = self.packages.${system}.default;
|
|
|
|
});
|
2020-08-26 06:13:05 +00:00
|
|
|
}
|