Skip to content

Commit

Permalink
refactor(pops.std): imporve the UX
Browse files Browse the repository at this point in the history
  • Loading branch information
GTrunSec committed Jan 8, 2024
1 parent be1d4b4 commit 114e9a4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 29 deletions.
10 changes: 1 addition & 9 deletions src/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,7 @@ let
in
flops.lib.haumea.pops.default.setInit {
src = ./.;
transformer = [
(
cursor: dir:
if (builtins.length cursor == 0 && (dir ? default)) then
removeAttrs dir [ "default" ]
else
dir
)
];
transformer = [ (import ./lib/haumea/removeTopDefault.nix { }) ];
inputs = {
lib = (nixlib.lib.recursiveUpdate nixlib.lib inputs.self.lib) // builtins;
haumea = haumea.lib;
Expand Down
5 changes: 2 additions & 3 deletions src/lib/haumea/removeTopDefault.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{ lib }:
cursor: dir:
if (lib.length cursor == 0 && (dir ? default)) then
_: cursor: dir:
if (builtins.length cursor == 0 && (dir ? default)) then
removeAttrs dir [ "default" ]
else
dir
2 changes: 1 addition & 1 deletion units/std/defaultCellsFrom/dev/packages.nix
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cell.pops.packages.exports.derivations
cell.pops.packages.exports.derivations or { }
2 changes: 1 addition & 1 deletion units/std/defaultCellsFrom/prod/packages.nix
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cell.pops.packages.exports.derivations
cell.pops.packages.exports.derivations or { }
35 changes: 20 additions & 15 deletions units/std/mkContent.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,28 @@ recursiveMerge [
"aarch64-linux"
"x86_64-linux"
];
cellBlocks = with std.blockTypes; [
(data "configs")
(data "data")
(installables "packages" { ci.build = true; })
# runnables
(runnables "scripts")
(runnables "tasks")
cellBlocks =
with std.blockTypes;
let
functions' = name: (functions name) // { cli = false; };
in
[
(data "configs")
(data "data")
(installables "packages" { ci.build = true; })
# runnables
(runnables "scripts")
(runnables "tasks")

(functions "devshellProfiles")
(devshells "shells")
(super.blockTypes.jupyenv "jupyenv")
(functions' "devshellProfiles")
(devshells "shells")
(super.blockTypes.jupyenv "jupyenv")

(nixago "nixago")
(containers "containers" { ci.publish = true; })
(functions "lib")
(functions "pops")
];
(nixago "nixago")
(containers "containers" { ci.publish = true; })
(functions' "lib")
(functions' "pops")
];
}
(lib.removeAttrs top [ "projectRoot" ])
]

0 comments on commit 114e9a4

Please sign in to comment.