Skip to content

Commit

Permalink
refactor: use findTargets for lib.dev
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Sep 15, 2023
1 parent e9a5684 commit 37eed5c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 37 deletions.
25 changes: 0 additions & 25 deletions src/lib/dev.nix

This file was deleted.

7 changes: 7 additions & 0 deletions src/lib/dev/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let
inherit (inputs.std) findTargets;
in
findTargets {
inherit inputs cell;
block = ./.;
}
13 changes: 8 additions & 5 deletions src/lib/dev/mkArion.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
inputs,
l,
cell,
}: let
inherit (inputs) arion nixpkgs;
inherit (inputs.cells.std.errors) requireInput;
inherit (requireInput "makes" "github:fluidattacks/makes" "std.lib.dev.mkMakes") arion nixpkgs;

inherit (nixpkgs) lib;

disabledNotice = ''
divnix/std disabled arion's nixos instrumentation.
Expand All @@ -29,9 +32,9 @@
(arion + /src/nix/service/nixos-init.nix)
];
imports = [
(l.mkRemovedOptionModule ["nixos" "configuration"] disabledNotice)
(l.mkRemovedOptionModule ["nixos" "build"] disabledNotice)
(l.mkRemovedOptionModule ["nixos" "evaluatedConfig"] disabledNotice)
(lib.mkRemovedOptionModule ["nixos" "configuration"] disabledNotice)
(lib.mkRemovedOptionModule ["nixos" "build"] disabledNotice)
(lib.mkRemovedOptionModule ["nixos" "evaluatedConfig"] disabledNotice)
];
};
in
Expand Down
12 changes: 7 additions & 5 deletions src/lib/dev/mkMakes.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
l,
inputs,
cell,
}: let
inherit (inputs) nixpkgs makes;
inherit (inputs.cells.std.errors) requireInput;
inherit (requireInput "makes" "github:fluidattacks/makes" "std.lib.dev.mkMakes") nixpkgs makes;
inherit (nixpkgs) lib;

makes' = l.fix (
l.extends
makes' = lib.fix (
lib.extends
(
_: _: {
inherit inputs;
Expand All @@ -20,4 +22,4 @@
.__unfix__
);
in
l.customisation.callPackageWith makes'
lib.customisation.callPackageWith makes'
3 changes: 2 additions & 1 deletion src/lib/dev/mkNixago.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
inputs,
cell,
}: let
inherit (inputs) dmerge nixago;
inherit (inputs.cells.std.errors) requireInput;
inherit (requireInput "nixago" "github:nix-community/nixago" "std.lib.dev.mkNixago") dmerge nixago;

l = inputs.nixpkgs.lib // builtins;
in
Expand Down
4 changes: 3 additions & 1 deletion src/lib/dev/mkShell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
inputs,
cell,
}: let
inherit (inputs) devshell nixago;
inherit (inputs.cells.std.errors) requireInput;

inherit (requireInput "devshell" "github:numtide/devshell" "std.lib.dev.mkShell") devshell nixago;

l = inputs.nixpkgs.lib // builtins;
in
Expand Down

0 comments on commit 37eed5c

Please sign in to comment.