-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
241 additions
and
76 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
{ lib, flops }: | ||
# let | ||
# # Helper function to collect outPath attributes recursively | ||
# collectPaths = | ||
# input: | ||
# lib.concatMap | ||
# ( | ||
# attr: | ||
# let | ||
# # Check for outPath or sourceInfo.outPath and collect if present | ||
# paths = | ||
# if lib.isAttrs attr then | ||
# if attr ? outPath then | ||
# [ attr.outPath ] | ||
# else if attr ? sourceInfo && attr.sourceInfo ? outPath then | ||
# [ attr.sourceInfo.outPath ] | ||
# else | ||
# [ ] | ||
# else | ||
# [ ]; | ||
# # Recursively collect paths from nested inputs if they exist | ||
# nestedPaths = | ||
# if lib.isAttrs attr && attr ? inputs then collectPaths attr.inputs else [ ]; | ||
# in | ||
# paths ++ nestedPaths | ||
# ) | ||
# (lib.attrValues input); | ||
# # Main function to collect outPath attributes from all inputs | ||
# inputsToPaths = inputs: lib.flatten (collectPaths inputs); | ||
# in | ||
# # Example usage | ||
# inputsToPaths | ||
inputs: | ||
let | ||
l = lib; | ||
|
||
extractAttrsFromInputs = | ||
inputs: | ||
l.pipe inputs [ | ||
(l.filterAttrs (_: v: l.isAttrs v && (v ? sourceInfo.outPath || v ? outPath))) | ||
(l.mapAttrs (_: v: v.sourceInfo.outPath or v.outPath or v.path)) | ||
(l.mapAttrs (_: v: toString v)) | ||
]; | ||
|
||
attrsToPaths = i: lib.attrValues (extractAttrsFromInputs i); | ||
|
||
inherit (flops) recursiveMerge; | ||
updatedInputs = (recursiveMerge (l.flatten [ inputs ])); | ||
in | ||
l.pipe updatedInputs [ | ||
( | ||
v: | ||
map (x: if v.${x} ? inputs then attrsToPaths v.${x}.inputs else attrsToPaths v) | ||
(l.attrNames (extractAttrsFromInputs v)) | ||
) | ||
l.flatten | ||
l.unique | ||
] | ||
++ attrsToPaths updatedInputs # extractPaths From the top level inputs | ||
/* inputsToPaths { | ||
b = { | ||
inputs = { | ||
d = { | ||
outPath = "<PATH-b.d>"; | ||
}; | ||
f = { | ||
outPath = "<PATH-b.f>"; | ||
}; | ||
}; | ||
outPath = "<PATH-b>"; | ||
}; | ||
a = { | ||
inputs = { | ||
b = { | ||
outPath = "<PATH-a.b>"; | ||
}; | ||
c = { | ||
outPath = "<PATH-a.c>"; | ||
}; | ||
}; | ||
outPath = "<PATH-a>"; | ||
}; | ||
} | ||
=> | ||
[ "<PATH-a>" "<PATH-a.b>" "<PATH-a.c>" "<PATH-b>" "<PATH-b.d>" "<PATH-b.f>" ] | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
inputs.self.pops.self.load.inputs | ||
// { | ||
omnibus = | ||
(lib.recursiveUpdate root { pops.self = inputs.self.pops.self; }) | ||
// root.flakeOutputs; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
flops.haumea.pops.default.setInit { | ||
src = projectDir + "/units/configs"; | ||
inputs = root.loaderInputs; | ||
inputs = root.lib.loaderInputs; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
flops.haumea.pops.default.setInit { | ||
src = projectDir + "/units/nixos/homeModules"; | ||
type = "nixosModules"; | ||
inputs = root.loaderInputs; | ||
inputs = root.lib.loaderInputs; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
flops, | ||
omnibus, | ||
haumea, | ||
root, | ||
}: | ||
let | ||
inherit (flops) recursiveMerge'; | ||
in | ||
load: | ||
(flops.haumea.pops.default.setInit ( | ||
recursiveMerge' [ | ||
{ | ||
loader = with haumea; [ (matchers.nix loaders.scoped) ]; | ||
inputs = root.lib.loaderInputs; | ||
} | ||
load | ||
] | ||
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
flops.haumea.pops.default.setInit { | ||
src = projectDir + "/units/nixos/nixosModules"; | ||
type = "nixosModules"; | ||
inputs = root.loaderInputs; | ||
inputs = root.lib.loaderInputs; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
let | ||
inherit (inputs) nixpkgs; | ||
inherit (root.ops) makes; | ||
inherit (makes) makeScript makeEnvVars; | ||
in | ||
(super.load { | ||
inputs = | ||
{ | ||
inherit | ||
nixpkgs | ||
makes | ||
makeScript | ||
makeEnvVars | ||
; | ||
} | ||
// lib.optionalAttrs (inputs ? climod) { | ||
climod = nixpkgs.callPackage inputs.climod { pkgs = nixpkgs; }; | ||
}; | ||
loader = with haumea; [ (matchers.nix loaders.scoped) ]; | ||
transformer = [ (_cursor: dir: if dir ? default then dir.default else dir) ]; | ||
}) | ||
|
||
/* (matchers.regex "^(default)\\.(nix)" ( | ||
_: _: path: | ||
let | ||
getDir = (list: builtins.elemAt list ((builtins.length list) - 3)) ( | ||
l.split "/" path | ||
); | ||
in | ||
( | ||
if l.hasPrefix "makes-" getDir then | ||
(scopedImport | ||
( | ||
self.load.inputs | ||
// { | ||
# inherit (self.initLoad.inputs.makes) makeEnvVars; | ||
makeEnvVars = self: self; | ||
} | ||
) | ||
path | ||
) | ||
else | ||
{ } | ||
) | ||
)) | ||
*/ |
File renamed without changes.
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.