Commit graph

275 commits

Author SHA1 Message Date
Eelco Dolstra d12c9911df
Merge remote-tracking branch 'origin/master' into nix-2.0 2018-02-22 17:28:51 +01:00
Eelco Dolstra 32af695a22
nix: 1.11.16 -> 2.0 2018-02-22 17:03:27 +01:00
Jan Malakhovski 2e6b796761 nixos: rename config.system.nixos* -> config.system.nixos.* 2018-02-18 12:56:30 +00:00
Eelco Dolstra 847ea13be3
Doh 2018-02-07 19:47:03 +01:00
Eelco Dolstra 0f5d5970b2
nixos-prepare-root: Remove
This is no longer needed thanks to Nix 2.0 magic.
2018-02-07 19:39:14 +01:00
Eelco Dolstra 5d8860b919
nixos-install: Accept --substituters
This is useful in tests where we don't have network access. Passing
--substituters "" prevents wasting time by checking cache.nixos.org.
2018-02-07 19:39:13 +01:00
Eelco Dolstra 598a3f5b30
nixos-install: Create /etc 2018-02-07 19:10:13 +01:00
Eelco Dolstra 6daad9b3c5
nixos-install: Fix --closure 2018-02-07 18:22:05 +01:00
Eelco Dolstra da702a4034
nixos-enter: Don't require root
Of course, you'll get a bunch of warnings from the activation script:

  $ nixos-enter --root /tmp/mnt/
  setting up /etc...
  mount: /dev: permission denied.
  mount: /dev/pts: permission denied.
  mount: /dev/shm: permission denied.
  mount: /sys: permission denied.
  /nix/var/nix/profiles/system/activate: line 74: /proc/sys/kernel/modprobe: Permission denied
  chown: changing ownership of '/run/wrappers/wrappers.0pKlU8JsvV/dbus-daemon-launch-helper': Invalid argument
  NOTE: Under Linux, effective file capabilities must either be empty, or
        exactly match the union of selected permitted and inheritable bits.
  Failed to set capabilities on file `/run/wrappers/wrappers.0pKlU8JsvV/ping' (Operation not permitted)
  chown: changing ownership of '/run/wrappers/wrappers.0pKlU8JsvV/unix_chkpwd': Invalid argument

  [root@nixos:/]#
2018-02-07 17:59:04 +01:00
Eelco Dolstra bb030ece3b
nixos-enter: Check whether --root denotes a NixOS installation 2018-02-07 17:23:05 +01:00
Eelco Dolstra f0979ca30e
nixos-install: Don't require root
E.g.

  nixos-install --root /tmp/mnt/ --no-bootloader --no-root-passwd

now works for non-root users.
2018-02-07 17:20:26 +01:00
Eelco Dolstra f9e64dbe76
nixos-enter: Don't mount special filesystems
The activation script already does this.
2018-02-05 21:05:02 +01:00
Eelco Dolstra e88f28965a
nixos-install: Make compatible with Nix 2.0
The use of Nix 2.0 significantly simplifies the installer, since we
can just pass a different store URI (--store /mnt) - it's no longer
needed to set up a chroot environment for the build, and to bootstrap
Nix into the chroot.

Also, commands that need to run in the installation (namely boot
loader installation and setting a root password) are now executed
using nixos-enter.

This also removes the need for nixos-prepare-root since any required
initialisation is done by Nix or by the activation script.
2018-02-05 19:50:36 +01:00
Eelco Dolstra 60cb23001a
Add a "nixos-enter" command
This factors out the functionality in nixos-install for running a
command inside a NixOS installation (nixos-install --chroot).
2018-02-05 19:41:54 +01:00
Eelco Dolstra 875eaf0821
nix: 1.11.15 -> 1.11.16 2017-12-12 17:46:21 +01:00
Maximilian Bosch 20a5e9db84 nixos-option: don't eval description
see https://github.com/NixOS/nixpkgs/pull/31630#issuecomment-344073438
2017-11-14 23:06:44 +01:00
Orivej Desh 2dd9588834
Merge pull request #31071 from yegortimoshenko/nixos-install/mkdir-or-chmod
nixos-prepare-root: chmod if dir already exists, fixes #22413
2017-11-11 01:04:14 +00:00
Yegor Timoshenko 2c9e195eed nixos-prepare-root: chmod if dir already exists 2017-11-04 15:07:36 +00:00
Yegor Timoshenko f2621d4ba8 nixos-generate-config: enforce umask 0022, fixes #30954 2017-10-30 21:59:37 +00:00
Danylo Hlynskyi dab7ecc054 nixos-generate-config: lessen priority for cpuFreqGovernor (#30221)
In particular, it conflicts with `services.tlp.enable` option.

There exists workaround:
```
  powerManagement.cpuFreqGovernor = lib.mkForce null;
  services.tlp.enable = true;
