From 1647556eb0b15b3dd1ea83ae372c81e547fb1343 Mon Sep 17 00:00:00 2001 From: rhiannon morris Date: Wed, 2 Apr 2025 19:08:27 +0200 Subject: [PATCH] more fixes that only surface when used lol --- flake.nix | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index 2244c01..0adab0e 100644 --- a/flake.nix +++ b/flake.nix @@ -23,10 +23,15 @@ ]; - makeApp = pkgs: name: exe: - { type = "app"; program = "${pkgs.${name}}/bin/${defaultTo name exe}"; }; + makeApp = pkgs: name: exe: { + inherit name; + value = { + type = "app"; + program = "${pkgs.${name}}/bin/${defaultTo name exe}"; + }; + }; - linuxApps = pkgs: [ + linuxApps = pkgs: builtins.listToAttrs [ (makeApp pkgs "basilisk" null) (makeApp pkgs "isabelle" null) (makeApp pkgs "firefox-esr-alias" "firefox-esr") @@ -34,15 +39,16 @@ ]; - ifLinux64 = f: pkgs: optionalAttrs (pkgs.system == "x86_64-linux") (f pkgs); + ifLinux64 = sys: optionalAttrs (sys == "x86_64-linux"); - mkPackages = pkgs: - ifLinux64 linuxPackages pkgs // crossPlatformPackages pkgs // fonts pkgs; + mkPackages = sys: pkgs: + ifLinux64 sys (linuxPackages pkgs) // + crossPlatformPackages pkgs // fonts pkgs; - mkApps = pkgs: ifLinux64 linuxApps pkgs; + mkApps = sys: pkgs: ifLinux64 sys (linuxApps pkgs); in { - packages = forAllSystems (sys: mkPackages nixpkgs.legacyPackages.${sys}); - apps = forAllSystems (sys: mkApps nixpkgs.legacyPackages.${sys}); - overlays = forAllSystems (sys: final: prev: mkApps final); + packages = forAllSystems (sys: mkPackages sys nixpkgs.legacyPackages.${sys}); + apps = forAllSystems (sys: mkApps sys nixpkgs.legacyPackages.${sys}); + overlays = forAllSystems (sys: final: prev: mkPackages sys final); }; }