Compare commits

...

44 Commits

Author SHA1 Message Date
nixpkgs-ci[bot]
f3fe341d1f Merge master into staging-nixos 2026-06-06 00:45:45 +00:00
Will Fancher
2964861f87 systemd-logind: allow service reloads to apply new configuration (#523985) 2026-06-05 22:06:29 +00:00
Gaétan Lepage
ad710f62d2 ruff: 0.15.15 -> 0.15.16 (#528543) 2026-06-05 20:14:08 +00:00
Jost Alemann
38e91d6423 ruff: 0.15.15 -> 0.15.16
Changelog: https://github.com/astral-sh/ruff/releases/tag/0.15.16
Diff: https://github.com/astral-sh/ruff/compare/0.15.15...0.15.16
2026-06-05 21:17:44 +02:00
nixpkgs-ci[bot]
513af3a8b8 Merge master into staging-nixos 2026-06-05 18:41:48 +00:00
Thiago Kenji Okada
3c6fea25e6 nixos-rebuild-ng: disable flake auto-detection when --file or --attr is used (#527046) 2026-06-05 17:48:35 +00:00
nixpkgs-ci[bot]
208ca4b73e Merge master into staging-nixos 2026-06-05 13:02:58 +00:00
Gaétan Lepage
2eadef8b56 ty: 0.0.42 -> 0.0.44 (#527911) 2026-06-05 12:21:28 +00:00
Jost Alemann
dc965bdf7f ty: 0.0.42 -> 0.0.44
Changelog: https://github.com/astral-sh/ty/releases/tag/0.0.44
Diff: https://github.com/astral-sh/ty/compare/0.0.42...0.0.44
2026-06-05 11:38:03 +02:00
Dmitry Voronin
be84ec22c5 systemd-logind: allow service reloads to apply new configuration 2026-06-05 11:18:12 +03:00
nixpkgs-ci[bot]
bcf0672a6c Merge master into staging-nixos 2026-06-05 07:32:14 +00:00
nixpkgs-ci[bot]
6c241c7e70 Merge master into staging-nixos 2026-06-05 00:48:29 +00:00
nikstur
bd0813cd48 nixos/systemd: gnupg -> gnupgMinimal (#527976) 2026-06-04 23:05:38 +02:00
nikstur
603f171aa8 nixos/systemd: gnupg -> gnupgMinimal
This fixes the bashless tests as gnupgMinimal doest not depend on bash.
2026-06-04 22:53:26 +02:00
nikstur
1087b3eb08 gnupgMinimal: init
This used to be a non-exposed part of the systemd derivation. However,
in #509324 this was removed. Re-add this to use it for systemd-import
and systemd-sysupdate to provide a minimal gnupg without bash. This
fixes the bashless tests.
2026-06-04 22:52:52 +02:00
K900
c519e3619d Merge remote-tracking branch 'origin/master' into staging-nixos 2026-06-04 22:22:00 +03:00
Matt Sturgeon
96489aed91 pkgs-lib/formats: Use .attrs.json where possible (#524404) 2026-06-04 19:11:48 +00:00
Thiago Kenji Okada
d0fa46bc62 nixos-rebuild-ng: add env var to allow use without systemd-run (#527342) 2026-06-04 17:44:29 +00:00
Yuriy Taraday
691dc02df0 pkgs-lib/formats: Use .attrs.json where possible
This expands on https://github.com/NixOS/nixpkgs/pull/498928 that
introduced __structuredAttrs here by actually using data in
`.attrs.json` when it makes sense, instead of relying on environment
variables. This leads to less temporary files, faster execution and
nicer code.
2026-06-04 19:21:52 +02:00
nikstur
bf343540cd nixos/systemd/user: migrate to RFC 42-style settings (#516329) 2026-06-04 14:42:22 +00:00
nixpkgs-ci[bot]
1735c5d0c3 Merge master into staging-nixos 2026-06-04 13:06:58 +00:00
azuwis
b63a81166a nixos-rebuild-ng: add tests for --file/--attr disabling flake auto-detection 2026-06-04 20:01:07 +08:00
zowoq
095fb17676 nixos-rebuild-ng: add env var to allow use without systemd-run
useful if nixos-rebuild is already running under a systemd service, e.g. a pull deployment
2026-06-04 18:21:51 +10:00
nixpkgs-ci[bot]
820c4fb191 Merge master into staging-nixos 2026-06-04 07:40:39 +00:00
K900
c2ff225a34 linux/common-config: enable ARM_SMMU_V3_SVA on aarch64 (#527847) 2026-06-04 06:55:12 +00:00
Pratham Patel
32861fa28b linux/common-config: enable ARM_SMMU_V3_SVA on aarch64
This makes CUDA compute work with the GB10 platform on my ASUS Ascent
GX10. This wasn't enabled by `autoModules` because it is a boolean.

Before:
```
$ llama-cli --list-devices
0.00.468.603 E ggml_cuda_init: failed to initialize CUDA: initialization error
Available devices:

$ zcat /proc/config.gz | grep CONFIG_ARM_SMMU_V3_SVA=

$ echo $?
1
```

After:
```
$ llama-cli --list-devices
Available devices:
  CUDA0: NVIDIA GB10 (124534 MiB, 44410 MiB free)

$ zcat /proc/config.gz | grep CONFIG_ARM_SMMU_V3_SVA=
CONFIG_ARM_SMMU_V3_SVA=y
```

Here is the information about the GPU on the GB10 platform:
```
$ sudo lspci -vvv -s 000f:01:00.0
000f:01:00.0 VGA compatible controller: NVIDIA Corporation GB20B [GB10] (rev a1) (prog-if 00 [VGA controller])
        Subsystem: NVIDIA Corporation Device 0000
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0
        Interrupts: pin B disabled, MSI(X) routed to IRQ 193-200
        IOMMU group: 20
        Region 0: Memory at 24000000 (64-bit, prefetchable) [size=64M]
        Capabilities: [40] Power Management version 3
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [48] MSI: Enable- Count=1/16 Maskable+ 64bit+
                Address: 0000000000000000  Data: 0000
                Masking: 00000000  Pending: 00000000
        Capabilities: [60] Express (v2) Endpoint, IntMsgNum 0
                DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
                        ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset+ SlotPowerLimit 0W TEE-IO-
                DevCtl: CorrErr+ NonFatalErr+ FatalErr+ UnsupReq+
                        RlxdOrd+ ExtTag+ PhantFunc- AuxPwr- NoSnoop+ FLReset-
                        MaxPayload 128 bytes, MaxReadReq 512 bytes
                DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr- TransPend-
                LnkCap: Port #0, Speed 2.5GT/s, Width x16, ASPM L1, Exit Latency L1 <4us
                        ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp+
                LnkCtl: ASPM Disabled; RCB 128 bytes, LnkDisable- CommClk-
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt- FltModeDis-
                LnkSta: Speed 2.5GT/s, Width x1 (downgraded)
                        TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
                DevCap2: Completion Timeout: Range AB, TimeoutDis+ NROPrPrP- LTR+
                         10BitTagComp+ 10BitTagReq+ OBFF Via message, ExtFmt- EETLPPrefix+, MaxEETLPPrefixes 1
                         EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
                         FRS- TPHComp- ExtTPHComp-
                         AtomicOpsCap: 32bit- 64bit- 128bitCAS-
                DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-
                         AtomicOpsCtl: ReqEn+
                         IDOReq- IDOCompl- LTR+ EmergencyPowerReductionReq-
                         10BitTagReq- OBFF Disabled, EETLPPrefixBlk-
                LnkCap2: Supported Link Speeds: 2.5GT/s, Crosslink- Retimer+ 2Retimers+ DRS-
                LnkCtl2: Target Link Speed: 32GT/s, EnterCompliance- SpeedDis-
                         Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
                         Compliance Preset/De-emphasis: -6dB de-emphasis, 0dB preshoot
                LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete- EqualizationPhase1-
                         EqualizationPhase2- EqualizationPhase3- LinkEqualizationRequest-
                         Retimer- 2Retimers- CrosslinkRes: unsupported, FltMode-
        Capabilities: [9c] Vendor Specific Information: Len=14 <?>
        Capabilities: [b0] MSI-X: Enable+ Count=9 Masked-
                Vector table: BAR=0 offset=00b90000
                PBA: BAR=0 offset=00ba0000
        Capabilities: [100 v1] Secondary PCI Express
                LnkCtl3: LnkEquIntrruptEn- PerformEqu-
                LaneErrStat: 0
        Capabilities: [12c v1] Latency Tolerance Reporting
                Max snoop latency: 0ns
                Max no snoop latency: 0ns
        Capabilities: [14c v1] Data Link Feature <?>
        Capabilities: [158 v1] Physical Layer 16.0 GT/s
                Phy16Sta: EquComplete- EquPhase1- EquPhase2- EquPhase3- LinkEquRequest-
        Capabilities: [188 v1] Physical Layer 32.0 GT/s
                Phy32Cap: EqualizationBypass+ NoEqualizationNeeded-
                          ModTsMode0+ ModTsMode1- ModTsMode2-
                Phy32Ctl: EqualizationBypassDis- NoEqualizationNeededDis-
                          Modified TS Usage Mode: PCI Express
                Phy32Sta: EquComplete- EquPhase1- EquPhase2- EquPhase3- LinkEquRequest-
                          Received Enhanced Link Behavior Control: Full Equalization required
                          ModTsRecv- TxPrecodeOn- TxPrecodeReq- NoEqualizationNeededRecv-
        Capabilities: [1b8 v2] Advanced Error Reporting
                UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP-
                        ECRC- UnsupReq- ACSViol- UncorrIntErr- BlockedTLP- AtomicOpBlocked- TLPBlockedErr-
                        PoisonTLPBlocked- DMWrReqBlocked- IDECheck- MisIDETLP- PCRC_CHECK- TLPXlatBlocked-
                UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP-
                        ECRC- UnsupReq- ACSViol- UncorrIntErr+ BlockedTLP- AtomicOpBlocked- TLPBlockedErr-
                        PoisonTLPBlocked- DMWrReqBlocked- IDECheck- MisIDETLP- PCRC_CHECK- TLPXlatBlocked-
                UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+
                        ECRC- UnsupReq- ACSViol- UncorrIntErr+ BlockedTLP- AtomicOpBlocked- TLPBlockedErr-
                        PoisonTLPBlocked- DMWrReqBlocked- IDECheck- MisIDETLP- PCRC_CHECK- TLPXlatBlocked-
                CESta:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr- CorrIntErr- HeaderOF-
                CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+ CorrIntErr+ HeaderOF+
                AERCap: First Error Pointer: 00, ECRCGenCap- ECRCGenEn- ECRCChkCap- ECRCChkEn-
                        MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
                HeaderLog: 00000000 00000000 00000000 00000000
        Capabilities: [200 v1] Lane Margining at the Receiver
                PortCap: Uses Driver+
                PortSta: MargReady- MargSoftReady-
        Capabilities: [248 v1] Alternative Routing-ID Interpretation (ARI)
                ARICap: MFVC- ACS-, Next Function: 0
                ARICtl: MFVC- ACS-, Function Group: 0
        Capabilities: [290 v2] L1 PM Substates
                L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+ L1_PM_Substates+
                          PortCommonModeRestoreTime=0us PortTPowerOnTime=10us
                L1SubCtl1: PCI-PM_L1.2- PCI-PM_L1.1- ASPM_L1.2- ASPM_L1.1-
                           T_CommonMode=0us LTR1.2_Threshold=0ns
                L1SubCtl2: T_PwrOn=10us
        Capabilities: [2a4 v1] Vendor Specific Information: ID=0001 Rev=1 Len=014 <?>
        Capabilities: [2c8 v1] Data Object Exchange
                DOECap: IntSup+
                        IntMsgNum 8
                DOECtl: IntEn-
                DOESta: Busy+ IntSta+ Error+ ObjectReady-
        Capabilities: [2e0 v1] Address Translation Service (ATS)
                ATSCap: Invalidate Queue Depth: 00
                ATSCtl: Enable+, Smallest Translation Unit: 00
        Capabilities: [2e8 v1] Process Address Space ID (PASID)
                PASIDCap: Exec- Priv-, Max PASID Width: 14
                PASIDCtl: Enable+ Exec- Priv-
        Capabilities: [2f0 v1] Device Serial Number 00-00-00-00-00-2d-b0-48
        Kernel driver in use: nvidia
        Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia
```
2026-06-04 10:47:39 +05:30
nixpkgs-ci[bot]
1ca1e743a2 Merge master into staging-nixos 2026-06-04 00:55:27 +00:00
nixpkgs-ci[bot]
b254f3f549 Merge master into staging-nixos 2026-06-03 19:21:48 +00:00
nixpkgs-ci[bot]
4bc901828f Merge master into staging-nixos 2026-06-03 13:39:45 +00:00
K900
4b955908d1 nixos/virtualisation: (Aarch64) remove -device virtio-gpu-pci (#527511) 2026-06-03 10:59:00 +00:00
Doron Behar
48995a6ef9 nixos/virtualisation: (Aarch64) remove -device virtio-gpu-pci
In 9e78baf, Aarch64 machines were added the `-device virtio-gpu-pci`
argument, to mirror `-vga std` option that was added unconditionally to
virtualised x86_64 machines. This also enabled screenshots on aarch64
machines to be taken in tests. Since then, in a7ca287, the `-vga std`
option was removed, because that is the default value of this option
embedded in QEMU since version 2.2.

Removing it from the hard-coded list of qemu options makes it possible
for the user to choose their own `-vga` value. Similarly, for Aarch
virtualised machines, choosing unconditionally the `-device virtio-gpu-pci`
option instead of e.g `-device virtio-gpu-gl-pci`, can be bothersome too - see:

https://discourse.nixos.org/t/test-an-aarch64-linux-vm-wayland-compositor-from-an-x86-64-linux-host/77416/2

This commit is similar to 44c6c2ef16 which
was reverted in #527048.
2026-06-03 13:50:32 +03:00
nixpkgs-ci[bot]
b2b78e8274 Merge master into staging-nixos 2026-06-03 07:44:40 +00:00
nixpkgs-ci[bot]
cff2c31f82 Merge master into staging-nixos 2026-06-03 00:55:57 +00:00
nixpkgs-ci[bot]
c08d8d01e9 Merge master into staging-nixos 2026-06-02 19:16:37 +00:00
Ramses
46ff137a45 nixos/systemd: ship time-set.target (#526425) 2026-06-02 14:04:55 +00:00
nixpkgs-ci[bot]
540adb9a23 Merge master into staging-nixos 2026-06-02 13:18:52 +00:00
nixpkgs-ci[bot]
ca87bfdda4 Merge master into staging-nixos 2026-06-02 07:41:17 +00:00
Gaétan Lepage
323460b6b6 ty: 0.0.40 -> 0.0.42 (#526719) 2026-06-02 07:27:33 +00:00
nixpkgs-ci[bot]
0ca1e2583e Merge master into staging-nixos 2026-06-02 00:50:36 +00:00
Jost Alemann
5f567ce58e ty: 0.0.40 -> 0.0.42
Changelog: https://github.com/astral-sh/ty/releases/tag/0.0.42
Diff: https://github.com/astral-sh/ty/compare/0.0.40...0.0.42
2026-06-02 00:51:44 +02:00
azuwis
2e1d60e197 nixos-rebuild-ng: disable flake auto-detection when --file or --attr is used
When --file or --attr is explicitly passed, flake auto-detection should
not override the user's intent to use a non-flake configuration.
2026-06-01 20:05:16 +08:00
r-vdp
5197842329 nixos/systemd: ship time-set.target
time-sync.target has Wants/After=time-set.target, every OnCalendar=
timer gains an implicit After=time-set.target, and
systemd.special(7) documents it as the hook for "system clock has
been set from a local source". Without the unit file the target is
not-found, so WantedBy=time-set.target on third-party units is
silently ignored and the timer ordering is a no-op.
2026-05-31 21:12:39 +03:00
Jamie Magee
0522a75d35 nixos/systemd/user: migrate to RFC 42-style settings
Replace `systemd.user.extraConfig` with a freeform `systemd.user.settings.Manager` submodule, rendered via `utils.systemdUtils.lib.settingsToSections`. `extraConfig` is removed via `mkRemovedOptionModule`. Mirrors the existing `systemd.settings.Manager` migration of the system-side manager.

Updates the two in-tree consumers (`nixos/modules/testing/test-instrumentation.nix` and `nixos/tests/systemd.nix`) to the new option.

Adds `nixos/tests/systemd-user-settings` to assert the rendered `user.conf` contents.
2026-05-19 19:27:58 -07:00
Jamie Magee
4959eee3f3 nixos/systemd/user: drop with lib;
Drop the `with utils;`, `with systemdUtils.unitOptions;` and `with lib;` blocks and qualify all references with `lib.`, `utils.systemdUtils.lib.` and `utils.systemdUtils.types.` instead. No behavioural change.
2026-05-19 19:27:16 -07:00
21 changed files with 197 additions and 104 deletions

View File

@@ -24,6 +24,8 @@
- Python 2 has been removed from the top-level package set, as it is long past end-of-life. The `python2`, `python27`, `python2Full`, `python27Full`, `python2Packages`, and `python27Packages` attributes, along with the legacy `python`, `pythonFull`, and `pythonPackages` aliases, now throw an error directing you to `python3`. The `isPy2` and `isPy27` package flags have been removed accordingly. The only remaining Python 2 interpreter is vendored inside the `resholve` package for its `oil` dependency and is not exposed for general use.
- `systemd.user.extraConfig` has been removed in favor of the structured [](#opt-systemd.user.settings.Manager) option. Use `systemd.user.settings.Manager` to set any `systemd-user.conf(5)` option directly. For example, replace `systemd.user.extraConfig = "DefaultTimeoutStartSec=60";` with `systemd.user.settings.Manager.DefaultTimeoutStartSec = 60;`.
- `services.timesyncd.extraConfig` has been removed in favor of the structured [](#opt-services.timesyncd.settings.Time) option. Use `services.timesyncd.settings.Time` to set any `timesyncd.conf(5)` option directly. For example, replace `services.timesyncd.extraConfig = "PollIntervalMaxSec=180";` with `services.timesyncd.settings.Time.PollIntervalMaxSec = 180;`.
## Other Notable Changes {#sec-release-26.11-notable-changes}

View File

@@ -14,7 +14,7 @@ let
inherit (config) sshBackdoor;
inherit (hostPkgs.stdenv.hostPlatform) isLinux;
inherit (hostPkgs.stdenv.hostPlatform) isLinux isAarch64;
# Reifies and correctly wraps the python test driver for
# the respective qemu version and with or without ocr support
@@ -256,6 +256,10 @@ in
#
# If needed, this can still be turned off.
virtualisation.qemu.enableSharedMemory = lib.mkDefault isLinux;
# Needed for screenshots to work (in e.g `nixosTests.login`)
virtualisation.qemu.options = lib.optionals (isLinux && isAarch64) [
"-device virtio-gpu-pci"
];
assertions = [
{

View File

@@ -40,6 +40,7 @@ let
"network-online.target"
"nss-lookup.target"
"nss-user-lookup.target"
"time-set.target"
"time-sync.target"
"first-boot-complete.target"
]
@@ -808,7 +809,7 @@ in
systemd.targets.remote-fs.unitConfig.X-StopOnReconfiguration = true;
systemd.services.systemd-importd = lib.mkIf cfg.package.withImportd {
environment = proxy_env;
path = [ pkgs.gnupg ];
path = [ pkgs.gnupgMinimal ];
};
systemd.services.systemd-pstore.wantedBy = [ "sysinit.target" ]; # see #81138

View File

@@ -64,13 +64,13 @@
environment.etc."systemd/logind.conf".text =
utils.systemdUtils.lib.settingsToSections config.services.logind.settings;
# Restarting systemd-logind breaks X11
# Restarting systemd-logind breaks X11 and other user sessions.
# However, reloading the service seems to do the trick of loading new configuration without breaking anything.
# - upstream commit: https://cgit.freedesktop.org/xorg/xserver/commit/?id=dc48bd653c7e101
# - systemd announcement: https://github.com/systemd/systemd/blob/22043e4317ecd2bc7834b48a6d364de76bb26d91/NEWS#L103-L112
# - this might be addressed in the future by xorg
#systemd.services.systemd-logind.restartTriggers = [ config.environment.etc."systemd/logind.conf".source ];
systemd.services.systemd-logind.restartIfChanged = false;
systemd.services.systemd-logind.stopIfChanged = false;
systemd.services.systemd-logind.reloadIfChanged = true;
# The user-runtime-dir@ service is managed by systemd-logind we should not touch it or else we break the users' sessions.
systemd.services."user-runtime-dir@".stopIfChanged = false;

View File

@@ -138,7 +138,7 @@ in
systemd.services.systemd-sysupdated = {
aliases = [ "dbus-org.freedesktop.sysupdate1.service" ];
path = [ pkgs.gnupg ];
path = [ pkgs.gnupgMinimal ];
};
systemd.timers = {

View File

@@ -5,16 +5,13 @@
utils,
...
}:
with utils;
with systemdUtils.unitOptions;
with lib;
let
cfg = config.systemd.user;
systemd = config.systemd.package;
inherit (systemdUtils.lib)
inherit (utils.systemdUtils.lib)
generateUnits
targetToUnit
serviceToUnit
@@ -53,7 +50,7 @@ let
user ? null,
}:
let
suffix = optionalString (user != null) "-${user}";
suffix = lib.optionalString (user != null) "-${user}";
in
pkgs.writeTextFile {
name = "nixos-user-tmpfiles.d${suffix}";
@@ -61,74 +58,86 @@ let
text = ''
# This file is created automatically and should not be modified.
# Please change the options systemd.user.tmpfiles instead.
${concatStringsSep "\n" rules}
${lib.concatStringsSep "\n" rules}
'';
};
in
{
imports = [
(lib.mkRemovedOptionModule [
"systemd"
"user"
"extraConfig"
] "Use systemd.user.settings.Manager instead.")
];
options = {
systemd.user.extraConfig = mkOption {
default = "";
type = types.lines;
example = "DefaultTimeoutStartSec=60";
systemd.user.settings.Manager = lib.mkOption {
default = { };
type = lib.types.submodule {
freeformType = lib.types.attrsOf utils.systemdUtils.unitOptions.unitOption;
};
example = {
DefaultTimeoutStartSec = 60;
};
description = ''
Extra config options for systemd user instances. See {manpage}`systemd-user.conf(5)` for
available options.
Settings for systemd user instances. See {manpage}`systemd-user.conf(5)`
for available options.
'';
};
systemd.user.units = mkOption {
systemd.user.units = lib.mkOption {
description = "Definition of systemd per-user units.";
default = { };
type = systemdUtils.types.units;
type = utils.systemdUtils.types.units;
};
systemd.user.paths = mkOption {
systemd.user.paths = lib.mkOption {
default = { };
type = systemdUtils.types.paths;
type = utils.systemdUtils.types.paths;
description = "Definition of systemd per-user path units.";
};
systemd.user.services = mkOption {
systemd.user.services = lib.mkOption {
default = { };
type = systemdUtils.types.services;
type = utils.systemdUtils.types.services;
description = "Definition of systemd per-user service units.";
};
systemd.user.slices = mkOption {
systemd.user.slices = lib.mkOption {
default = { };
type = systemdUtils.types.slices;
type = utils.systemdUtils.types.slices;
description = "Definition of systemd per-user slice units.";
};
systemd.user.sockets = mkOption {
systemd.user.sockets = lib.mkOption {
default = { };
type = systemdUtils.types.sockets;
type = utils.systemdUtils.types.sockets;
description = "Definition of systemd per-user socket units.";
};
systemd.user.targets = mkOption {
systemd.user.targets = lib.mkOption {
default = { };
type = systemdUtils.types.targets;
type = utils.systemdUtils.types.targets;
description = "Definition of systemd per-user target units.";
};
systemd.user.timers = mkOption {
systemd.user.timers = lib.mkOption {
default = { };
type = systemdUtils.types.timers;
type = utils.systemdUtils.types.timers;
description = "Definition of systemd per-user timer units.";
};
systemd.user.tmpfiles = {
enable =
(mkEnableOption "systemd user units systemd-tmpfiles-setup.service and systemd-tmpfiles-clean.timer")
(lib.mkEnableOption "systemd user units systemd-tmpfiles-setup.service and systemd-tmpfiles-clean.timer")
// {
default = true;
example = false;
};
rules = mkOption {
type = types.listOf types.str;
rules = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
example = [ "D %C - - - 7d" ];
description = ''
@@ -139,17 +148,17 @@ in
'';
};
users = mkOption {
users = lib.mkOption {
description = ''
Per-user rules for creation, deletion and cleaning of volatile and
temporary files automatically.
'';
default = { };
type = types.attrsOf (
types.submodule {
type = lib.types.attrsOf (
lib.types.submodule {
options = {
rules = mkOption {
type = types.listOf types.str;
rules = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
example = [ "D %C - - - 7d" ];
description = ''
@@ -165,8 +174,8 @@ in
};
};
systemd.user.generators = mkOption {
type = types.attrsOf types.path;
systemd.user.generators = lib.mkOption {
type = lib.types.attrsOf lib.types.path;
default = { };
example = {
systemd-gpt-auto-generator = "/dev/null";
@@ -179,9 +188,9 @@ in
'';
};
systemd.additionalUpstreamUserUnits = mkOption {
systemd.additionalUpstreamUserUnits = lib.mkOption {
default = [ ];
type = types.listOf types.str;
type = lib.types.listOf lib.types.str;
example = [ ];
description = ''
Additional units shipped with systemd that should be enabled for per-user systemd instances.
@@ -203,29 +212,26 @@ in
upstreamWants = [ ];
};
"systemd/user.conf".text = ''
[Manager]
${cfg.extraConfig}
'';
"systemd/user.conf".text = utils.systemdUtils.lib.settingsToSections cfg.settings;
};
systemd.user.units =
mapAttrs' (n: v: nameValuePair "${n}.path" (pathToUnit v)) cfg.paths
// mapAttrs' (n: v: nameValuePair "${n}.service" (serviceToUnit v)) cfg.services
// mapAttrs' (n: v: nameValuePair "${n}.slice" (sliceToUnit v)) cfg.slices
// mapAttrs' (n: v: nameValuePair "${n}.socket" (socketToUnit v)) cfg.sockets
// mapAttrs' (n: v: nameValuePair "${n}.target" (targetToUnit v)) cfg.targets
// mapAttrs' (n: v: nameValuePair "${n}.timer" (timerToUnit v)) cfg.timers;
lib.mapAttrs' (n: v: lib.nameValuePair "${n}.path" (pathToUnit v)) cfg.paths
// lib.mapAttrs' (n: v: lib.nameValuePair "${n}.service" (serviceToUnit v)) cfg.services
// lib.mapAttrs' (n: v: lib.nameValuePair "${n}.slice" (sliceToUnit v)) cfg.slices
// lib.mapAttrs' (n: v: lib.nameValuePair "${n}.socket" (socketToUnit v)) cfg.sockets
// lib.mapAttrs' (n: v: lib.nameValuePair "${n}.target" (targetToUnit v)) cfg.targets
// lib.mapAttrs' (n: v: lib.nameValuePair "${n}.timer" (timerToUnit v)) cfg.timers;
systemd.user.timers = {
# enable systemd user tmpfiles
systemd-tmpfiles-clean.wantedBy = optional cfg.tmpfiles.enable "timers.target";
systemd-tmpfiles-clean.wantedBy = lib.optional cfg.tmpfiles.enable "timers.target";
}
# Generate timer units for all services that have a startAt value.
// (mapAttrs (name: service: {
// (lib.mapAttrs (name: service: {
wantedBy = [ "timers.target" ];
timerConfig.OnCalendar = service.startAt;
}) (filterAttrs (name: service: service.startAt != [ ]) cfg.services));
}) (lib.filterAttrs (name: service: service.startAt != [ ]) cfg.services));
# Provide the systemd-user PAM service, required to run systemd
# user instances.
@@ -244,18 +250,19 @@ in
systemd.services.systemd-user-sessions.restartIfChanged = false; # Restart kills all active sessions.
# enable systemd user tmpfiles
systemd.user.services.systemd-tmpfiles-setup.wantedBy = optional cfg.tmpfiles.enable "basic.target";
systemd.user.services.systemd-tmpfiles-setup.wantedBy =
lib.optional cfg.tmpfiles.enable "basic.target";
# /run/current-system/sw/etc/xdg is in systemd's $XDG_CONFIG_DIRS so we can
# write the tmpfiles.d rules for everyone there
environment.systemPackages = optional (cfg.tmpfiles.rules != [ ]) (writeTmpfiles {
environment.systemPackages = lib.optional (cfg.tmpfiles.rules != [ ]) (writeTmpfiles {
inherit (cfg.tmpfiles) rules;
});
# /etc/profiles/per-user/$USER/etc/xdg is in systemd's $XDG_CONFIG_DIRS so
# we can write a single user's tmpfiles.d rules there
users.users = mapAttrs (user: cfg': {
packages = optional (cfg'.rules != [ ]) (writeTmpfiles {
users.users = lib.mapAttrs (user: cfg': {
packages = lib.optional (cfg'.rules != [ ]) (writeTmpfiles {
inherit (cfg') rules;
inherit user;
});

View File

@@ -238,11 +238,11 @@ in
'';
systemd.settings.Manager = managerSettings;
systemd.user.extraConfig = ''
systemd.user.settings.Manager = {
# Allow very slow start
DefaultTimeoutStartSec=300
DefaultDeviceTimeoutSec=300
'';
DefaultTimeoutStartSec = 300;
DefaultDeviceTimeoutSec = 300;
};
boot.consoleLogLevel = 7;

View File

@@ -1379,7 +1379,6 @@ in
"-device usb-tablet,bus=usb-bus.0"
])
(mkIf pkgs.stdenv.hostPlatform.isAarch [
"-device virtio-gpu-pci"
"-device usb-ehci,id=usb0"
"-device usb-kbd"
"-device usb-tablet"

View File

@@ -1670,6 +1670,7 @@ in
systemd-timesyncd-nscd-dnssec = runTest ./systemd-timesyncd-nscd-dnssec.nix;
systemd-user-linger = runTest ./systemd-user-linger.nix;
systemd-user-linger-purge = runTest ./systemd-user-linger-purge.nix;
systemd-user-settings = runTest ./systemd-user-settings.nix;
systemd-user-tmpfiles-rules = runTest ./systemd-user-tmpfiles-rules.nix;
systemd-userdbd = runTest ./systemd-userdbd.nix;
systemtap = handleTest ./systemtap.nix { };

View File

@@ -0,0 +1,24 @@
{
name = "systemd-user-settings";
meta = {
maintainers = [ ];
};
nodes.machine =
{ lib, ... }:
{
systemd.user.settings.Manager = {
DefaultTimeoutStartSec = lib.mkForce "60";
DefaultEnvironment = "FOO=bar";
};
};
testScript = ''
machine.wait_for_unit("multi-user.target")
with subtest("settings.Manager renders user.conf"):
machine.succeed("grep -F '[Manager]' /etc/systemd/user.conf")
machine.succeed("grep -F 'DefaultTimeoutStartSec=60' /etc/systemd/user.conf")
machine.succeed("grep -F 'DefaultEnvironment=FOO=bar' /etc/systemd/user.conf")
'';
}

View File

@@ -34,7 +34,7 @@
RebootWatchdogSec = "10min";
KExecWatchdogSec = "5min";
};
systemd.user.extraConfig = "DefaultEnvironment=\"XXX_USER=bar\"";
systemd.user.settings.Manager.DefaultEnvironment = "\"XXX_USER=bar\"";
services.journald.extraConfig = "Storage=volatile";
test-support.displayManager.auto.user = "alice";

View File

@@ -314,13 +314,16 @@ It must be one of the following:
be made using _nixos_ function in nixpkgs or importing and calling
nixos/lib/eval-config.nix from nixpkgs. If specified without *--attr*
option, builds the configuration from the top-level attribute set of the
file.
file. Using this option disables automatic flake detection, same as
*--no-flake*.
*--attr* _attrPath_, *-A* _attrPath_
Build the NixOS system from a nix file and use the specified
attribute path from the file specified by the *--file* option.
If specified without *--file* option, uses _system.nix_ in current directory,
the system-wide _<nixos-system>_ file, or finally, /etc/nixos/system.nix.
Using this option disables automatic flake detection, same as
*--no-flake*.
*--flake* _flake-uri[#name]_, *-F* _flake-uri[#name]_
Build the NixOS system from the specified flake. It defaults to the
@@ -379,6 +382,10 @@ NIX_SSHOPTS
NIX_SUDOOPTS
Additional options to be passed to sudo on the command line.
NIXOS_REBUILD_NO_SYSTEMD_RUN
If set, then *nixos-rebuild* will run without the
_systemd-run_ wrapper.
# FILES
/etc/nixos/system.nix

View File

@@ -329,6 +329,10 @@ def parse_args(
if args.flake and (args.file or args.attr):
parser.error("--flake cannot be used with --file or --attr")
if (args.file or args.attr) and args.flake is None:
# Disable flake auto-detection when --file or --attr is used
args.flake = False
if args.store_path:
if args.rollback:
parser.error("--store-path and --rollback are mutually exclusive")

View File

@@ -708,6 +708,8 @@ def switch_to_configuration(
"not working in target host"
)
cmd = []
elif os.environ.get("NIXOS_REBUILD_NO_SYSTEMD_RUN"):
cmd = []
run_wrapper(
[*cmd, path_to_config / "bin/switch-to-configuration", str(action)],

View File

@@ -89,6 +89,22 @@ def test_parse_args() -> None:
assert r_store_path.flake is False
assert r_store_path.store_path == "/nix/store/foo"
# --file and --attr should disable flake auto-detection
r_file, _ = nr.parse_args(["nixos-rebuild", "switch", "--file", "foo.nix"])
assert r_file.flake is False
assert r_file.file == "foo.nix"
r_attr, _ = nr.parse_args(["nixos-rebuild", "switch", "--attr", "bar"])
assert r_attr.flake is False
assert r_attr.attr == "bar"
r_file_attr, _ = nr.parse_args(
["nixos-rebuild", "switch", "--file", "foo.nix", "--attr", "bar"]
)
assert r_file_attr.flake is False
assert r_file_attr.file == "foo.nix"
assert r_file_attr.attr == "bar"
r1, g1 = nr.parse_args(
[
"nixos-rebuild",

View File

@@ -819,6 +819,38 @@ def test_switch_to_configuration_without_systemd_run(
)
@patch(get_qualified_name(n.run_wrapper, n), autospec=True)
def test_switch_to_configuration_without_systemd_run_env_var(
mock_run: Any, monkeypatch: MonkeyPatch
) -> None:
profile_path = Path("/path/to/profile")
mock_run.return_value = CompletedProcess([], 0)
with monkeypatch.context() as mp:
mp.setenv("LOCALE_ARCHIVE", "")
mp.setenv("NIXOS_REBUILD_NO_SYSTEMD_RUN", "1")
n.switch_to_configuration(
profile_path,
m.Action.SWITCH,
elevate=e.NO_ELEVATOR,
target_host=None,
specialisation=None,
install_bootloader=False,
)
mock_run.assert_called_with(
[profile_path / "bin/switch-to-configuration", "switch"],
env={
"LOCALE_ARCHIVE": e.PRESERVE_ENV,
"NIXOS_NO_CHECK": e.PRESERVE_ENV,
"NIXOS_INSTALL_BOOTLOADER": "0",
},
elevate=e.NO_ELEVATOR,
remote=None,
stdout=sys.stderr,
)
@patch(get_qualified_name(n.run_wrapper, n), autospec=True)
def test_switch_to_configuration_with_systemd_run(
mock_run: Mock, monkeypatch: MonkeyPatch

View File

@@ -16,7 +16,7 @@
rustPlatform.buildRustPackage (finalAttrs: {
pname = "ruff";
version = "0.15.15";
version = "0.15.16";
__structuredAttrs = true;
@@ -24,12 +24,12 @@ rustPlatform.buildRustPackage (finalAttrs: {
owner = "astral-sh";
repo = "ruff";
tag = finalAttrs.version;
hash = "sha256-WpjOOCYLZ1d8XPUx3qNHD+fuK6t65u/1/ZezABWpBD0=";
hash = "sha256-krmHCLijp+D4gBjKV9cdicPob4ry5I6QwB3MUz0z7zA=";
};
cargoBuildFlags = [ "--package=ruff" ];
cargoHash = "sha256-SfkoLl43Y1DNqIRW+HljVcEHWhedTS99SGhMvkQ4dmo=";
cargoHash = "sha256-d2iV7iWf7lVhj1Bbaxxk5Zao4KK3oC7whppRvk0erzA=";
nativeBuildInputs = [ installShellFiles ];

View File

@@ -17,7 +17,7 @@
rustPlatform.buildRustPackage (finalAttrs: {
pname = "ty";
version = "0.0.40";
version = "0.0.44";
__structuredAttrs = true;
src = fetchFromGitHub {
@@ -25,7 +25,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
repo = "ty";
tag = finalAttrs.version;
fetchSubmodules = true;
hash = "sha256-kdfPnyQXYtf3BDrYCFGfX0bMoPGjRpyH3aUeRZBiUKY=";
hash = "sha256-P19+C6u0mkIrR0H8M/l7Wn3r8JSY4Ul9p64oXaLdWCQ=";
};
# For Darwin platforms, remove the integration test for file notifications,
@@ -39,7 +39,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
cargoBuildFlags = [ "--package=ty" ];
cargoHash = "sha256-yUbHTzUGNdpm3b1s/SkcpFGdp7WjN+xO+CVrPPwrh6A=";
cargoHash = "sha256-d2iV7iWf7lVhj1Bbaxxk5Zao4KK3oC7whppRvk0erzA=";
nativeBuildInputs = [ installShellFiles ];
buildInputs = [ rust-jemalloc-sys ];

View File

@@ -248,6 +248,10 @@ let
BOUNCE = option yes;
};
iommu = lib.optionalAttrs stdenv.hostPlatform.isAarch64 {
ARM_SMMU_V3_SVA = whenAtLeast "5.9" yes;
};
memtest = {
MEMTEST = yes;
};

View File

@@ -142,14 +142,12 @@ optionalAttrs allowAliases aliases
runCommand name
{
nativeBuildInputs = [ jq ];
value = builtins.toJSON value;
inherit value;
preferLocalBuild = true;
__structuredAttrs = true;
}
''
valuePath="$TMPDIR/value"
printf "%s" "$value" > "$valuePath"
jq . "$valuePath" > $out
jq .value "$NIX_ATTRS_JSON_FILE" > $out
''
) { };
@@ -167,14 +165,12 @@ optionalAttrs allowAliases aliases
runCommand name
{
nativeBuildInputs = [ remarshal_0_17 ];
value = builtins.toJSON value;
inherit value;
preferLocalBuild = true;
__structuredAttrs = true;
}
''
valuePath="$TMPDIR/value"
printf "%s" "$value" > "$valuePath"
json2yaml "$valuePath" "$out"
json2yaml --unwrap value "$NIX_ATTRS_JSON_FILE" "$out"
''
) { };
@@ -192,14 +188,12 @@ optionalAttrs allowAliases aliases
runCommand name
{
nativeBuildInputs = [ remarshal ];
value = builtins.toJSON value;
inherit value;
preferLocalBuild = true;
__structuredAttrs = true;
}
''
valuePath="$TMPDIR/value"
printf "%s" "$value" > "$valuePath"
json2yaml "$valuePath" "$out"
json2yaml --unwrap value "$NIX_ATTRS_JSON_FILE" "$out"
''
) { };
@@ -938,8 +932,8 @@ optionalAttrs allowAliases aliases
python3
black
];
imports = builtins.toJSON (value._imports or [ ]);
value = builtins.toJSON (removeAttrs value [ "_imports" ]);
imports = value._imports or [ ];
value = removeAttrs value [ "_imports" ];
pythonGen = pkgs.writeText "pythonGen" ''
import json
import os
@@ -962,26 +956,20 @@ optionalAttrs allowAliases aliases
else:
return repr(value)
with open(os.environ["importsPath"], "r") as f:
imports = json.load(f)
if imports is not None:
for i in imports:
with open(os.environ["NIX_ATTRS_JSON_FILE"], "r") as f:
attrs = json.load(f)
if attrs["imports"] is not None:
for i in attrs["imports"]:
print(f"import {i}")
print()
with open(os.environ["valuePath"], "r") as f:
for key, value in json.load(f).items():
for key, value in attrs["value"].items():
print(f"{key} = {recursive_repr(value)}")
'';
preferLocalBuild = true;
__structuredAttrs = true;
}
''
export importsPath="$TMPDIR/imports"
printf "%s" "$imports" > "$importsPath"
export valuePath="$TMPDIR/value"
printf "%s" "$value" > "$valuePath"
cat "$valuePath"
python3 "$pythonGen" > $out
black $out
''
@@ -1011,14 +999,14 @@ optionalAttrs allowAliases aliases
python3Packages.xmltodict
libxml2Python
];
value = builtins.toJSON value;
inherit value;
pythonGen = pkgs.writeText "pythonGen" ''
import json
import os
import xmltodict
with open(os.environ["valuePath"], "r") as f:
print(xmltodict.unparse(json.load(f), full_document=${
with open(os.environ["NIX_ATTRS_JSON_FILE"], "r") as f:
print(xmltodict.unparse(json.load(f)["value"], full_document=${
if withHeader then "True" else "False"
}, pretty=True, indent=" " * 2))
'';
@@ -1026,8 +1014,6 @@ optionalAttrs allowAliases aliases
__structuredAttrs = true;
}
''
export valuePath="$TMPDIR/value"
printf "%s" "$value" > "$valuePath"
python3 "$pythonGen" > $out
xmllint $out > /dev/null
''

View File

@@ -2284,6 +2284,10 @@ with pkgs;
pinentry = if stdenv.hostPlatform.isDarwin then pinentry_mac else pinentry-gtk2;
};
gnupg = gnupg24;
gnupgMinimal = gnupg.override {
enableMinimal = true;
guiSupport = false;
};
gnused = callPackage ../tools/text/gnused { };