diff --git a/flake.nix b/flake.nix index 1ca1e6d4..077462e6 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,7 @@ ... }: let system = "x86_64-linux"; + allowUnfree = true; inherit (nixpkgs) lib; flib = import ./lib.nix lib; @@ -38,7 +39,7 @@ # manually import the packages subflake to avoid locking issues # this flake must have the same inputs that dotpkgs expects dotpkgs = (import ./dotpkgs/flake.nix).outputs inputs; - in { + in flib.spoofAllowUnfree allowUnfree { # merge the packages flake into this one inherit (dotpkgs) packages nixosModules homeManagerModules; diff --git a/lib.nix b/lib.nix index 425416d6..fd2e451c 100644 --- a/lib.nix +++ b/lib.nix @@ -12,4 +12,21 @@ lib: rec { ]; # same as above but with an attrset of named flake inputs flatFlakes = system: builtins.mapAttrs (_: f: flatFlake f system); + # spoof the license of every package + spoofAllowUnfree = maybe: flake: ( + if maybe + then lib.recursiveUpdate flake { + # spoof the licenses for local flake packages + packages = + builtins.mapAttrs (_: system: + builtins.mapAttrs (_: package: + package.overrideAttrs (old: { + meta.license = + old.meta.license // { free = true; }; + }) + ) system + ) flake.packages; + } + else flake + ); }