`inputs.self` has no `outPath` attribute
AFAIU, flakes generate self.outPath by using either "${dirOf ./flake.nix}" or fetch[Git|Mercurial] (dirOf ./flake.nix) (or analogies of such). Would it be possible/make sense for with-inputs to add this?
I don't currently have much access to my laptop, but I'd be surprised if we did not have self.outPath, can you verify and a failing test ? We should have a test that checks self.outPath is present, if that is not currently the case, PR is very welcome :)
wdym surprised? currently with-inputs isn't even supposed to resolve self as a flake, only outputs top-level with separate outputs and inputs: https://github.com/denful/with-inputs/blob/dae6b8126fe613bfe12185d94d593db426a34daa/with-inputs.nix#L146-L150
funnily enough, the workaround is to set a top-level output outPath = ./.;; or, in flake-parts:
options.flake.outPath = inputs.nixpkgs.lib.mkOption {
type = inputs.nixpkgs.lib.types.path;
default = ./.;
};
Fix (at least for the from.* api cases) in https://github.com/denful/with-inputs/pull/18.
nix-repl> nixosConfigurations.jetpure.config.home-manager.extraSpecialArgs.self
{
_type = "flake";
allSystems = { ... };
apps = { ... };
checks = { ... };
currentSystem = { ... };
debug = { ... };
denful = { ... };
devShells = { ... };
diskoConfigurations = { ... };
formatter = { ... };
inputs = { ... };
legacyPackages = { ... };
modules = { ... };
nixosConfigurations = { ... };
nixosModules = «repeated»;
outputs = { ... };
overlays = «repeated»;
packages = { ... };
}
{
self,
inputs,
...
}:
{
zen.miscellaneous.home-manager = {
os =
{
...
}:
{
home-manager.extraSpecialArgs = {
inherit
self
inputs
;
};
};
};
}
also, how to make self alike in flake?
for this works
nix-repl> "${outputs.inputs.self}"
error:
… while evaluating a path segment
at «string»:1:2:
1| "${outputs.inputs.self}"
| ^
error: cannot coerce a set to a string: { _type = "flake"; allSystems = { x86_64-linux = «thunk»; }; apps = { x86_64-linux = «thunk»; }; checks = { x86_64-linux = «thunk»; }; currentSystem = { _module = «thunk»; allModuleArgs = «thunk»; apps = «thunk»; «9 attributes elided» }; «13 attributes elided» }
Fixed at #23 please use latest main.