From c881b53ac63b3ef281088a409f838a1ad9d1c443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Mekina?= Date: Mon, 17 Nov 2025 21:37:19 +0100 Subject: [PATCH] add default nix build target --- flake.nix | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/flake.nix b/flake.nix index 3328964..edee8ff 100644 --- a/flake.nix +++ b/flake.nix @@ -32,25 +32,33 @@ inherit buildInputs; shellHook = envSetup; }; - } // (with pkgs; { - packages.documentation = build "documentation.pdf"; - packages.theses = stdenv.mkDerivation { - name = name + "-theses"; - dontUnpack = true; - buildInputs = builtins.map (v: build v) [ - "bp_cs.pdf" "bp_en.pdf" - "dp_cs.pdf" "dp_en.pdf" - "prj_cs.pdf" "prj_en.pdf" - "sp_cs.pdf" "sp_en.pdf" - ]; - installPhase = '' - mkdir $out - for input in $buildInputs - do - cp -R $input/. $out - done - ''; - }; - }) + } // ( + with pkgs; + let + merge = buildInputs: name: stdenv.mkDerivation { + inherit name buildInputs; + dontUnpack = true; + installPhase = '' + mkdir $out + for input in $buildInputs + do + cp -R $input/. $out + done + ''; + }; + documentation = build "documentation.pdf"; + theses = merge (builtins.map (v: build v) [ + "bp_cs.pdf" "bp_en.pdf" + "dp_cs.pdf" "dp_en.pdf" + "prj_cs.pdf" "prj_en.pdf" + "sp_cs.pdf" "sp_en.pdf" + ]) (name + "-" + "theses"); + in + { + packages.documentation = documentation; + packages.theses = theses; + packages.default = merge [documentation theses] name; + } + ) ); }