From f87582250fd324cd04886cd84a7ee58d03133b13 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 24 Feb 2019 21:02:29 +0100 Subject: Add nix-shell environment type to tasker Allows for convenient management of non-project-specific shell environments. --- tasks/default.nix | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'tasks') diff --git a/tasks/default.nix b/tasks/default.nix index e851c24..6966fd2 100644 --- a/tasks/default.nix +++ b/tasks/default.nix @@ -1,6 +1,15 @@ -{ pkgs ? import { }, ... }: +{ pkgs, ... }: -{ +let + mkShellDerivation = n: ps: pkgs.stdenvNoCC.mkDerivation rec { + name = n; + buildInputs = ps; + shellHook = '' + export NIX_SHELL_NAME="${name}" + ''; + }; + +in { custom.tasks = { bsc_edit = { description = "Grid refinement BSc thesis editor"; @@ -29,5 +38,15 @@ directory = "~/projects/contrib/openlb"; command = "nix-shell --command fish"; }; + cpp_shell = { + description = "Generic C++ shell environment"; + type = "environment"; + directory = "~/"; + environment = mkShellDerivation "cpp-env" (with pkgs; [ + cmake + gcc8 + gdb cgdb + ]); + }; }; } -- cgit v1.2.3