diff --git a/example/flake.nix b/example/flake.nix index fb1cdb6..0ca9829 100644 --- a/example/flake.nix +++ b/example/flake.nix @@ -9,8 +9,8 @@ packages.x86_64-linux.default = let pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; - tf2pkgs = inputs.tf2-nix.packages.x86_64-linux; - in tf2pkgs.mergeTf2Configs (with tf2pkgs; [ + tf2Pkgs = inputs.tf2-nix.lib.mkTf2Pkgs { inherit pkgs; }; + in tf2Pkgs.mergeTf2Configs (with tf2Pkgs; [ mastercomfig.presets.medium-low mastercomfig.addons.flat-mouse mastercomfig.addons.no-tutorial diff --git a/flake.nix b/flake.nix index 5ed8770..81f054a 100644 --- a/flake.nix +++ b/flake.nix @@ -7,13 +7,17 @@ }; outputs = { self, ... }@inputs: + let + # keep it as an attrset arg for future expandability + mkTf2Pkgs = { pkgs }: import ./tf2/packages { inherit pkgs; }; + in inputs.flake-utils.lib.eachDefaultSystem (system: let pkgs = import inputs.nixpkgs { inherit system; }; - lib = pkgs.lib; in { - legacyPackages = import ./tf2/packages { - inherit pkgs lib; - }; - }); + legacyPackages = mkTf2Pkgs pkgs; + }) + // { + lib = { inherit mkTf2Pkgs; }; + }; } diff --git a/tf2/packages/default.nix b/tf2/packages/default.nix index fe4003d..7ab0e1b 100644 --- a/tf2/packages/default.nix +++ b/tf2/packages/default.nix @@ -1,6 +1,8 @@ -{ pkgs, lib }: +{ pkgs }: let + inherit (pkgs) lib; + mkTf2Config = pkgs.callPackage ../mkTf2Config.nix {}; fetchFromGameBanana =