From 567b3e5e9439c05f8b9383ef688ec680c9764a3b Mon Sep 17 00:00:00 2001 From: Ivan Porto Wigner <47715589+iivvaannxx@users.noreply.github.com> Date: Sat, 2 Sep 2023 00:20:14 +0200 Subject: [PATCH] Testing with custom flake packages. --- flake.nix | 3 +++ packages/default.nix | 18 ++++++++++++++++++ packages/scripts/json2nix.nix | 8 ++++++++ 3 files changed, 29 insertions(+) create mode 100644 packages/default.nix create mode 100644 packages/scripts/json2nix.nix diff --git a/flake.nix b/flake.nix index 0121840..ffdba86 100644 --- a/flake.nix +++ b/flake.nix @@ -52,6 +52,9 @@ # Allow unfree packages. _module.args.pkgs = lib.custom.mkUnfreePkgs nixpkgs { inherit system; }; _module.args.upkgs = lib.custom.mkUnfreePkgs unstablepkgs { inherit system; }; + + # Import all the custom packages. + # packages = import ./packages args; }; flake = { diff --git a/packages/default.nix b/packages/default.nix new file mode 100644 index 0000000..b67e00e --- /dev/null +++ b/packages/default.nix @@ -0,0 +1,18 @@ +{ lib, pkgs, ... } @ args: let + + inherit (builtins) baseNameOf; + inherit (lib.custom) mapModulesRecursive; + + # Contains all the paths to each package. + currentPath = ./.; + importPackage = path: let + + packageName = baseNameOf path; + package = pkgs.callPackage "${currentPath}/${path}" { }; + + in { "${packageName}" = package; }; + + # All the custom defined packages. + allPackages = mapModulesRecursive currentPath importPackage; + +in allPackages diff --git a/packages/scripts/json2nix.nix b/packages/scripts/json2nix.nix new file mode 100644 index 0000000..ac3516b --- /dev/null +++ b/packages/scripts/json2nix.nix @@ -0,0 +1,8 @@ +{ pkgs, lib, ... } @ args: let + + + +in pkgs.writeShellScriptBin "json2nix" '' + + echo "JSON2NIX!!!" +'' \ No newline at end of file