Skip to content

Commit

Permalink
build: default nix package uses prebuilt script
Browse files Browse the repository at this point in the history
  • Loading branch information
hraban committed May 2, 2024
1 parent b26e53e commit 8b8e4ff
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
in
{
packages = {
default = pkgs.stdenv.mkDerivation {
# Build the actual application from its org-mode source using Emacs.
fromsrc = pkgs.stdenv.mkDerivation {
pname = "tomono";
version = "2.0.0";
src = pkgs.lib.cleanSource ./.;
Expand Down Expand Up @@ -49,8 +50,15 @@
description = "Migrate multiple repositories into a single monorepo";
};
};
# A very simple and light-weight derivation which relies on the
# pre-built source being checked in to the repository. Which it is,
# so that’s easy.
default = pkgs.writeShellApplication {
name = "tomono";
text = builtins.readFile ./tomono;
};
# For distribution outside of Nix
dist = self.packages.${system}.default.overrideAttrs (_: {
dist = self.packages.${system}.fromsrc.overrideAttrs (_: {
dontFixup = true;
# This doesn’t make sense but it makes CI easier and who cares.
keepTest = true;
Expand All @@ -62,7 +70,7 @@
# alone. This can reuse the git path baking and the shebang
# patching of the main derivation, so I can just immediately call
# it.
tomono-test = self.packages.${system}.default.overrideAttrs (_: {
tomono-test = self.packages.${system}.fromsrc.overrideAttrs (_: {
keepTest = true;
});
in
Expand All @@ -71,7 +79,7 @@
version = "1.0";
nativeBuildInputs = [
# The actual code being tested. Must be in PATH.
self.packages.${system}.default
self.packages.${system}.fromsrc
];
dontUnpack = true;
buildPhase = ''
Expand Down

0 comments on commit 8b8e4ff

Please sign in to comment.