* Add flake.lock and clean up flake.nix
Add a lockfile to work around https://github.com/NixOS/nix/issues/6541
(and because it's a good idea anyway).
Also use flake-utils, and restrict ourselves to the five platforms
supported by nixpkgs. Otherwise, the IFD for nmd fails on weird
platforms. This fixes `nix flake check`.
Remove the redundant `apps` output, see https://github.com/nix-community/home-manager/pull/2442#issuecomment-1133670487
* nixos,nix-darwin: factor out into a common module
* nixos,nix-darwin: make `home-managers.users` shallowly visible
Make sure the option is included in the NixOS/nix-darwin manual (but the
HM submodule options aren't).
Also add a static description to the HM submodule type so that we don't need to
evaluate the submodules just to build the option manual. This makes
nixos-search able to index the home-manager flake.
Also clean up some TODOs.
* flake: add nmd and nmt
This avoids having to use `pkgs.fetchFromGitLab` in an IFD, which causes
issues when indexing packages with nixos-search because `pkgs` is
instantiated with every platform.
Home Manager can be ran with
`nix run --no-write-lock-file github:nix-community/home-manager`.
This is useful for people who want to try out Home Manager or,
want to bootstrap their home-environment.
* flake: ensure passed pkgs with overlays and config is used
In the pkgsModule inside modules/modules.nix it will try to use the
<nixpkgs> from NIX_PATH if home.stateVersion is not set. This is not
available when using flakes so we need to require at least 20.09 and we
might as well default to that.
Also if you have added overlays and config to your pkgs it will be lost
so we need to transfer those as well.
This is an alternative to passing pkgs to extraSpecialArgs which will
break the usage of things like nixpkgs.config.packageOverrides.
* flake: add extraModules
If you want to add some extra home-manager modules, you have to mix them
with the configuration as such:
configuration = {
imports = [
emacs-config.homeManagerModules.emacsConfig
./home.nix
];
};
Instead of:
configuration = ./home.nix;
extraModules = [ emacs-config.homeManagerModules.emacsConfig ];
Which separates these two concerns.
No flake.lock is added because the only input (nixpkgs) will almost
always be overridden, and currently Home Manager's testing and
verification is not flake based.
PR #1455