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-shell: init at 0.0.1 #38433

Closed
wants to merge 1 commit into from
Closed

nixos-shell: init at 0.0.1 #38433

wants to merge 1 commit into from

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Apr 4, 2018

Motivation for this change
  • procrastinating hard during a delayed flight.
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
    • 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/)
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: nixos-shell

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: nixos-shell

Partial log (click to expand)

install -D bin/nixos-shell /nix/store/7n3swcy3dr96l9nsyd3l3bvf9qljpkyq-nixos-shell-0.0.1/bin/nixos-shell
install -D share/nixos-shell/nixos-shell.nix /nix/store/7n3swcy3dr96l9nsyd3l3bvf9qljpkyq-nixos-shell-0.0.1/share/nixos-shell/nixos-shell.nix
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/7n3swcy3dr96l9nsyd3l3bvf9qljpkyq-nixos-shell-0.0.1
strip is /nix/store/3zq400fri5dv7d30lpxlqm2v9y1iis6j-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/7n3swcy3dr96l9nsyd3l3bvf9qljpkyq-nixos-shell-0.0.1/bin
patching script interpreter paths in /nix/store/7n3swcy3dr96l9nsyd3l3bvf9qljpkyq-nixos-shell-0.0.1
/nix/store/7n3swcy3dr96l9nsyd3l3bvf9qljpkyq-nixos-shell-0.0.1/bin/nixos-shell: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/3gg2p6n4kv2f0lsxd41f5iz1ivkbzyzr-bash-4.4-p19/bin/bash"
checking for references to /build in /nix/store/7n3swcy3dr96l9nsyd3l3bvf9qljpkyq-nixos-shell-0.0.1...
/nix/store/7n3swcy3dr96l9nsyd3l3bvf9qljpkyq-nixos-shell-0.0.1

@davidak
Copy link
Member

davidak commented Apr 4, 2018

Could you find a name and description that makes more clear what this is? A shell, VM or container are different things. What is the difference to nixos-container?

@Mic92
Copy link
Member Author

Mic92 commented Apr 4, 2018

Draft for description:

nixos-containers are based on systemd-nspawn and is os-level virtualization, which means that no external kernel is used to run the container. In comparison to nixos-containers it does not need root and is ephemeral. I called it nixos-shell because the semantic is similar to nix-shell. It looks for a vm.nix in the current directory, but starts a whole virtual machine instead of just setting some environment variables.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: nixos-shell

Partial log (click to expand)


install -D bin/nixos-shell /nix/store/pv9lwbwsxydilbp5ha9s0s4c32h3h206-nixos-shell-0.0.1/bin/nixos-shell
install -D share/nixos-shell/nixos-shell.nix /nix/store/pv9lwbwsxydilbp5ha9s0s4c32h3h206-nixos-shell-0.0.1/share/nixos-shell/nixos-shell.nix
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/pv9lwbwsxydilbp5ha9s0s4c32h3h206-nixos-shell-0.0.1
strip is /nix/store/fzcs0fn6bb04m82frhlb78nc03ny3w55-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/pv9lwbwsxydilbp5ha9s0s4c32h3h206-nixos-shell-0.0.1/bin
patching script interpreter paths in /nix/store/pv9lwbwsxydilbp5ha9s0s4c32h3h206-nixos-shell-0.0.1
/nix/store/pv9lwbwsxydilbp5ha9s0s4c32h3h206-nixos-shell-0.0.1/bin/nixos-shell: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/q1g0rl8zfmz7r371fp5p42p4acmv297d-bash-4.4-p19/bin/bash"
checking for references to /tmp/nix-build-nixos-shell-0.0.1.drv-0 in /nix/store/pv9lwbwsxydilbp5ha9s0s4c32h3h206-nixos-shell-0.0.1...

@Mic92
Copy link
Member Author

Mic92 commented Apr 4, 2018

nixos-shell also respects overlays for building VMs and the current user profile/shell environment: https://github.com/Mic92/nixos-shell/blob/master/share/nixos-shell/nixos-shell.nix#L5

@Mic92
Copy link
Member Author

Mic92 commented Apr 4, 2018

Probably I should add container support too.

@Mic92
Copy link
Member Author

Mic92 commented Apr 4, 2018

Prior work: https://github.com/chrisfarms/nixos-shell (where I currently stole the name from)

@Mic92
Copy link
Member Author

Mic92 commented Apr 4, 2018

maybe incorporating: https://docs.python.org/3.6/library/cmd.html
At some point when it comes to argument parsing, some high-level language would be better.

@Mic92
Copy link
Member Author

Mic92 commented Apr 4, 2018

@volth do you have sensible defaults regarding ballooning, the current memory limit is quite low.

@Mic92
Copy link
Member Author

Mic92 commented Apr 4, 2018

auto ballooning requires some experimental branches of qemu... https://github.com/clearcontainers/vhost-9pfs would be also nice to speedup file sharing.

@Mic92
Copy link
Member Author

Mic92 commented Apr 4, 2018

There are some changes I want to make, before adding this to nixpkgs.

@Mic92 Mic92 closed this Apr 4, 2018
@Mic92 Mic92 deleted the nixos-shell branch September 6, 2018 08:46
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

3 participants