Skip to content
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

add tmpOnTmpfs feature from #23912 #27189

Closed
wants to merge 1 commit into from
Closed

Conversation

ikervagyok
Copy link
Contributor

Motivation for this change

wanted this feature already, implemented it now.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

default = false;
description = ''
Whether to mount a tmpfs on <filename>/tmp</filename> during boot.
Setting this to `true` is equivalent to 50% of available memory. For details about valid strings, see `man mount`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 50% you are promising is something that will easily break, if upstream changes something. Either document that you do what upstream does, or implement the 50% yourself by figuring out available physical memory, etc.

@edolstra
Copy link
Member

edolstra commented Jul 7, 2017

A few points:

  • I don't really like overloading the type of options (i.e. either bool string). Why not just add a separate size option, like boot.devShmSize?

  • We really should continue to use the upstream unit to prevent getting out of sync with systemd. The upstream unit also has several options omitted here (e.g. Description, Conflicts, After, etc.). It would be better to use systemd's override mechanisms, e.g.

systemd.mounts = [ { where = "tmp"; options = [...]; } ];

or even better

systemd.mounts."/tmp".options = [...];

but that will require changing systemd.mounts into an attrset, like systemd.services.

@ikervagyok
Copy link
Contributor Author

@edolstra:

  1. I wanted to keep the interface unchanged for people who already have set this option, otherwise i'd make two options: boot.tmpOnTmpfs.enable and boot.tmpOnTmpfs.size.
  2. can you give me any pointers how to tackle this? this would be a major refactoring, if i understand correctly.

@c0bw3b c0bw3b changed the title add tmpOnTmpfs feature from https://github.com/NixOS/nixpkgs/issues/23912 add tmpOnTmpfs feature from #23912 Oct 21, 2018
@bobvanderlinden
Copy link
Member

Should converting systemd.mounts to an attrset be part of the effort? I cannot think of a way to do this in a backwards compatible way.

@ivan
Copy link
Member

ivan commented Sep 6, 2019

For the author, reviewers, and committers: this PR was scanned and appears to add a use of the deprecated types.string, which emits a warning as of #66346. Before merging, please change this to another type, possibly:

  • types.str for a single string where merging does not make sense, or cannot work
  • types.lines for multi-line configuration or scripts where merging is possible
  • types.listOf types.str for a mergeable list of strings

@infinisil
Copy link
Member

Doesn't seem to be much interest in this, closing for now, feel free to reopen

@infinisil infinisil closed this Jan 15, 2020
@Artturin Artturin mentioned this pull request Sep 2, 2021
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants