This commit is contained in:
2025-12-01 11:43:29 +01:00
parent 1e70a6407d
commit 040f9566df
6 changed files with 18 additions and 18 deletions

View File

@@ -23,28 +23,28 @@
pkgs, pkgs,
system, system,
... ...
}: let }: {
mkTask = part:
pkgs.stdenv.mkDerivation {
name = "a1-${part}";
src = ./.;
buildPhase = ''
cc ${part}.c -o ${part}.out
'';
installPhase = ''
mkdir -p $out/bin/
mv ${part}.out $out/bin/
'';
meta = {
mainProgram = "${part}.out";
};
};
in {
# Per-system attributes can be defined here. The self' and inputs' # Per-system attributes can be defined here. The self' and inputs'
# module parameters provide easy access to attributes of the same # module parameters provide easy access to attributes of the same
# system. # system.
packages = { packages = let
mkTask = part:
pkgs.stdenv.mkDerivation {
name = "a1-${part}";
src = ./.;
buildPhase = ''
cc ${part}.c -o ${part}.out
'';
installPhase = ''
mkdir -p $out/bin/
mv ${part}.out $out/bin/
'';
meta = {
mainProgram = "${part}.out";
};
};
in {
a = mkTask "a"; a = mkTask "a";
b = mkTask "b"; b = mkTask "b";
c = mkTask "c"; c = mkTask "c";