From 56ff60221278a89ec002e6eb1ca417f059472a62 Mon Sep 17 00:00:00 2001 From: xenia Date: Tue, 17 Dec 2024 01:41:31 -0500 Subject: [PATCH] streamline unfree licensing --- flake.nix | 13 +++++++++++++ lib/licenses/FYPTL | 17 +++++++++++++++++ lib/licenses/fyptl.nix | 8 ++++++++ overlay.nix | 6 +++++- pkgs/ocaml/systemd-ml/default.nix | 10 ++-------- pkgs/rust/zbasefind/default.nix | 10 +--------- 6 files changed, 46 insertions(+), 18 deletions(-) create mode 100644 lib/licenses/FYPTL create mode 100644 lib/licenses/fyptl.nix diff --git a/flake.nix b/flake.nix index 3e82b21..9d996a2 100644 --- a/flake.nix +++ b/flake.nix @@ -105,6 +105,14 @@ defaultText = lib.literalExpression "true"; example = lib.literalExpression "false"; }; + + possiblyCommitCrimes = lib.mkOption { + description = "Globally enable usage of packages marked as FYPTL"; + type = lib.types.bool; + default = false; + defaultText = lib.literalExpression "false"; + example = lib.literalExpression "false"; + }; }; config.nix.registry.dragnpkgs-unstable = @@ -123,6 +131,11 @@ config.nix.nixPath = lib.mkIf config.dragnpkgs.setNixPath [ self.meta.path-entry ]; + + # TODO: also enable this for user-level nix, somehow + config.nixpkgs.config = lib.mkIf config.dragnpkgs.possiblyCommitCrimes { + allowlistedLicenses = lib.licenses.fyptl; + }; }) (import ./module.nix) diff --git a/lib/licenses/FYPTL b/lib/licenses/FYPTL new file mode 100644 index 0000000..c1d2312 --- /dev/null +++ b/lib/licenses/FYPTL @@ -0,0 +1,17 @@ +The Fuck You, Pirate This License (FYPTL) +--- + +Copyright (c) 2024 xenia . All Rights Reserved. + +Permission to use, copy, modify, and/or distribute this software IS NOT granted +for any purpose. Performing any such actions in connection with this software +may constitute copyright infringement, and the copyright holder(s) may pursue +any remedies for such infringement in accordance with applicable law. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/lib/licenses/fyptl.nix b/lib/licenses/fyptl.nix new file mode 100644 index 0000000..c1cae46 --- /dev/null +++ b/lib/licenses/fyptl.nix @@ -0,0 +1,8 @@ +{ + shortName = "FYPTL"; + fullName = "Fuck You, Pirate This License"; + deprecated = false; + free = false; + redistributable = false; + url = "https://git.lain.faith/haskal/dragnpkgs/src/branch/main/lib/licenses/FYPTL"; +} diff --git a/overlay.nix b/overlay.nix index e434509..5fc665b 100644 --- a/overlay.nix +++ b/overlay.nix @@ -1,4 +1,8 @@ final: prev: { + lib = prev.lib.extend (lfinal: lprev: { + licenses = lprev.licenses // { fyptl = import ./lib/licenses/fyptl.nix; }; + }); + fetchFromSteam = prev.callPackage ./lib/fetchsteam {}; fetchb4 = prev.callPackage ./lib/fetchb4 {}; @@ -36,7 +40,7 @@ final: prev: { mkNginxServer = prev.callPackage ./lib/dev-nginx {}; - zbasefind = prev.callPackage ./pkgs/rust/zbasefind {}; + zbasefind = final.callPackage ./pkgs/rust/zbasefind {}; eta = prev.callPackage ./pkgs/cmdline/eta {}; diff --git a/pkgs/ocaml/systemd-ml/default.nix b/pkgs/ocaml/systemd-ml/default.nix index 390db8e..83322ae 100644 --- a/pkgs/ocaml/systemd-ml/default.nix +++ b/pkgs/ocaml/systemd-ml/default.nix @@ -1,4 +1,5 @@ { + lib, fetchgit, buildDunePackage, @@ -30,14 +31,7 @@ buildDunePackage rec { meta = { description = ""; homepage = "https://git.lain.faith/haskal/systemd-ml"; - license = { - shortName = "fyptl"; - fullName = "fuck you pirate this license"; - deprecated = false; - free = false; - redistributable = false; - url = "data:text/html,

fuck you pirate this

"; - }; + license = lib.licenses.fyptl; maintainers = []; }; } diff --git a/pkgs/rust/zbasefind/default.nix b/pkgs/rust/zbasefind/default.nix index 003805c..967d13e 100644 --- a/pkgs/rust/zbasefind/default.nix +++ b/pkgs/rust/zbasefind/default.nix @@ -17,15 +17,7 @@ rustPlatform.buildRustPackage rec { meta = { description = "A firmware base address search tool"; homepage = "https://git.lain.faith/haskal/zbasefind"; - license = { - shortName = "fyptl"; - fullName = "fuck you pirate this license"; - deprecated = false; - free = false; - redistributable = false; - url = "data:text/html,

fuck you pirate this

"; - }; - + license = lib.licenses.fyptl; maintainers = []; }; }