Commit graph

784 commits

Author SHA1 Message Date
Svein Ove Aas 93c160fabc systemd: Set KillUserProcesses=no in logind.conf
Full discussion at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=825394

NixOS is even more of a server OS than Debian, and I can think of no
reason to make users jump through this sort of hoop.
2016-06-06 11:51:51 +01:00
Shea Levy 83c2629f15 Merge pull request #15895 from cerana/stage2-sysfs
stage2: if no /proc, also mount /sys
2016-06-03 11:32:57 -04:00
Nahum Shalman 9b0a5ced13 stage2: if no /proc, also mount /sys 2016-06-01 13:26:14 +00:00
Eelco Dolstra e8ad22be12 Rename gummiboot module 2016-06-01 12:55:56 +02:00
Eelco Dolstra 9f0e137338 Rename boot.loader.gummiboot.enable -> boot.loader.systemd-boot.enable 2016-06-01 12:55:52 +02:00
Eelco Dolstra f222689aba Use systemd-boot instead of gummiboot
Gummiboot is part of systemd now so we may as well use it.
2016-05-31 17:02:47 +02:00
Robin Gloster 2d382f3d98 Merge remote-tracking branch 'upstream/master' into hardened-stdenv 2016-05-30 19:39:34 +00:00
Profpatsch 16c923cef2 modules/mkRemovedOptionModule: add replacement doc
When displaying a warning about a removed Option we should always
include reasoning why it was removed and how to get the same
functionality without it.

Introduces such a description argument and patches occurences (mostly
with an empty string).

startGnuPGAgent: further notes on replacement
2016-05-29 00:42:08 +02:00
Vladimír Čunát 81039713fa Merge branch 'master' into staging
... to get the systemd update (rebuilding ~7k jobs).
2016-05-26 16:50:22 +02:00
Eelco Dolstra 845c9b50bf boot.initrd.luks.devices: Change into an attribute set
This allows setting options for the same LUKS device in different
modules. For example, the auto-generated hardware-configuration.nix
can contain

  boot.initrd.luks.devices.crypted.device = "/dev/disk/...";

while configuration.nix can add

  boot.initrd.luks.devices.crypted.allowDiscards = true;

Also updated the examples/docs to use /disk/disk/by-uuid instead of
/dev/sda, since we shouldn't promote the use of the latter.
2016-05-25 18:04:21 +02:00
Eelco Dolstra 32bed83b18 Remove boot.loader.grub.timeout and boot.loader.gummiboot.timeout
There is a generic boot.loader.timeout option.
2016-05-25 11:39:17 +02:00
Eelco Dolstra 0c5ebbd744 Merge pull request #15598 from rnhmjoj/systemd
Remove systemd shell aliases
2016-05-23 10:28:34 +02:00
Vladimír Čunát 0b192a0976 Merge branch 'master' into staging
That's to get mesa rebuild from master, as it's nontrivial.
2016-05-23 09:02:10 +02:00
rnhmjoj 1d9651e723
Remove systemd shell aliases 2016-05-21 19:25:21 +02:00
Nikolay Amiantov 53b8852498 initrd-ssh service: add assertions for host keys 2016-05-20 23:34:28 +03:00
Tuomas Tynkkynen 2a73de6e6c treewide: Make explicit that 'dev' output of openssl is used 2016-05-19 10:02:23 +02:00
Franz Pletz f8d481754c
Merge remote-tracking branch 'origin/master' into hardened-stdenv 2016-05-18 17:10:02 +02:00
Vladimír Čunát 65a9fa8cdc Merge branch 'master' into staging 2016-05-08 21:24:48 +02:00
Nikolay Amiantov 17e4803de7 initrd-ssh service: fix build 2016-05-07 15:38:46 +03:00
aszlig 67223ee205
nixos/stage-1: Don't kill kernel threads
Unfortunately, pkill doesn't distinguish between kernel and user space
processes, so we need to make sure we don't accidentally kill kernel
threads.

Normally, a kernel thread ignores all signals, but there are a few that
do. A quick grep on the kernel source tree (as of kernel 4.6.0) shows
the following source files which use allow_signal():

  drivers/isdn/mISDN/l1oip_core.c
  drivers/md/md.c
  drivers/misc/mic/cosm/cosm_scif_server.c
  drivers/misc/mic/cosm_client/cosm_scif_client.c
  drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  drivers/staging/rtl8188eu/core/rtw_cmd.c
  drivers/staging/rtl8712/rtl8712_cmd.c
  drivers/target/iscsi/iscsi_target.c
  drivers/target/iscsi/iscsi_target_login.c
  drivers/target/iscsi/iscsi_target_nego.c
  drivers/usb/atm/usbatm.c
  drivers/usb/gadget/function/f_mass_storage.c
  fs/jffs2/background.c
  fs/lockd/clntlock.c
  fs/lockd/svc.c
  fs/nfs/nfs4state.c
  fs/nfsd/nfssvc.c

