New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/tmp: fix reboots after 56d7e7492cbf2d61bd570f5b0a8015040e80aae9 #108881
Conversation
This would break right now - because there's a conflict between the upstream unit and the local one |
How so? I'm quite sure I'm running that config. Although that's on 20.09. |
@ajs124 Ah I misunderstood how nix processes these (my issue isn't with the upstream unit but by defining tmp.mount twice). We should avoid having needless override confs tho bc they're somewhat non-obvious when debugging a system for most people I think. |
47f6c94
to
2677c30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
did someone try rebooting into this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the what
is also required (for NixOS, at least):
error: --- ThrownError ------------------------------------------------------------------------- nix
The option `systemd.mounts.[definition 1-entry 1].what' is used but not defined.
2677c30
to
95c9dce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just booted into this change. Works as expected.
$ systemctl cat tmp.mount
# /nix/store/4i7s80g57bqha7nna9yqcr50my0fva80-systemd-247.2/example/systemd/system/tmp.mount
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Temporary Directory (/tmp)
Documentation=https://systemd.io/TEMPORARY_DIRECTORIES
Documentation=man:file-hierarchy(7)
Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
ConditionPathIsSymbolicLink=!/tmp
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
After=swap.target
[Mount]
What=tmpfs
Where=/tmp
Type=tmpfs
Options=mode=1777,strictatime,nosuid,nodev,size=50%,nr_inodes=400k
# /nix/store/2x81582q36h2g1ar9qkpc3sz4j76h3xs-system-units/tmp.mount.d/overrides.conf
[Unit]
[Mount]
Options=mode=1777
Options=strictatime
Options=rw
Options=nosuid
Options=nodev
Options=size=50%
What=tmpfs
Where=/tmp
$ mount | rg /tmp
tmpfs on /tmp type tmpfs (rw,relatime,size=16416428k)
$ df -h | rg /tmp
tmpfs 16G 16K 16G 1% /tmp
$ df -i | rg /tmp
tmpfs 4104106 35 4104071 1% /tmp
Those separate |
You could try changing However, I'm pretty sure it's just aesthetic. It works fine as-is. diff --git a/nixos/modules/system/boot/tmp.nix b/nixos/modules/system/boot/tmp.nix
index c1442311280..66845af2d1f 100644
--- a/nixos/modules/system/boot/tmp.nix
+++ b/nixos/modules/system/boot/tmp.nix
@@ -40,7 +40,7 @@ with lib;
{
what = "tmpfs";
where = "/tmp";
- mountConfig.Options = [ "mode=1777" "strictatime" "rw" "nosuid" "nodev" "size=50%" ];
+ options = "mode=1777,strictatime,rw,nosuid,nodev,size=50%";
}
];
EDIT: That works.
EDIT2: Is the |
Apparently it didn't: #157512 |
Motivation for this change
Alternative to #108860
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)