```
But should it?
2017-10-20 19:59:31 +00:00
aszlig f4e742594d
nixos: Fix detection of btrfs root volume
Regression introduced by 801c920e95.

Since then, the btrfsSimple subtest of the installer VM test fails with:

Btrfs did not return a path for the subvolume at /

The reason for this is that the output for "btrfs subvol show" has
changed between version 4.8.2 and 4.13.1.

For example the output of "btrfs subvol show /" in version 4.8.2 was:

/ is toplevel subvolume

In version 4.13.1, the output now is the following and thus the regular
expressions used in nixos-generate-config.pl and install-grub.pl now
match (which results in the error mentioned above):

/
        Name:                   <FS_TREE>
        UUID:                   -
        Parent UUID:            -
        Received UUID:          -
        Creation time:          -
        Subvolume ID:           5
        Generation:             287270
        Gen at creation:        0
        Parent ID:              0
        Top level ID:           0
        Flags:                  -
        Snapshot(s):

In order to fix this I've changed nixos-generate-config.pl and
install-grub.pl, because both use "btrfs subvol show" in a similar vein,
so the regex for parsing the output now doesn't match anymore whenever
the volume path is "/", which should result in the same behaviour as we
had with btrfs-progs version 4.8.2.

Tested against the btrfsSimple, btrfsSubvols and btrfsSubvolDefault
subtests of the installer VM test and they all succeed now.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-10-11 04:30:52 +02:00
Franz Pletz 801c920e95
btrfs-progs: 4.8.2 -> 4.13.1 2017-10-07 04:04:20 +02:00
Daniel Peebles 79d8ccf4f0 Merge pull request #28777 from copumpkin/installer-chroot
nixos-install: re-enable --chroot option
2017-09-26 12:23:19 -07:00
Dan Peebles 186c120bed nixos-install: re-enable --chroot option
I forgot to implement it the first time around. Whoops!
2017-09-26 07:25:14 -07:00
Franz Pletz 0f5cd17f2c
nixos-generate-config: add programs options examples 2017-09-23 20:03:19 +02:00
Jörg Thalheim 7d5633ea7a Merge pull request #27342 from lheckemann/installer-changes
Installer changes
2017-09-15 16:19:11 +01:00
Eelco Dolstra 6dad1f70ce
nix: 1.11.14 -> 1.11.15 2017-09-15 16:38:33 +02:00
Graham Christensen 8a11b0d7df Merge pull request #28775 from grahamc/describe-stateVersion
Document the stateVersion more
2017-08-31 06:47:09 -04:00
Eelco Dolstra 79954b9d1f
nix: 1.11.13 -> 1.11.14 2017-08-31 11:00:09 +02:00
Graham Christensen 8efb46b609
configuration.nix: Document the stateVersion more 2017-08-30 21:41:35 -04:00
Graham Christensen af51aa79d2
installer: add a comment hinting about enabling libinput for touchpads 2017-08-30 20:24:36 -04:00
Pascal Bach 322d0c562c auto-upgrade: add proxy support
Add the proxy variables so that auto upgrade works behind a proxy.
2017-08-30 01:25:47 +02:00
Eelco Dolstra 17642b5fd0
nix: 1.11.12 -> 1.11.13 2017-07-18 10:54:01 +02:00
Eelco Dolstra 40cf34aaae
nix: 1.11.11 -> 1.11.12 2017-07-13 16:37:11 +02:00
Linus Heckemann 77ce02201e nixos-install: use FIFO for system closure
This avoids running out of space in space-constrained environments,
e.g. VMs with relatively small amounts of memory and tmp on tmpfs
2017-07-13 06:30:24 +01:00
Linus Heckemann 8b1f1d93fa nixos-install: only search for nixpkgs when needed 2017-07-13 06:26:44 +01:00
Linus Heckemann fa5700544b nixos-install: quote nixos-prepare-root arguments
This prevents the script from breaking when channel_root is empty.
2017-07-12 21:58:25 +01:00
Eelco Dolstra 707703185d
nixos-rebuild: Respect empty NIX_REMOTE
Fixes #11384.

Note: in Nix 1.12, you can set NIX_REMOTE to "local" to avoid
ambiguity.
2017-07-07 11:58:10 +02:00
Eelco Dolstra 5446934b41
nix: 1.11.10 -> 1.11.11
(cherry picked from commit 7b1e936b24)
2017-06-19 19:03:39 +02:00
Eelco Dolstra 0bffe03828
nix: 1.11.9 -> 1.11.10 2017-06-12 20:13:27 +02:00
Jörg Thalheim 361314ca71
nixos-prepare-root: force symlink at /run
Otherwise a reinstall will fail.
2017-05-01 16:10:58 +02:00
Eelco Dolstra e4190943c8
nix: 1.11.8 -> 1.11.9 2017-04-25 17:19:10 +02:00
Dan Peebles f1708a9d7d make-disk-image: change to be less VM-centric
This changes much of the make-disk-image.nix logic (and thus most NixOS
image building) to use LKL to set up the target directory structure rather
than a Linux VM. The only work we still do in a VM is less IO-heavy stuff
that while still time-consuming, is less of the overall load. The goal is
to kill more of that stuff, but that will require deeper changes to NixOS
activation scripts and switch-to-configuration.pl, and I don't want to
bite off too much at once.
2017-04-24 02:30:00 +00:00
Dan Peebles d990aa7163 Refactor nixos-install to separate out filesystem build logic
The key distinction I'm drawing is that there's a component that deals
with the store of the machine being built, and another component for
the store building it. The inner part of it assumes nothing from the
builder (doesn't need chroot or root powers) so it can run comfortably
inside a Nix build, as well as nixos-rebuild. I have some upcoming work
that will use that to significantly speed up and streamline image builds
for NixOS, especially on virtualized hosts like EC2, but it's also a
reasonable speedup on native hosts.
2017-04-16 16:09:41 +00:00
Eelco Dolstra 2cb25f8b59
nix: 1.11.7 -> 1.11.8 2017-03-21 14:49:23 +01:00
Franz Pletz fb50cde71e
nixos/treewide: systemd.time is in manvolume 7
cc #23396
2017-03-21 08:28:53 +01:00
Eelco Dolstra d72a34311a
Remove nixFallback
This causes unintended schema upgrades, and is no longer needed now
that we have nixos/modules/installer/tools/nix-fallback-paths.nix.
2017-03-06 15:54:50 +01:00
Thomas Tuegel d91637c546
nixos-generate-config: rename plasma5 desktop 2017-03-03 07:28:29 -06:00
Eelco Dolstra 8e1fa01f3a
nix: 1.11.6 -> 1.11.7 2017-02-24 12:53:53 +01:00
Eelco Dolstra 14c47bd546 Merge pull request #22758 from dezgeg/pr-nixos-rebuild
nixos-rebuild: Don't rebuild nixos-rebuild when --fast is used
2017-02-14 16:35:43 +01:00