summary refs log tree commit diff
path: root/nix/checks.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-02-22 18:34:47 +0000
committerAlyssa Ross <hi@alyssa.is>2023-02-22 18:39:09 +0000
commitc3fbeca89c23270314d1a24017160ff6fe7cc497 (patch)
treec5cc8a914335524cb34d28e40cd010a9faae0549 /nix/checks.nix
parent136428bf5b46f69ee85d579531b92299f964ba52 (diff)
downloadspectrum-c3fbeca89c23270314d1a24017160ff6fe7cc497.tar
spectrum-c3fbeca89c23270314d1a24017160ff6fe7cc497.tar.gz
spectrum-c3fbeca89c23270314d1a24017160ff6fe7cc497.tar.bz2
spectrum-c3fbeca89c23270314d1a24017160ff6fe7cc497.tar.lz
spectrum-c3fbeca89c23270314d1a24017160ff6fe7cc497.tar.xz
spectrum-c3fbeca89c23270314d1a24017160ff6fe7cc497.tar.zst
spectrum-c3fbeca89c23270314d1a24017160ff6fe7cc497.zip
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 <hi@alyssa.is>
Diffstat (limited to 'nix/checks.nix')
-rw-r--r--nix/checks.nix55
1 files changed, 0 insertions, 55 deletions
diff --git a/nix/checks.nix b/nix/checks.nix
deleted file mode 100644
index d5a40c0..0000000
--- a/nix/checks.nix
+++ /dev/null
@@ -1,55 +0,0 @@
-# SPDX-License-Identifier: MIT
-# SPDX-FileCopyrightText: 2022 Unikie
-
-import ../nix/eval-config.nix ({ config, src, ... }: {
-  recurseForDerivations = true;
-
-  doc-links = config.pkgs.callPackage (
-    { lib, runCommand, ruby, wget }:
-    runCommand "spectrum-doc-links" {
-      doc = import ../Documentation { inherit config; };
-      nativeBuildInputs = [ ruby wget ];
-    } ''
-      mkdir root
-      ln -s $doc root/doc
-      ruby -run -e httpd -- --port 4000 root &
-      wget -r -nv --delete-after --no-parent --retry-connrefused http://localhost:4000/doc/
-      touch $out
-    ''
-  ) {};
-
-  reuse = config.pkgs.callPackage (
-    { lib, runCommand, reuse }:
-    runCommand "spectrum-reuse" {
-      inherit src;
-      nativeBuildInputs = [ reuse ];
-    } ''
-      reuse --root $src lint
-      touch $out
-    ''
-  ) {};
-
-  rustfmt = config.pkgs.callPackage (
-    { lib, runCommand, rustfmt }:
-    runCommand "spectrum-rustfmt" {
-      inherit src;
-      nativeBuildInputs = [ rustfmt ];
-    } ''
-      shopt -s globstar
-      rustfmt --check $src/**/*.rs
-      touch $out
-    ''
-  ) {};
-
-  shellcheck = config.pkgs.callPackage (
-    { lib, runCommand, shellcheck }:
-    runCommand "spectrum-shellcheck" {
-      inherit src;
-      nativeBuildInputs = [ shellcheck ];
-    } ''
-      shopt -s globstar
-      shellcheck $src/**/*.sh
-      touch $out
-    ''
-  ) {};
-})