aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGravatar Tom van der Lee <tom@vanderlee.io>2026-09-21 15:57:04 +0200
committerGravatar Tom van der Lee <tom@vanderlee.io>2026-09-21 15:57:04 +0200
commitc3f882fae8f4c1ae84deafc310357846e8b66ad1 (patch)
tree7d8e9fac29bec584fb39283c41d0d73632fb01e8 /lib
parenta6e0ae7b4eb877d0c22ae84ee55d6a85618ca4c1 (diff)
downloaddesktop-flake-c3f882fae8f4c1ae84deafc310357846e8b66ad1.tar.gz
desktop-flake-c3f882fae8f4c1ae84deafc310357846e8b66ad1.tar.bz2
desktop-flake-c3f882fae8f4c1ae84deafc310357846e8b66ad1.zip
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BBSd4VBfoKHjE1HR3P8kmn
Diffstat (limited to 'lib')
-rw-r--r--lib/mkHome.nix9
-rw-r--r--lib/mkNixos.nix7
-rw-r--r--lib/unfree-allowlist.nix6
3 files changed, 21 insertions, 1 deletions
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 @@
1{ inputs }: 1{ inputs }:
2{ username, system, extraModules ? [ ] }: 2{ username, system, extraModules ? [ ] }:
3let
4 unfreeAllowlist = import ./unfree-allowlist.nix;
5in
3inputs.home-manager.lib.homeManagerConfiguration { 6inputs.home-manager.lib.homeManagerConfiguration {
4 pkgs = inputs.nixpkgs.legacyPackages.${system}; 7 pkgs = import inputs.nixpkgs {
8 inherit system;
9 config.allowUnfreePredicate = pkg:
10 builtins.elem (inputs.nixpkgs.lib.getName pkg) unfreeAllowlist;
11 };
5 modules = [ ../users/${username}.nix ] ++ extraModules; 12 modules = [ ../users/${username}.nix ] ++ extraModules;
6} 13}
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 @@
1{ inputs }: 1{ inputs }:
2{ hostname, system ? "x86_64-linux", users ? [ "tom" ], extraModules ? [ ] }: 2{ hostname, system ? "x86_64-linux", users ? [ "tom" ], extraModules ? [ ] }:
3let
4 unfreeAllowlist = import ./unfree-allowlist.nix;
5in
3inputs.nixpkgs.lib.nixosSystem { 6inputs.nixpkgs.lib.nixosSystem {
4 inherit system; 7 inherit system;
5 specialArgs = { inherit inputs; }; 8 specialArgs = { inherit inputs; };
6 modules = [ 9 modules = [
10 {
11 nixpkgs.config.allowUnfreePredicate = pkg:
12 builtins.elem (inputs.nixpkgs.lib.getName pkg) unfreeAllowlist;
13 }
7 ../modules/nixos/common.nix 14 ../modules/nixos/common.nix
8 ../hosts/${hostname}/configuration.nix 15 ../hosts/${hostname}/configuration.nix
9 inputs.home-manager.nixosModules.home-manager 16 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 @@
1[
2 "slack"
3 "discord"
4 "spotify"
5 "claude-code"
6]