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

ikervagyok commented Jul 6, 2017

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`.

This comment has been minimized.

Copy link
@0xABAB

0xABAB Jul 6, 2017

Contributor

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.

@FRidh FRidh added the 6.topic: nixos label Jul 7, 2017
@edolstra

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor Author

ikervagyok commented Jul 7, 2017

@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

This comment has been minimized.

Copy link
Contributor

bobvanderlinden commented Apr 13, 2019

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

Infinisil commented Jan 15, 2020

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

@Infinisil Infinisil closed this Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.