Commit Graph

151 Commits

Author SHA1 Message Date
Domen Kožar
78be7f5a53 Revert "nixos-rebuild: Add option for building and/or deploying on a remote host"
This reverts commit ca0c460406.

All the installer tests are failing due to this change. cc @rickynils
2016-01-10 17:50:50 +01:00
Eelco Dolstra
104c252b61 Merge pull request #11279 from rickynils/nixos-rebuild-remote
nixos-rebuild: Add option for building and/or deploying on a remote host
2016-01-04 11:52:25 +01:00
Tobias Geerinckx-Rice
82419575aa btrfsProgs -> canonical btrfs-progs 2016-01-03 20:38:44 +01:00
Rickard Nilsson
ca0c460406 nixos-rebuild: Add option for building and/or deploying on a remote host
This commit adds the options --build-host and --target-host to nixos-rebuild.

--build-host instructs nixos-rebuild to perform all nix builds on the
specified host (via ssh). Build results are then copied back to the
local machine and used when activating the system.

--build-target instructs nixos-rebuild to activate the configuration
not on the local machine but on the specified remote host. Build
results are copied to the target machine and then activated there (via ssh).

It is possible to combine the usage of --build-host and --target-host,
in which case you can perform the build on one remote machine and deploy
the configuration to another remote machine. The only requirement is that
the build host has a working ssh connection to the target host (if the
target is not local), and that the local machine can connect to both
the target and the build host. Also, your user must be allowed to copy
nix closures between the local machine and the target and host machines.

At no point in time are the configuration sources (the nix files) copied
anywhere. Instead, nix evaluation always happens locally
(with nix-instantiate). The drv-file is then copied and realised remotely
(with nix-store).

As a convenience, if only --target-host is specified, --build-host is
implicitly set to that host too. So if you want to build locally and deploy
remotely you have to explicitly set "--build-host localhost".

To activate (test, boot or switch) you need to have root access to the
target host. You can specify this by "--target-host root@myhost".

