Profpatsch/shell.nix
  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
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# generic shell.nix that can be used for most of my projects here,
# until I figure out a way to have composable shells.
let root = (import ./. { }); in
{ pkgs ? root.third_party.nixpkgs, depot ? root, ... }:

pkgs.mkShell {

  buildInputs = [
    pkgs.sqlite-interactive
    pkgs.sqlite-utils
    pkgs.haskell-language-server
    pkgs.cabal-install
    (pkgs.haskellPackages.ghcWithHoogle (h: [
      h.async
      h.aeson-better-errors
      h.blaze-html
      h.bencode
      h.conduit-extra
      h.error
      h.monad-logger
      h.pa-label
      h.pa-pretty
      h.pa-run-command
      h.pa-error-tree
      h.ihp-hsx
      h.optparse-simple
      h.PyF
      h.foldl
      h.unliftio
      h.xml-conduit
      h.wai
      h.wai-extra
      h.warp
      h.profunctors
      h.semigroupoids
      h.validation-selective
      h.free
      h.cryptonite-conduit
      h.sqlite-simple
      h.hedgehog
      h.http-conduit
      h.http-conduit
      h.wai-conduit
      h.nonempty-containers
      h.deriving-compat
      h.unix
      h.tagsoup
      h.attoparsec
      # h.iCalendar
      h.case-insensitive
      h.hscolour
      h.nicify-lib
      h.hspec
      h.hspec-expectations-pretty-diff
      h.tmp-postgres
      h.postgresql-simple
      h.resource-pool
      h.xmonad-contrib
      h.hs-opentelemetry-sdk
      h.punycode
      h.HFuse
    ]))

    pkgs.rustup
    pkgs.pkg-config
    pkgs.fuse
    pkgs.postgresql_16
    pkgs.nodejs
    pkgs.ninja
    pkgs.s6
    pkgs.caddy
    pkgs.sqlite
    pkgs.go
    pkgs.bat
    pkgs.squashfsTools

    # Zig from overlay for sqlitefs development (specific nightly)
    (
      let
        zigOverlay = import
          (pkgs.fetchFromGitHub {
            owner = "mitchellh";
            repo = "zig-overlay";
            rev = "e4fc402cd94b23b126d1a8b223a55b6cf31b0abc";
            sha256 = "sha256-e1QH86DuElVscK3X0yoQtt8CYeCbPboD+YBM1d1FLpg=";
          })
          { inherit (pkgs) system; };
        # Use the same nightly as the earlier command
      in
      zigOverlay."master-2025-07-08"
    )

    (depot.nix.binify {
      name = "nix-run";
      exe = depot.users.Profpatsch.nix-tools.nix-run;
    })
  ];

  DEPOT_ROOT = toString ./.;
  PROFPATSCH_ROOT = toString ./users/Profpatsch;

  WHATCD_RESOLVER_TOOLS = pkgs.linkFarm "whatcd-resolver-tools" [
    {
      name = "pg_format";
      path = "${pkgs.pgformatter}/bin/pg_format";
    }
    {
      name = "exiftool";
      path = "${pkgs.exiftool}/bin/exiftool";
    }
  ];
  WHATCD_RESOLVER_TRANSMISSION_DOWNLOAD_DIRECTORY = "/home/philip/tmp/a/seeding";
  WHATCD_RESOLVER_SOURCE_DIRECTORY = toString ./users/Profpatsch/whatcd-resolver;

  # DECLIB_MASTODON_ACCESS_TOKEN read from `pass` in .envrc.

  QR_CODE_TOOLS = builtins.toJSON
    {
      qrencode = "${pkgs.qrencode}/bin/qrencode";
      gtkdialog = "${depot.users.Profpatsch.gtkdialog}/bin/gtkdialog";
    };

  CAMERA_TOOLS = builtins.toJSON
    {
      exiftool = "${pkgs.exiftool}/bin/exiftool";
    };

  RUSTC_WRAPPER =
    let
      wrapperArgFile = libs: pkgs.writeText "rustc-wrapper-args"
        (pkgs.lib.concatStringsSep
          "\n"
          (pkgs.lib.concatLists
            (map
              (lib: [
                "-L"
                "${pkgs.lib.getLib lib}/lib"
              ])
              libs)));
    in
    depot.nix.writeExecline "rustc-wrapper" { readNArgs = 1; } [
      "$1"
      "$@"
      "@${wrapperArgFile [
      depot.third_party.rust-crates.nom
    ]}"
    ];

}