Skip to content

Commit b7c90c8

Browse files
Cleanup unused
Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
1 parent 9fcf786 commit b7c90c8

File tree

4 files changed

+2
-127
lines changed

4 files changed

+2
-127
lines changed

docs/default.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,8 @@ runCommandLocal "ghaf-doc"
4343
# set the package Meta info
4444
meta = {
4545
description = "Ghaf Documentation";
46-
# TODO should we Only push docs from one Architecture?
4746
platforms = [
4847
"x86_64-linux"
49-
"aarch64-linux"
5048
];
5149
};
5250
}

hydrajobs/flake-module.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ in
2929
intel-vm-debug.x86_64-linux = self.packages.x86_64-linux.vm-debug;
3030
nxp-imx8mp-evk-debug.x86_64-linux = self.packages.aarch64-linux.nxp-imx8mp-evk-debug;
3131
docs.x86_64-linux = self.packages.x86_64-linux.doc;
32-
docs.aarch64-linux = self.packages.aarch64-linux.doc;
3332
# Build cross-compiled images
3433
nvidia-jetson-orin-agx-debug-from-x86_64.x86_64-linux =
3534
self.packages.x86_64-linux.nvidia-jetson-orin-agx-debug-from-x86_64;

lib.nix

Lines changed: 2 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ let
99
inherit (inputs) nixpkgs;
1010
in
1111
nixpkgs.lib.extend (
12-
lib: _:
13-
# some utils for importing trees
14-
rec {
12+
lib: _: {
1513
/*
1614
*
1715
Filters Nix packages based on the target system platform.
@@ -38,6 +36,7 @@ nixpkgs.lib.extend (
3836
- [system] Target system platform (e.g., "x86_64-linux").
3937
- [pkgsSet] a set of Nix packages.
4038
*/
39+
# TODO should this be replaced with flake-parts pkgs-by-name
4140
platformPkgs =
4241
system:
4342
lib.filterAttrs (
@@ -54,113 +53,5 @@ nixpkgs.lib.extend (
5453
in
5554
lib.elem system platforms
5655
);
57-
58-
/*
59-
*
60-
Flattens a _tree_ of the shape that is produced by rakeLeaves.
61-
An attrset with names in the spirit of the Reverse DNS Notation form
62-
that fully preserve information about grouping from nesting.
63-
64-
# Example
65-
66-
```
67-
flattenTree {
68-
a = {
69-
b = {
70-
c = <path>;
71-
};
72-
};
73-
}
74-
=> { "a.b.c" = <path>; }
75-
```
76-
*/
77-
flattenTree =
78-
tree:
79-
let
80-
op =
81-
sum: path: val:
82-
let
83-
pathStr = builtins.concatStringsSep "." path; # dot-based reverse DNS notation
84-
in
85-
if builtins.isPath val then
86-
# builtins.trace "${toString val} is a path"
87-
(sum // { "${pathStr}" = val; })
88-
else if builtins.isAttrs val then
89-
# builtins.trace "${builtins.toJSON val} is an attrset"
90-
# recurse into that attribute set
91-
(recurse sum path val)
92-
else
93-
# ignore that value
94-
# builtins.trace "${toString path} is something else"
95-
sum;
96-
97-
recurse =
98-
sum: path: val:
99-
builtins.foldl' (sum: key: op sum (path ++ [ key ]) val.${key}) sum (builtins.attrNames val);
100-
in
101-
recurse { } [ ] tree;
102-
103-
/*
104-
*
105-
Recursively collect the nix files of _path_ into attrs.
106-
Return an attribute set where all `.nix` files and directories with `default.nix` in them
107-
are mapped to keys that are either the file with .nix stripped or the folder name.
108-
All other directories are recursed further into nested attribute sets with the same format.
109-
110-
# Example
111-
112-
Example file structure:
113-
114-
```
115-
./core/default.nix
116-
./base.nix
117-
./main/dev.nix
118-
./main/os/default.nix
119-
```
120-
121-
```nix
122-
rakeLeaves .
123-
=> {
124-
core = ./core;
125-
base = base.nix;
126-
main = {
127-
dev = ./main/dev.nix;
128-
os = ./main/os;
129-
};
130-
}
131-
```
132-
*/
133-
134-
rakeLeaves =
135-
dirPath:
136-
let
137-
seive =
138-
file: type:
139-
# Only rake `.nix` files or directories
140-
(type == "regular" && lib.hasSuffix ".nix" file) || (type == "directory");
141-
142-
collect = file: type: {
143-
name = lib.removeSuffix ".nix" file;
144-
value =
145-
let
146-
path = dirPath + "/${file}";
147-
in
148-
if (type == "regular") || (type == "directory" && builtins.pathExists (path + "/default.nix")) then
149-
path
150-
# recurse on directories that don't contain a `default.nix`
151-
else
152-
rakeLeaves path;
153-
};
154-
155-
files = lib.filterAttrs seive (builtins.readDir dirPath);
156-
in
157-
lib.filterAttrs (_n: v: v != { }) (lib.mapAttrs' collect files);
158-
159-
importLeaves =
160-
#
161-
# Create an import stanza by recursing a directory to find all default.nix and <file.nix>
162-
# files beneath withough manually having to list all the subsequent files.
163-
#
164-
path: builtins.attrValues (lib.mapAttrs (_: import) (rakeLeaves path));
16556
}
16657
)

lib/ghaf-modules.nix

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)