From ea44ab432f9a38b79aa2dc8b17b10681b252d232 Mon Sep 17 00:00:00 2001 From: Xaiya Schumin Date: Wed, 20 May 2026 11:31:33 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fixed=20handling=20of=20unfree?= =?UTF-8?q?=20packages=20in=20flake?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Xaiya Schumin --- flake.nix | 45 +++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/flake.nix b/flake.nix index e1f9343..bdac145 100644 --- a/flake.nix +++ b/flake.nix @@ -1,37 +1,30 @@ { description = "Xaiya's packaged packages"; - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - }; + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; outputs = { self, nixpkgs }: let - inherit (nixpkgs) lib; + systems = nixpkgs.lib.systems.flakeExposed; - eachSystem = - systems: fn: - lib.foldl' ( - acc: system: lib.recursiveUpdate acc (lib.mapAttrs (_: value: { ${system} = value; }) (fn system)) - ) { } systems; + forAllSystems = + function: + nixpkgs.lib.genAttrs systems ( + system: function ( + import nixpkgs { + inherit system; + config.allowUnfree = true; + } + ) + ); + in { + packages = forAllSystems (pkgs: { + discord-music-presence = pkgs.callPackage ./pkgs/discord-music-presence.nix { }; + }); - systems = lib.systems.flakeExposed; - in - eachSystem systems ( - system: - let - pkgs = nixpkgs.legacyPackages.${system}; - in - { - # TODO: add logic for packages - packages = { - discord-music-presence = pkgs.callPackage ./pkgs/discord-music-presence.nix { }; - }; - - devShells = { + devShells = forAllSystems (pkgs: { default = pkgs.callPackage ./shell.nix { }; - }; - } - ); + }); + }; }