I have tested the obvious scenarios and they are working. Some of the
combinations of --build-host and --target-host and the various actions might
not make much sense, and should maybe be forbidden (like setting a remote
target host when building a VM), and some combinations might not work at all.
2016-01-01 18:21:59 +01:00
Eelco Dolstra
af6732e503 nixos autoUpgrade: add a 'dates' option
(cherry picked from commit 80917d2473)
Originally merged #11808 to release-15.09 directly. Close #11821.
2015-12-19 08:46:13 +01:00
Arseniy Seroka
61910861dc fix spelling 2015-10-25 04:26:49 +03:00
Brian McKenna
3ef956eb50 nixos-generate-config: look at mmc_host for device drivers
I needed to add sdhci_acpi and mmc_block to my initrd modules in order to boot
my Chromebook. Looking under /sys/class/mmc_host/*/device/driver/module will
give us the sdhci_acpi dependency.
2015-10-16 17:41:15 +11:00
Charles Strahan
cb38f10d12 nixos-generate-config: detect brcmfmac requirement
This makes the firmware available (or would, if someone switched off
enableAllFirmware). Corresponding kernel module should get auto-loaded.

See #9948. Close #9971.
2015-10-15 13:12:42 +02:00
Eelco Dolstra
e65b8fcebe Fix nixos-upgrade 2015-10-05 09:26:30 +02:00
Eelco Dolstra
ab16b6a837 Merge pull request #10160 from dezgeg/pr-unset-build-hook-in-nixos-install
nixos-install: Don't use NIX_BUILD_HOOK from caller's environment
2015-09-30 23:33:07 +02:00
Tuomas Tynkkynen
725a4d6740 nixos-install: Don't use NIX_BUILD_HOOK from caller's environment
If nixos-install is run on a machine with `nix.distributedBuilds = true`
the installation will fail at some point like this:

Died at /nix/store/4frhrl31cl7iahlz6vyvysy5dmr6xnh3-nix-1.10/libexec/nix/build-remote.pl line 115, <STDIN> line 1.

This is due to `nix.distributedBuilds` setting
NIX_BUILD_HOOK=/nix/store/.../build-remote.pl in the global environment,
which then gets confused in the minimal chroot created by nixos-install.

To avoid these kinds of issues with build hooks, just disable them in
the chroot.
2015-09-30 23:02:21 +03:00
Eelco Dolstra
3231424c37 Bump fallback Nix store paths 2015-09-30 21:12:46 +02:00
Tuomas Tynkkynen
8914e1af6d nixos-generate-config: Don't enable vbox guest via deprecated option
Avoids this warning when running `nixos-rebuild switch`:
````
building Nix...
building the system configuration...
trace: Obsolete option `services.virtualboxGuest.enable' is used. It was renamed to `virtualisation.virtualbox.guest.enable'.
````
2015-08-16 00:32:37 +02:00
Eelco Dolstra
43c4756090 Add auto update feature
You can now keep your system up to date automatically by setting:

  system.autoUpgrade.enable = true;

Fixes #7369.
2015-08-07 05:37:31 +02:00
Eelco Dolstra
2cd7c1f198 Unify NixOS and Nixpkgs channel structure
This is primarily to ensure that

  -I nixpkgs=https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz

and

  -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz

and

  -I nixpkgs=https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz

behave consistently.

It also allows installing packages via "nix-env -iA nixos.<pkg>"
rather than "nixos.pkgs.<pkg>". It would be even better to allow
"nixpkgs.<pkg>", but that requires a change to nix-channel.

Fixes #7659.
2015-08-05 17:37:11 +02:00
Eelco Dolstra
91e71725d4 Remove some obsolete references to <nixos> 2015-08-05 17:37:08 +02:00
Eelco Dolstra
bb38d9974b Update fallback Nix store paths 2015-08-05 14:34:57 +02:00
Eelco Dolstra
699ba71b50 nixos-install: Source the profile when running inside the chroot 2015-08-05 14:33:18 +02:00
Eelco Dolstra
d166c854b6 Add option system.stateVersion
This option requests compatibility with older NixOS releases with
respect to stateful data, in cases where new releases have defaults
that might be incompatible with system state of existing NixOS
deployments. For instance, if we change the default version of
PostgreSQL, existing deployments will break if the new version can't
read databases created by the old version.

So for example, setting

  system.stateVersion = "15.07";

requests that options like services.postgresql.package use defaults
corresponding to the 15.07 release branch. Note that
nixos-generate-config emits this option. (In the future, NixOps may
set system.stateVersion to the NixOS release in use when the machine
was created.)

See also #7939 for another motivating example.
2015-07-27 20:30:09 +02:00
Eelco Dolstra
b1623385d0 nixos-generate-config: Container improvements 2015-07-17 11:27:33 +02:00
Eelco Dolstra
fd06533def nixos-install: Don't barf if btrfs is missing 2015-07-13 17:55:49 +02:00
William A. Kennington III
08ff83eab3 nixos/btrfs: Fix parsing of btrfs subvolume show with btrfsprogs 4.1 2015-07-07 11:34:50 -07:00
Vladimír Čunát
0b68b92062 nixos i18n.consoleFont: choose a different default
Distros often choose Terminus as the default, and it supports some
non-ASCII characters that we use in config. Fixes #8107.
2015-06-09 20:13:42 +02:00
Eelco Dolstra
e98da673e4 nixos-checkout: Add nixpkgs-channels as a remote
This way, you can do things like

  git checkout channels/nixos-14.12

to get the latest tested and built version of NixOS.
2015-05-20 14:16:36 +02:00
Steven Shaw
2a8577d7fe Correct spelling 2015-05-03 19:15:03 +10:00
Domen Kožar
ff88f4bcda nixos-install: correctly detect stdin 2015-04-29 18:48:21 +02:00
Jookia
71910be9ea nixos-install: Fix chroot flag not defaulting to Bash outside NixOS.
Passing the chroot flag to nixos-install without arguments should now give you a
Bash shell as intended rather than try an empty path.

This was masked by the user's shell (usually /bin/bash) being defaulted to by
chroot, and being found since their paths used NixOS conventions.
2015-04-28 06:37:04 -04:00
Jookia
7b37a5f168 nixos-install: Fix password prompt failing outside NixOS.
When bootstrapping from other distributions, nixos-install is unable to find
various tools in the chroot since their paths aren't aware of NixOS conventions.

This makes a small change to existing code by specifying nixpkgs/nixos instead
of just nixos when running nix-instantiate in the chroot. I haven't tested this
outside of bootstrapping, but the same specification is used elsewhere in the
code so I don't see why it wouldn't work.
2015-04-28 06:34:47 -04:00
aszlig
df31a338dc
nixos-rebuild: Conditionally update channels.
This partially reverts commit 3a4fd0bfc6.

Addresses another concern by @edolstra that users might not want to
update *all* channels. We're now reverting to the old behaviour but
after updating the "nixos" channel, we just check whether the channel
ships with a file called ".update-on-nixos-rebuild" and if it exists, we
update that channel as well.

Other channels than these are not touched anymore.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-04-13 12:54:19 +02:00
aszlig
3a4fd0bfc6
nixos-rebuild: Update all channels of user root.
Should make it even easier to use custom channels, because whenever the
user does a "nixos-rebuild --upgrade", it will also upgrade possibly
used ("used" as in referenced in configuration.nix) channels besides
"nixos". And if you also ship a channel tied to a particular version of
nixpkgs or even remove the "nixos" channels, you won't run into
unexpected situations where the system is not updating your custom
channels.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-04-13 00:09:00 +02:00
Eelco Dolstra
a38f130126 Revert "Set stricter permissions on /nix/store"
This reverts commit 066758758e because
it breaks NixOS VM tests.
2015-04-07 15:10:41 +02:00
Domen Kožar
42c421adc3 Merge pull request #7180 from jagajaga/fix_generator
Fixing nixos-generate-config
2015-04-07 12:24:04 +02:00
Arseniy Seroka
b11f662617 fix https://github.com/NixOS/nixpkgs/issues/3560 2015-04-05 16:12:14 +03:00
lethalman
f72b0c43f6 Merge pull request #6762 from lethalman/nixos-install
nixos-install: support -j, --cores and --option. Closes #6755
2015-03-30 18:06:53 +02:00
Eelco Dolstra
224d0d5302 Set stricter permissions on /nix/store
The nixbld group doesn't need read permission, it only needs write and
execute permission.

(cherry picked from commit 066758758e)
2015-03-18 10:58:08 +01:00
Luca Bruno
fe6b0b15e6 nixos-install: support -j, --cores and --option. Closes #6755 2015-03-11 16:47:44 +00:00
Eelco Dolstra
a574065a81 nixos-rebuild: Add ‘dry-activate’ command
‘nixos-rebuild dry-activate’ builds the new configuration and then
prints what systemd services would be stopped, restarted etc. if the
configuration were actually activated. This could be extended later to
show other activation actions (like uids being deleted).

To prevent confusion, ‘nixos-rebuild dry-run’ has been renamed to
‘nixos-rebuild dry-build’.
2015-03-09 16:50:59 +01:00
Peter Simons
263a49be20 Merge pull request #5704 from eduarrrd/nixos-version
Add option to display git revision to nixos-version
2015-02-20 16:35:56 +01:00
Domen Kožar
b83433cdd1 Remove gui (see #6207), use nixui instead 2015-02-08 10:47:58 +01:00
Eelco Dolstra
53710c752a nixos-rebuild: Update fallback code to update Nix 2015-01-27 18:58:20 +01:00
Eelco Dolstra
b9c4569b6b nixos-install: Create /root with 700 permission 2015-01-15 18:37:55 +01:00
Eduard Bachmakov
86cd055477 Add option to display git revision to nixos-version
Example use case: git checkout `nixos-version --hash`
2014-12-27 21:43:04 +01:00
Domen Kožar
a4961f09f6 Merge pull request #5390 from abbradar/nixos-isntall
nixos-install: fix -I flag
2014-12-23 18:15:14 +01:00
Nicolas B. Pierron
6a7971bee7 Merge pull request #5416 from nbp/nixos-option-include
nixos-option: Support -I option
2014-12-21 15:11:11 -08:00
Nicolas B. Pierron
974edc5056 nixos-option: Use <nixpkgs/nixos> instead of <nixpkgs>. 2014-12-21 01:33:06 +01:00
Nicolas B. Pierron
82a5f54c0d nixos-option: Support -I option. 2014-12-20 20:30:19 +01:00
Nicolas B. Pierron
c9682a22ff nixos-option: Produce nicer error messages in case of typos. 2014-12-20 19:52:28 +01:00
Nicolas B. Pierron
640428d3c5 nixos-option: Handle 'attrsOf submodule' options. 2014-12-20 19:16:43 +01:00
Nicolas B. Pierron
cd2f7ce9f9 nixos-option: Improve error messages to avoid reporting internal location and traces. 2014-12-19 23:00:52 +01:00
Nicolas B. Pierron
b2abfe54b3 nixos-option: Print derivation outPath within attribute sets and list, when the strict mode is used. 2014-12-19 23:00:00 +01:00