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 module for accepting licenses #9234

Closed
wants to merge 4 commits into from

Conversation

ts468
Copy link
Contributor

@ts468 ts468 commented Aug 13, 2015

A general module where nixpkgs related licenses can be accepted.
The module also helps to documents the available options.

For example, the "allowUnfree" nixpkgs option can now be accepted
by the following configuration in the "nixos/configuration.nix".
nixpkgs = {
licenses = {
allowUnfree = true;
};
};

The module also fixes the issue of passing "allowUnfree=true" to
the i686 package tree within x86_64 systems.

NOTE: The module only affects the evaluation of the system wide
configuration. User initiated "nix-env" commands are not in-
fluenced. A future "nixuser" program will take care of that.

As an example, the installation of oraclejdk is handled by the new
module.
The license of the oraclejdk{7,7psu,8} packages have been changed
to the "Oracle Binary Code License Agreement for the Java SE Platform
Products and JavaFX". The packages can now only be installed once the
license is accepted, e.g., within the "nixos/modules/misc/licenses.nix"
module.
To accept the license for nixos system wide evaluations, the following can
be added to the nixos/configuration.nix file:
nixpkgs = {
licenses = {
oracleBinaryCodeLicenseForJava = "accept";
};
};

Thomas Strobel added 4 commits August 13, 2015 14:25
A general module where nixpkgs related licenses can be accepted.
The module also helps to documents the available options.

For example, the "allowUnfree" nixpkgs option can now be accepted
by the following configuration in the "nixos/configuration.nix".
  nixpkgs = {
    licenses = {
      allowUnfree = true;
    };
  };

The module also fixes the issue of passing "allowUnfree=true" to
the i686 package tree within x86_64 systems.

NOTE: The module only affects the evaluation of the system wide
      configuration. User initiated "nix-env" commands are not in-
      fluenced. A future "nixuser" program will take care of that.
The "Oracle Binary Code License Agreement for the Java SE Platform Products
and JavaFX" is the first example of a license that is managed by the new
"nixos/modules/misc/licenses.nix" module.
By default, the license is black-listed and it has to be accepted explicitly.

For nixos system wide evaluations the following can be added to the
nixos/configuration.nix file to accept the license:
  nixpkgs = {
    licenses = {
      oracleBinaryCodeLicenseForJava = "accept";
    };
  };

For user initiated evaluations by, e.g., "nix-env", for example the following
line can be added to "~/.nixpkgs/config.nix" to clear all black-listed licenses:
  blacklistedLicenses = [];
The license of the oraclejdk{7,7psu,8} packages have been changed to the "Oracle
Binary Code License Agreement for the Java SE Platform Products and JavaFX".
The packages can now only be installed once the license is accepted, e.g.,
within the "nixos/modules/misc/licenses.nix" module. In return, the packages are
downloaded automatically without user intervention.
@edolstra
Copy link
Member

Hm, I don't know. I don't really want us to start reproducing Nixpkgs config options in NixOS. I mean, you can already set

  nixpkgs.config.allowUnfree = true;

@ts468
Copy link
Contributor Author

ts468 commented Aug 13, 2015

Please let me know what you think!

The need to better document license related options like, e.g., "allowUnfree" has been mentioned in #4493.
Also, by requiring to accept licenses explicitly, the concerns for making oraclejdk available through an automated download, as raised in #6557, should be addressed.

@@ -347,6 +347,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {
fullName = "OpenSSL License";
};

oraclejavabcl = {
fullName = "Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX";
url = "http://www.oracle.com/technetwork/java/javase/terms/license/index.html";
Copy link
Member

Choose a reason for hiding this comment

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

Unfree licenses must have free = false to prevent them from being accepted by default.

@jcumming
Copy link
Contributor

A naive, untested suggestion:

myoraclejdk = pkgs.oraclejdk.override { license = accepted; };

... or some mechanism outside of nixpkgs to override the src and the license attrs. That way nixpkgs has correct license information, and you can use a local repository of tarballs or whatever for the closed source, proprietary software.

@ts468
Copy link
Contributor Author

ts468 commented Aug 14, 2015

@edolstra Hm, so what do you suggest, how should I expose, e.g., the oraclejavabcl to the user? Should I create an option in nixpkgs.config instead? Would that be better than going down the black-listing approach?
I understand that there is little benefit in what one can do from simply reproducing all nixpkgs.config options in NixOS, but sometimes I find it still very useful to have a proper NixOS option. For example, I very often consult http://nixos.org/nixos/options.html to check for options, and I think commonly used settings like, e.g., license related options should show up there as well. It's a great strength of NixOS to have such a powerful module system where, e.g., documented options can be centralized into one place, and with this PR I just try to extend the module system in that spirit---and of course to also make oraclejdk be downloaded automatically ;)

@jcumming Thank you very much for your thoughts, but ideally I want to get a solution for oraclejdk that works within nixpkgs. But maybe an integrated override option is the way to go!

@joachifm
Copy link
Contributor

Is this still being worked on?

@ts468
Copy link
Contributor Author

ts468 commented May 2, 2016

@joachifm I'm still interested in a solution, but it doesn't have a high priority for me at the moment.

@grahamc
Copy link
Member

grahamc commented Feb 6, 2017

Closing for being very stale.

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

6 participants