{
  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.devenv.url = "github:cachix/devenv";

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

  outputs = { self, devenv, nixpkgs, flake-utils, clicks-server, pnpm2nix, ... }@inputs:
    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 = devenv.lib.mkShell {
            inherit inputs pkgs;
            modules = [
              ({ pkgs, config, ... }: {
                # This is your devenv configuration
                packages = [ nodejs nodePackages.pnpm pkgs.pkg-config pkgs.fontconfig.dev pkgs.clamav ];

                enterShell = ''
                  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
                  ]}
                '';

                services.mongodb = {
                  enable = true;
                  package = pkgs.mongodb-6_0;
                  additionalArgs = [
                    "--port"
                    "27017"
                    "--noauth"
                  ];
                };

                processes.clamav.exec = let
                    clamd_config = pkgs.writeText "clamd.conf" ''
                        TCPSocket 3310
                        PidFile /tmp/clamav-nucleus.pid
                        DatabaseDirectory ${config.env.DEVENV_STATE}/clamav/db
                        TemporaryDirectory /tmp
                        Foreground true
                    '';
                    freshclam_config = pkgs.writeText "freshclam.conf" ''
                        DatabaseDirectory ${config.env.DEVENV_STATE}/clamav/db
                        DatabaseMirror database.clamav.net
                    '';
                in "mkdir -p $DEVENV_STATE/clamav/db && ${pkgs.clamav}/bin/freshclam --config ${freshclam_config} || true; ${pkgs.clamav}/bin/clamd -c ${clamd_config}";
              })
            ];
          };
        }) // {
      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;
        };
    };
}
