1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-05 02:39:45 +01:00
Commit graph

22 commits

Author SHA1 Message Date
Andrew Marshall
cc58d31953
flake: Expose tests to allow running purely (#3412)
* flake: Expose tests to allow running purely

The existing way to run tests with `nix-shell` relies on impure usage of
`<nixpkgs>`. This can lead to failures when the local nixpkgs is
incompatible with the locked one. I.e., where CI is passing but a
contributor may experience a failure.

So, expose tests as `devShells.tests` to use the locked nixpkgs and
allow easy invocation via `nix develop`.

* tests: Remove impure path

With Nix 2.10+ and pure evaluation mode e.g.

```
nix run nixpkgs/nixos-unstable#nixVersions.nix_2_10 -- develop -i .#tests.zplug-modules
```

this test would fail with:

> error: the path '~/.customZplugHome' can not be resolved in pure mode

Since the test only cares that it is a path, rather than anything about
its contents, use a dummy empty directory.
2022-11-27 01:37:24 +01:00
aameen-tulip
6dc8a43f39
flake: list deprecated args in throw
The use of `throwIf` was retained on the off chance that someone
intentionally overrides it.
2022-09-27 15:50:32 +02:00
MaxCan-Code
8e4220e6c6
flake: add templates (#2892)
Add example flakes from `docs/nix-flakes.adoc` as templates.
2022-08-26 22:37:16 -04:00
Noah Fontes
1d3380afba
flake: fix self referential lib output
In https://github.com/nix-community/home-manager/pull/2859, the
library became self-referential, so we need to use the stdlib-extended
helper instead of importing directly.
2022-07-24 14:38:51 +02:00
Robert Helgesson
9550595502
docs,tests: fetch nmd and nmt using fetchTarball
This simplifies the code a bit and avoids using experimental Flake
functionality. If Flakes become stable before NixOS 22.11 then we can
consider having nmd and nmt as Flake inputs. Maybe could then also
avoid the need for flake-compat.
2022-06-26 22:22:46 +02:00
Naïm Favier
f26946858e
flake: remove superfluous arguments
Remove `stateVersion`, `username`, and `homeDirectory` as they can be
set in the configuration directly. Together with the previous commit,
this makes setting `stateVersion` explicitly mandatory.

Also replace `configuration` by `modules`, which expects a list of
Home Manager modules.

Also remove `system` which was made useless by #3028.
2022-06-26 01:01:57 +02:00
Naïm Favier
69e804839e
flake: don't reinstantiate nixpkgs
See https://zimbatm.com/notes/1000-instances-of-nixpkgs for
motivation.
2022-06-19 00:45:09 +02:00
Naïm Favier
2ff38c646f
flake: make pkgs required in homeManagerConfiguration
Prevents Home Manager from pinning Nixpkgs on behalf of users, see

  https://github.com/nix-community/home-manager/pull/2971#discussion_r898556798
2022-06-19 00:44:29 +02:00
Naïm Camille Favier
64ab7d6e8d
Prepare inclusion in nixos-search (#2971)
* 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.
2022-06-07 20:45:06 +02:00
Sandro
93a69d0738
Simplify function (#2903) 2022-04-20 14:18:39 -04:00
Luc Chabassier
5ac84ebeef
Add lib argument to homeManagerConfiguration (#2753) 2022-04-17 18:14:41 -04:00
Otavio Salvador
cfab869fce
flake: add packages.<system>.default (#2835) 2022-04-02 18:38:18 +02:00
Sandro
b23bb05890
flake: only support linux + darwin
This is to prevent errors with `flake check` because for example
cygwin can't even build bash.

Closes #2829
2022-03-27 00:53:49 +01:00
contrun
c4c761ba55
add flake attribute apps to make it easier to run (#2442)
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.
2021-11-23 01:36:55 -05:00
Samuel Gräfenstein
4320399a3e
flake: add docs to packages output 2021-09-21 22:12:55 +02:00
Terje Larsen
0c236e13bc
flake: add extraModules option, inherit nixpkgs config and overlays in homeManagerConfiguration (#1767)
* 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.
2021-04-20 16:19:24 -04:00
Imran Hossain
0a6227d667
flake.nix: Add packages and defaultPackages outputs (#1913) 2021-04-11 17:46:27 -04:00
Naïm Favier
920ea74afe
flake.nix: add nixosModule and darwinModule to outputs (#1858) 2021-03-16 21:19:01 -04:00
mlatus
cf5dad76c1
flake: add extraSpecialArgs
This allows flake user to pass extra arguments to all modules.
2021-01-07 21:13:28 +01:00
Roosembert Palacios
6dc8de259a
flake: expose Home Manager lib 2020-12-14 21:02:15 +01:00
Nicolas Berbiche
1f34c048b3
flake: add nix-darwin module 2020-09-04 14:34:37 +02:00
Tony Olagbaiye
6cf6b587b5
flake: add flake.nix
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
2020-08-26 23:49:12 +02:00