Commit graph

839 commits

Author SHA1 Message Date
Eelco Dolstra a5f883e535 nixos/modules/installer/cd-dvd/channel.nix: Handle null config.system.nixos.revision 2020-02-15 20:16:14 +01:00
Maximilian Bosch c391343fcd
nixos/nixos-build-vms: switch to python test-driver
In 0945178b3c we decided that Perl-based
VM tests should be deprecated and will be removed between 20.03 and
20.09. So let's switch `nixos-build-vms(8)` to python as well (which is
entirely interactive, so other scripts won't break).

In my experience, the test-driver isn't used most of the time, so this
patch is mainly supposed to get rid of the (probably misleading)
deprecation warning when running `nixos-build-vms`. Apart from that, the
interface for python's test-driver is way nicer.
2020-02-15 19:35:17 +01:00
snicket2100 50a597cd7a
installation-cd-graphical-base.nix: adding git (#79098) 2020-02-14 18:52:18 +02:00
Graham Christensen 2d42fc240c
nixos-enter: redirect to fd2 instead of a file named /dev/stderr
In some cases, /dev/stderr may not point to a sensible location. For
example, running nixos-enter inside a systemd unit where the unit's
StandardOutput and StandardError are set to be sockets. In these
cases, this line would fail.

Piping to fd2 directly works just as well, even under strange and
twisted executions.

Co-authored-by: Michael Bishop <michael.bishop@iohk.io>
2020-02-12 21:18:27 -05:00
Eelco Dolstra fb05afd78d Doh 2020-02-10 16:32:59 +01:00
Eelco Dolstra 8f86624ac9 nixos-rebuild: Remove TODOs 2020-02-10 15:45:27 +01:00
Eelco Dolstra c05cc615f2 nixos.revision: Use null instead of "master"
"master" is not a valid SHA-1 commit hash, and it's not even
necessarily the branch used. 'nixos-version --revision' now returns an
error if the commit hash is not known.
2020-02-10 15:45:15 +01:00
Eelco Dolstra b98ea45608 nixos-version --json: Use builtins.toJSON 2020-02-10 15:45:10 +01:00
Eelco Dolstra f9392f04ae nixos-rebuild: Remove --keep-going flag 2020-02-10 15:45:06 +01:00
Eelco Dolstra 4089dbf090 nixos-rebuild: Make 'edit' work with with flakes 2020-02-10 15:45:03 +01:00
Eelco Dolstra c08930874a nixos-rebuild: Propagate various flake lock file flags
And also --refresh and --no-net.
2020-02-05 23:15:18 +01:00
Eelco Dolstra 2a0cf385d2 nixos-rebuild: Avoid subshell reading hostname
Co-Authored-By: Jörg Thalheim <Mic92@users.noreply.github.com>
2020-02-05 23:15:18 +01:00
Eelco Dolstra 2452042c47 nixos-rebuild: Support -L flag 2020-02-05 23:15:18 +01:00
Eelco Dolstra 98e322b929 nixos-rebuild: uri -> url 2020-02-05 23:15:18 +01:00
Eelco Dolstra fb051f0dec nixos-{rebuild,container}: Use flakeref#attrpath syntax
This makes them consistent with the 'nix' command line.
2020-02-05 23:15:18 +01:00
Eelco Dolstra cfd468adbb nixos-rebuild: Use /etc/nixos/flake.nix if it exists 2020-02-05 23:15:18 +01:00
Eelco Dolstra 7e9b745174 nixos-version: Add --json flag and show system.configurationRevision 2020-02-05 23:15:18 +01:00
Eelco Dolstra 22cc7ab78c nixos-rebuild: Add --flake option 2020-02-05 23:15:18 +01:00
Frederik Rietdijk 419bc0a4cd Revert "Revert "Merge master into staging-next""
In 87a19e9048 I merged staging-next into master using the GitHub gui as intended.
In ac241fb7a5 I merged master into staging-next for the next staging cycle, however, I accidentally pushed it to master.
Thinking this may cause trouble, I reverted it in 0be87c7979. This was however wrong, as it "removed" master.

This reverts commit 0be87c7979.
2020-02-05 19:41:25 +01:00
Frederik Rietdijk 0be87c7979 Revert "Merge master into staging-next"
I merged master into staging-next but accidentally pushed it to master.
This should get us back to 87a19e9048.

This reverts commit ac241fb7a5, reversing
changes made to 76a439239e.
2020-02-05 19:18:35 +01:00
Richard Marko 0c20feb231 use overlayfs by default for netboot and iso 2020-02-05 10:35:59 +01:00
Eelco Dolstra eaf1fbaef4
nixos-rebuild: --use-remote-sudo does not take an argument
Also remove outdated comment about trailing space.
2020-02-01 10:09:33 +01:00
Maximilian Bosch 7f49fa63ca
Merge pull request #75439 from Ma27/submodule-fixes-for-nixos-option
nixos/nixos-option: fix evaluator to render a full submodule entry
2020-02-01 10:00:59 +01:00
worldofpeace 0f2536f15b nixos/release: rename iso_graphical to iso_plasma5
And all the other things and paths to match it
2020-01-27 16:34:37 -05:00
zimbatm ab10bac1b1
nixos-rebuild: fix the maybeSudo usage
* properly expand the command using arrays instead of strings
* also handle sudo on the localhost
2020-01-21 13:17:38 +01:00
Malte Brandy c1d7850f85
Improve documentation for stateVersion
The meaning of stateVersion often leads to a lot of confusion. This
commit trys to improve that situation.
2020-01-07 22:27:03 +01:00
rnhmjoj 1d61efb7f1 treewide: use attrs instead of list for types.loaOf options 2020-01-06 10:39:18 -05:00
Eelco Dolstra 3b15451291
nix: 2.3.1 -> 2.3.2 2020-01-05 20:35:43 +01:00
Linus Heckemann b9bf846080
Merge pull request #76189 from Ma27/nixos-install-verbosity-level
nixos/nixos-installer: add flags for verbosity and build logs
2019-12-28 11:50:25 +01:00
Pavol Rusnak 4899c6992c
nixos-generate-config: i18n.consoleFont has been renamed to console.font
fixes #76391
2019-12-25 15:02:58 +01:00
Maximilian Bosch 1fc248afcc
nixos/nixos-installer: add flags for verbosity and build logs
When installing a fresh NixOS system it occasionally happens that you
encounter issues that are rather hard to track down since
`nixos-install(8)` doesn't provide any debugging flags.

This patch adds `-L` to force `nix build` to display the build-log on
stderr and `-v` to increase the log-level of Nix.
2019-12-22 22:46:58 +01:00
buckley310 ebbb7165c5 nixos-generate-config: don't generate swapDevices for zram devices (#75921) 2019-12-19 22:03:21 +02:00
Chuck ed51fd0033 nixos/nixos-option: Convert --all into -r 2019-12-19 15:00:43 +01:00
Chuck 9dd23e8743 nixos/nixos-option: Refactor: Move functions around 2019-12-19 15:00:43 +01:00
Chuck 09ac7cb55f nixos/nixos-option: Show values inside aggregate options uniformly
1. This makes aggregates of submodules (including the very important
"nixos-option users.users.<username>" case) behave the same way as any
other you-need-to-keep-typing-to-get-to-an-option-leaf (eg:
"nixos-option environment").

Before e0780c5:

  $ nixos-option users.users.root
  error: At 'root' in path 'users.users.root': Attribute not found
  An error occurred while looking for attribute names. Are you sure that 'users.users.root' exists?

After e0780c5 but before this change, this query just printed out a raw
thing, which is behavior that belongs in "nix eval", "nix-instantiate
--eval", or "nix repl <<<":

  $ nixos-option users.users.root
  {
    _module = {
      args = { name = "root"; };
      check = true;
    };
    createHome = false;
    cryptHomeLuks = null;
    description = "System administrator";
    ...

After this change:

  $ nixos-option users.users.root
  This attribute set contains:
  createHome
  cryptHomeLuks
  description
  extraGroups
  group
  hashedPassword
  ...

2. For aggregates of other types (not submodules), print out the option
that contains them rather than printing an error message.

Before:

  $ nixos-option environment.shellAliases.l
  error: At 'l' in path 'environment.shellAliases.l': Attribute not found
  An error occurred while looking for attribute names. Are you sure that 'environment.shellAliases.l' exists?

After:

  $ nixos-option environment.shellAliases.l
  Note: showing environment.shellAliases instead of environment.shellAliases.l
  Value:
  {
    l = "ls -alh";
    ll = "ls -l";
    ls = "ls --color=tty";
  }
  ...
2019-12-19 15:00:43 +01:00
Bernardo Meurer 70c5a78062
nixos: compress make-ext4-fs with zstd 2019-12-13 16:18:04 -08:00
Maximilian Bosch e0780c5cff
nixos/nixos-option: fix evaluator to render a full submodule entry
When running e.g. `nixos-option users.users.ma27`, the evaluation breaks
since `ma27` is the attribute name in `attrsOf (submodule {})`, but not
a part of the option tree and therefore breaks with the following
errors:

```
error: At 'ma27' in path 'users.users.ma27': Attribute not found
An error occurred while looking for attribute names. Are you sure that 'users.users.ma27' exists?
```

This happens since the option evaluator expects that either the option
exists or the option is a submodule and the "next" token in the
attribute path points to an option (e.g. `users.users.ma27.createHome`).

This patch checks in the `Attribute not found` condition if the attribute-path
actually exists in the config tree. If that's true, a dummy-attrset is created
which contains `{_type = "__nixos-option-submodule-attr";}`, in that case, the
entire entry of the submodule will be displayed.
2019-12-12 14:27:36 +01:00
Arnout Engelen 88ee3b021d installer/cd-dvd/iso-image: avoid leaking build timestamps
When 'grafting' '/nix/store/<hash>-loopback.cfg' from disk onto
'/boot/grub/loopback.cfg' on the iso, the parent 'grub' directory does not
exist yet. In this case it is automatically created and inherits its
attributes, including timestamp, from /nix/store.

This is correct/expected/intentional behavior of xorriso, but has the
undesired result of leaking the timestamps of /nix/store into the iso. For
this reason we put the loopback.cfg in a
'/nix/store/<hash>-loopback.cfg/grub/loopback.cfg' instead, so it will inherit
the attributes from the correctly-timestamped
'/nix/store/<hash>-loopback.cfg/grub' directory.

For the same reason we move '/EFI/boot/efi-background.png' down in the list
so it is grafted after its parent '/EFI/boot' directory is created with
the correct timestamp.

fixes #74944
2019-12-11 09:07:40 +01:00
Jan Tojnar 77661f8cfd
nixos/plasma5: drop enableQt4Support option
Phonon no longer supports Qt4 so this is useless.
2019-11-22 09:01:05 +01:00
worldofpeace c9601a67a5
Merge pull request #71622 from worldofpeace/iso-no-slim
installer: use sddm in plasma5
2019-11-11 20:46:32 +00:00
Samuel Dionne-Riel 40f7a343e1
Merge pull request #72751 from c00w/sd_image_hydra
sd-image: Add the compressed file path for hydra.
2019-11-10 13:44:52 -05:00
Bjørn Forsman 2c09cfc097 nixos-rebuild: add explicit option to enable (remote) sudo
Add --use-remote-sudo option. When set, remote commands will be prefixed
with 'sudo'. This allows using sudo remotely _without_ having to use
sudo locally (when using --build-host/--taget-host).
2019-11-07 17:03:12 +01:00
Colin L Rice c861f8083d sd-image: Add the compressed file path for hydra.
This makes the nixos on arm user instructions work again.
2019-11-05 10:10:51 -05:00
Chuck 1e7985942b snake_case -> camelCase 2019-11-04 15:11:45 +01:00
Chuck 445145d5b9 Support aggregate types attrsOf and listOf 2019-11-04 15:11:45 +01:00
Chuck a3e31df4d7 (clang-format for has_example) 2019-11-04 15:11:45 +01:00
Chuck 57a5752300 Add maintainer 2019-11-04 15:11:45 +01:00
Chuck 5646240870 Only print example when there is one 2019-11-04 15:11:45 +01:00
Chuck 4d17d5b31f snake_case -> camelCase 2019-11-04 15:11:45 +01:00
Chuck 84d55716a9 Don't print header on stderr
Automated consumers can use 'sed 1d' or similar to remove this header.

This probably makes this output *easier* to consume correctly.  Having
this header show up in consumers' terminal or log output is probably not
useful, but hiding it without hiding all error messages would have been
more troublesome that just stripping it from stdout.

I.e., previously, unsophisticated use would show undesired output:
  $ some-other-tool
  This attribute set contains:
  This attribute set contains:
  This attribute set contains:
  This attribute set contains:
  <Actual some-other-tool output>

The simplest way to hide this undesired output would have been
nixos-option ... 2>/dev/null, which would hide all error messages.
We do not wish to encourage that.

Correct use would have been something like:
  nixos-option ... 2> >( grep --line-buffered -v 'This attribute set contains:')

After this change, correct use is simpler:
  nixos-option ... | sed 1d
or
  nixos-option ... | sed '1/This attribute set contains:/d'
if the caller don't know if this invocation of nixos-option will yield
an attribute listing or an option description.
2019-11-04 15:11:45 +01:00
Chuck 2ddd2d0760 Explain why header goes on stderr 2019-11-04 15:11:45 +01:00
Chuck 94a068fe36 Pass values by reference
Switch from convention "appease clang-tidy --checks='*'" to
"References are like non-nullptr pointers".  The clang-tidy check
"google-runtime-references" complains about non-const reference
arguments, but this is not a convention used in Nix.
2019-11-04 15:11:45 +01:00
Chuck 3d3ce8df7f Pass Context by reference
Switch from convention "appease clang-tidy --checks='*'" to
"References are like non-nullptr pointers".  The clang-tidy check
"google-runtime-references" complains about non-const reference
arguments, but this is not a convention used in Nix.
2019-11-04 15:11:45 +01:00
Chuck c967e3fd3e Hold state and autoArgs by reference
Switch from convention "appease clang-tidy --checks='*'" to
"References are like non-nullptr pointers".  The clang-tidy check
"google-runtime-references" complains about non-const reference
arguments, but this is not a convention used in Nix.
2019-11-04 15:11:45 +01:00
Chuck c457766a1f Use std::get_if 2019-11-04 15:11:45 +01:00
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 c2576266ba
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
worldofpeace 7dc84e1824 installer: use sddm in plasma5
Slim is abandoned and won't work with wayland.
It's in our best interest to use the display-manager
that makes most sense for Plasma5, sddm.

We've already moved on from it being default in #30890
and the graphical.nix profile, which the virtualbox profile uses,
has sddm anyway.
2019-10-22 00:28:47 -04: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 823da4d492, reversing
changes made to b75c8ee3bc.
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 66967ec752, reversing
changes made to fb6595eafd.
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
worldofpeace 789fcebdab
Merge pull request #46997 from worldofpeace/installer-autorun
installer: autorun xserver in graphical media
2019-10-05 11:34:27 +00:00
lassulus 9d04a64a8f iso-image: add loopback.cfg support to boot iso from grub 2019-10-04 23:24:52 +02:00
worldofpeace 489548310f nixos/iso-image: add menu entry to disable display-manager 2019-10-02 22:10:18 -04:00
worldofpeace f6f5151d57 installer: autorun xserver in graphical media 2019-10-02 22:10:18 -04:00
AmineChikhaoui 6ce605e18d
sdImage: add option to enable bzip2 compression
also make SD image compression the default setup.
Fixes issues with output size such as: https://hydra.nixos.org/build/102163603
2019-09-30 15:42:13 -04:00
worldofpeace 1d1ff2cc50
Merge pull request #67305 from adisbladis/iso-image-defaults
Change ISO image defaults
2019-09-28 18:09:08 -04:00
Samuel Dionne-Riel 95005c1039
Merge pull request #68265 from tkerber/rpi4
Various: Add support for raspberry pi 4.
2019-09-27 14:35:17 -04:00
Franz Pletz 66967ec752
Merge pull request #67232 from ck3d/container-useHostResolvConf
machinectl compliant NixOS installation
2019-09-25 09:34:17 +00: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
Silvan Mosberger f47ef8fcf7
sdImage: use findmnt to get root device when resizing (#58059)
sdImage: use findmnt to get root device when resizing
2019-09-20 23:28:01 +02:00
Thomas Kerber cc5baf2d86
Various: Add support for raspberry pi 4. 2019-09-17 04:05:16 +01: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
worldofpeace 04bd834d69 iso-image-kde: link new nixos-manual desktop item to desktop 2019-09-07 03:34:06 -04:00
adisbladis da8019bfce iso-image: Enable nouveau by default
This is a much more sensible default for modern hardware.
2019-09-07 03:34:06 -04:00
adisbladis b3a06f10d1 iso-image-kde: Disable synaptics
It's been deprecated since 17.09 and libinput is a better default
2019-09-07 03:30:45 -04:00
Jan Tojnar cdf426488b
Merge branch 'master' into staging-next
Fixed trivial conflicts caused by removing rec.
2019-09-06 03:20:09 +02:00
Eelco Dolstra 37e333af9a
nix: 2.2.2 -> 2.3 2019-09-04 21:36:49 +02:00
Vladimír Čunát f21211ebfe
Merge branch 'master' into staging 2019-09-02 23:25:24 +02:00
Ben Wolsieffer 9e5aa25c53 sd-image: don't use installer.cloneConfig option that is not imported
This once again allows sd-image.nix to imported standalone to build SD images
of arbitrary NixOS systems.
2019-09-01 14:15:33 -04:00
Silvan Mosberger 478e7184f8
nixos/modules: Remove all usages of types.string
And replace them with a more appropriate type

Also fix up some minor module problems along the way
2019-08-31 18:19:00 +02:00
Frederik Rietdijk ad1d58c622 Merge staging-next into staging 2019-08-31 10:04:20 +02:00
volth 08f68313a4 treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
Florian Klink 0aa5e3165c sd-image.nix: set installer.cloneConfig to false
As SD Card images are both installation media and installation target,
don't copy over a /etc/nixos/configuration.nix

Closes #63576.
2019-08-19 16:34:06 +02:00
Sarah Brofeldt e0cf7d6093 nixos/sd-image: Increase default firmware partition size 2019-08-18 22:55:39 +02:00
Marek Mahut 08749c4860
Merge pull request #66588 from lschuermann/nixos-enter-silent
nixos-enter: add --silent to suppress activation script output
2019-08-15 10:22:27 +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
worldofpeace 397c7d26fc installer: Don't run as root
There's many reason why it is and is going to
continue to be difficult to do this:

1. All display-managers (excluding slim) default PAM rules
   disallow root auto login.

2. We can't use wayland

3. We have to use system-wide pulseaudio

4. It could break applications in the session.
   This happened to dolphin in plasma5
   in the past.

This is a growing technical debt, let's just use
passwordless sudo.
2019-08-12 14:45:27 -04:00
Bas van Dijk 810388afd2 nixos-generate-config: enable overriding configuration.nix 2019-08-08 17:00:10 +02:00
Jeff Slight c1e3414044
nixos/sd-image-aarch64: update deprecated option 2019-07-30 12:33:11 -07:00
Nikolay Amiantov e4837acf21 nixos netboot: explicitly specify initrd
Needed for iPXE on UEFI, see http://forum.ipxe.org/archive/index.php/thread-7589.html
2019-07-15 19:33:21 +03:00
Samuel Dionne-Riel 6fba2c3565 sd-image-raspberrypi: populateBoot -> populateFirmware
Fixes an incomplete change from the last changes.
2019-06-25 20:49:34 -04:00
Samuel Dionne-Riel 6bc2d30ee3
Merge pull request #62462 from samueldr/sd-image/fat-free
sd-image: FAT free /boot
2019-06-24 14:53:49 -04:00
Samuel Dionne-Riel 7c819989f9
Merge pull request #63147 from samueldr/aarch64/graphics-fixes
aarch64: misc. graphical boot fixes
2019-06-24 14:53:01 -04:00
Samuel Dionne-Riel 288118cdfa sd-image: Adds removed options for removed options
This will keep configuration configuring the size of the /boot partition
still build, while showing the deprecation warning.

In 99.9% of cases I assume ignoring the configuration is better, as the
sd-image builder already is pretty opinionated in that matter.
2019-06-16 17:47:32 -04:00
Samuel Dionne-Riel c113c094cf sd-image: Pull less slack in the image by accounting for slack
The slack, seemingly, accounted for more than the minimum required for
slack plus the two partitions.

This change makes the gap a somewhat abstracted amount, but is not
configurable within the derivation.
2019-06-16 17:47:31 -04:00
Samuel Dionne-Riel 1843e00146 sd-image: Updates comments 2019-06-16 17:47:31 -04:00
Samuel Dionne-Riel 8634d5700d sd-image: firmware partition reduced to 20MiB 2019-06-16 17:47:31 -04:00
Samuel Dionne-Riel 53884e1b94 sd-image: Switch /boot to the ext4 partition 2019-06-16 17:47:31 -04:00
Samuel Dionne-Riel 6e9e78b618 sd-image: Moves /boot into rootfs
The current FAT32 partition is kept as it is required for the Raspberry
Pi family of hardware. It is where the firmware is kept.

The partition is kept bootable, and the boot files kept in there until
the following commits, to keep all commits of this series individually
bootable.
2019-06-16 17:47:30 -04:00
volth f3282c8d1e treewide: remove unused variables (#63177)
* treewide: remove unused variables

* making ofborg happy
2019-06-16 19:59:05 +00: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
Samuel Dionne-Riel 5d92d16b49 sd-image-aarch64: Allows early modesetting for Allwinner boards
This will reduce the confusion at boot, where the only thing visible is
the last message from u-boot; where it looks like the board is
hung, while in reality it's likely resizing partitions.
2019-06-15 14:26:21 -04:00
Samuel Dionne-Riel 390f2071df sd-image-aarch64: Allows early modesetting for the Raspberry Pi
This will reduce the confusion at boot, where the only thing visible is
the last message from u-boot; where it looks like the Raspberry Pi is
hung, while in reality it's likely resizing partitions.
2019-06-15 14:26:20 -04:00
Eelco Dolstra 734b3e7758
Merge pull request #62966 from bjornfor/nixos-generate-config-bcache
nixos-generate-config: add support for bcache
2019-06-12 10:06:17 +02:00
Matthew Bauer 02698c4a61
Merge pull request #59803 from volth/patch-316
nixos/netboot: import -> callPackage
2019-06-10 21:30:23 -04: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
Robin Gloster 6cf583cf2f
Merge pull request #60406 from JohnAZoidberg/remove-isnull
treewide: Remove usage of isNull
2019-05-18 09:36:24 +00: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
Daniel Schaefer 786f02f7a4 treewide: Remove usage of isNull
isNull "is deprecated; just write e == null instead" says the Nix manual
2019-04-29 14:05:50 +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
Jean-Paul Calderone d0bdb55093
Fix the rootPartitionUUID description
The value given here is used as the ext4 filesystem uuid.  It is not used as the partition uuid.
2019-04-24 13:34:18 -04:00
Matthew Bauer 2a8ca24215
Merge pull request #59435 from furrycatherder/fix-tarball
nixos: fix system-tarball
2019-04-20 20:58:42 -04:00
volth ca7a18a24b
nixos/netboot: import -> callPackage
Copy-paste from iso-image.nix

Besides the simplification, it should use `pkgs.buildPackages.squashfsTools` because it is used in `nativeBuildInputs` instead of incorrect `pkgs.squashfsTools` which was forced by `import'
2019-04-18 01:11:04 +00:00
Eelco Dolstra 5399f34ad9
nix: 2.2 -> 2.2.2 2019-04-15 19:06:57 +02:00
Sean Haugh 040d159eb4 nixos: fix system-tarball 2019-04-13 22:14:37 -05: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
Léo Gaspard e3b87b04b7 Revert "Merge pull request #57559 from Ekleog/iso-image-reproducibilization"
This reverts commit bb32e322a5, reversing
changes made to e0b4356c0d.
2019-04-01 18:17:42 +02:00
Graham Christensen bb32e322a5
Merge pull request #57559 from Ekleog/iso-image-reproducibilization
iso-image: make reproducible by not relying on mcopy's readdir
2019-03-29 08:02:56 -04:00
Silvan Mosberger 1660845954
Merge pull request #58196 from tomfitzhenry/iso-syslinux-serial-consistent
syslinux: change serial bit rate to 115200
2019-03-28 22:51:48 +01:00
Tom Fitzhenry 0d67c6a52b syslinux: change serial bit rate to 115200
Prior to this commit an installation over serial via syslinux would
involve:
1. setting bitrate to BIOS's bitrate (typically 115200)
2. setting bitrate to syslinux's bitrate (38400)
3. setting bitrate to stty's bitrate (115200)

By changing syslinux's bitrate to 115200, an installation over serial
is a smoother experience, and consistent with the GRUB2 installation
which is also 115200 bps.

    [root@nixos:~]# stty
    speed 115200 baud; line = 0;
    -brkint ixoff iutf8
    -iexten

In a future commit I will add default serial terminals to the syslinux
kernel lines.
2019-03-24 19:36:30 +11:00
Matthew Bauer 73be6fba8b
Merge pull request #54625 from FlorianFranzen/efi32
grub: Support 32bit EFI on 64bit platforms
2019-03-21 11:39:45 -04:00
Michael Eden bd7bcb5576 sdImage: use findmnt to get root device when resizing 2019-03-21 11:34:20 -04:00
Florian Franzen e51a840259 grub: Support 32bit EFI on 64bit x86 platforms 2019-03-18 10:38:07 +01:00
Léo Gaspard f7fb88c324
iso-image: make reproducible by not relying on mcopy's readdir 2019-03-13 03:19:40 +01:00
Matthew Bauer a923a5bbdc
ova: remove stateVersion
This is undefined in the default configuration.nix template.
2019-03-09 14:25:05 -05: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
Elis Hirwing 5f00002a3c
Merge pull request #56167 from etu/iso-with-audio
installer: Enable pulseaudio in all graphical iso's
2019-02-22 21:24:12 +01:00
Symphorien Gibol a915b33315 nixos: add preferLocalBuild=true; on derivations for config files 2019-02-22 20:11:27 +01:00
Elis Hirwing 6483e75afa
installer: Enable pulseaudio in all graphical iso's 2019-02-21 23:04:33 +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
Graham Christensen 013c7fa4ba
efi-image_eltorito: make reproducible
'./*' produces arguments ordered by inode.

efiDir produces, reliably, ./EFI, so just make all the directories
known explicitly.
2019-02-05 21:33:37 -05: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
devhell c3d22fdca1 nixos-generate-config: Include extraGroups "wheel"
I've been asked, on numerous occasions, by my students and others, how
to 'sudo' on NixOS.

Of course new users could read up in the manual on how to do that, or we
could make it more accessible for them by simply making it visible in
the default `configuration.nix` file.

Additionally, as raised in [1], replacing `guest` with something more
recognizable could be potentially beneficial to new users. I've
opted for `jane` for now.

[1]: https://github.com/NixOS/nixpkgs/pull/54519#issuecomment-457012223
2019-01-27 20:33:36 +00:00
Danylo Hlynskyi 0abf181066
Merge pull request #48153 from Ma27/fix-nixos-option-for-invalid-options
nixos-option: don't abort with shell failures if options are not existant
2019-01-24 02:38:02 +02:00
Danylo Hlynskyi a866551226
nixos-option: prune backtick from output
It doesn't work good with double-click selection in terminal (it gets into selection buffer of some terminals)
2019-01-24 02:37:29 +02:00
Claudio Bley 352e06d3da installer/tools: Avoid duplicate LUKS device entries in hw config
There are situations where several filesystems reside on a single encrypted LUKS
device (e.g. when using BTRFS subvolumes).

Simply generating a `boot.init.luks.devices.NAME.device` entry for each mounted
filesystem will result in an error later when evaluating the nix expression in
`hardware-configuration.nix`.
2019-01-19 22:02:49 +01:00
Jörg Thalheim bfbadab4a4
Merge pull request #53801 from Mic92/nixos-builders
nixos-rebuild: allow to override builders
2019-01-13 21:59:43 +00:00
Vladimír Čunát bde8efe792
Merge branch 'master' into staging-next
A couple thousand rebuilds have accumulated on master.
2019-01-12 12:19:34 +01:00
Eelco Dolstra 94ea1c2d83
nix: 2.1.3 -> 2.2 2019-01-11 12:47:06 +01:00
Jörg Thalheim e40bfa4d85
nixos-rebuild: allow to override builders
Since nix 2.0 the no-build-hook option was replaced by the builders options
that allows to override remote builders ad-hoc.
Since it is useful to disable remote builders updating nixos without network,
this commit reintroduces the option.
2019-01-11 11:40:25 +00:00
Vladimír Čunát 287144e342
Merge branch 'master' into staging-next 2019-01-10 13:07:21 +01:00
Matthew Bauer 04373fd3cc
Merge pull request #52594 from matthewbauer/fix-51025
make-disk-image: use filterSource instead of cleanSource
2019-01-07 16:29:58 -06:00
Matthew Bauer f05d8f31ec make-disk-image: use filterSource instead of cleanSource
cleanSource does not appear to work correctly in this case. The path
does not get coerced to a string, resulting in a dangling symlink
produced in channel.nix.  Not sure why, but this
seems to fix it.

Fixes #51025.

/cc @elvishjericco
2019-01-07 16:28:50 -06:00
Frederik Rietdijk 60a3973a55 Merge staging-next into staging 2019-01-05 10:15:00 +01:00
Frederik Rietdijk 2da31b80bb Merge master into staging-next 2019-01-03 20:07:35 +01:00
(cdep)illabout 46ecec8239
nixos/cpufreq: Remove the alias to set the cpu frequency governor
This PR temporarily fixes the issue with PR 53041 as explained
here:

https://github.com/NixOS/nixpkgs/pull/53041#commitcomment-31825338

The alias `powerManagement.cpufreq.governor` to
`powerManagement.cpuFreqGovernor` has been removed.
2019-01-03 20:57:49 +09:00
Matthew Bauer 921a47bc92 treewide: remove cross assertions
sd-image-raspberrypi, sd-image-aarch64, and
sd-image-armv7l-multiplatform can all be cross compiled now.
2019-01-02 23:02:50 -06:00
Matthew Bauer 35af6e3605 treewide: use buildPackages for config builders 2019-01-02 23:02:50 -06:00
Frederik Rietdijk 092e3b50a8 Merge master into staging-next 2019-01-02 21:08:27 +01:00
Vladimír Čunát 70bff06140
Merge branch 'master' into staging 2019-01-02 17:19:23 +01:00
(cdep)illabout b0f10d2d53
cpufreq: add option for setting the cpu max and min frequencies
This adds a NixOS option for setting the CPU max and min frequencies
with `cpufreq`.  The two options that have been added are:

- `powerManagement.cpufreq.max`
- `powerManagement.cpufreq.min`

It also adds an alias to the `powerManagement.cpuFreqGovernor` option as
`powerManagement.cpufreq.governor`.  This updates the installer to use
the new option name.  It also updates the manual with a note about
the new name.
2019-01-01 19:18:12 +09:00
Frederik Rietdijk 10afccf145 Merge staging-next into staging 2018-12-27 18:11:34 +01:00
Samuel Dionne-Riel 302d53df2b nixos/sd-image-aarch64-new-kernel: Added to release
This, paired with the previous commit, ensures the channel won't be held
back from a kernel upgrade and a non-building sd image, while still
having a new-kernel variant available.
2018-12-26 11:03:32 +00:00
Samuel Dionne-Riel 207210660f nixos/sd-image-aarch64: Configures it to use the default kernel 2018-12-26 11:03:32 +00:00
Frederik Rietdijk 9ab61ab8e2 Merge staging-next into staging 2018-12-19 09:00:36 +01:00
volth bb9557eb7c lib.makePerlPath -> perlPackages.makePerlPath 2018-12-15 03:50:31 +00:00
Samuel Dionne-Riel ad27b068d7 installer: Adds AArch64 UEFI installer support. 2018-12-12 19:26:34 -05:00
Samuel Dionne-Riel 3864438049 iso-image: Do not use batch operations for mcopy.
```
       b      Batch mode. Optimized for huge recursive copies, but less secure if a crash happens during the copy.
```

It seems the "less secure if a crash happens" does not need a crash to
happen.

With batch mode:

```
/[...]/.
  Start (0) does not point to parent (___)
```

For pretty much everything copied in.

Without batch mode, everything passes `fsck`.

See #51150
2018-11-28 19:14:54 -05:00
Samuel Dionne-Riel 0a367c41ea iso-image: Verifies the FAT partition at build.
This is done to ensure `mtools`-based operations leave a clean FS.
2018-11-28 19:14:18 -05:00
Samuel Dionne-Riel 1b6a4d3979 sd-image: Do not use batch operation for mcopy.
```
       b      Batch mode. Optimized for huge recursive copies, but less secure if a crash happens during the copy.
```

It seems the "less secure if a crash happens" does not need a crash to
happen.

With batch mode:

```
/[...]/.
  Start (0) does not point to parent (___)
```

For pretty much everything copied in.

Without batch mode, everything passes `fsck`.

See #51150
2018-11-29 01:50:30 +02:00
Samuel Dionne-Riel 2e5eb135aa sd-image: Verifies the FAT partition before copying it.
This is to ensure `mtools`-based operations don't wreck the FS.
2018-11-29 01:50:30 +02:00
Maximilian Bosch b36fa8ef91
nixos-build-vms: fix eval
Previously I got the following error message:

```
error: opening file '/home/ma27/Projects/nixpkgs/nixos/modules/installer/default.nix': No such file or directory
```

Probably related to 6c68fbd4e1.
2018-11-23 13:43:47 +01:00
Jörg Thalheim a91a1eede5
Merge pull request #50495 from zimbatm/nixos-move-autoupgrade
nixos: move system.autoUpgrade
2018-11-17 13:08:27 +00:00
zimbatm 7b9a553e21
nixos: move system.autoUpgrade
This is not installer-specific
2018-11-17 14:05:30 +01:00
Silvan Mosberger 5c4ed80ad7
Merge pull request #49835 from Synthetica9/fix-49826
nixos-generate-config: fix for swapless kernels
2018-11-17 02:53:43 +01:00
Léo Gaspard 27a5427526
nixos-build-vms: fix syntax error
Introduced by 6c68fbd4e1
2018-11-13 00:40:07 +09:00
Léo Gaspard 6c68fbd4e1
tests: refactor to carry the package set as an argument
This way, the package set will be possible to pass without re-importing
all the time
2018-11-11 23:11:45 +09:00
Patrick Hilhorst ce65df3a36
nixos-generate-config: fix for swapless kernels
Fixes #49826
2018-11-06 17:32:54 +01:00