From 4c2786df8a0f4fd7a62e6f74361773ce65a40a02 Mon Sep 17 00:00:00 2001 From: surtur Date: Sun, 13 Nov 2022 14:42:05 +0100 Subject: [PATCH] flake: improve checking whether thesis type is set --- flake.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 16a4bc0..ed75e52 100644 --- a/flake.nix +++ b/flake.nix @@ -17,8 +17,15 @@ supportedSystems = ["aarch64-linux" "x86_64-linux" "x86_64-darwin"]; forAllSystems = nixpkgs.lib.genAttrs supportedSystems; - thesisType = ""; # ms, bc - throw "Set thesis type!" + # ms, bc + thesis = ""; + + checkThesisType = {type}: + if builtins.stringLength type == 0 + then "unknown" + else type; + thesisType = checkThesisType {type = thesis;}; + documentName = "thesis"; pname = thesisType + "_" + documentName; version = "0.0.1";