Commit Graph

615 Commits

Author SHA1 Message Date
Silvan Mosberger
c70a466d21 nixos/systemd: Allow creation of unit directories
This patch allows creation of files like
/etc/systemd/system/user-.slice.d/limits.conf with

    systemd.units."user-.slice.d/limits.conf" = {
      text = ''
        [Slice]
        CPUAccounting=yes
        CPUQuota=50%
      '';
    };

which previously threw an error

Also renames the systemd-unit-path test to sytsemd-misc, and extends it to
test that `systemd.units` can handle directories. In this case we make
sure that resource limits specified in user slices apply.
2022-03-25 17:47:44 +01:00
Viktor Kleen
6d766ae8b7
nixos/test-driver: deduplicate VLANs
Naively deduplicate VLANs in the python driver for NixOS tests. The
current implementation accidentally works, since the VLan class mutates
the environment. On construction it sets QEMU_VDE_SOCKET_${id} and this
environment variable gets overwritten once a second VLAN with the same
id is constructed. Because the NIC flags passed to qemu just use the
QEMU_VDE_SOCKET_${id} environment variable, this implicitly chooses a
single vde_switch process for each VLAN.

However, this leads to unusable vde_switch processes being spawned in
each test run and as a side effect makes it impossible to access the
correct VLan objects in the interactive test driver. It also makes it
remarkably hard to understand why the current implementation ever
worked.
2022-03-22 13:16:28 +00:00
Robert Hensing
0395086d0c
Merge pull request #162271 from Infinisil/warn-no-type
Throw an error for options without a type
2022-03-16 22:58:45 +01:00
Bob van der Linden
9bc093b30a
nixos: systemd: split off helper functions into systemd-lib 2022-03-15 21:52:13 +01:00
pennae
aa7b129708
Merge pull request #154113 from pennae/systemd-escaping
nixos: add functions and documentation for escaping systemd Exec* directives
2022-03-13 19:57:32 +00:00
pennae
40a35299fa nixos: add functions and documentation for escaping systemd Exec* directives
it's really easy to accidentally write the wrong systemd Exec* directive, ones
that works most of the time but fails when users include systemd metacharacters
in arguments that are interpolated into an Exec* directive. add a few functions
analogous to escapeShellArg{,s} and some documentation on how and when to use them.
2022-03-12 00:48:52 +01:00
Janne Heß
0c766a100e lib/options: Throw error for options without a type
Makes all options rendered in the manual throw an error if they don't
have a type specified.

This is a follow-up to #76184

Co-Authored-By: Silvan Mosberger <contact@infinisil.com>
2022-02-28 22:51:41 +01:00
talyz
b549e7bbb5
genJqSecretsReplacementSnippet: Fix error handling
With the previous change that enabled error propagation through
`inherit_errexit`, the script would fail if `errexit` was set, but
`inherit_errexit` was not. This is due to `shopt -p` exiting with an
error if the option is disabled. To work around this, use the exit
code instead of the text value returned by `shopt -p`.

Fixes #160869.
2022-02-23 12:48:51 +01:00
Daniel Fullmer
24fb872079 nixos/test-driver: fix regression when using legacy start command
The aarch64-linux versions of the boot.uefiUsb and boot.uefiCdrom tests
were broken by b0fc9da879.
That commit was a refactor which omitted the qemuBinary option, which was
previously available in the legacy start command. This restores that
option and fixes the tests previously mentioned.
2022-02-17 18:12:24 -08:00
Janne Heß
fa3c756621
Merge pull request #157329 from helsinki-systems/feat/nixos-reload-triggers
nixos/systemd: Implement reload triggers
2022-02-11 23:59:26 +01:00
Janne Heß
b5b3ee4f78
nixos/systemd: Add reloadTriggers to services 2022-02-09 15:14:37 +01:00
Jonathan Ringer
46fd0afcb3
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
	pkgs/development/python-modules/pysdl2/default.nix
	pkgs/top-level/aliases.nix
