From 80b5a14c5e6c19d7a81050596c4c1f4edce55a9a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 2 Oct 2023 18:14:05 +0200 Subject: [PATCH] whitelist for nonfree packages --- modules/desktop/default.nix | 9 +++++++++ modules/desktop/gaming.nix | 6 ++++++ modules/nixpkgs.nix | 17 ++++++++++++++--- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index ab3aa05..262fcce 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -38,6 +38,7 @@ in { alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; + #jack.enable = true; }; programs = { @@ -90,6 +91,14 @@ in { "electron-12.2.3" ]; + my.allowUnfreePackages = [ + "insync" + "insync-pkg" + + "rider" + "pycharm-professional" + ]; + fonts = { fontconfig.defaultFonts.monospace = ["FiraCode Nerd Font"]; fonts = with pkgs; [ diff --git a/modules/desktop/gaming.nix b/modules/desktop/gaming.nix index e0ae169..69c8c83 100644 --- a/modules/desktop/gaming.nix +++ b/modules/desktop/gaming.nix @@ -42,5 +42,11 @@ in { dedicatedServer.openFirewall = true; }; }; + + my.allowUnfreePackages = [ + "steam" + "steam-original" + "steam-run" + ]; }; } diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index 3bb6d9a..d3db394 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -1,16 +1,27 @@ -{config, ...}: let +{ + config, + lib, + ... +}: let unstable-commit-sha = "f5892ddac112a1e9b3612c39af1b72987ee5783a"; in { + options.my.allowUnfreePackages = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = []; + example = ["steam"]; + }; + config = { nixpkgs.config = { - allowUnfree = true; - # make nixos-unstable availiable as 'pkgs.unstable' packageOverrides = pkgs: { unstable = import (fetchTarball "https://github.com/nixos/nixpkgs/tarball/${unstable-commit-sha}") { config = config.nixpkgs.config; }; }; + + # https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085 + allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.my.allowUnfreePackages; }; system = {