From c3f882fae8f4c1ae84deafc310357846e8b66ad1 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Mon, 21 Sep 2026 15:57:04 +0200 Subject: Add Slack, Discord, Spotify, teams-for-linux, and Claude Code Provisions these via home-manager, scoping unfree-package access to exactly these packages and skipping any that aren't available for the current system/architecture (e.g. aarch64-linux lacks Discord/Spotify builds) instead of failing evaluation. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01BBSd4VBfoKHjE1HR3P8kmn --- lib/mkHome.nix | 9 ++++++++- lib/mkNixos.nix | 7 +++++++ lib/unfree-allowlist.nix | 6 ++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 lib/unfree-allowlist.nix (limited to 'lib') diff --git a/lib/mkHome.nix b/lib/mkHome.nix index db85b86..ab27981 100644 --- a/lib/mkHome.nix +++ b/lib/mkHome.nix @@ -1,6 +1,13 @@ { inputs }: { username, system, extraModules ? [ ] }: +let + unfreeAllowlist = import ./unfree-allowlist.nix; +in inputs.home-manager.lib.homeManagerConfiguration { - pkgs = inputs.nixpkgs.legacyPackages.${system}; + pkgs = import inputs.nixpkgs { + inherit system; + config.allowUnfreePredicate = pkg: + builtins.elem (inputs.nixpkgs.lib.getName pkg) unfreeAllowlist; + }; modules = [ ../users/${username}.nix ] ++ extraModules; } diff --git a/lib/mkNixos.nix b/lib/mkNixos.nix index 5f1d8ac..a058dfc 100644 --- a/lib/mkNixos.nix +++ b/lib/mkNixos.nix @@ -1,9 +1,16 @@ { inputs }: { hostname, system ? "x86_64-linux", users ? [ "tom" ], extraModules ? [ ] }: +let + unfreeAllowlist = import ./unfree-allowlist.nix; +in inputs.nixpkgs.lib.nixosSystem { inherit system; specialArgs = { inherit inputs; }; modules = [ + { + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (inputs.nixpkgs.lib.getName pkg) unfreeAllowlist; + } ../modules/nixos/common.nix ../hosts/${hostname}/configuration.nix inputs.home-manager.nixosModules.home-manager diff --git a/lib/unfree-allowlist.nix b/lib/unfree-allowlist.nix new file mode 100644 index 0000000..fb84c52 --- /dev/null +++ b/lib/unfree-allowlist.nix @@ -0,0 +1,6 @@ +[ + "slack" + "discord" + "spotify" + "claude-code" +] -- cgit v1.3