2022-02-06 18:36:59 -08:00
Robert Hensing
8403e02a5d
Merge pull request #126769 from ncfavier/nixosSystem-lib
nixos: move default module location logic to `eval-config.nix`
2022-02-06 22:49:17 +01:00
Jonathan Ringer
c6c7162876
Merge remote-tracking branch 'origin/staging-next' into staging 2022-02-03 21:34:17 -08:00
Jonathan Ringer
9a16965c75
Merge remote-tracking branch 'origin/staging-next' into staging
Conflicts:
	pkgs/development/python-modules/awesomeversion/default.nix
	pkgs/development/python-modules/md2gemini/default.nix
	pkgs/development/python-modules/mill-local/default.nix
	pkgs/development/python-modules/pyatv/default.nix
	pkgs/development/python-modules/pyezviz/default.nix
	pkgs/development/python-modules/pyinsteon/default.nix
	pkgs/development/python-modules/pylitterbot/default.nix
	pkgs/development/python-modules/pynuki/default.nix
	pkgs/development/python-modules/pypck/default.nix
	pkgs/development/python-modules/types-requests/default.nix
	pkgs/top-level/aliases.nix
2022-02-03 21:29:24 -08:00
Kim Lindberger
415b9c3b5a
Merge pull request #157519 from talyz/gitlab-error-handling
nixos/gitlab: Implement better script error handling
2022-02-03 22:19:03 +01:00
Lassulus
b80607af67
Merge pull request #154804 from Mic92/tests-prompt
nixos/tests: add prompt to shell_interact()
2022-02-02 18:50:46 +01:00
github-actions[bot]
aee8ca6639
Merge staging-next into staging 2022-02-01 00:02:21 +00:00
Guillaume Girol
d6f45aa6c3
Merge pull request #152372 from symphorien/systemd-validate-after
nixos/systemd: validate the values of systemd.services.<name>.after
2022-01-31 20:57:13 +00:00
talyz
95069d76d3
genJqSecretsReplacementSnippet: Propagate secret file read errors
If an error occurs while trying to read a secret file, we want that
error to propagate to the main shell context. That means we have to
set the `inherit_errexit` option, which allows errors from subshells
to propagate to the outer shell. Also, the subshell cannot run as part
of another command, such as `export`, since that will simply ignore
the subshell exit status and only respect `export`s exit status; first
assigning the value to a variable and then exporting it solves issue.
2022-01-31 12:44:54 +01:00
Jan Tojnar
2da5ce4ab3 Merge branch 'staging-next' into staging
; Conflicts:
;	pkgs/development/python-modules/fakeredis/default.nix
2022-01-28 14:05:11 +01:00
Naïm Favier
5ab62e17b5
nixos: move default module location logic to eval-config.nix 2022-01-27 22:13:35 +01:00
Daniel Olsen
68e9cd0f7e nixos/lib: Use SingleLineStr in systemd description 2022-01-27 12:56:36 -08:00
Dmitry Kalinkin
0693fd77f7
Merge branch 'staging-next' into staging
Conflicts:
	nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
	nixos/doc/manual/release-notes/rl-2205.section.md
	pkgs/development/python-modules/aioesphomeapi/default.nix
	pkgs/development/python-modules/mat2/default.nix
	pkgs/development/python-modules/pydevccu/default.nix
	pkgs/development/python-modules/pywlroots/default.nix
	pkgs/development/python-modules/rokuecp/default.nix
2022-01-27 00:54:10 -05:00
Patrick Hilhorst
23c87e7991
nixos/testing-python: actually copy build artefacts
This broke in #156858.
2022-01-26 22:26:19 +01:00
Marijan Petričević
411bb3c35f add --no-interactive flag 2022-01-26 11:27:01 +01:00
Marijan Petričević
44830dc048 use lib.optionalString 2022-01-26 10:46:46 +01:00
Marijan Petričević
75de3397fd nixos/tests: fix #146169 2022-01-26 10:46:45 +01:00
Marijan Petričević
446c21fdc7 factor out tmp-dir checks 2022-01-25 11:31:25 +01:00
Marijan Petričević
03c90974a7 add tmp_dir access check 2022-01-25 11:14:57 +01:00
Marijan Petričević
e17fcbc966 introduce writeable_dir argparse type 2022-01-25 10:21:33 +01:00
Marijan Petričević
7765670c8a make output_directory an optional parameter 2022-01-25 01:18:52 +01:00
Marijan Petričević
f9b5f9dba7 nixos/test-driver: use an argument instead of the out env-var 2022-01-25 01:17:29 +01:00
Alyssa Ross
1a60dd2adc
Merge remote-tracking branch 'nixpkgs/staging-next' into staging
Conflicts:
	pkgs/development/python-modules/cupy/default.nix
	pkgs/development/python-modules/staticjinja/default.nix
