Skip to content

Commit

Permalink
look ma no overlays
Browse files Browse the repository at this point in the history
  • Loading branch information
molarmanful committed Jan 14, 2025
1 parent 41ecea8 commit 2e89ec9
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 45 deletions.
4 changes: 2 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
cfg ? "",
nerd ? false,
release ? false,
P,

lib,
stdenvNoCC,
bited-build,
...
}:

Expand All @@ -18,7 +18,7 @@ stdenvNoCC.mkDerivation {
buildPhase = ''
runHook preBuild
rm -rf out
${bited-build}/bin/bited-build ${cfg} \
${P.bited-build}/bin/bited-build ${cfg} \
${lib.optionalString nerd "--nerd"} \
${lib.optionalString release "--release"}
runHook postBuild
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

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

62 changes: 24 additions & 38 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

outputs =
{
self,
nixpkgs,
utils,
bited-utils,
Expand All @@ -24,48 +23,35 @@
version = builtins.readFile ./VERSION;
in

{
overlays.default =
final: prev:
let
build = o: final.callPackage ./. ({ inherit version; } // o);
in
{
kirsch = build { pname = name; };
kirsch-nerd = build {
pname = "${name}-nerd";
nerd = true;
};
kirsch-release = build {
pname = "${name}-release";
nerd = true;
release = true;
};
kirsch-img = final.callPackage ./img.nix {
name = "${name}-img";
};
};
}

// utils.lib.eachDefaultSystem (
utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system}.appendOverlays [
bited-utils.overlays.default
self.overlays.default
];
pkgs = nixpkgs.legacyPackages.${system};
P = bited-utils.packages.${system};
in
{

packages = {
inherit (pkgs)
kirsch
kirsch-nerd
kirsch-release
kirsch-img
;
default = pkgs.kirsch;
};
packages =
let
build = o: pkgs.callPackage ./. ({ inherit version P; } // o);
in
rec {
kirsch = build { pname = name; };
kirsch-nerd = build {
pname = "${name}-nerd";
nerd = true;
};
kirsch-release = build {
pname = "${name}-release";
nerd = true;
release = true;
};
kirsch-img = pkgs.callPackage ./img.nix {
inherit P;
name = "${name}-img";
};
default = kirsch;
};

devShells.default = pkgs.mkShell {
packages = with pkgs; [
Expand Down
4 changes: 2 additions & 2 deletions img.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
name,
cfg ? "",
P,

writeShellApplication,
bited-img,
...
}:

writeShellApplication {
inherit name;
text = "${bited-img}/bin/bited-img ${cfg}";
text = "${P.bited-img}/bin/bited-img ${cfg}";
}

0 comments on commit 2e89ec9

Please sign in to comment.