diff --git a/lib/makes.nix b/lib/makes.nix new file mode 100644 index 0000000..bb0986e --- /dev/null +++ b/lib/makes.nix @@ -0,0 +1,16 @@ +{ inputs }: +let + l = inputs.nixpkgs.lib // builtins; + inherit (inputs) nixpkgs makes; +in +l.fix ( + l.extends + (_: _: { + inherit inputs; + inherit (nixpkgs) system; + __nixpkgs__ = nixpkgs; + __nixpkgsSrc__ = nixpkgs.path; + }) + (import (makes + /src/args/agnostic.nix) { inherit (nixpkgs) system; }) + .__unfix__ +) diff --git a/local/lock/flake.lock b/local/lock/flake.lock index ef8ab20..fd46b0d 100644 --- a/local/lock/flake.lock +++ b/local/lock/flake.lock @@ -82,6 +82,22 @@ "type": "github" } }, + "makes": { + "flake": false, + "locked": { + "lastModified": 1696868671, + "narHash": "sha256-4SGTcJ+E3wZXhtcvxZROCGam7371THcPYtmdyV9JzVo=", + "owner": "fluidattacks", + "repo": "makes", + "rev": "380ecfa979898ab283874ca44f76a75a551834b6", + "type": "github" + }, + "original": { + "owner": "fluidattacks", + "repo": "makes", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1696879762, @@ -104,6 +120,7 @@ "devshell": "devshell", "fenix": "fenix", "home-manager": "home-manager", + "makes": "makes", "nixpkgs": "nixpkgs", "srvos": "srvos" } diff --git a/local/lock/flake.nix b/local/lock/flake.nix index 4cd5b41..add744b 100644 --- a/local/lock/flake.nix +++ b/local/lock/flake.nix @@ -17,6 +17,9 @@ fenix.url = "github:nix-community/fenix"; fenix.inputs.nixpkgs.follows = "nixpkgs"; + + makes.url = "github:fluidattacks/makes"; + makes.flake = false; }; outputs = _: { }; } diff --git a/tests/_snapshots/makes b/tests/_snapshots/makes new file mode 100644 index 0000000..f785e80 --- /dev/null +++ b/tests/_snapshots/makes @@ -0,0 +1,4 @@ +#pretty +{ + makeScript = ; +} \ No newline at end of file diff --git a/tests/makes/expr.nix b/tests/makes/expr.nix new file mode 100644 index 0000000..b7e7d4b --- /dev/null +++ b/tests/makes/expr.nix @@ -0,0 +1,20 @@ +{ omnibus, lib }: +let + inherit (omnibus.__inputs__) nixpkgs makes; + makesLib = + (omnibus.pops.lib.addLoadExtender { + load = { + inputs = { + inputs = { + nixpkgs = nixpkgs.legacyPackages.x86_64-linux; + inherit makes; + }; + }; + }; + }).layouts.default.makes; + + inherit (makesLib) makeScript; +in +{ + makeScript = makeScript; +} diff --git a/tests/makes/format.nix b/tests/makes/format.nix new file mode 100644 index 0000000..f9e1770 --- /dev/null +++ b/tests/makes/format.nix @@ -0,0 +1 @@ +"pretty"