refactor devShell in the flake

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2022-10-22 07:34:00 +05:30
parent 31132065c0
commit 33bf0a9f6f
2 changed files with 16 additions and 11 deletions

14
flake.lock generated
View File

@@ -2,16 +2,16 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1648632716, "lastModified": 1666393929,
"narHash": "sha256-kCmnDeiaMsdhfnNKjxdOzwRh2H6eQb8yWAL+nNabC/Y=", "narHash": "sha256-Tet6WIaK0NaeNmr+0ayIkHEauuKde+Tv3X+giSQB6wE=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "710fed5a2483f945b14f4a58af2cd3676b42d8c8", "rev": "7a0b1f3b9549507ba45339178221e6494f5ab6d7",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-unstable", "ref": "release-22.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@@ -24,11 +24,11 @@
}, },
"utils": { "utils": {
"locked": { "locked": {
"lastModified": 1648297722, "lastModified": 1659877975,
"narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=", "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade", "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -2,7 +2,7 @@
description = "My personal website"; description = "My personal website";
inputs = { inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable; nixpkgs.url = github:nixos/nixpkgs/release-22.05;
utils.url = github:numtide/flake-utils; utils.url = github:numtide/flake-utils;
}; };
@@ -25,17 +25,22 @@
phases = "unpackPhase buildPhase"; phases = "unpackPhase buildPhase";
nativeBuildInputs = [ site ]; nativeBuildInputs = [ site ];
buildPhase = (pkgs.lib.concatStringsSep "\n" vars ) + '' buildPhase = (pkgs.lib.concatStringsSep "\n" vars ) + ''
log=$(site build)
mkdir -p $out mkdir -p $out
cp -r \_site/* $out cp -r \_site/* $out
''; '';
}; };
in in
rec { rec {
devShell = with pkgs; mkShell { devShell = with pkgs.haskellPackages; shellFor {
packages = _: [ site ];
withHoogle = true;
buildInputs = [ buildInputs = [
cabal-install
haskell-language-server haskell-language-server
(haskellPackages.ghcWithPackages (h: with h; [ hakyll pandoc ])) ghcid
];
nativeBuildInputs = with pkgs; [
zlib
]; ];
}; };
packages = { packages = {