Skip to content

Commit

Permalink
chore: clean path
Browse files Browse the repository at this point in the history
  • Loading branch information
GTrunSec committed Oct 17, 2023
1 parent dd2aeb1 commit 8e985bc
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 68 deletions.
34 changes: 0 additions & 34 deletions src/__lib/__lock/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/__lib/__lock/flake.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{
inputs = {
nosys.url = "github:divnix/nosys";
flake-compat = {
url = "github:gtrunsec/flake-compat/lockFile";
flake = false;
};
call-flake.url = "github:divnix/call-flake";
};
outputs = _: { };
}
10 changes: 0 additions & 10 deletions src/__lib/call-flake-override.nix

This file was deleted.

31 changes: 16 additions & 15 deletions src/flake/pops.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,36 @@ let
mergeToDepth
foldl
filter
call-flake-override
deSystemize
;

__inputs__ = (call-flake ../__lib/__lock).inputs;
in
{
inputsExtender = pop {
defaults = {
initInputs = { };
inputs = { };
sysInputs = { };
overrideInputs = { };
initFlake = {
inputs = { };
outputs = { };
};
};
extension = self: super: {
setInitInputs =
(
initInputs:
extendPop self (
self: super: {
initInputs =
initFlake =
if (lib.isPath initInputs || lib.isString initInputs) then
call-flake-override initInputs self.overrideInputs
call-flake initInputs
else if lib.hasAttr "outPath" initInputs then
call-flake-override initInputs.outPath self.overrideInputs
call-flake initInputs.outPath
else
initInputs
super.initFlake
;
initInputs =
if self.initFlake == { } then initInputs else self.initFlake.inputs;
}
)
);
Expand Down Expand Up @@ -100,9 +103,7 @@ in
extension =
self: super:
let
deSysInputs =
mapAttrs (_: input: __inputs__.nosys.lib.deSys self.system input)
extendedInputs;
deSysInputs = mapAttrs (_: input: deSystemize self.system input) extendedInputs;

extendedInputs =
foldl
Expand Down Expand Up @@ -244,11 +245,11 @@ in
)
(
systems:
foldl (attrs: system: mergeToDepth 3 attrs (self.outputsForSystem system)) { }
systems
lib.recursiveUpdate self.initFlake.outputs (
foldl (attrs: system: mergeToDepth 3 attrs (self.outputsForSystem system)) { }
systems
)
);

outputs = self.inputs;
};
};
}
2 changes: 1 addition & 1 deletion src/haumea/pops.nix
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ let
if (extender ? setInit) then
(extender.setInit self.initLoad).load
else
extender.load
extender.load or { }
;
in
l.recursiveMerge ([
Expand Down
2 changes: 1 addition & 1 deletion tests/_snapshots/flake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
};
};
};
outputs = {
inputs = {
flake-compat = {
lastModified = 1683211519;
lastModifiedDate = "20230504144519";
Expand Down
4 changes: 2 additions & 2 deletions tests/flake/expr.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ let
))
]
)
).outputs;
).inputs;
in
{
exampleFlake = exampleFlake.outputs exampleFlake.inputs;
outputs = outputs ./__lock;
inputs = outputs ./__lock;
}

0 comments on commit 8e985bc

Please sign in to comment.