diff --git a/inputs.nix b/inputs/default.nix similarity index 97% rename from inputs.nix rename to inputs/default.nix index 7647cab1..9885a83b 100644 --- a/inputs.nix +++ b/inputs/default.nix @@ -1,5 +1,5 @@ let - inherit (import ./lib {}) mkDep mkInput mkHyprDep mkSrc; + inherit (import ./lib.nix) mkDep mkInput mkHyprDep mkSrc; inherit (builtins) listToAttrs map removeAttrs; # Inputs @@ -180,6 +180,13 @@ let }; }; + bbsteamieInputs = { + jovian = mkDep { + owner = "Jovian-Experiments"; + repo = "Jovian-NixOS"; + }; + }; + srcs = [ # Home-assistant ## Components @@ -368,7 +375,7 @@ let in { inherit mkDep mkInput mkSrc; - otherInputs = + extraInputs = { flakegen = { url = "github:jorsn/flakegen"; @@ -381,6 +388,7 @@ in { // clusterInputs // serviviInputs // nosInputs + // bbsteamieInputs // desktopInputs.hyprlandInputs // desktopInputs.agsInputs // (listToAttrs (map (x: { diff --git a/lib/inputs.nix b/inputs/lib.nix similarity index 62% rename from lib/inputs.nix rename to inputs/lib.nix index 253fa9c4..e3eb2105 100644 --- a/lib/inputs.nix +++ b/inputs/lib.nix @@ -1,17 +1,23 @@ -lib: lock: let +let + inherit (builtins) fetchTarball fromJSON readFile removeAttrs; + + lock = fromJSON (readFile ../flake.lock); + lib = import "${fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/${lock.nodes.nixpkgs.locked.rev}.tar.gz"; + sha256 = lock.nodes.nixpkgs.locked.narHash; + }}/lib"; + inherit (lib) attrValues findFirst foldl' hasAttr matchAttrs optionalAttrs recursiveUpdate; - inherit (builtins) removeAttrs; recursiveUpdateList = list: foldl' recursiveUpdate {} list; in rec { /* + * From an attrset, returns a flake input that has its type defaulted + * to `github` and has some of its inputs following this flake's input + * of the same name. * - From an attrset, returns a flake input that has its type defaulted - to `github` and has some of its inputs following this flake's input - of the same name. - - It gets information from the `flake.lock` file and can be used thanks - to flakegen + * It gets information from the `flake.lock` file and can be used thanks + * to flakegen */ mkInput = {type ? "github", ...} @ info: let input = diff --git a/lib/default.nix b/lib/default.nix index 6d5ebb63..16d4ffcc 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -16,6 +16,5 @@ capitalise = str: (toUpper (substring 0 1 str) + (concatStringsSep "" (tail (stringToCharacters str)))); in {inherit lib mkVersion capitalise;} - // (import ./inputs.nix lib lock) // optionalAttrs (inputs != {}) (import ./flake-lib.nix inputs) // optionalAttrs (pkgs != {}) (import ./pkgs.nix {inherit pkgs mkVersion capitalise self;}) diff --git a/outputs.nix b/outputs.nix index a274e19b..bc4a3c74 100644 --- a/outputs.nix +++ b/outputs.nix @@ -1,6 +1,6 @@ { inputs = let - inherit (import ./inputs.nix) mkDep mkInput otherInputs; + inherit (import ./inputs) mkDep mkInput extraInputs; mainInputs = { systems = mkInput { @@ -37,14 +37,9 @@ inputs.sops-nix.follows = "sops-nix"; }; - - jovian = mkDep { - owner = "Jovian-Experiments"; - repo = "Jovian-NixOS"; - }; }; in - mainInputs // otherInputs; + mainInputs // extraInputs; outputs = inputs @ { nixpkgs,