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

nixos/virtualbox: add swap file #57557

Merged
merged 1 commit into from Apr 19, 2019
Merged

Conversation

matthewbauer
Copy link
Member

Puts 4G swap in /var/swap of OVA. This serves as backup when you hit
the memory cap for the image.

I need to test this some more to make sure there are no regressions.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • 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/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Contributor

@danbst danbst left a comment

Choose a reason for hiding this comment

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

though I think 2Gb should be enough. Any reasoning on why 4G?

@xeji
Copy link
Contributor

xeji commented Mar 15, 2019

though I think 2Gb should be enough.

I agree, and believe it's generally better to give VMs only a small amount of local swap space.
If they use more than that you can assign them more memory, that's what ballooning and overcommiting are for...

Puts 2G swap in /var/swap of OVA. This serves as backup when you hit
the memory cap for the image.

Fixes NixOS#57171 and fixes NixOS#22696
@matthewbauer matthewbauer merged commit c1fd154 into NixOS:master Apr 19, 2019
samueldr added a commit to samueldr/nixpkgs that referenced this pull request Apr 21, 2019
@samueldr
Copy link
Member

❌ The option 'swap' [...] does not exist.

~/tmp/nixpkgs/nixpkgs 1 $ nix-instantiate --show-trace nixos/release-combined.nix -A nixos.ova.x86_64-linux
error: while evaluating anonymous function at /Users/samuel/tmp/nixpkgs/nixpkgs/nixos/release-combined.nix:20:34, called from undefined position:
while evaluating 'removeMaintainers' at /Users/samuel/tmp/nixpkgs/nixpkgs/nixos/release-combined.nix:17:23, called from /Users/samuel/tmp/nixpkgs/nixpkgs/nixos/release-combined.nix:20:37:
while evaluating anonymous function at /Users/samuel/tmp/nixpkgs/nixpkgs/nixos/release.nix:184:48, called from /Users/samuel/tmp/nixpkgs/nixpkgs/lib/attrsets.nix:292:43:
while evaluating 'hydraJob' at /Users/samuel/tmp/nixpkgs/nixpkgs/lib/customisation.nix:157:14, called from /Users/samuel/tmp/nixpkgs/nixpkgs/nixos/release.nix:188:5:
while evaluating the attribute 'config.system.build.virtualBoxOVA' at /Users/samuel/tmp/nixpkgs/nixpkgs/nixos/lib/eval-config.nix:58:5:
while evaluating the attribute 'config' at /Users/samuel/tmp/nixpkgs/nixpkgs/lib/modules.nix:87:25:
while evaluating 'yieldConfig' at /Users/samuel/tmp/nixpkgs/nixpkgs/lib/modules.nix:74:29, called from /Users/samuel/tmp/nixpkgs/nixpkgs/lib/modules.nix:73:16:
while evaluating anonymous function at /Users/samuel/tmp/nixpkgs/nixpkgs/lib/modules.nix:80:24, called from /Users/samuel/tmp/nixpkgs/nixpkgs/lib/modules.nix:80:11:
while evaluating anonymous function at /Users/samuel/tmp/nixpkgs/nixpkgs/lib/modules.nix:81:26, called from /Users/samuel/tmp/nixpkgs/nixpkgs/lib/modules.nix:81:13:
The option `swap' defined in `/Users/samuel/tmp/nixpkgs/nixpkgs/nixos/modules/virtualisation/virtualbox-image.nix' does not exist.
Command exited with non-zero status 1

Hopefully once NixOS/ofborg#342 is merged this will be made more evident, since it also made the tested job of nixos:trunk-combined disappear.

See #59945

grahamc pushed a commit to grahamc/nixpkgs that referenced this pull request Apr 22, 2019
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

5 participants