2022-01-24 15:39:34 +00:00
Samuel Dionne-Riel
18ebd1c330
Merge pull request #153409 from tpwrules/fix-nonx86-iso-reproducibility
installer/cd-dvd/iso-image: avoid leaking build timestamps on non-x86
2022-01-23 21:15:26 -05:00
github-actions[bot]
aeb6db8171
Merge staging-next into staging 2022-01-20 18:01:55 +00:00
Alyssa Ross
464d6108b0 Revert "qemu, runInLinuxVM: change default cpu to qemu64"
This reverts commit af180d554b.

The bug we were working around with this change has been fixed in QEMU
6.2.0.
2022-01-20 15:29:33 +00:00
Robert Hensing
98ae5a9298
Merge pull request #153211 from hercules-ci/minimal-nixos
Add minimal NixOS entrypoint
2022-01-20 14:42:46 +01:00
Jörg Thalheim
f472e52aa6 nixos/tests: add prompt to shell_interact()
Example session:

>>> start_all()
>>> machines[0].shell_interact()
client: waiting for the VM to finish booting
client: connected to guest root shell
client: (connecting took 0.00 seconds)
(finished: waiting for the VM to finish booting, in 0.05 seconds)
client: Terminal is ready (there is no initial prompt):
$ ls -la
total 39
drwxrwxrwt 11 root root 4096 Jan 15 06:06 .
drwxr-xr-x 17 root root 4096 Jan 15 06:06 ..
drwxrwxrwt  2 root root 4096 Jan 15 06:06 .font-unix
drwxrwxrwt  2 root root 4096 Jan 15 06:06 .ICE-unix
drwx------  2 root root    2 Jan 12 20:19 shared
drwx------  3 root root 4096 Jan 15 06:06 systemd-private-b8f21699ea684491926859758de41975-nscd.service-txgYVZ
drwx------  3 root root 4096 Jan 15 06:06 systemd-private-b8f21699ea684491926859758de41975-systemd-logind.service-U3GmlL
drwxrwxrwt  2 root root 4096 Jan 15 06:06 .Test-unix
drwxrwxrwt  2 root root 4096 Jan 15 06:06 .X11-unix
drwxr-xr-x  2 root root    2 Jan 15 06:06 xchg
drwxrwxrwt  2 root root 4096 Jan 15 06:06 .XIM-unix
2022-01-15 07:07:06 +01:00
Robert Hensing
2bf5958169
Merge pull request #151082 from hercules-ci/nixos-cleanup-vmWithBootLoader
nixos: turn vmWithBootLoader into option (`nixos-rebuild build-vm`)
2022-01-14 18:49:27 +01:00
Robert Hensing
3168017b90 nixos/lib: Clarify that nixos.evalModules impl is NOT experimental 2022-01-10 12:36:57 +01:00
Robert Hensing
d3f956aba3 nixos/lib: Add featureFlags, use it for minimal modules 2022-01-10 12:36:57 +01:00
Robert Hensing
25caf736d5 nixos/eval-config: Layer on top of nixos/eval-config-minimal 2022-01-10 12:26:59 +01:00
Robert Hensing
e31e096b66 nixos/lib: Move evalModules into its own file 2022-01-10 12:26:59 +01:00
Zhaofeng Li
9e97ef794a lib/qemu-common: Add serial device name for RISC-V 2022-01-09 15:29:52 -08:00
github-actions[bot]
b40a01817b
Merge master into staging-next 2022-01-08 18:01:00 +00:00
Jacek Galowicz
048fd95f10
Merge pull request #146905 from Synthetica9/failure_mode
nixos/test-driver: add polling_condition
2022-01-08 18:28:25 +01:00
Jonathan Ringer
86f9a32c4c
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
	pkgs/development/python-modules/hydra/default.nix
2022-01-07 10:31:29 -08:00
Patrick Hilhorst
0c3f1cf420
Merge pull request #153273 from Synthetica9/passthru-driverInteractive 2022-01-07 16:04:43 +01:00
Robert Hensing
fbd038eca2 nixos/lib: init (experimental) 2022-01-07 01:21:07 +01:00