Commit Graph

81 Commits

Author SHA1 Message Date
Sandro Jäckel 5f6364fc28
home-manager: add `--no-out-link` command line option
When this option is used then `home-manager build` will not produce a
`result` link in the current working directory.
2021-07-29 16:04:41 +02:00
Dusk Banks 63af2d3e4c
home-manager: add `home-manager option`
This adds functionality much like that provided by `nixos-option`.
2021-06-15 23:46:45 +02:00
bb010g 5eb199e937
home-manager: pass on `--debug` option (#2049)
* man-home-manager: remove trailing whitespace

* home-manager: pass on `--debug` option
2021-06-05 16:11:06 -06:00
Robert Helgesson 19d95258ac
docs: set current version to 21.11 2021-06-05 20:05:04 +02:00
ant-arctica 3a16ebdf72
home-manager: Add --flake option to home-manager (#1856)
Implements a --flake options for build and switch, along with the usual
flake related optons (for lock-files etc).

Configurations in the flake are automatically discovered in the
following order:
1. `outputs.homeConfigurations."$flake-uri"` (the `--flake parameter`)
2. `outputs.homeConfigurations."$USERNAME@$HOSTNAME"`
3. `outputs.homeConfigurations."$USERNAME"`

Make home-manager use default configuration from
~/.config/nixpkgs/flake.nix, if it exists and nothing else is
specified.

Co-authored-by: Nicolas Berbiche <nicolas@normie.dev>
2021-04-07 13:17:39 -04:00
Sandro 90223cf3eb
home-manager: allow overriding pkgs with --arg(str) (#1889) 2021-03-31 19:40:37 +02:00
Teo Ljungberg 69e2693342
home-manager: respect NO_COLOR environment variable
This makes Home Manager respect the NO_COLOR environment variable to
disable coloring from output generated by Home Manager.

This initiative can be found more on https://no-color.org/
2021-03-03 23:28:06 +01:00
Robert Helgesson 46a750f94f
home-manager: use 21.05 as next version
Fixes #1662
2021-02-05 22:09:00 +01:00
Robert Helgesson fd79015c0f
home-manager: pass `-j` to nix-build
Fixes #1596
2020-11-13 23:56:57 +01:00
Robert Helgesson ef72617c4a
home-manager: add `--version` option 2020-11-03 23:12:24 +01:00
Samuel Ainsworth 7e5fee4268
home-manager: handle `$EDITOR` containing spaces
The quoted `$EDITOR` causes errors when using values containing
arguments, eg. "code --wait". This is in contrast to the majority of
tools (git, etc.) that do support this usage.

Fixes #1496
2020-10-08 23:17:28 +02:00
Robert Helgesson 2c6a023744
home-manager: remove home-manager-path on uninstall
Fixes #1443
2020-08-14 23:19:48 +02:00
Dmitry Kalinkin dc227b579d
home-manager: respect NIX_STATE_DIR
This allows to install home-manager on a system without root access.

PR #1196
2020-06-14 20:41:55 +02:00
Robert Helgesson 687395ebda
home-manager: remove unsupported `-2` option
This option used to make the `home-manager` command use the `nix` tool
from Nix 2. Unfortunately the `nix` tool is a bit experimental and it
is best to await its stabilization before supporting it in Home
Manager.
2020-04-18 11:37:06 +02:00
Robert Helgesson e5325c2274
home-manager: fix shellcheck warning 2020-04-18 11:37:05 +02:00
Timo Kaufmann 5969551a5c
home-manager: add instantiate subcommand
It can be useful to simply instantiate a Home Manager configuration
without actually building it, for example for the purpose of
pre-building it with some custom command.

PR #1099
2020-03-25 21:16:43 +01:00
Chris Hodapp 9ab59dd6ac
home-manager: handle args with spaces to doBuildAttr
Presently, if you pass an argument with spaces in it to `doBuildAttr`,
it will be split it into multiple arguments to `nix build` or
`nix-build`. This situation arises, for example, on systems with
spaces in `XDG_DATA_HOME`.

Specifically, the `home-manager` script errors out in trying to
address the `read-news` state file. With this change, argument
separation should be preserved properly in `doBuildAttr`.

PR #1044
2020-02-24 23:51:36 +01:00
Robert Helgesson e1153f4d2e
home-manager: make sure all files are uninstalled
This forces the `home.file` option to be completely empty when
switching to the uninstall configuration. This is necessary to guard
against files are added by default in Home Manager, such as
`$XDG_CACHE_HOME/.keep`.
2020-02-15 19:26:23 +01:00
oxalica 7c30831e8f
home-manager: fix pass-through option passing
This resolves, e.g., the errors occurring when passing empty arguments
like `--option builders ''`.

Closes #967
2020-01-01 12:27:29 +01:00
Robert Helgesson 7c2532d9f9
home-manager: add --(no-)substitute options
Fixes #312
2019-12-01 10:43:39 +01:00
Robert Helgesson 8ab1d22a82
home-manager: support `--option` argument
Fixes #784
2019-08-30 00:52:09 +02:00
Robert Helgesson 8fe4e0879c
home-manager: support a few extra pass-through options
These options will be passed through to the `nix-build` tool.
2019-08-26 23:06:36 +02:00
Robert Helgesson 6bec9547c6
home-manager: exit directly after printing help 2019-08-26 23:06:36 +02:00
Robert Helgesson 42732990cd
home-manager: rewrite argument parsing
This rewrite allows "long options" but unfortunately does not allow
merged options such as `-vn`.

Also improve the home-manager manual page, with this it should include
all sub-commands and arguments.

Finally, include the home-manager manual page in the generated HTML
documentation.
2019-06-09 22:19:03 +02:00
Judson f82246171b
files: backup file collisions
When a configuration file would be written to an existing file, rather
than failing switch (and having the user have to move or delete those
files), move the files automatically to a new path.

Closes #585
2019-06-09 14:26:12 +02:00
Robert Helgesson 3bb7c75db3
home-manager: add uninstall command 2019-04-28 18:40:41 +02:00
Robert Helgesson 67aee78fdf
home-manager: remove unnecessary error message
An error message about the erroneous option is already printed by
`getopts` so there is no need to print it again.
2019-04-10 01:31:22 +02:00
zimbatm 571e17410a
home-manager: add edit command
With this change, running

    home-manager edit

opens `$HOME_MANAGER_CONFIG` in `$EDITOR`.

This is mainly for convenience. Users should not have to remember the
exact location of the Home Manager configuration.
2018-12-04 23:17:19 +01:00
Alex Brandt 3b9b897af3
home-manager: add generation expiration command
This adds a new command to the home-manager shell script that allows
generations to be removed that are older than an given absolute or
relative date.

This allows users to manage the expiration of their home-manager
generations separately from their system or user profiles via
nix-collect-garbage. It is most important if the user desires to have
a convenient way to have different expiration times for Home Manager
generations than other system or user profiles.
2018-10-18 23:12:29 +02:00
Robert Helgesson 859c132ee2
home-manager: enable build output during switch
Fixes #352
2018-08-28 00:17:57 +02:00
Robert Helgesson 39213a1847
home-manager: fix work directory when building generation 2018-07-31 21:05:05 +02:00
Robert Helgesson 4f67e8d0c3
home-manager: fix GC issue
It was previously possible to create the news information and lose it
in a Nix GC before being able to view it. This also causes a switch to
error out. This change makes the news information a root in the
garbage collector.

Note, this change also removes the need for `nix eval` so the
`doBuildAttr` function is simplified accordingly.

Fixes #327
2018-07-31 13:42:56 +02:00
Robert Helgesson f4a1a5e94c
home-manager: resolve default configuration file path
Home Manager needs an absolute and resolved path to its configuration
file. The default configuration path is absolute but not necessarily
resolved. For example, some users may have `~/.config` be a symbolic
link to somewhere else. We therefore run the default configuration
path through the `realpath` tool to resolve it.

Fixes #304
2018-07-12 00:30:54 +02:00
Robert Helgesson dadfaed829
home-manager: add support for the nix tool
This adds an experimantal, undocumented, and unsupported flag `-2` for
the `home-manager` command that enables the use of the new `nix`
command instead of `nix-build`.
2018-07-08 23:24:35 +02:00
Robert Helgesson 06e7d087f2
home-manager: colorize only when connected to terminal
Before, the output of `home-manager generations` would be colorized
even when used in a pipeline.
2018-03-03 22:00:02 +01:00
Robert Helgesson 81fb420457
home-manager: switch NIX_PATH order
This new order allows overriding the home-manager path from the
command line using `home-manager -I home-manager=/a/b/c`.
2018-01-28 18:37:01 +01:00
Robert Helgesson 5fe8d574ca
home-manager: add shellcheck directives 2018-01-27 09:49:35 +01:00
Robert Helgesson a9dc7fa7cc
home-manager: improve the generation timestamp format 2018-01-27 09:47:30 +01:00
Mario Rodas 21fefbc8f6
home-manager: check whether a command is passed
"set -u" treats unset variables as an error, and $1 is unbound when no
command is passed.
2018-01-22 19:18:10 +01:00
Robert Helgesson 04ea044917
home-manager: look for '--help' on command line
This is a special case to work around the lack of long options in
`getopts`.
2017-11-12 14:11:59 +01:00
Robert Helgesson 66219f23bb
home-manager: add 'remove-generations' command
This command allows the user to immediately remove specific
generations from the profiles directory.
2017-11-12 14:07:41 +01:00
Robert Helgesson 187a12e90a
home-manager: minor cleanup output from generations 2017-11-12 13:37:59 +01:00
Robert Helgesson 14083a0857
home-manager: refuse build if CWD is read-only
This produces a clearer error message than produced by Nix.

Fixes #116.
2017-11-05 19:33:08 +01:00
Robert Helgesson efb5256d28
home-manager: use XDG configuration directory 2017-10-29 01:59:34 +02:00
Silvan Mosberger 35775b3bc5 fix typo 2017-10-24 13:12:18 +02:00
Robert Helgesson bf3a8c6383
home-manager: point <home-manager> to project root
Before this path would point to the modules path. Using the project
root instead makes it possible to set `<home-manager>` to point to a
downloadable archive of Home Manager. This should make it
significantly easier to install and keep Home Manager up to date.

To match this change we also deprecate the Home Manager option

    programs.home-manager.modulesPath

and instead ask users to use

    programs.home-manager.path
2017-10-24 01:14:22 +02:00
Ruben Maher 5605e46acb
home-manager: fix typo 2017-10-22 10:59:09 +02:00
Robert Helgesson cda222d2ec
home-manager: present news even if assertion failed 2017-09-09 17:14:07 +02:00
Robert Helgesson ad1eee7aa5
home-manager: minor news build cleanups
- Rename the build function.

- Specify the built attribute in the build function.

- Make the news build silent.
2017-09-06 23:44:58 +02:00
Robert Helgesson 9c1b3735b4
home-manager: add news sub-command
This command allows the user to examine the news items generated by
the news module. See #52.

Many thanks to @nonsequitur and @uvNikita for suggestions and
improvements.
2017-09-05 11:37:07 +02:00