{
  description = "A basic flake with a shell";
  inputs.nixpkgs.follows = "clicks-server/nixpkgs";
  inputs.flake-utils.url = "github:numtide/flake-utils";
  inputs.clicks-server.url = "git+ssh://git@github.com/clicksminuteper/nixfiles";
  inputs.pnpm2nix.url = "git+ssh://git@github.com/clicksminuteper/pnpm2nix";

  inputs.pnpm2nix.inputs.nixpkgs.follows = "nixpkgs";

  outputs = { self, nixpkgs, flake-utils, clicks-server, pnpm2nix }:
    flake-utils.lib.eachDefaultSystem
      (system:
        let
          pkgs = nixpkgs.legacyPackages.${system};
          nodejs = pkgs.nodejs_20;
          nodePackages = pkgs.nodePackages_latest;
          lib = pkgs.lib;
        in
        rec {
          devShells.default = pkgs.mkShell {
            packages = [ nodejs nodePackages.pnpm pkgs.pkg-config pkgs.fontconfig.dev ];
            shellHook = ''
              unset name
              export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${lib.makeSearchPath "/lib/pkgconfig" [
                pkgs.pixman
                pkgs.cairo.dev
                pkgs.libpng.dev
                pkgs.gnome2.pango.dev
                pkgs.glib.dev
                pkgs.harfbuzz.dev
                pkgs.freetype.dev
              ]}
            '';
          };
        }) // {
      packages.x86_64-linux =
        let
          pkgs = nixpkgs.legacyPackages.x86_64-linux;
          nodejs = pkgs.nodejs_20;
          nodePackages = pkgs.nodePackages_latest;
          lib = pkgs.lib;
        in
        rec {
          node_modules = lib.pipe
            {
              src = ./.;
              linkDevDependencies = true;
              overrides = pnpm2nix.defaultPnpmOverrides.x86_64-linux // {
                canvas = (drv: drv.overrideAttrs (oldAttrs: {
                  nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ pkgs.pkg-config ];
                  buildInputs = oldAttrs.buildInputs ++ [
                    pkgs.pixman
                    pkgs.cairo.dev
                    pkgs.libpng.dev
                    pkgs.gnome2.pango.dev
                    pkgs.glib.dev
                    pkgs.harfbuzz.dev
                    pkgs.freetype.dev
                  ];
                }));

                "@tensorflow/tfjs-node" = (drv: drv.overrideAttrs (oldAttrs: {
                  buildInputs = oldAttrs.buildInputs ++ [
                    pkgs.libtensorflow
                  ];

                  preBuild = ''
                    mkdir -p node_modules/@tensorflow/tfjs-node/deps/lib
                    ln -s ${pkgs.libtensorflow}/lib/libtensorflow.so.2 node_modules/@tensorflow/tfjs-node/deps/lib/libtensorflow.so.2.9.1
                  '';
                }));
              };
            } [
            (pnpm2nix.mkPnpmPackage.x86_64-linux)
            (drv: builtins.readFile "${drv}/nix-support/propagated-build-inputs")
            (path: "${path}/node_modules")
          ];

          nucleus =
            let
              packageJSON = (builtins.fromJSON (builtins.readFile ./package.json));
            in
            pkgs.stdenv.mkDerivation {
              pname = "nucleus";
              version = packageJSON.version;

              src = ./.;

              buildInputs = [ nodejs nodePackages.pnpm ];
              nativeBuildInputs = [ nodePackages.pnpm nodePackages.typescript pkgs.python3 ];

              buildPhase = ''
                ${pkgs.python3}/bin/python3 ${./scripts/fix-pnpm-bin.py} ${node_modules} ./bin
                export PATH=$PATH:./bin
                ln -s ${node_modules} node_modules
                pnpm run build
              '';

              installPhase = ''
                mkdir -p $out

                cp dist $out -r
                cp node_modules $out -r
                cp bin $out/.bin -r
                cp package.json $out
                cp LICENSE $out

                mkdir -p $out/bin
                echo "#!/usr/bin/env bash" > $out/bin/nucleus
                echo "cd $out" >> $out/bin/nucleus
                echo "export PATH=$PATH:$out/node_modules/.bin" >> $out/bin/nucleus
                echo "${packageJSON.scripts.start}" >> $out/bin/nucleus
                chmod +x $out/bin/nucleus
              '';
            };

          dockerImage = pkgs.dockerTools.streamLayeredImage {
            name = "nucleus";
            tag = "latest";
            contents = [ nucleus ];
            config.Cmd = [ "${nucleus}/bin/nucleus" ];
          };

          default = nucleus;
        };
    };
}
