2020-08-26 08:13:05 +02:00
|
|
|
{
|
|
|
|
description = "Home Manager for Nix";
|
|
|
|
|
2022-06-07 20:45:06 +02:00
|
|
|
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
inputs.nmd.url = "gitlab:rycee/nmd";
|
|
|
|
inputs.nmd.flake = false;
|
|
|
|
inputs.nmt.url = "gitlab:rycee/nmt";
|
|
|
|
inputs.nmt.flake = false;
|
2020-08-26 08:13:05 +02:00
|
|
|
|
2022-06-07 20:45:06 +02:00
|
|
|
inputs.utils.url = "github:numtide/flake-utils";
|
|
|
|
inputs.flake-compat.url = "github:edolstra/flake-compat";
|
|
|
|
inputs.flake-compat.flake = false;
|
2020-08-27 18:38:15 +02:00
|
|
|
|
2022-06-07 20:45:06 +02:00
|
|
|
outputs = { self, nixpkgs, nmd, utils, ... }:
|
|
|
|
{
|
|
|
|
nixosModules = rec {
|
|
|
|
home-manager = import ./nixos;
|
|
|
|
default = home-manager;
|
|
|
|
};
|
|
|
|
# deprecated in Nix 2.8
|
|
|
|
nixosModule = self.nixosModules.default;
|
2021-11-23 07:36:55 +01:00
|
|
|
|
2022-06-07 20:45:06 +02:00
|
|
|
darwinModules = rec {
|
|
|
|
home-manager = import ./nix-darwin;
|
|
|
|
default = home-manager;
|
|
|
|
};
|
|
|
|
# unofficial; deprecated in Nix 2.8
|
|
|
|
darwinModule = self.darwinModules.default;
|
2021-11-23 07:36:55 +01:00
|
|
|
|
2021-04-11 23:46:27 +02:00
|
|
|
lib = {
|
|
|
|
hm = import ./modules/lib { lib = nixpkgs.lib; };
|
|
|
|
homeManagerConfiguration = { configuration, system, homeDirectory
|
2022-06-16 12:21:13 +02:00
|
|
|
, username, extraModules ? [ ], extraSpecialArgs ? { }, pkgs
|
2022-04-18 00:14:41 +02:00
|
|
|
, lib ? pkgs.lib, check ? true, stateVersion ? "20.09" }@args:
|
2021-04-20 22:19:24 +02:00
|
|
|
assert nixpkgs.lib.versionAtLeast stateVersion "20.09";
|
|
|
|
|
2021-04-11 23:46:27 +02:00
|
|
|
import ./modules {
|
2022-04-18 00:14:41 +02:00
|
|
|
inherit pkgs lib check extraSpecialArgs;
|
2021-04-11 23:46:27 +02:00
|
|
|
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
|
|
|
};
|
2022-06-07 20:45:06 +02:00
|
|
|
} // utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
2022-06-16 12:25:39 +02:00
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
2022-06-07 20:45:06 +02:00
|
|
|
docs = import ./docs {
|
|
|
|
inherit pkgs;
|
|
|
|
nmdSrc = nmd;
|
|
|
|
};
|
|
|
|
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 08:13:05 +02:00
|
|
|
}
|