While not all of these are necessarily kthreads and some functionality
may still be unimpeded, it's still quite harmful and can cause
unexpected side-effects, especially because some of these kthreads are
storage-related (which we obviously don't want to kill during bootup).

During discussion at #15226, @dezgeg suggested the following
implementation:

for pid in $(pgrep -v -f '@'); do
    if [ "$(cat /proc/$pid/cmdline)" != "" ]; then
        kill -9 "$pid"
    fi
done

This has a few downsides:

 * User space processes which use an empty string in their command line
   won't be killed.
 * It results in errors during bootup because some shell-related
   processes are already terminated (maybe it's pgrep itself, haven't
   checked).
 * The @ is searched within the full command line, not just at the
   beginning of the string. Of course, we already had this until now, so
   it's not a problem of his implementation.

I posted an alternative implementation which doesn't suffer from the
first point, but even that one wasn't sufficient:

for pid in $(pgrep -v -f '^@'); do
    readlink "/proc/$pid/exe" &> /dev/null || continue
    echo "$pid"
done | xargs kill -9

This one spawns a subshell, which would be included in the processes to
kill and actually kills itself during the process.

So what we have now is even checking whether the shell process itself is
in the list to kill and avoids killing it just to be sure.

Also, we don't spawn a subshell anymore and use /proc/$pid/exe to
distinguish between user space and kernel processes like in the comments
of the following StackOverflow answer:

http://stackoverflow.com/a/12231039

We don't need to take care of terminating processes, because what we
actually want IS to terminate the processes.

The only point where this (and any previous) approach falls short if we
have processes that act like fork bombs, because they might spawn
additional processes between the pgrep and the killing. We can only
address this with process/control groups and this still won't save us
because the root user can escape from that as well.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Fixes: #15226
2016-05-06 16:24:42 +02:00
Robin Gloster c92bca56f8 Merge remote-tracking branch 'upstream/master' into hardened-stdenv 2016-05-02 22:58:02 +00:00
William A. Kennington III 60b3484928 dbus: Fix for new 1.10 version
(cherry picked from commit 68a4a6df3971d66aa988bba680351a30fbadbed3)
2016-05-02 13:04:20 -05:00
Tuomas Tynkkynen 4ff8f377af Merge remote-tracking branch 'upstream/master' into staging 2016-04-28 00:13:53 +03:00
Graham Christensen 56f8206b85 Update etc example to not use a real config file
A user noticed the example for `hosts`, took the `mode` permissions literally, and ended up with surprising behavior on their system. Updating the documentation to not reference a real config file which might have real permissions requirements.
2016-04-27 10:27:52 -05:00
Nikolay Amiantov 5f19542581 Merge commit 'refs/pull/14694/head' of git://github.com/NixOS/nixpkgs into staging 2016-04-25 18:02:23 +03:00
Tuomas Tynkkynen 1d4b21ef42 treewide: Use correct output of config.nix.package in non-string contexts 2016-04-25 16:44:38 +02:00
Nikolay Amiantov 5ff40ddedf add get* helper functions and mass-replace manual outputs search with them 2016-04-25 13:24:39 +03:00
Nikolay Amiantov ab0a0c004e makeSearchPathOutputs: refactor to makeSearchPathOutput 2016-04-25 13:24:39 +03:00
Alexander Ried 1d6990db06 boot.loader.grub: fix variable name (#14855) 2016-04-20 22:27:34 +02:00
Robin Gloster d020caa5b2 Merge remote-tracking branch 'upstream/master' into hardened-stdenv 2016-04-18 13:49:22 +00:00
Tuomas Tynkkynen ab428dce14 stage-1: Remove doublePatchelf hack
No longer needed with the new patchelf version.
2016-04-15 01:53:34 +03:00
Eelco Dolstra 840f3230a2 Restore default core limit of 0:infinity
Continuation of 79c3c16dcbb3b45c0f108550cb89ccd4fc855e3b. Systemd 229
sets the default RLIMIT_CORE to infinity, causing systems to be
littered with core dumps when systemd.coredump.enable is disabled.

This restores the 15.09 soft limit of 0 and hard limit of infinity.
2016-04-14 13:18:09 +02:00
Nikolay Amiantov 8b7ebaffeb replace makeSearchPath tree-wise to take care of possible multiple outputs 2016-04-13 22:09:41 +03:00
Vladimír Čunát 39ebb01d6e Merge branch 'staging', containing closure-size #7701 2016-04-13 09:25:28 +02:00
Vladimír Čunát 30f14243c3 Merge branch 'master' into closure-size
Comparison to master evaluations on Hydra:
  - 1255515 for nixos
  - 1255502 for nixpkgs
2016-04-10 11:17:52 +02:00
Moritz Ulrich e366d8294e systemd.generators: Generate folders via environment.etc. 2016-04-08 14:50:20 +02:00
Moritz Ulrich 88e2cc480f systemd.generator-packages: Option to specify packages providing generators. 2016-04-08 14:50:20 +02:00
Robin Gloster 3e68106afd Merge remote-tracking branch 'upstream/master' into hardened-stdenv 2016-04-07 21:52:26 +00:00
Robin Gloster a73a28de7b fix grammar errors 2016-04-06 16:16:23 +00:00
joachifm 97c8bf61ef Merge pull request #14474 from MatrixAI/fixed-stage1
nixos/stage-1: Removed logCommands conditional for resetting the file descriptors after completion of logging
2016-04-05 22:39:14 +02:00
Roger Qiu 53e8e93939 nixos/stage-1: Removed logCommands conditional for resetting the file descriptors after completion of logging 2016-04-06 00:27:18 +10:00
Eelco Dolstra f2af8874e8 Revert "initrd: Use modprobe from busybox"
This reverts commit 45c218f893.

Busybox's modprobe causes numerous "Unknown symbol" errors in the
kernel log, even though the modules do appear to load correctly.
2016-04-01 17:39:09 +02:00
Vladimír Čunát ab15a62c68 Merge branch 'master' into closure-size
Beware that stdenv doesn't build. It seems something more will be needed
than just resolution of merge conflicts.
2016-04-01 10:06:01 +02:00
Eelco Dolstra 54ca7e9f75 Restore core dumps
Systemd 229 sets kernel.core_pattern to "|/bin/false" by default,
unless systemd-coredump is enabled. Revert back to the default of
writing "core" in the current directory.
2016-03-25 17:29:29 +01:00
kklas aac666e302 sw-raid: make mdmon start from initrd
Also add required systemd services for starting/stopping mdmon.

Closes #13447.
abbradar: fixed `mdadmShutdown` service name according to de facto conventions.
2016-03-09 21:03:49 +03:00
Vladimír Čunát 09af15654f Merge master into closure-size
The kde-5 stuff still didn't merge well.
I hand-fixed what I saw, but there may be more problems.
2016-03-08 09:58:19 +01:00
Nathan Zadoks 1904ef7f09 systemd: enable upstream systemd-binfmt.service
Since we don't restart sysinit.service in switch-to-configuration, this
additionally overrides systemd-binfmt.service to depend on
proc-sys-fs-binfmt_misc.automount, which is normally provided by
sysinit.service.
2016-03-02 21:00:47 +01:00
Eelco Dolstra f3d94cfc23 Revert "Add the tool "nixos-typecheck" that can check an option declaration to:"
This reverts commit cad8957eab. It
breaks NixOps, but more importantly, such major changes to the module
system really need to be reviewed.
2016-03-01 20:52:06 +01:00
Thomas Strobel cad8957eab Add the tool "nixos-typecheck" that can check an option declaration to:
- Enforce that an option declaration has a "defaultText" if and only if the
   type of the option derives from "package", "packageSet" or "nixpkgsConfig"
   and if a "default" attribute is defined.

 - Enforce that the value of the "example" attribute is wrapped with "literalExample"
   if the type of the option derives from "package", "packageSet" or "nixpkgsConfig".

 - Warn if a "defaultText" is defined in an option declaration if the type of
   the option does not derive from "package", "packageSet" or "nixpkgsConfig".

 - Warn if no "type" is defined in an option declaration.
2016-02-29 01:09:00 +01:00
Vladimír Čunát f8516a0717 nixos copySystemConfiguration: fix when chrooted
Fixes #7974. Also makes the description more informative.
2016-02-28 10:08:42 +01:00
Leroy Hopson 392ca77d4c nixos/activation-script: fix formatting of example 2016-02-27 22:25:40 +13:00
zimbatm b73c5ae291 Merge pull request #10546 from aszlig/nixops-issue-350
Fixes for NixOps issue #350
2016-02-26 00:33:49 +00:00
Roger Qiu 5cf823e1f4 nixos/stage-1/2: Added -r option to read so that read interprets backslashes literally, and corrected the comment about optional logging. 2016-02-24 18:54:25 +11:00
Eelco Dolstra deae4eff7b Make stage-1/2 logging unconditional, and drop log level to "debug"
Using "debug" level prevents spamming the console with messages twice
(once directly and once via kmsg).
2016-02-23 11:56:09 +01:00
Roger Qiu 474d5a7bd0 nixos/stage-2: Added boot.logCommands 2016-02-23 11:56:09 +01:00
Roger Qiu 142f65e07a nixos/stage-1: Added boot.initrd.logCommands 2016-02-23 11:56:08 +01:00
Vladimír Čunát d039c87984 Merge branch 'master' into closure-size 2016-02-14 08:33:51 +01:00
Peter Simons a1fa485378 Revert "Remove double-backslashes from grub conf file".
This reverts commit b861bf8ddf, because according to @mdorman [1] this
change rendered his NixOS systems unbootable, and we probably don't want that.

[1] b861bf8ddf (commitcomment-16058598)
2016-02-12 13:14:34 +01:00
Ben Booth b861bf8ddf Remove double-backslashes from grub conf file
The double-backspashes in the splashimage, kernel, and initrd sections serve no purpose and confuse pygrub
2016-02-11 12:05:15 -08:00
Nikolay Amiantov 5396a01b6c init-script-builder: handle containers without a kernel 2016-02-10 02:05:47 +03:00
Robin Gloster 0ee88cffca Merge pull request #10417 from puffnfresh/nixos/mmc_block
initrd: add mmc_block to default available modules
2016-02-08 23:51:46 +01:00
Aneesh Agrawal 3c5fca9618 filesystems: use list of strings for fs options
Allow usage of list of strings instead of a comma-separated string
for filesystem options. Deprecate the comma-separated string style
with a warning message; convert this to a hard error after 16.09.
15.09 was just released, so this provides a deprecation period during
the 16.03 release.

closes #10518

Signed-off-by: Robin Gloster <mail@glob.in>
2016-02-06 19:48:30 +00:00
Vladimír Čunát 54299b60c4 Merge #12779: Mass replace pkg}/bin-style strings
... to refer to correct outputs
2016-02-03 17:25:22 +01:00
Vladimír Čunát ae74c356d9 Merge recent 'staging' into closure-size
Let's get rid of those merge conflicts.
2016-02-03 16:57:19 +01:00
Eelco Dolstra 42709fb4e9 switch-to-configuration: Handle failure to read /proc/1/exe
It's not entirely clear why this happens, but sometimes /proc/1/exe
returns a bogus value, like
/ar3a3j6b9livhy5fcfv69izslhgk4gcz-systemd-217/lib/systemd/systemd. In
any case, we can just conservatively assume that we need to restart
systemd when this happens.

Fixes #10261.
2016-02-03 15:01:18 +01:00
Nikolay Amiantov 1dce7c0b82 initrd-ssh module: don't check if network is up
We already do this in initrd-network.
2016-02-03 16:37:10 +03:00
Nikolay Amiantov b4528a696a initrd-network: call postCommands only if network is up 2016-02-03 16:35:21 +03:00
aszlig 8ecd3a5e1d
nixos/stage-1: Fix references to readlink/basename
Fixes references coming from the mdadm udev rules.

This addresses #12722 (mdadm udev rules have references to /usr/bin) but
still won't fix the warning, though (if we want to fix the warnings, we
will have to patch the udev rules generater in services/hardware/udev).

For common mdraid functionality, this shouldn't fix anything, because
the wrong references seem to only apply to containers, see these
(wrapped) lines from ${mdadm}/lib/udev/rules.d/63-md-raid-arrays.rules:

  # Tell systemd to run mdmon for our container, if we need it.
  ENV{MD_LEVEL}=="raid[1-9]*",
    ENV{MD_CONTAINER}=="?*",
  PROGRAM="/usr/bin/readlink $env{MD_CONTAINER}",
    ENV{MD_MON_THIS}="%c"
    ENV{MD_MON_THIS}=="?*",
    PROGRAM="/usr/bin/basename $env{MD_MON_THIS}",
    ENV{SYSTEMD_WANTS}+="mdmon@%c.service"

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2016-02-03 14:19:24 +01:00
Nikolay Amiantov 1d70e2fb75 initrd modules: move passwd and nsswitch back to initrd-ssh
Partially reverts commit 901163c0c7.
This has broken remote SSH into initrd because ${cfg.shell} is not
expanded. Also, nsswitch is useless without libnss_files.so which
are installed by initrd-ssh.
2016-02-03 14:56:55 +03:00
Nikolay Amiantov 815ff00ee0 initrd-ssh module: enable only if initrd network is enabled 2016-02-03 14:55:52 +03:00
Nikolay Amiantov cc70183cee initrd-network module: initialize network before other pre-LVM commands
This is needed to ensure that network will be initialized before LUKS
passphrase is asked.
2016-02-03 14:55:42 +03:00
Eelco Dolstra cc925d0506 boot.initrd.network: Support DHCP
This allows us to use it for EC2 instances.
2016-02-02 19:59:27 +01:00
Eelco Dolstra 901163c0c7 Split the initrd sshd support into a separate module
Also, drop boot.initrd.postEarlyDeviceCommands since preLVMCommands
should work fine.
2016-02-02 19:59:27 +01:00
Tuomas Tynkkynen 13b3f3f246 treewide: Mass replace 'openssl}/bin' to refer the 'bin' output 2016-02-01 20:46:16 +02:00
Eelco Dolstra 45c218f893 initrd: Use modprobe from busybox 2016-02-01 18:19:24 +01:00
Tuomas Tynkkynen d91c7347d1 treewide: Mass replace 'openssl}/lib' to refer the 'out' output 2016-01-24 10:03:38 +02:00
Tuomas Tynkkynen a1909d7380 treewide: Mass replace 'glibc}/lib' to refer the 'out' output 2016-01-24 10:03:35 +02:00
Peter Simons 9ee5a6b858 Merge pull request #12481 from nathan7/usrbinenv-option
activation-script module: add environment.usrbinenv option
2016-01-22 11:18:37 +01:00
Robin Gloster eac8cb1ce1 Merge pull request #11896 from mayflower/upstream-networkd
networkd: add IPForward IPMasquerade options,  DHCPServer section
2016-01-20 13:06:44 +01:00
Nathan Zadoks df82096af0 activation-script module: add environment.usrbinenv option 2016-01-19 23:29:48 +01:00
Vladimír Čunát 716aac2519 Merge branch 'staging' into closure-size 2016-01-19 09:55:31 +01:00
Nikolay Amiantov 148396c022 systemd service: add *.busname upstream units 2016-01-18 19:42:25 +03:00
Robin Gloster 4a0692a5fb types: remove references to new packageSet
Reverts part of a04a7272aa

packageSet is slated to be introduced in #11866 but currently causes
evalation errors.

/cc @ts468
2016-01-17 19:49:38 +00:00
Thomas Strobel a04a7272aa Add missing 'type', 'defaultText' and 'literalExample' in module definitions
- add missing types in module definitions
- add missing 'defaultText' in module definitions
- wrap example with 'literalExample' where necessary in module definitions
2016-01-17 19:41:23 +01:00
Evgeny Egorochkin 01130e502a systemd: backslashes are no longer allowed in script names 2016-01-10 11:31:38 +02:00
Arseniy Seroka c03fe79265 Merge pull request #10996 from oxij/nixos-label
nixos: introduce system.nixosLabel support
2016-01-09 20:52:08 +03:00
Jan Malakhovski 119c8f91e7 nixos: introduce system.nixosLabel option and use it where appropriate
Setting nixosVersion to something custom is useful for meaningful GRUB
menus and /nix/store paths, but actuallly changing it rebulids the
whole system path (because of `nixos-version` script and manual
pages). Also, changing it is not a particularly good idea because you
can then be differentitated from other NixOS users by a lot of
programs that read /etc/os-release.

This patch introduces an alternative option that does all you want
from nixosVersion, but rebuilds only the very top system level and
/etc while using your label in the names of system /nix/store paths,
GRUB and other boot loaders' menus, getty greetings and so on.
2016-01-08 22:26:15 +00:00
Daniel Peebles 57cb5ab17a Merge pull request #12198 from mayflower/remove-upstart-layer
Remove upstart layer
2016-01-07 13:47:39 -05:00
Eelco Dolstra e4b4e9b986 linux: Make Unix domain sockets builtin
This hopefully fixes intermittent initrd failures where udevd cannot
create a Unix domain socket:

  machine# running udev...
  machine# error getting socket: Address family not supported by protocol
  machine# error initializing udev control socket
  machine# error getting socket: Address family not supported by protocol

The "unix" kernel module is supposed to be loaded automatically, and
clearly that works most of the time, but maybe there is a race
somewhere. In any case, no sane person would run a kernel without Unix
domain sockets, so we may as well make it builtin.

http://hydra.nixos.org/build/30001448
2016-01-07 13:20:53 +01:00
Robin Gloster 88292fdf09 jobs -> systemd.services 2016-01-07 06:39:06 +00:00
Eelco Dolstra 6d02d7e740 NixOS tests: Increase hung_task_timeout_secs
This hopefully fixes intermittent test failures like

  http://hydra.nixos.org/build/29962437

  router# [  240.128835] INFO: task mke2fs:99 blocked for more than 120 seconds.
  router# [  240.130135]       Not tainted 3.18.25 #1-NixOS
  router# [  240.131110] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.

assuming that these are caused by high load on the host.
2016-01-04 16:53:42 +01:00
Vladimír Čunát 0e1fe66aad kernel: do not load configs module (close #10912)
... because we make it built-in by default.
I can't imagine anyone who wanted to purge this module from his/her system,
so let's keep it simple, at least for now.
2016-01-04 13:59:53 +01:00
Tobias Geerinckx-Rice 82419575aa btrfsProgs -> canonical btrfs-progs 2016-01-03 20:38:44 +01:00
Vladimír Čunát f9f6f41bff Merge branch 'master' into closure-size
TODO: there was more significant refactoring of qtbase and plasma 5.5
on master, and I'm deferring pointing to correct outputs to later.
2015-12-31 09:53:02 +01:00
Eelco Dolstra e78bad5262 etc: Use a friendlier name than "etc-file" 2015-12-30 15:17:30 +01:00
Eelco Dolstra 1ba2015450 install-grub: Make more robust against GC'ed system profile entries
Previously this barfed with:

  updating GRUB 2 menu...
  fileparse(): need a valid pathname at /nix/store/zldbbngl0f8g5iv4rslygxwp0dbg1624-install-grub.pl line 391.
  warning: error(s) occured while switching to the new configuration
2015-12-30 15:07:18 +01:00
Christian Albrecht 83a64cecc9 networkd: add DHCPServer config section 2015-12-23 06:04:39 +01:00
Christian Albrecht 2307d24544 networkd: add IPForward and IPMasquerade options
to Network config section
2015-12-23 06:02:59 +01:00
Thomas Strobel d856841ba4 nixos trustedGRUB: add support for HP laptops 2015-12-22 03:12:30 +01:00
Luca Bruno 5b0352a6a4 Merge branch 'master' into closure-size 2015-12-11 18:31:00 +01:00
Nicole Angel c840974c24 grub: fix typo in variable name (trivial) 2015-12-10 19:52:08 +01:00
Gabriel Ebner f4c01fc004 systemd: enable timedated, hostnamed, localed. 2015-12-07 20:25:53 +01:00
Luca Bruno a412927924 Merge remote-tracking branch 'origin/master' into closure-size 2015-11-25 21:37:30 +01:00
Vladimír Čunát 333d69a5f0 Merge staging into closure-size
The most complex problems were from dealing with switches reverted in
the meantime (gcc5, gmp6, ncurses6).
It's likely that darwin is (still) broken nontrivially.
2015-11-20 14:32:58 +01:00
Jaka Hudoklin b9291616a6 systemd module: Add OnFailure to systemd common unit options 2015-11-16 15:12:28 +01:00
William A. Kennington III 9579c9ec7f Merge commit 'cb21b77' into master.upstream
This is a partial merge of staging for builds which are working
2015-11-13 15:53:10 -08:00
Domen Kožar 505117f3fb Merge branch 'master' into staging 2015-11-11 12:53:36 +01:00
Nikolay Amiantov d4c27381dc Merge pull request #10460 from abbradar/remote-askpass
Support network in initrd and entering LUKS passphrase via SSH
2015-11-10 16:41:34 +03:00
Eelco Dolstra 81f6c62004 Merge remote-tracking branch 'origin/master' into systemd-219 2015-10-30 15:47:37 +01:00
aszlig 26963cfc2d
switch-to-configuration: Fix unit name quoting.
Clearly it would be the best if we'd directly generate mount units
instead of converting /etc/fstab. But in order to do that we need to
test it throughly so this approach is for the next stable release.

This fix however is intended for inclusion into release-14.12 and
release-15.09.

Using a simple regular expression unfortunately isn't sufficient for
proper mount unit name quoting/escaping and there is a utility in
systemd called systemd-escape which does nothing less than that.

Of course, using an external program to escape the unit name is way more
expensive and causes us to fork for each mount point.

But given that we already do quite a lot of forks just for unit starting
and stopping, I think it doesn't matter that much. Well, except if you
have a whole bunch of mount points.

However, if the latter is the case and you have thousands of mount
points, you probably have stumbled over this already if your mount point
contains a dash.

As for my motivation to fix this: I've stumbled on this while trying to
fix the "none" backend test for NixOps (see NixOS/nixops#350), where the
target machines use /nix/.ro-store and /nix/.rw-store as mount points.

The implementation we had so far did improperly escape it so those mount
points got the following unit files:

 * nix-.ro-store.mount
 * nix-.rw-store.mount

The correct names for these units are however:

 * nix-.ro\x2dstore.mount
 * nix-.rw\x2dstore.mount

So using systemd-escape now properly generates these names.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-10-22 19:40:00 +02:00
Nikolay Amiantov de8b8b35a4 nixos/swap: refactor, add randomEncryption option 2015-10-20 15:56:12 +03:00
Nikolay Amiantov 12fcfe39db nixos/luksroot: allow to enter passphrase from another console 2015-10-18 18:41:11 +03:00
Nikolay Amiantov 1bd3d9de2a nixos/luksroot: use 'nuke-refs -e' option to simplify things 2015-10-18 18:41:11 +03:00
Nikolay Amiantov c81fb457c9 nixos/initrd-network: add new module 2015-10-18 18:41:11 +03:00
Nikolay Amiantov 8f967a3056 nixos/stage-1: add postEarlyDeviceCommands hook 2015-10-18 18:41:10 +03:00
Brian McKenna fda9d83ddf initrd: add mmc_block to default available modules
mmc_block and sdhci_acpi are both necessary for a Bay Trail Chromebook with an
internal eMMC drive. The sdhci_acpi module is detectable but I can not figure
out a way to check whether the mmc_block module is needed by just looking at
/sys/
2015-10-16 22:20:38 +11:00
Eelco Dolstra 5f077e2296 Factor out option renaming
Option aliases/deprecations can now be declared in any NixOS module,
not just in nixos/modules/rename.nix. This is more modular (since it
allows for example grub-related aliases to be declared in the grub
module), and allows aliases outside of NixOS (e.g. in NixOps modules).

The syntax is a bit funky. Ideally we'd have something like:

  options = {
    foo.bar.newOption = mkOption { ... };
    foo.bar.oldOption = mkAliasOption [ "foo" "bar" "newOption" ];
  };

but that's not possible because options cannot define values in
*other* options - you need to have a "config" for that. So instead we
have functions that return a *module*: mkRemovedOptionModule,
mkRenamedOptionModule and mkAliasOptionModule. These can be used via
"imports", e.g.

  imports = [
    (mkAliasOptionModule [ "foo" "bar" "oldOption" ] [ "foo" "bar" "newOption" ]);
  ];

As an added bonus, deprecation warnings now show the file name of the
offending module.

Fixes #10385.
2015-10-14 18:18:47 +02:00
Eelco Dolstra 73f0d83858 systemd: Update to 227 2015-10-07 22:01:21 +02:00
Thomas Strobel 7a8980193d nixos grub: trustedBoot: introduce safety check that TPM is available 2015-10-06 20:12:39 +02:00
Vladimír Čunát b44d846990 udev: complete rework
- systemd puts all into one output now (except for man),
  because I wasn't able to fix all systemd/udev refernces
  for NixOS to work well
- libudev is now by default *copied* into another path,
  which is what most packages will use as build input :-)
- pkgs.udev = [ libudev.out libudev.dev ]; because there are too many
  references that just put `udev` into build inputs (to rewrite them all),
  also this made "${udev}/foo" fail at *evaluation* time
  so it's easier to catch and change to something more specific
2015-10-04 10:03:53 +02:00
Tuomas Tynkkynen cd3088455d nixos/stage-2: Build readonly-mountpoint with normal mkDerivation phases
This way the binary gets stripped & rpath-shrinked etc. as usual.
We'd seem to get a runtime reference to gcc otherwise.

TODO: Maybe we should be able to set e.g. 'dontUnpack = true;'
to make this more pretty.
2015-10-03 14:08:55 +02:00
Vladimír Čunát 5227fb1dd5 Merge commit staging+systemd into closure-size
Many non-conflict problems weren't (fully) resolved in this commit yet.
2015-10-03 13:33:37 +02:00
Eelco Dolstra b23038dd80 Merge remote-tracking branch 'origin/master' into systemd-219 2015-10-01 14:17:46 +02:00
ts468 1ddc1cdcf2 Merge pull request #10076 from ts468/upstream.systemd
systemd module: add option to specify generators
2015-09-30 15:12:43 +02:00
Thomas Strobel 05c46bfc05 systemd module: add option to specify generators
Adding the configuration option 'systemd.generators' to
specify systemd system-generators. The option allows to
either add new system-generators to systemd, or to over-
ride or disable the system-generators provided by systemd.

Internally, the configuration option 'systemd.generators'
maps onto the 'environment.etc' configuration option.
Having a convenience wrapper around 'environment.etc' helps
to group the systemd system-generator configuration more
easily with other 'systemd...' configurations.
2015-09-29 11:53:25 +02:00
Eelco Dolstra 3fada8c5a0 Remove unnecessary "|| true" from the stage 1 script 2015-09-28 22:15:47 +02:00
Eelco Dolstra 9d92bd7845 Add filesystem option to automatically grow to the maximum size
This is primarily for EC2 and other cloud environments, where the disk
may be bigger than the original image.
2015-09-24 19:59:44 +02:00
Eelco Dolstra 01f19f54e0 Merge remote-tracking branch 'origin/master' into systemd-219
Conflicts:
	pkgs/os-specific/linux/systemd/fixes.patch
	pkgs/os-specific/linux/upower/0.99.nix
	pkgs/top-level/all-packages.nix
2015-09-21 12:57:30 +02:00
Jaka Hudoklin e0881324ac Merge pull request #9925 from oxij/nixos-cleanups-and-fixes
nixos types: cleanups and fixes
2015-09-19 00:28:49 +02:00
Jan Malakhovski a153de28bb nixos: rename some outputs for better discoverability in /nix/store 2015-09-18 19:00:20 +00:00
Jan Malakhovski 6eadb16022 nixos: fix some types 2015-09-18 18:48:50 +00:00
Mathnerd314 87012187b2 kmod-debian-aliases: init at 21-1 2015-09-13 10:55:44 +02:00
Eelco Dolstra 916793cf13 Merge branch 'master' into systemd-219
Conflicts:
	nixos/modules/system/boot/systemd.nix
	pkgs/applications/networking/p2p/transmission/default.nix
	pkgs/development/libraries/libseccomp/default.nix
	pkgs/os-specific/linux/systemd/default.nix
	pkgs/top-level/all-packages.nix
2015-09-07 21:28:33 +02:00
Eelco Dolstra 6ab7e0de29 Create /var/log/journal
Fixes #9614.
2015-09-03 11:35:47 +02:00
lethalman d025500186 Merge pull request #9383 from anderspapitto/master
also generate startAt timers for systemd user units
2015-08-26 10:42:44 +02:00
Eelco Dolstra e4610f2965 buildEnv: Support package priorities like nix-env
This gets rid of a bunch of collision warnings.
2015-08-25 00:40:40 +02:00
Eelco Dolstra 9c61317002 Put all firmware in $out/lib/firmware
This way, hardware.firmware can be a list of packages.
2015-08-25 00:40:34 +02:00
Anders Papitto 57f7798b51 also generate startAt timers for systemd user units 2015-08-20 23:46:08 -07:00
Eelco Dolstra 80d9b42663 Allow units to specify that they shouldn't be stopped when removed 2015-08-07 05:37:23 +02:00
Spencer Janssen 026c31dd9d stage-1: fix typo that breaks resume
$d should be $sd, this causes resume from hibernate to fail if
resumeDevice is not explicitly set in config.  Introduced in commit:
'stage-1: Shut up warnings about swap devices that don't exist yet'

(cherry picked from commit 2a31397f53)
2015-07-31 08:49:38 +02:00
Spencer Janssen 2a31397f53 stage-1: fix typo that breaks resume
$d should be $sd, this causes resume from hibernate to fail if
resumeDevice is not explicitly set in config.  Introduced in commit:
'stage-1: Shut up warnings about swap devices that don't exist yet'
2015-07-30 16:30:20 -05:00
viric 982ce5ed58 Merge pull request #8978 from dezgeg/pr-arm-images
ARM SD card image expressions
2015-07-29 14:13:57 +02:00
Eelco Dolstra f07b2121f9 Fix grub-reboot 2015-07-27 01:07:38 +02:00
Tuomas Tynkkynen 8665b0d8b1 extlinux-conf-builder: Fix warning when building in chroot
When using extlinux-conf-builder in a nix build using chroots, the
following error message could be seen:

/nix/store/XXX-extlinux-conf-builder.sh: line 121: cd: /nix/var/nix/profiles: No such file or directory

To avoid this, just skip the code path parsing /nix/var/nix/profiles
when $numGenerations (passed from the command line) is 0 (which is the
only legal value of $numGenerations in a nix build context).
2015-07-26 00:31:20 +03:00
Eelco Dolstra c49b24c940 Fix capitalisation 2015-07-25 19:06:07 +02:00
Eelco Dolstra 174dd0eae7 Fix description of boot.consoleLogLevel 2015-07-25 19:06:07 +02:00
Tuomas Tynkkynen a6c95a3f7d extlinux-conf-builder: Set menu title to force prompt display
Without a menu title, U-Boot's distro scripts just autoboot the first
entry by default.

When I initially wrote this, my board wasn't apparently running stock
U-Boot but had some local hacks saved in the U-Boot's environment
which made it always display the prompt.
2015-07-22 16:08:18 +03:00
Tuomas Tynkkynen 8496f71e92 extlinux-conf-builder: Make it work on non-DTB systems
With this, boot.loader.generic-extlinux-compatible can be used with
linuxPackages_rpi on the Raspberry Pi.
2015-07-22 16:08:17 +03:00
Tuomas Tynkkynen 6147909f8e extlinux-conf-builder: Properly copy kernels for the default entry
When calling addEntry inside a subshell, the filesCopied array would
be updated only in the subshell's environment. This would only cause an
issue if no -g flag was passed to the script, causing no kernels
to be copied.
2015-07-22 16:08:17 +03:00
Tuomas Tynkkynen 5d02c02a9b systemd: Use upstream tmpfiles.d rules
This fixes a failing assert in systemd-timesyncd (issue #5913) as it
expects the directory /run/systemd/netif/links/ to exist, and nothing in
NixOS currently creates it.

Also we get a net reduction in our code as rules for /run/utmp and
/var/log/journal are also provided by the same upstream file.

(cherry picked from commit a278a9224a)
2015-07-22 12:27:05 +02:00
Eelco Dolstra 925e1f91c5 Set up /etc/machine-id before starting systemd
Otherwise, systemd will try to populate /etc, which we don't want.

(cherry picked from commit c8501a4218)
2015-07-22 12:24:32 +02:00
Eelco Dolstra 0ab320a884 stage-1: Shut up warnings about swap devices that don't exist yet
(cherry picked from commit 388dac478d)
2015-07-22 12:24:06 +02:00
Eelco Dolstra ec82157ac5 stage-2: Don't run hwclock in containers
(cherry picked from commit b978df019a)
2015-07-22 12:23:52 +02:00
Eelco Dolstra 9647609e3e stage-1: Don't mount /dev/shm if it's already mounted
(cherry picked from commit c8ef598945)
2015-07-22 12:23:48 +02:00
Eelco Dolstra 6bd4e0b8cd Create systemd-{network,resolve} user/group unconditionally
This shuts up this error from dbus:

May 11 13:52:16 machine dbus-daemon[259]: Unknown username "systemd-network" in message bus configuration file
May 11 13:52:16 machine dbus-daemon[259]: Unknown username "systemd-resolve" in message bus configuration file

which happens because the D-Bus config for networkd/resolved is
enabled unconditionally, and we don't have an easy way to turn it off.

(cherry picked from commit f19b58fb6a)
2015-07-22 12:23:45 +02:00
Eelco Dolstra 65700b435c Use ConditionVirtualization to disable some services in containers
(cherry picked from commit c52a983806)
2015-07-22 12:23:40 +02:00
Eelco Dolstra bc1773fe16 Merge remote-tracking branch 'origin/staging' into systemd-219
Conflicts:
	pkgs/os-specific/linux/kernel/linux-3.4.nix
	pkgs/os-specific/linux/systemd/default.nix
2015-07-20 22:57:23 +02:00
Eelco Dolstra dc62669335 Set ‘allowSubstitutes = false’ on various derivations
This reduces the number of binary cache requests. See
b64988bb35.
2015-07-09 15:10:37 +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
William A. Kennington III cb343e7be6 nixos/install-grub: Fix symlink installation for boot filesystems which don't support symlinking
Some filesystems like fat32 don't support symlinking and need to be
supported on /boot as an efi system partition. Instead of creating the symlink directly in boot, create the symlink in
a temporary directory which has to support symlinking.
2015-07-05 18:34:47 -07:00
Thomas Strobel 4ee2d39fbf grub installation: fix: simplify code 2015-07-05 21:55:56 +02:00
Thomas Strobel 65cbbc75b0 grub installation: integrate trustedGRUB + fix broken equality check 2015-07-05 19:51:53 +02:00
Marcin Falkiewicz c1becad3eb nixos/modules/system/boot/luksroot.nix: allow for LUKS devices with detached header 2015-06-29 17:36:47 +02:00
William A. Kennington III d4fc2b4d99 nixos/install-grub: Fix grub1 installation 2015-06-17 11:47:36 -07:00
Eelco Dolstra 6e6a96d42c Some more type cleanup 2015-06-15 18:18:46 +02:00
Eelco Dolstra 19ffa212af types.uniq types.int -> types.int
types.int already implies uniqueness.
2015-06-15 18:11:32 +02:00
Bjørn Forsman 74d5adcb4d nixos: move environment.{variables => sessionVariables}.MODULE_DIR
This solves the problem that modprobe does not know about $MODULE_DIR
when run via sudo, and instead wrongly tries to read /lib/modules/:

  $ sudo strace -efile modprobe foo |& grep modules
  open("/lib/modules/3.14.37/modules.softdep", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  open("/lib/modules/3.14.37/modules.dep.bin", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  open("/lib/modules/3.14.37/modules.dep.bin", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  open("/lib/modules/3.14.37/modules.alias.bin", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

Without this patch, one would have to use sudo -E (preserves environment
vars). But that option is reserved for sudo users with extra rights
(SETENV), so it's not a solution.

environment.sessionVariables are set by PAM, so they are included in the
environment used by sudo.
2015-06-14 18:56:58 +02:00
Luca Bruno 033605e87f Merge branch 'nixos-subdir'
Conflicts:
	nixos/modules/system/boot/loader/grub/grub.nix
2015-06-13 15:18:12 +02:00
Luca Bruno c3e832b323 stage-1: mkdir -p /mnt-root, it may be created earlier by some hooks 2015-06-13 15:02:51 +02:00
Luca Bruno 3754de550f nixos/grub: allow customization of the nix store path 2015-06-13 15:02:00 +02:00
William A. Kennington III 502a19b2b4 nixos/grub: Support labeling efi bootloaders with independent id's 2015-06-10 15:47:08 -07:00
William A. Kennington III c891134b77 nixos/grub: Prevent module errors and make gfxmode configurable 2015-06-10 11:50:35 -07:00
Lluís Batlle i Rossell 1c22734cd2 Forcing the load of atkbd in initrd.
In some computers, having the module available does not really load it,
therefore, it results in not having the keyboard avaiable in initrd.
2015-06-10 12:16:25 +02:00
William A. Kennington III 48381b7621 nixos-artwork: Make into a derivation and use fetchfromgithub 2015-06-08 18:32:32 -07:00
Eelco Dolstra 7318ff0e38 Add option ‘system.extraDependencies’ for including stuff in the system closure
Mostly useful for installer tests that don't have network access. This
generalizes virtualisation.pathsInNixDB and isoImage.storeContents.
2015-06-04 11:06:44 +02:00
Tuomas Tynkkynen a278a9224a systemd: Use upstream tmpfiles.d rules
This fixes a failing assert in systemd-timesyncd (issue #5913) as it
expects the directory /run/systemd/netif/links/ to exist, and nothing in
NixOS currently creates it.

Also we get a net reduction in our code as rules for /run/utmp and
/var/log/journal are also provided by the same upstream file.
2015-06-03 10:49:01 +02:00
William A. Kennington III 1e98da6d99 nixos/grub: Use nixos artwork 2015-05-29 13:26:32 -07:00
William A. Kennington III 159fed47bc nixos/grub: Fix video display on efi 2015-05-29 13:26:32 -07:00
William A. Kennington III d4f3930201 nixos/grub: Fix defaultConfig 2015-05-29 13:26:32 -07:00
William A. Kennington III b07d2a447b nixos/grub: Fix assertion 2015-05-25 23:03:31 -07:00
William A. Kennington III fd5b273e82 nixos/grub: Add the ability to mirror grub to multiple partitions 2015-05-25 20:23:06 -07:00
William A. Kennington III f42d2503d7 Merge pull request #7643 from Shados/fix-grub-efi-only
grub2: Fix EFI-only installation
2015-05-25 13:55:20 -07:00
Jonathan Glines 847f8297fc Added config options for systemd-coredump functionality. 2015-05-24 18:22:53 -06:00
Eelco Dolstra 588b92a7d2 systemd: Update to 220 2015-05-22 15:34:08 +02:00
Eelco Dolstra c8501a4218 Set up /etc/machine-id before starting systemd
Otherwise, systemd will try to populate /etc, which we don't want.
2015-05-18 11:35:00 +02:00
Tuomas Tynkkynen 6d176afe5e generic-extlinux-compatible: Add new bootloader for ARM
This module generates a /boot/extlinux/extlinux.conf bootloader
configuration file that is supported by e.g. U-Boot:

http://git.denx.de/?p=u-boot.git;a=blob;f=doc/README.distro;hb=refs/heads/master

With this, all ARM boards supported by U-Boot can be booted in a common
way (a single boot file generator, all boards booting via initrd like
x86) and with same boot menu functionality as GRUB has.

-- sample extlinux.conf file --
# Generated file, all changes will be lost on nixos-rebuild!

# Change this to e.g. nixos-42 to temporarily boot to an older configuration.
DEFAULT nixos-default

TIMEOUT 50

LABEL nixos-default
  MENU LABEL NixOS - Default
  LINUX ../nixos/n7vxfk60nb5h0mcbhkwwxhcz2q2nvxzv-linux-4.1.0-rc3-cpufreq-zImage
  INITRD ../nixos/0ss2zs8sb6d1qn4gblxpwlxkfjsgs5f0-initrd-initrd
  FDTDIR ../nixos/n7vxfk60nb5h0mcbhkwwxhcz2q2nvxzv-linux-4.1.0-rc3-cpufreq-dtbs
  APPEND systemConfig=/nix/store/469qvr43ln8bfsnk5lzcz6m6jfcgdd4r-nixos-15.06.git.0b7a7a6M init=/nix/store/469qvr43ln8bfsnk5lzcz6m6jfcgdd4r-nixos-15.06.git.0b7a7a6M/init loglevel=8 console=ttyS0,115200n8 drm.debug=0xf

LABEL nixos-71
  MENU LABEL NixOS - Configuration 71 (2015-05-17 21:32 - 15.06.git.0b7a7a6M)
  LINUX ../nixos/n7vxfk60nb5h0mcbhkwwxhcz2q2nvxzv-linux-4.1.0-rc3-cpufreq-zImage
  INITRD ../nixos/0ss2zs8sb6d1qn4gblxpwlxkfjsgs5f0-initrd-initrd
  FDTDIR ../nixos/n7vxfk60nb5h0mcbhkwwxhcz2q2nvxzv-linux-4.1.0-rc3-cpufreq-dtbs
  APPEND systemConfig=/nix/store/469qvr43ln8bfsnk5lzcz6m6jfcgdd4r-nixos-15.06.git.0b7a7a6M init=/nix/store/469qvr43ln8bfsnk5lzcz6m6jfcgdd4r-nixos-15.06.git.0b7a7a6M/init loglevel=8 console=ttyS0,115200n8 drm.debug=0xf
2015-05-17 23:38:03 +03:00
Eelco Dolstra 388dac478d stage-1: Shut up warnings about swap devices that don't exist yet 2015-05-11 18:18:36 +02:00
Eelco Dolstra 76055df52d Allow systemd-journald to be restarted
With systemd 219, this is fine because systemd will cause the new
journald to re-use the file descriptors of the old one. So existing
connections to the journal are unaffected.
2015-05-11 18:18:36 +02:00
Eelco Dolstra b978df019a stage-2: Don't run hwclock in containers 2015-05-11 18:18:36 +02:00
Eelco Dolstra c8ef598945 stage-1: Don't mount /dev/shm if it's already mounted 2015-05-11 18:18:36 +02:00
Eelco Dolstra f19b58fb6a Create systemd-{network,resolve} user/group unconditionally
This shuts up this error from dbus:

May 11 13:52:16 machine dbus-daemon[259]: Unknown username "systemd-network" in message bus configuration file
May 11 13:52:16 machine dbus-daemon[259]: Unknown username "systemd-resolve" in message bus configuration file

which happens because the D-Bus config for networkd/resolved is
enabled unconditionally, and we don't have an easy way to turn it off.
2015-05-11 18:18:36 +02:00
Eelco Dolstra c52a983806 Use ConditionVirtualization to disable some services in containers 2015-05-11 18:18:35 +02:00
Eelco Dolstra fe952a42a7 systemd: Update to 219 2015-05-11 18:18:35 +02:00
Eelco Dolstra 492471b453 Apply some overrides to upstream systemd units
This removes the need for the following patches:

9a6cade993
9f7e832c90
2015-05-11 12:43:35 +02:00
Lluís Batlle i Rossell 21dd114f82 Revert "Making nixos keep a ref to its stdenv"
This reverts commit d170c98d13.

niksnut argues that we need smaller system closures, not bigger.

So users facing the trouble of getting gcc rebuilds after nix-collect-garbage
for any minimal nixos configuration change should use other means of
not losing the stdenv output.

One way is to keep one somewhere: nix-build -A stdenv -o stdenv '<nixpkgs>'.
Another may be to use nix.conf options like gc-keep-outputs, gc-keep-derivations
or env-keep-derivations.
2015-05-09 21:11:49 +00:00
Lluís Batlle i Rossell d170c98d13 Making nixos keep a ref to its stdenv
This will help a lot on ARM, where nix-collect-garbage erases gcc; then, any
change to a small system config file requires rebuilding gcc again.

I don't know why it does not happen on x86. Maybe it just pulls the gcc from
hydra, if garbage is collected.
2015-05-09 20:19:34 +00:00
Lluís Batlle i Rossell d8a2bb86c0 Raspberry Pi 2 changes to make it boot.
It boots, but some things still don't work:
1) Installation of DTBs
2) Boot of initrd

Booting still needs a proper config.txt in /boot, which could probably be
managed by NixOS.
2015-05-09 17:05:24 +00:00
Vladimír Čunát d449020d87 nixos: try to fix, choosing correct binary outputs 2015-05-05 11:56:31 +02:00
Vladimír Čunát b7c3c25218 fix ${udev} references (and a few others) 2015-05-05 11:52:08 +02:00
Eelco Dolstra 28e49dcb41 Style fix 2015-05-04 14:18:14 +02:00
Eelco Dolstra c2bf9c3ee3 Typo 2015-05-04 14:16:19 +02:00
Alexei Robyn 60da99ea2a grub module: removed invalid device check for grub EFI installation 2015-04-30 19:28:34 +10:00
aszlig 4cdb4a4fef
networkd: Fix evaluation of systemd.network units.
During the refactor of the networkd stuff in f8dbe5f, a lot of the
options are now needed by systemd.nix as well as networkd.nix but
weren't moved by that commit as well.

For now, this fixes all networkd VM tests except for the macvlan one and
thus it should fix #7505 for at least DHCP-based configuration.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-04-30 06:49:10 +02:00
aszlig 49fa00cded
networkd: Fix disabled networkd units.
In f8dbe5f, the default value for networking unit "enabled" option
suddenly flipped to false. I have no idea of whether this happened by
accident, but I'm setting it to true again, because it essentially
breaks systemd networking support and we have systemd.network.enable to
have a "turn the world off" switch.

And of course, because the mentioned commit obviously wasn't done with
even a run of the simplest run of one of the network VM tests, we now
get an evaluation error if we switch useNetworkd to true.

Fixes the core issue of #7505.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-04-30 06:49:10 +02:00
Eelco Dolstra 56f66dad97 Fix #7476 2015-04-20 11:32:29 +02:00
Eelco Dolstra abeb4a9c96 stage-2-init: Don't depend on sysvtools 2015-04-20 11:32:28 +02:00
Eelco Dolstra c87977e97d Don't include networkd units unless enabled
Otherwise, the enabled -> disabled transition won't be handled
correctly (switch-to-configuration currently assumes that if a unit is
running and exists, it should be restarted).
2015-04-19 22:06:45 +02:00
Eelco Dolstra f8dbe5f376 systemd: Move networkd into separate modules
The systemd module was getting rather bloated.
2015-04-19 22:06:45 +02:00
Thomas Strobel 66c73da5f9 Fix grub for "nodev" targets. 2015-04-18 19:22:25 +02:00
Eelco Dolstra 4466707ddf switch-to-configuration: Better error checking 2015-04-13 12:28:12 +02:00
Eelco Dolstra a38f130126 Revert "Set stricter permissions on /nix/store"
This reverts commit 066758758e7c0768ff8da51d208cdae0f33b368c because
it breaks NixOS VM tests.
2015-04-07 15:10:41 +02:00
Nicolas B. Pierron 6de931a0f8 Merge rename.nix changes. 2015-04-03 23:12:12 +02:00
Eelco Dolstra 1c39a47ac8 Reload, don't restart, dbus.service
Many bus clients get hopelessly confused when dbus-daemon is
restarted. So let's not do that.

Of course, this is not ideal either, because we end up stuck with a
possibly outdated dbus-daemon. But that issue will become irrelevant
in the glorious kdbus-based future.

Hopefully this also gets rid of systemd getting stuck after
dbus-daemon is restarted:

Apr 01 15:37:50 mandark systemd[1]: Failed to register match for Disconnected message: Connection timed out
Apr 01 15:37:50 mandark systemd[1]: Looping too fast. Throttling execution a little.
Apr 01 15:37:51 mandark systemd[1]: Looping too fast. Throttling execution a little.
...
2015-04-01 16:57:16 +02:00
William A. Kennington III 113c6c8f6a nixos/initrd: Do a lazy library copy in hopes to save some space for replaced binaries 2015-03-29 21:53:25 -07:00
William A. Kennington III 6b3cf366d7 nixos/initrd: Allow overriding of binaries 2015-03-29 21:26:39 -07:00
William A. Kennington III 553105310a nixos/stage-1: Fix the initrd builder for shell scripts 2015-03-29 13:20:54 -07:00
William A. Kennington III 4868649f03 nixos/initrd: Generic library copying 2015-03-28 18:37:29 -07:00
Aristid Breitkreuz 1901f3fe77 fix initrd now that cryptsetup switched to libgcrypt 1.6 2015-03-28 23:59:19 +00:00
William A. Kennington III 8b3c7af358 Merge pull request #6981 from layus/systemd-escape-colon
nixos/systemd: Also escape ':' characters
2015-03-25 15:33:21 -07:00
William A. Kennington III f2655e4fa0 makeInitrd: Support prepending other initrds 2015-03-25 14:14:46 -07:00
Guillaume Maudoux 6ca7fb8f73 nixos/systemd: Also escape ':' characters 2015-03-25 22:11:35 +01: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 066758758e7c0768ff8da51d208cdae0f33b368c)
2015-03-18 10:58:08 +01:00
Shea Levy e4a06f35b1 nixos: Don't evaluate twice to get the value of config.nixpkgs 2015-03-12 23:42:57 +01:00
Eelco Dolstra 475df1a350 switch-to-configuration: Don't print already active target units
Since we restart all active target units (of which there are many),
it's hard to see the units that actually matter. So don't print that
we're starting target units that are already active.
2015-03-09 16:51:06 +01: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
Nikolay Amiantov b802018482 stage-1: fix hibernation (close #6675)
Fixes #6617.
2015-03-07 13:00:08 +01:00
Joachim Fasting d375550ead nixos: add a few missing type specifiers under boot.* 2015-02-28 09:19:23 +01:00
Thomas Strobel c62e42e9c5 Enhance stage-1/2 scripts for better dealing with squashfs 2015-02-20 17:42:22 +01:00
Shea Levy 2fe3a3c203 Merge branch 'grub' of git://github.com/ts468/nixpkgs
Fix grubTarget on nodev installs
2015-02-20 07:47:06 -05:00
Shea Levy 3e44f99055 Fix grub 1 install 2015-02-19 19:33:17 -05:00
Thomas Strobel c61ff9b51e Fix grubTarget on nodev installs 2015-02-16 20:19:44 +01:00
William A. Kennington III 1fddcd1e83 grub: Don't remove zfs support if contained in the default binary 2015-02-13 14:40:41 -08:00
Harald van Dijk 0fe9d58e4e stage-1-init: fix PID 1 shell
The PID 1 shell is executed as the last command in a sh invocation. Some
shells implicitly use exec for that, but the current busybox ash does not,
so the shell gets a wrong PID. Spell out the exec.
2015-02-13 10:20:29 +00:00
Domen Kožar 5a4614dc1f Add hid_lenovo to initrd kernel modules 2015-02-13 01:42:13 +01:00
William A. Kennington III b556983eb7 nixos/system: Add xhci_pci as it is needed to detect host buses in the initrd for usb keyboards on the xhci bus and storage devices on the iso 2015-02-09 13:09:26 -08:00
Wout Mertens 8f42f33c45 stage-1-init: better warnings
- Suppress spurious LVM FD3 warning:
  See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=432986
- Warn when device doesn't come online
2015-02-09 21:53:51 +01:00
Shea Levy 24c0844cfb Fix grub on nodev installs 2015-02-08 22:31:14 -05:00
William A. Kennington III 2a0754ccbc Merge pull request #5994 from ts468/grub
Add 'target' parameter for GRUB installation chain
2015-02-08 14:18:13 -08:00
Jaka Hudoklin 769fb8a141 Merge pull request #5486 from matejc/fixgatewayd
systemd-journal-gatewayd: add systemd-journal group
2015-02-07 14:52:31 +00:00
Shea Levy c45372f038 Merge commit 'cfb29ab882323d379aba20a95020c7c24f883eae'
Partial staging merge, including cc-wrapper fixes

Conflicts:
	pkgs/applications/audio/spotify/default.nix
	pkgs/build-support/cc-wrapper/default.nix
	pkgs/development/compilers/cryptol/1.8.x.nix
2015-02-02 21:14:28 -05:00
Bob van der Linden a3d5f4f3ef nixos: gummiboot: change default to 1000 if boot.loader.timeout is null
When gummiboot.timeout == null, the menu will still be skipped.
When gummiboot.timeout == 0, the menu will also be skipped.
The only way to show the menu 'indefinitely' is to show it a long time.
2015-01-30 10:36:21 +01:00
Bob van der Linden f93ba51469 nixos: loader: added generic config.boot.loader.timeout option
timeout options of grub and gummiboot will inherit the value of this
option by default.
2015-01-30 09:53:44 +01:00
Thomas Strobel 3767370866 Add target parameter to grub installation chain 2015-01-27 19:46:37 +01:00
Domen Kožar cb7cd012df Merge pull request #5593 from abbradar/modprobe-fix
modprobe: wrap all of kmod
2015-01-24 07:11:16 +01:00
Peter Simons ec6b82a0c2 Merge branch 'master' into staging. 2015-01-19 18:41:17 +01:00
wmertens d3383e4879 Merge pull request #4394 from wmertens/patch-6
setup-etc.pl: Fail when symlink/rename fails
2015-01-19 12:39:41 +01:00
Longrin Wischnewski 4b0100774a systemd: extend checkUnitConfig with on-abnormal 2015-01-19 11:41:18 +01:00
Eelco Dolstra efa8fc2b0a Paranoia 2015-01-15 18:37:55 +01:00
Eric Seidel 88eae46455 rename occurrences of gcc.gcc to gcc.cc 2015-01-14 20:47:49 -08:00
Luca Bruno 2beb43174f nixos-rebuild: use reload-or-restart for dbus. Closes #5767
Now that dbus reload has been moved before restarting units,
the reload may fail if dbus has been stopped before.
The reload-or-restart will reload dbus if it's active,
otherwise start it.
2015-01-14 16:08:47 +01:00
Nikolay Amiantov 2aaeacc579 nixos/modprobe: wrap all of kmod 2015-01-06 16:39:00 +03:00
Eelco Dolstra e62cb5585d Merge pull request #5507 from DamienCassou/systemd-user-timers
Add systemd.user.timers
2014-12-30 15:40:43 +01:00
Damien Cassou dcc93abe74 Add systemd.user.timers 2014-12-30 05:46:36 +01:00
Tobias Geerinckx-Rice c64257b8e5 Fix user-facing typos (mainly in descriptions) 2014-12-30 03:31:03 +01:00
Shea Levy 9245516b46 gummiboot-builder.py: run nix with no build-users-group
During install, the bootloader script gets run inside a chroot after the
/etc/group bind-mount is unmounted. Since we're not doing any building,
this should be safe, but really nix should just not care if the group
does not exist when no build is needed.

Fixes #5494
2014-12-29 07:09:10 -05:00
Matej Cotman 9eb24c72ff systemd: fix permissions on /var/log/journal 2014-12-28 22:37:50 +01:00
Alexander Kjeldaas da1f8578b0 Eradicate gzip -9 without -n 2014-12-28 13:45:27 +01:00
Eelco Dolstra 80a85541d5 Typo 2014-12-19 14:38:33 +01:00
Eelco Dolstra 5ad3a02938 Shut up a warning from udev
Issue #5260.
2014-12-19 14:37:50 +01:00
Eelco Dolstra c812e45292 switch-to-configuration: Ignore slice units 2014-12-18 01:47:36 +01:00
Peter Simons 0f2b026bfe nixos/modules/system/boot/luksroot.nix: hyperlinkify an URL in the documentation 2014-12-15 16:31:18 +01:00
Eelco Dolstra 88412c865d Fix ANSI escape in warning messages
Seems to have been broken by accident in 7d1ddae58e.
2014-12-15 16:19:35 +01:00
Vladimír Čunát 3bcd3ed017 nixos: check resumeDevice is absolute path and document
Fixes #5219 after merging #4995.

(cherry picked from commit 0681d61c3730c686548df3af9a7dc1a59abaf371)
Signed-off-by: Domen Kožar <domen@dev.si>
2014-12-12 11:11:57 +01:00
Jaka Hudoklin 8bb6fdc4f9 nixos/systemd: ignore null environment options 2014-12-07 21:44:20 +01:00
Emery Hemingway e69f876cca nixos: iPXE client for GRUB
fix bug in grub/install-grub.pl that would replace @bootRoot@ with an invalid string
2014-12-04 12:03:10 +01:00
William A. Kennington III 8a94c06595 nixos: Add network-pre.target and adjust firewall start ordering 2014-12-01 17:19:44 -08:00
William A. Kennington III 2b06a92c2a nixos/nfs: Fix dependency ordering 2014-12-01 17:19:44 -08:00
William A. Kennington III 1c04e69bce nixos/networking: Fix more harmless errors 2014-12-01 01:18:32 -08:00
William A. Kennington III 7ecb084b77 nixos/networking: More fixes 2014-11-29 22:35:03 -08:00
William A. Kennington III 1860ee27b0 nixos/networking: Fixes 2014-11-26 16:29:24 -08:00
William A. Kennington III 0626c1ecf0 nixos/systemd: ip-up and network-online targets should come after networkd-wait-online 2014-11-26 11:22:02 -08:00
William A. Kennington III 59f512ef7d nixos/network-interfaces: Provide a networkd implementation 2014-11-26 11:22:02 -08:00
William A. Kennington III 045132a9b0 systemd-network: Add assertions for user clarity 2014-11-26 11:22:02 -08:00
William A. Kennington III a332c4eac5 systemd: Enable more network services 2014-11-26 11:22:02 -08:00
William A. Kennington III 08e74f2791 systemd: Add ability to define networks 2014-11-26 11:22:02 -08:00
Nikolay Amiantov a2eb7ca23c stage-1: fix hibernation for device node symlinks
closes #4995
2014-11-15 21:44:37 +02:00
Eelco Dolstra ca441636f1 Merge branch 'staging' 2014-11-14 16:00:23 +01:00
Vladimír Čunát b4af993c3f Merge branch 'master' into staging
Conflicts (simple):
	pkgs/development/lisp-modules/clwrapper/setup-hook.sh
2014-11-14 14:28:23 +01:00
Rene Donner 8bd2f6bfc1 some typos 2014-11-14 13:05:55 +01:00
wmertens 5c19521c6e Merge pull request #4807 from wizeman/u/zfs-improvements
ZFS improvements
2014-11-13 10:26:30 +01:00
Shea Levy ba7c80eefb Fix init= stage 1 test 2014-11-12 18:25:03 -05:00
Ricardo M. Correia e9affb4274 nixos: Add system-wide option to set the hostid
The old boot.spl.hostid option was not working correctly due to an
upstream bug.

Instead, now we will create the /etc/hostid file so that all applications
(including the ZFS kernel modules, ZFS user-space applications and other
unrelated programs) pick-up the same system-wide host id. Note that glibc
(and by extension, the `hostid` program) also respect the host id configured in
/etc/hostid, if it exists.

The hostid option is now mandatory when using ZFS because otherwise, ZFS will
require you to force-import your ZFS pools if you want to use them, which is
undesirable because it disables some of the checks that ZFS does to make sure it
is safe to import a ZFS pool.

The /etc/hostid file must also exist when booting the initrd, before the SPL
kernel module is loaded, so that ZFS picks up the hostid correctly.

The complexity in creating the /etc/hostid file is due to having to
write the host ID as a 32-bit binary value, taking into account the
endianness of the machine, while using only shell commands and/or simple
utilities (to avoid exploding the size of the initrd).
2014-11-12 22:31:49 +01:00
Eelco Dolstra c5a7ff0afd Fix /dev/root udev rule in the ISO 2014-11-11 23:48:31 +01:00
Eelco Dolstra f33fa1b66b Merge remote-tracking branch 'origin/master' into staging
Conflicts:
	pkgs/development/libraries/boost/generic.nix
2014-11-11 23:48:08 +01:00
Luca Bruno b77d166b17 nixos: move bcache udev rule in a new bcache.nix module 2014-11-10 22:19:43 +01:00
Luca Bruno 31df4f70af nixos: Add boot.initrd.extraUdevRulesCommands 2014-11-10 22:19:43 +01:00
Luca Bruno 6af0d6974f Merge branch 'master' into staging 2014-11-10 10:03:52 +01:00
Luca Bruno 510fba95e8 nixos-rebuild: reload dbus before starting other units. Closes #4546 2014-11-08 19:40:28 +01:00
Vladimír Čunát 52404a868d Merge recent master into staging
Nixpkgs Hydra: ?compare=1157272

TODO: port e22889064f

Conflicts:
	nixos/tests/gnome3_10.nix (auto-solved)
	pkgs/applications/video/aegisub/default.nix
	pkgs/development/libraries/boost/1.55.nix
2014-11-05 15:00:44 +01:00
Nikolay Amiantov 775f381a9e stage-1: add bcache support
This adds necessary udev rule into initrd to support autodetecting
bcache partitions in stage-1. It also fixes 'sh' path for the new
rule to work.
2014-11-02 19:03:50 +03:00
Vladimír Čunát 2cf17b0802 Merge recent master into staging
Hydra nixpkgs: ?compare=1156478
2014-10-23 17:40:41 +02:00
William A. Kennington III f020a26164 nixos/systemd: Also escape \ characters 2014-10-19 16:34:53 -07:00
Vladimír Čunát 359dd3b8ac nixos: fix two pipefail problems
It failed since 3c6efec2c0, i.e. #4453.
Now it should "work" the same as before.
2014-10-19 19:29:28 +02:00
Domen Kožar 2fa662c957 systemd: replace @ when generating unit command name 2014-10-19 17:20:37 +02:00
Domen Kožar 0854836fd2 systemd: include name of the unit when generating nix store path 2014-10-19 15:49:55 +02:00
Eelco Dolstra 09dc132e04 Merge remote-tracking branch 'origin/master' into staging
Conflicts:
	pkgs/development/libraries/poppler/default.nix
2014-10-16 15:16:50 +02:00
Eelco Dolstra 058bf4ccc4 Create a udev rule for /dev/root
In the installation CD, this ensures that systemd will see a proper
udev node for /dev/root.

Fixes #4399.

Borrowed from

  http://lists.freedesktop.org/archives/systemd-devel/2014-July/020988.html
2014-10-10 17:18:04 +02:00
Eelco Dolstra a85dcf4a00 Merge remote-tracking branch 'origin/master' into staging
Conflicts:
	pkgs/development/libraries/libav/default.nix
	pkgs/shells/bash/bash-4.2-patches.nix
	pkgs/stdenv/generic/default.nix
2014-10-07 00:09:37 +02:00
wmertens 36641d9e69 setup-etc.pl: Fail when symlink/rename fails
When atomicSymlink can't symlink or rename, it should return failure. This is then handled with `... or die` and `... or warn`
2014-10-06 08:00:11 +02:00
Eelco Dolstra 97220c973f Replace hasAttr/getAttr calls with the ? and . operators
For NixOS evaluation, this gives a ~21% reduction in the number of
values allocated and a ~4% speedup. It's also more readable.
2014-10-05 01:11:06 +02:00