~zainab/blog

blog/shell.nix -rw-r--r-- 1.5 KiB
d9e5070ezainab-ali Add question aside 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
let
  pkgs = import <nixpkgs> {};
  serve = with pkgs;
    writeScriptBin "serve"
    ''
    #!${stdenv.shell}
    $(which raco) pollen start src
    '';
  source-serif-pro = pkgs.callPackage ./nix/source-serif-pro.nix { };
  source-code-pro = pkgs.callPackage ./nix/source-code-pro.nix { };
  ibm-plex = pkgs.callPackage ./nix/ibm-plex.nix { };
  kalam = pkgs.callPackage ./nix/kalam.nix { };
  fontLocal = with pkgs;
    writeScriptBin "gen-font-links"
    ''
    #!${stdenv.shell}
    cp -r ${source-serif-pro.out}/* src
    cp -r ${source-code-pro.out}/* src
    cp -r ${ibm-plex.out}/* src
    cp -r ${kalam.out}/* src
    chmod -R u+w src
    '';
  snippets = pkgs.callPackage ./nix/snippets.nix { };
  snippetsLocal = with pkgs;
    writeScriptBin "gen-snippets"
    ''
    #!${stdenv.shell}
     set -ex
     cp -rf ${snippets.out}/* src
     chmod -R u+w src
    '';
  favicon = pkgs.callPackage ./nix/favicon.nix { };
  faviconLocal = with pkgs;
    writeScriptBin "gen-favicon"
    ''
    #!${stdenv.shell}
     cp -rf ${favicon.out}/* src
     chmod -R u+w src
    '';
  pygments = pkgs.python38Packages.pygments;
in
with pkgs;
mkShell {
  # TODO: One of these derivations needs a network connection to be built, and
  # is rebuilt each time. This causes problems when working offline.
  buildInputs = [racket
                 scala
                 coursier
                 serve
                 kalam
                 fontLocal
                 snippetsLocal
                 faviconLocal
                 pygments
                ];
}