diff options
Diffstat (limited to 'default.nix')
-rw-r--r-- | default.nix | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/default.nix b/default.nix index 8d29ca6..d8acf76 100644 --- a/default.nix +++ b/default.nix @@ -36,26 +36,20 @@ let niv (hunspellWithDicts (with utils-i18n.dicts; [ en pt fr eo ])) ]; + drv = name: buildPhase: + pkgs.stdenv.mkDerivation { + inherit src buildInputs buildPhase; + name = "website-${name}"; + phases = [ "unpackPhase" "buildPhase" ]; + }; in rec { - site = pkgs.stdenv.mkDerivation { - inherit src buildInputs; - name = "website-site"; - phases = [ "unpackPhase" "buildPhase" ]; - buildPhase = '' - patchShebangs . - jekyll build -d $out --trace - ''; - }; - test = pkgs.stdenv.mkDerivation { - inherit src buildInputs; - name = "website-test"; - phases = [ "unpackPhase" "buildPhase" ]; - buildPhase = '' - patchShebangs . - ./tests.sh - touch $out - ''; - }; + site = drv "site" '' + jekyll build -d $out --trace + ''; + test = drv "test" '' + ./tests.sh + touch $out + ''; shell = pkgs.mkShell { inherit buildInputs; name = "website-shell"; |