Skip to content

Add 'nix app' command #2909

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

Merged
merged 2 commits into from
Jun 3, 2019
Merged

Add 'nix app' command #2909

merged 2 commits into from
Jun 3, 2019

Conversation

edolstra
Copy link
Member

This is like nix run, except that the command to execute is defined in a flake output, e.g.

  defaultApp = {
    type = "app";
    program = "${packages.blender_2_80}/bin/blender";
  };

Thus you can do

  $ nix app blender-bin

to start Blender from the blender-bin flake.

In the future, we can extend this with sandboxing. (For example we would want to be able to specify that Blender should not have network access by default and should only have access to certain paths in the user's home directory.)

@edolstra edolstra requested review from grahamc, shlevy and CSVdB May 31, 2019 21:57
edolstra added 2 commits June 3, 2019 09:27

Verified

This commit was signed with the committer’s verified signature. The key has expired.
NeQuissimus Tim Steinbach

Verified

This commit was signed with the committer’s verified signature. The key has expired.
NeQuissimus Tim Steinbach
This is like 'nix run', except that the command to execute is defined
in a flake output, e.g.

  defaultApp = {
    type = "app";
    program = "${packages.blender_2_80}/bin/blender";
  };

Thus you can do

  $ nix app blender-bin

to start Blender from the 'blender-bin' flake.

In the future, we can extend this with sandboxing. (For example we
would want to be able to specify that Blender should not have network
access by default and should only have access to certain paths in the
user's home directory.)
@edolstra edolstra changed the base branch from subdir to flakes June 3, 2019 07:34
@edolstra edolstra merged commit 507c150 into flakes Jun 3, 2019
@edolstra edolstra deleted the flake-apps branch June 6, 2019 10:28
@JohnAZoidberg
Copy link
Member

No manual/doc update? Can this be used without flakes?

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/sandboxing-all-programs-by-default/7792/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants