about summary refs log tree commit diff
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2016-05-17 01:40:10 +0200
committeraszlig <aszlig@redmoonstudios.org>2016-05-17 01:46:01 +0200
commitc3968ea04fe71b9e45432980c8c8326c7572eac6 (patch)
tree796d9ca447e140736cca0e397d0b9b97fa72a653
parentf50de454fd2f4c919195b1cc904b89343c243451 (diff)
modules: Add a new module for license selection
This basically provides module arguments with different variations of
the pkgs arguments so that it's easier to allow specific unfree packages
selectively.

Note that I deliberately chose "unfreeAndNonDistributablePkgs", because
we really want to let those packages stand out. We want to avoid
building those packages on Hydra as much as possible.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
-rw-r--r--modules/module-list.nix1
-rw-r--r--modules/profiles/licensing.nix19
2 files changed, 20 insertions, 0 deletions
diff --git a/modules/module-list.nix b/modules/module-list.nix
index 4eb8dc54..0aede318 100644
--- a/modules/module-list.nix
+++ b/modules/module-list.nix
@@ -4,6 +4,7 @@
   ./hardware/t100ha
   ./hardware/thinkpad.nix
   ./profiles/common.nix
+  ./profiles/licensing.nix
   ./profiles/tests.nix
   ./programs/gnupg
   ./programs/fish/fasd.nix
diff --git a/modules/profiles/licensing.nix b/modules/profiles/licensing.nix
new file mode 100644
index 00000000..1a7c9390
--- /dev/null
+++ b/modules/profiles/licensing.nix
@@ -0,0 +1,19 @@
+{ config, lib, ... }:
+
+let
+  overrideConfig = newConfig: import (import ../../nixpkgs-path.nix) {
+    inherit (config.nixpkgs) system;
+    config = config.nixpkgs.config // newConfig;
+  };
+
+in {
+  _module.args = {
+    unfreePkgs = overrideConfig {
+      whitelistedLicenses = [ lib.licenses.unfreeRedistributable ];
+    };
+
+    unfreeAndNonDistributablePkgs = overrideConfig {
+      allowUnfree = true;
+    };
+  };
+}