Commit Graph

381 Commits

Author SHA1 Message Date
Chuck
88183eb484 Per reviewer request, cast the other side.
I don't think this matters.  As long as one or the other of these is
a std::string, I get an operator== that looks at content rather than
pointer equality.  I picked casting the constant over casting the dynamic
thing in hopes that the compiler would have a better chance at optimizing
away any runtime cost.

Deferring to reviewer.
2019-11-04 15:11:45 +01:00
Chuck
aa8e1d5f1e Always say which path component had trouble 2019-11-04 15:11:45 +01:00
Chuck
c352bfeaf0 Switch from east const to west const
For consistency with the Nix C++ convention.

:~(
2019-11-04 15:11:45 +01:00
Chuck
b8db81573a Support submodules (Fixes #13121) 2019-11-04 15:11:45 +01:00
Chuck
88349921a4 clang-format 2019-11-04 15:11:45 +01:00
Chuck
6b405f9789 Fix missing "using ThrownError" 2019-11-04 15:11:45 +01:00
Chuck
0adf77e2ee Narrow the «not defined» check to just ThrownError 2019-11-04 15:11:45 +01:00
Chuck
c7c684aaa3 Preserve type of rethrown exceptions 2019-11-04 15:11:45 +01:00
Chuck
d89ccc1554 Correct syntax for license specification 2019-11-04 15:11:45 +01:00
Chuck
2336982957 Add license
This is important because this contains some code copied from nix (as an
interim expediency until that functionality can be exported via nix's
API).  The license specified here must be compatible with this borrowing.
Select the same license that nix is released under: lgpl2Plus.
2019-11-04 15:11:45 +01:00
Chuck
f3eedb6020 Parallel build is the default, so no need to specify 2019-11-04 15:11:45 +01:00
Chuck
e1ecc2b6c1 Remove list sorting 2019-11-04 15:11:45 +01:00
Chuck
36c00c1080 Use format strings, not concatenation, in error messages 2019-11-04 15:11:44 +01:00
Chuck
4af8dbf896 Reformat for 4-space indentation
Specifically, with
  clang-format --style='{ IndentWidth: 4, BreakBeforeBraces: Mozilla, ColumnLimit: 120, PointerAlignment: Middle }'
which was the clang-format invocation that produced the fewest diffs on
the nix source out of ~20 that I tried.
2019-11-04 15:11:44 +01:00
Chuck
74f05df671 nixos/nixos-option: Fix references to old name 2019-11-04 15:11:44 +01:00
Chuck
26c45dfec2 nixos/nixos-option: Show options' types #27920 2019-11-04 15:11:44 +01:00
Chuck
59c5bfc86b nixos/nixos-option: Rewrite in a more suitable language
Also add --all, which shows the value of all options.  Diffing the --all
output on either side of contemplated changes is a lovely way to better
understand what's going on inside nixos.
2019-11-04 15:11:44 +01:00
Daniel Fullmer
c7b123a81a nixos-generate-config: Fix incorrectly named option
This appears to be a typo from c2576266baaf02be2d4da39cf25ed48044b6245e
2019-11-02 15:46:16 -04:00
Frederik Rietdijk
a85e58ac13 Merge master into staging-next 2019-10-23 09:38:37 +02:00
Bjørn Forsman
263a81e285 nixos-rebuild: support sudo + --target-host
This adds support for deploying to remote hosts without being root:

  sudo nixos-rebuild --target-host non-root@host

Without this change, only root@host is able to deploy.

The idea is that if the local command is run with sudo, so should the
remote one, thus there is no need for adding any CLI options.
2019-10-22 20:44:25 +02:00
Franz Pletz
c2576266ba nixos/gnupg: add option for setting pinentry flavours
Co-authored-by: Florian Klink <flokli@flokli.de>
2019-10-16 20:31:05 -04:00
worldofpeace
2fbccbc728 Revert "Merge pull request #71095 from flokli/pinentry-cleanup"
This reverts commit 823da4d492b8b4ad46bf812db8421d99ff17a8fc, reversing
changes made to b75c8ee3bc1b9734c29740e9d17ac2175fe207fd.
2019-10-16 20:28:21 -04:00
Franz Pletz
edea9fed72 nixos/gnupg: add option for setting pinentry flavours
Co-authored-by: Florian Klink <flokli@flokli.de>
2019-10-16 19:56:49 -04:00
Jan Tojnar
1739d34904
Merge pull request #70734 from jtojnar/nixos-rebuild-remote-fish
nixos-rebuild: Fix target-host using fish
2019-10-11 13:26:11 +02:00
Eelco Dolstra
3ab3614e2b
nix: 2.3 -> 2.3.1 2019-10-10 16:23:33 +02:00
Jan Tojnar
316d4faba4
nixos-rebuild: Fix target-host using fish
I have `users.defaultUserShell = pkgs.fish;` set on my server and when I ran `nixos-rebuild switch --target-host …`, the command failed with the following error:

    fish: Unsupported use of '='. To run 'nix-store' with a modified environment, please use 'env PATH=… nix-store…'

That is because fish requires env to set environment variables for a program. It should also work on other shells.
2019-10-08 11:43:05 +02:00
Vladimír Čunát
f760f0ef48
Revert "Merge #67232: machinectl compliant NixOS installation"
This reverts commit 66967ec7521d065f605795d64ddbbbd4fcd448c3, reversing
changes made to fb6595eafdb90ef0bc7a31c2bfc9204e4cad11d9.
Fixes #70442; discussion: https://github.com/NixOS/nixpkgs/pull/70027
2019-10-07 20:56:59 +02:00
Linus Heckemann
0b754fbe54
Merge pull request #69302 from mayflower/networkd-disallow-dhcp
networkd: disallow useDHCP
2019-10-07 11:29:04 +02:00
Robin Gloster
5ee383ea8c
nixos-generate-config: add useDHCP per interface
This sets networking.useDHCP to false and for all interfaces found the
per-interface useDHCP to true. This replicates the current default
behaviour and prepares for the switch to networkd.
2019-09-24 11:44:01 +02:00
Christian Kögler
930ac600d2
nixos-install: ensure activation script is always called
The activation script is needed to get the missing files in etc/ created.
Needed for container manager like systemd-nspawn.
2019-09-13 17:33:34 +02:00
Eelco Dolstra
37e333af9a
nix: 2.2.2 -> 2.3 2019-09-04 21:36:49 +02:00
Leon Schuermann
415993d6b7 nixos-enter: silent activation script option
Also, fix a few shellcheck errors.
2019-08-13 23:48:58 +02:00
Bas van Dijk
810388afd2 nixos-generate-config: enable overriding configuration.nix 2019-08-08 17:00:10 +02:00
Bjørn Forsman
8f551be935 nixos-generate-config: don't emit tmpfs entry for /tmp
Because it most likely comes from the boot.tmpOnTmpfs option in
configuration.nix (managed declaratively).
2019-06-16 16:21:54 +02:00
Bjørn Forsman
4213e48dd9 nixos-generate-config: add dm-snapshot module if LVM is detected
Without this, the system becomes unbootable if the user creates a LVM
snapshot and reboots.

Fixes https://github.com/NixOS/nixpkgs/issues/33646

(The same kind of problem was fixed in RHEL a few years back:
https://bugzilla.redhat.com/show_bug.cgi?id=1287940)
2019-06-16 15:30:54 +02:00
Bjørn Forsman
9e45f6feac nixos-generate-config: don't generate swapDevices for *files*
Up until now, the output has been the same for swap devices and swap
files:

  { device = "/var/swapfile"; }

Whereas for swap *files* it's easier to manage them declaratively in
configuration.nix:

  { device = "/var/swapfile"; size = 8192; }

(NixOS will create the swapfile, and later resize it, if the size
attribute is changed.)

With the assumption that swap files are specified in configuration.nix,
it's silly to output them to hardware-configuration.nix.
2019-06-16 15:26:33 +02:00
Bjørn Forsman
4755811a12 nixos-generate-config: add support for bcache
Add "bcache" to boot.initrd.availableKernelModules if a bcache device is
detected.

This fixes a problem I've had one too many times: I install NixOS and
forget to add "bcache", resulting in an unbootable machine (until fixed
with Live CD). Now NixOS will do it for me.
2019-06-10 21:22:07 +02:00
Yegor Timoshenko
6a63021eba
Merge pull request #60207 from volth/patch-329
nixos-generate-config: do not build btrfs-tools when btrfs is not used
2019-05-22 15:32:00 +03:00
Linus Heckemann
89b64ab5e1 nixos-generate-config: add rudimentary high-DPI detection
Fixes the main remaining part of #12345
2019-05-15 06:34:40 +02:00
volth
c01ea27ce3
nixos-generate-config: do not build btrfs-tools when btrfs is not used
cross-compilation of `btrfs-tools` is broken, and this usually needless dependency of each system closure on `btrfs-tools` prevents cross-compilation of whole system closures
2019-04-25 12:08:20 +00:00
Eelco Dolstra
5399f34ad9
nix: 2.2 -> 2.2.2 2019-04-15 19:06:57 +02:00
Danylo Hlynskyi
eddb31be99
Merge pull request #55121 from Ma27/add-option-support-to-nixos-build-vms
nixos-build-vms: pass `--option` to `nix-build`
2019-04-14 02:57:57 +03:00
Maximilian Bosch
eaf98c7bcf
nixos/nixos-install: tell the user what to do if setting a root password failed
If setting a root password using the `passwd` call in the
`nixos-install` script fails, it should be explained how set it manually
to ensure that nobody gets accidentally locked out of the system.
2019-03-08 19:57:02 +01:00
Matthew Bauer
b0799b4219
Merge pull request #56115 from matthewbauer/nixos-rebuild-upgrade-nix
nixos-rebuild: try to get Nix fallback from new channel first
2019-03-02 18:48:28 -05:00
Daiderd Jordan
50fec3dcd2 nixos-rebuild: add edit command (#56241) 2019-02-25 00:59:35 +01:00
Matthew Bauer
475c8aa018 nixos-rebuild: get Nix from channel
If our old Nix can’t evaluate the Nixpkgs channel, try the fallback
from the new channel /first/. That way we can upgrade Nix to a newer
version and support breaking changes to Nix (like seen in the upgrade
o Nix 2.0).

This change should be backported to older NixOS versions!
2019-02-20 20:02:20 -05:00
Eelco Dolstra
07208e7a0b
nixos-generate-config: Don't suggest setting a uid
This hasn't been needed for a long time, even when `mutableUsers =
false`. Setting a uid manually is potentially risky since it could
collide with non-declarative user accounts. (We do check for
collisions between declarative accounts.)
2019-02-11 10:49:25 +01:00
Maximilian Bosch
e998f5140f
nixos-build-vms: pass --option to nix-build
Also simplified the argument parsing to write all currently supported
CLI options into a bash array and pass this to `nix-build`.

Also documented `--option` usage in the corresponding manpage.
2019-02-04 10:46:12 +01:00
aanderse
c01eeda8e9 nixos-generate-config: account for mount points & devices with spaces & tabs in the name (#50234) 2019-02-03 14:33:31 +01:00
Graham Christensen
18119f2d93
Merge pull request #54519 from devhell/modify_ngc.pl
nixos-generate-config: Include extraGroups "wheel"
2019-01-27 15:59:29 -05:00