1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-16 16:19:44 +01:00
Commit graph

64 commits

Author SHA1 Message Date
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
Robert Helgesson
a37b5c9c61
Change installation instructions to use nix-channel
This avoids the uncontrollable nature of fetching the tarball as part
of the evaluation. Instead the user can decide when to update and also
perform rollbacks, if necessary.
2018-12-04 00:59:52 +01:00
Wael M. Nasreddine
30f3baabaf
home-manager: import modules using relative path 2018-12-04 00:39:34 +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
99c900946d
Avoid substitution for some derivations
In particular, don't bother attempting to do substitution of the home
files and home generation derivations since these rarely, if ever,
could be substituted.

Fixes #330
2018-07-31 21:16:36 +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
06d4f39e7b
home-manager: use shellHook to install
This changes the installation command from

    nix-shell $HM_PATH -A install --run 'home-manager switch'

to

    nix-shell $HM_PATH -A install

The added shell hook will print some useful information and run
`home-manager switch`.
2017-11-29 23:48:58 +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
Cornelius Mika
b8ddb11796
use buildCommand for single phase builds 2017-11-06 14:24:04 +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
fa4f9197ee
home-manager: avoid import to improve error messages
When using `import` to inject the configuration into the module system
we lose the location in error messages, i.e., it just says
``<unknown-file>'`.
2017-11-02 11:19:12 +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
2ff8c12bf9
home-manager: change platforms to unix 2017-10-18 00:45:29 +02:00
Robert Helgesson
bc40ab378c
home-manager: add license field 2017-10-16 18:40:34 +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
Robert Helgesson
39fc16954b
home-manager: make sure switch generation is GC root
Using `--no-out-link` is convenient but it does not set up a GC root,
so an unfortunately timed GC could remove the generation before
activation completes. Many thanks to @nonsequitur for noting this
problem.
2017-09-04 22:19:56 +02:00
Robert Helgesson
6611c16099
home-manager: print errors to stderr 2017-09-01 10:24:01 +02:00
Nikita Uvarov
5eff7f38df
home-manager: remove escaping
The Nix code that was extracted to its own file erroneously included
escaping of "${".
2017-08-28 17:56:56 +02:00
Robert Helgesson
e9ca4305a6
home-manager: move Nix code to own file 2017-08-28 11:37:34 +02:00
Robert Helgesson
b4fff6b9b7
home-manager: minor attribute rename
The "activation-script" attribute doesn't actually point directly at
the activation script. Renamed the attribute to be more descriptive.
2017-08-27 13:04:39 +02:00
Robert Helgesson
2245b0ac94
home-manager: simplify use of nix-build output
There is no need to specify an out link when switching to a new
generation since nix-build prints the store path on standard output.
Similarly, when just building a generation we specify no out link
since nix-build will use "result" by default.
2017-08-27 12:55:30 +02:00
Cornelius Mika
02a501705a
home-manager: show full script path on activation error
Run the activation script in its original nix-store location so that
Bash error messages show the real script location instead of 'wrkdir',
which gets deleted right after the script exits.
2017-08-20 09:50:42 +02:00
Cornelius Mika
a9d9fb5d75
home-manager: exit with an error on build failure
Because 'set -e' has no effect on commands that run in an if condition,
the script was always exiting with no error when 'doBuild' failed.

As a bonus, $wrkdir is now always removed after building.
2017-08-20 09:50:37 +02:00
Cornelius Mika
ffbc7e723d
home-manager: add config file attribute 2017-08-18 21:37:07 +02:00
Robert Helgesson
28d3f74614
home-manager: allow a user-defined third module path
The user-defined path will be used if present, otherwise the two
"fallback" defaults (in `.nixpkgs` and `.config/nixpkgs`) will be
used.
2017-07-11 20:53:42 +02:00
Robert Helgesson
98c7b23178
home-manager: remove unnecessary variable setting
The `NIX_PATH` variable is set by the `setHomeManagerModulesPath`
function so it is unnecessary to set it again.
2017-07-11 19:48:49 +02:00
Robert Helgesson
0aa549f07b
home-manager: support .config configuration path
This commit changes the default path of the Home Manager configuration
file from `~/.nixpkgs/home.nix` to `~/.config/nixpkgs/home.nix`. The
old path is still supported and will be used if the `.config` path
does not exist.

This aligns Home Manager with the preferred configuration directory in
NixOS 17.03.

Fixes #13.
2017-06-03 00:42:37 +02:00
Robert Helgesson
67391395ef
home-manager: use NIX_PATH to locate modules
This removes the old argument based method that Home Manager used to
find its modules by a `NIX_PATH` based method. Specifically, this adds
a `home-manager` Nix path prefix that can be overridden much like with
the `nixpkgs` path prefix.
2017-06-03 00:42:37 +02:00
Christopher League
1a491f24f7
home-manager: add coreutils to PATH
This ensures that we use the expected version of some useful tools,
such as readlink.
2017-05-16 22:04:58 +02:00
Robert Helgesson
870d1d484d
home-manager: use strict Bash evaluation
In particular, this will ensure that the whole script fails with an
error code if the activation script fails during a switch. Fixes #10.
2017-05-14 14:02:15 +02:00
Robert Helgesson
fea693ba16
Use stricter Bash settings in activation script
For example, with these settings Bash will complain if uninitialized
variables are used. Some code has been improved to run cleanly with
these settings.
2017-03-25 21:57:03 +01:00
Robert Helgesson
d2e8c57bd5
home-manager: Use --show-trace only when verbose 2017-02-21 21:49:12 +01:00
Robert Helgesson
ed9464258a
home-manager: add command line option -I
This options is passed on to nix-build and allows, for example, building
a user environment using a custom Nixpkgs.
2017-02-14 18:25:30 +01:00
Robert Helgesson
deaa6d3dd4
Add configurable verbosity during activation 2017-01-21 12:27:50 +01:00