From c3fbeca89c23270314d1a24017160ff6fe7cc497 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Wed, 22 Feb 2023 18:34:47 +0000 Subject: lib/common.mk: init We can simplify our Makefiles a bit by moving some things into a library file. So far, I've done this for non-component-specific macros, and inference rules. Some tar2ext4 rules used a temporary file for the tar2ext4 invocation, and then moved the file into place when it was done, to prevent a half-built image sticking around if tar2ext4 died. According to POSIX, make should clean up any targets that didn't finish building if it's interrupted, so we should only end up with a half-built image if tar2ext4 crashes, e.g. due to running out of disk space. I think we should just ignore that possibility, since otherwise we'd have to write annoying make rules using temporary file names for every target, and if it does happen recovery is just a make clean away. With this, I've also made a small reorganisation. I got rid of the "nix" directory and created a "lib" directory, where I put eval-config.nix and the new common.mk file, since both are library code. checks.nix isn't really a library though, so I moved it into the "release" directory, since the only reference to it is in release.nix. Signed-off-by: Alyssa Ross --- Documentation/default.nix | 2 +- Documentation/jekyll.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'Documentation') diff --git a/Documentation/default.nix b/Documentation/default.nix index 90f8e88..b0fe341 100644 --- a/Documentation/default.nix +++ b/Documentation/default.nix @@ -2,7 +2,7 @@ # SPDX-FileCopyrightText: 2022 Unikie # SPDX-License-Identifier: MIT -import ../nix/eval-config.nix ({ config, src, ... }: config.pkgs.callPackage ( +import ../lib/eval-config.nix ({ config, src, ... }: config.pkgs.callPackage ( { lib, stdenvNoCC, jekyll, drawio-headless }: diff --git a/Documentation/jekyll.nix b/Documentation/jekyll.nix index fe16186..4b32ebe 100644 --- a/Documentation/jekyll.nix +++ b/Documentation/jekyll.nix @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 Alyssa Ross # SPDX-License-Identifier: MIT -import ../nix/eval-config.nix ({ config, ... }: config.pkgs.callPackage ( +import ../lib/eval-config.nix ({ config, ... }: config.pkgs.callPackage ( { bundlerApp }: -- cgit 1.4.1