commit 402ea19e0bc98c31178804634d50c79c1bf71fd2 Author: Colin Date: Wed Apr 27 06:38:39 2022 +0000 repo init: contains the current uninsane.org definition diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 000000000..1ebeea7dc --- /dev/null +++ b/configuration.nix @@ -0,0 +1,122 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./fs-configuration.nix + ./services-conf/gitea-configuration.nix + ./services-conf/jellyfin-configuration.nix + ./services-conf/matrix-configuration.nix + ./services-conf/nginx-configuration.nix + ./services-conf/pleroma-configuration.nix + ./services-conf/postgres-configuration.nix + ./user-configuration.nix + ]; + + nixpkgs.overlays = [ + (self: super: { + pleroma = super.callPackage ./pkgs/pleroma { }; + }) + ]; + + # TODO colin: re-enable the firewall + networking.firewall.enable = false; + + # XXX colin: UNMODIFIED DEFAULTS BELOW + + # Use the extlinux boot loader. (NixOS wants to enable GRUB by default) + boot.loader.grub.enable = false; + # Enables the generation of /boot/extlinux/extlinux.conf + boot.loader.generic-extlinux-compatible.enable = true; + + # networking.hostName = "nixos"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Set your time zone. + # time.timeZone = "Europe/Amsterdam"; + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + networking.useDHCP = false; + networking.interfaces.eth0.useDHCP = true; + networking.interfaces.wlan0.useDHCP = true; + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Select internationalisation properties. + # i18n.defaultLocale = "en_US.UTF-8"; + # console = { + # font = "Lat2-Terminus16"; + # keyMap = "us"; + # }; + + # Enable the X11 windowing system. + # services.xserver.enable = true; + + + + # Configure keymap in X11 + # services.xserver.layout = "us"; + # services.xserver.xkbOptions = "eurosign:e"; + + # Enable CUPS to print documents. + # services.printing.enable = true; + + # Enable sound. + # sound.enable = true; + # hardware.pulseaudio.enable = true; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + # users.users.jane = { + # isNormalUser = true; + # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + # }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + # environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + # firefox + # ]; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "21.11"; # Did you read the comment? + +} + diff --git a/fs-configuration.nix b/fs-configuration.nix new file mode 100644 index 000000000..41a0c0f9b --- /dev/null +++ b/fs-configuration.nix @@ -0,0 +1,18 @@ +{ config, pkgs, lib, ... }: + +{ + fileSystems."/mnt/storage" = { + device = "/dev/disk/by-uuid/2be70d38-79f4-41b6-bee2-bce5a25f8f7b"; + fsType = "ext4"; + }; + + fileSystems."/var/lib/pleroma" = { + device = "/mnt/storage/opt/pleroma.nix"; + options = [ "bind" ]; + }; + + # swapDevices = [ + # { device = "/swapfile"; size = 4096; } + # ]; +} + diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 000000000..730a91950 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,22 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; + fsType = "ext4"; + }; + + powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; +} diff --git a/pkgs/pleroma/default.nix b/pkgs/pleroma/default.nix new file mode 100644 index 000000000..2475455fd --- /dev/null +++ b/pkgs/pleroma/default.nix @@ -0,0 +1,236 @@ +{ lib, beamPackages +, fetchFromGitHub, fetchFromGitLab +, file, cmake, bash +, nixosTests, writeText +, cookieFile ? "/var/lib/pleroma/.cookie" +, ... +}: + +beamPackages.mixRelease rec { + pname = "pleroma"; + version = "2.4.51"; + + src = fetchFromGitLab { + domain = "git.pleroma.social"; + owner = "pleroma"; + repo = "pleroma"; + rev = "a5d7e98de0ed7989d80e4698155676488afbb423"; + # compute with `nix to-sri sha256:` + sha256 = "sha256-CvhqlpCxmEIYTtGqCMCUCVq8Y71J95l6W6FRJMXvSL8="; + }; + + preFixup = if (cookieFile != null) then '' + # There's no way to use a subprocess to cat the content of the + # file cookie using wrapProgram: it gets escaped (by design) with + # a pair of backticks :( + # We have to come up with our own custom wrapper to do this. + function wrapWithCookie () { + local hidden + hidden="$(dirname "$1")/.$(basename "$1")"-wrapped + while [ -e "$hidden" ]; do + hidden="''${hidden}_" + done + mv "$1" "''${hidden}" + + cat > "$1" << EOF + #!${bash}/bin/bash + export RELEASE_COOKIE="\$(cat "${cookieFile}")" + exec -a "\$0" "''${hidden}" "\$@" + EOF + chmod +x "$1" + } + + for f in "$out"/bin/*; do + if [[ -x "$f" ]]; then + wrapWithCookie "$f" + fi + done + '' else ""; + + mixNixDeps = import ./mix.nix { + inherit beamPackages lib; + overrides = (final: prev: { + # mix2nix does not support git dependencies yet, + # so we need to add them manually + gettext = beamPackages.buildMix rec { + name = "gettext"; + version = "0.19.1"; + + src = fetchFromGitHub { + owner = "tusooa"; + repo = "gettext"; + rev = "72fb2496b6c5280ed911bdc3756890e7f38a4808"; + sha256 = "V0qmE+LcAbVoWsJmWE4fwrduYFIZ5BzK/sGzgLY3eH0="; + }; + beamDeps = with final; [ ]; + }; + crypt = beamPackages.buildRebar3 rec { + name = "crypt"; + version = "0.4.3"; + + src = fetchFromGitHub { + owner = "msantos"; + repo = "crypt"; + rev = "f75cd55325e33cbea198fb41fe41871392f8fb76"; + sha256 = "sha256-ZYhZTe7cTITkl8DZ4z2IOlxTX5gnbJImu/lVJ2ZjR1o="; + }; + + postInstall = "mv $out/lib/erlang/lib/crypt-${version}/priv/{source,crypt}.so"; + + beamDeps = with final; [ elixir_make ]; + }; + prometheus_ex = beamPackages.buildMix rec { + name = "prometheus_ex"; + version = "3.0.5"; + + src = fetchFromGitLab { + domain = "git.pleroma.social"; + group = "pleroma"; + owner = "elixir-libraries"; + repo = "prometheus.ex"; + rev = "a4e9beb3c1c479d14b352fd9d6dd7b1f6d7deee5"; + sha256 = "1v0q4bi7sb253i8q016l7gwlv5562wk5zy3l2sa446csvsacnpjk"; + }; + beamDeps = with final; [ prometheus ]; + }; + prometheus_phx = beamPackages.buildMix rec { + name = "prometheus_phx"; + version = "0.1.1"; + + preBuild = '' + touch config/prod.exs + ''; + src = fetchFromGitLab { + domain = "git.pleroma.social"; + group = "pleroma"; + owner = "elixir-libraries"; + repo = "prometheus-phx"; + rev = "9cd8f248c9381ffedc799905050abce194a97514"; + sha256 = "0211z4bxb0bc0zcrhnph9kbbvvi1f2v95madpr96pqzr60y21cam"; + }; + beamDeps = with final; [ prometheus_ex ]; + }; + remote_ip = beamPackages.buildMix rec { + name = "remote_ip"; + version = "0.1.5"; + + src = fetchFromGitLab { + domain = "git.pleroma.social"; + group = "pleroma"; + owner = "elixir-libraries"; + repo = "remote_ip"; + rev = "b647d0deecaa3acb140854fe4bda5b7e1dc6d1c8"; + sha256 = "0c7vmakcxlcs3j040018i7bfd6z0yq6fjfig02g5fgakx398s0x6"; + }; + beamDeps = with final; [ combine plug inet_cidr ]; + }; + captcha = beamPackages.buildMix rec { + name = "captcha"; + version = "0.1.0"; + + src = fetchFromGitLab { + domain = "git.pleroma.social"; + group = "pleroma"; + owner = "elixir-libraries"; + repo = "elixir-captcha"; + rev = "e0f16822d578866e186a0974d65ad58cddc1e2ab"; + sha256 = "0qbf86l59kmpf1nd82v4141ba9ba75xwmnqzpgbm23fa1hh8pi9c"; + }; + beamDeps = with final; [ ]; + }; + + # majic needs a patch to build + majic = beamPackages.buildMix rec { + name = "majic"; + version = "1.0.0"; + + src = beamPackages.fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "17hab8kmqc6gsiqicfgsaik0rvmakb6mbshlbxllj3b5fs7qa1br"; + }; + + # src = fetchFromGitLab { + # domain = "git.pleroma.social"; + # group = "pleroma"; + # owner = "elixir-libraries"; + # repo = "majic"; + # rev = "289cda1b6d0d70ccb2ba508a2b0bd24638db2880"; + # sha256 = "15605lsdd74bmsp5z96f76ihn7m2g3p1hjbhs2x7v7309n1k108n"; + # }; + # patchPhase = '' + # substituteInPlace lib/majic/server.ex --replace "erlang.now" "erlang.time" + # ''; + buildInputs = [ file ]; + + beamDeps = with final; [ nimble_pool mime plug elixir_make ]; + }; + + + # Some additional build inputs and build fixes + http_signatures = prev.http_signatures.override { + patchPhase = '' + substituteInPlace mix.exs --replace ":logger" ":logger, :public_key" + ''; + }; + fast_html = prev.fast_html.override { + nativeBuildInputs = [ cmake ]; + dontUseCmakeConfigure = true; + }; + syslog = prev.syslog.override { + buildPlugins = with beamPackages; [ pc ]; + }; + + # This needs a different version (1.0.14 -> 1.0.18) to build properly with + # our Erlang/OTP version. + eimp = beamPackages.buildRebar3 rec { + name = "eimp"; + version = "1.0.18"; + + src = beamPackages.fetchHex { + pkg = name; + inherit version; + sha256 = "0fnx2pm1n2m0zs2skivv43s42hrgpq9i143p9mngw9f3swjqpxvx"; + }; + + patchPhase = '' + echo '{plugins, [pc]}.' >> rebar.config + ''; + buildPlugins = with beamPackages; [ pc ]; + + beamDeps = with final; [ p1_utils ]; + }; + + mime = prev.mime.override { + patchPhase = let + cfgFile = writeText "config.exs" '' + use Mix.Config + config :mime, :types, %{ + "application/activity+json" => ["activity+json"], + "application/jrd+json" => ["jrd+json"], + "application/ld+json" => ["activity+json"], + "application/xml" => ["xml"], + "application/xrd+xml" => ["xrd+xml"] + } + ''; + in '' + mkdir config + cp ${cfgFile} config/config.exs + ''; + }; + }); + }; + + passthru = { + tests.pleroma = nixosTests.pleroma; + inherit mixNixDeps; + }; + + meta = with lib; { + description = "ActivityPub microblogging server"; + homepage = "https://git.pleroma.social/pleroma/pleroma"; + license = licenses.agpl3; + maintainers = with maintainers; [ petabyteboy ninjatrappeur yuka kloenk ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/pleroma/mix.nix b/pkgs/pleroma/mix.nix new file mode 100644 index 000000000..beef3015b --- /dev/null +++ b/pkgs/pleroma/mix.nix @@ -0,0 +1,1650 @@ +{ lib, beamPackages, overrides ? (x: y: {}) }: + +let + buildRebar3 = lib.makeOverridable beamPackages.buildRebar3; + buildMix = lib.makeOverridable beamPackages.buildMix; + buildErlangMk = lib.makeOverridable beamPackages.buildErlangMk; + + self = packages // (overrides self packages); + + packages = with beamPackages; with self; { + accept = buildRebar3 rec { + name = "accept"; + version = "0.3.5"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1f0vmjjyyz8klhdb3k8zrcxpidhfy6706327nmisnbnc1ci8rc8i"; + }; + + beamDeps = []; + }; + + base62 = buildMix rec { + name = "base62"; + version = "1.2.2"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1fvpygkdmd7l737lv7svir8n1vhk0m094i8ygwcvx9gam2ykc4yl"; + }; + + beamDeps = [ custom_base ]; + }; + + # base64url = buildMix rec { + base64url = buildRebar3 rec { + name = "base64url"; + version = "0.0.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1yf1m1587vd9l6w4x5b36g4kxrxqfpwbqk2l4mkqinzmwch9pc7s"; + }; + + beamDeps = []; + }; + + bbcode_pleroma = buildMix rec { + name = "bbcode_pleroma"; + version = "0.2.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1hyixcxhcf2j2gyavmmnvfslnl6z60dz1qa9xysfspws85s1118r"; + }; + + beamDeps = [ nimble_parsec ]; + }; + + bcrypt_elixir = buildMix rec { + name = "bcrypt_elixir"; + version = "2.3.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0s9psinz913l690xbcrl21m23zwinw4r2ypjgg7ybl3f9wfxd09c"; + }; + + beamDeps = [ comeonin elixir_make ]; + }; + + benchee = buildMix rec { + name = "benchee"; + version = "1.0.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1nxd6blgmalb1qm9n11yaq24din2grc3pnnfsx6wkiz9hzkqmm9s"; + }; + + beamDeps = [ deep_merge ]; + }; + + bunt = buildMix rec { + name = "bunt"; + version = "0.2.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0lw3v9kwbbcy1v6ygziiky887gffwwmxvyg4r1v0zm71kzhcgxbs"; + }; + + beamDeps = []; + }; + + cachex = buildMix rec { + name = "cachex"; + version = "3.3.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "189irin4xkbnj6b3ih1h5fvli1xq6m1sz1xiyqryyk71vphmw3nr"; + }; + + beamDeps = [ eternal jumper sleeplocks unsafe ]; + }; + + calendar = buildMix rec { + name = "calendar"; + version = "1.0.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0vqa1zpzsdgr6i3yx8j9b6qscvgrbvzn43p5bqm930hcja0ra3lr"; + }; + + beamDeps = [ tzdata ]; + }; + + castore = buildMix rec { + name = "castore"; + version = "0.1.10"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0r96zwva2g6q59vyar8swaka0vxx27xfpf17xar2ss25rgh190x4"; + }; + + beamDeps = []; + }; + + certifi = buildRebar3 rec { + name = "certifi"; + version = "2.8.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1slp20z2fgcq9p2bbdp1gj218kjqpx5jsa95sq40nq7qqv0yziva"; + }; + + beamDeps = []; + }; + + combine = buildMix rec { + name = "combine"; + version = "0.10.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "06s5y8b0snr1s5ax9v3s7rc6c8xf5vj6878d1mc7cc07j0bvq78v"; + }; + + beamDeps = []; + }; + + comeonin = buildMix rec { + name = "comeonin"; + version = "5.3.2"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "012zr4s7b5bipng6yszqxkqr1lcv7imf8gyvxad56jachh1396fh"; + }; + + beamDeps = []; + }; + + concurrent_limiter = buildMix rec { + name = "concurrent_limiter"; + version = "0.1.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1sqnb987qwwy4ip7kxh9g7vv5wz61fpv3pbnxpbv9yy073r8z5jk"; + }; + + beamDeps = [ telemetry ]; + }; + + connection = buildMix rec { + name = "connection"; + version = "1.1.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1746n8ba11amp1xhwzp38yfii2h051za8ndxlwdykyqqljq1wb3j"; + }; + + beamDeps = []; + }; + + cors_plug = buildMix rec { + name = "cors_plug"; + version = "2.0.3"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1sls8rns2k48qrga0ngysbn9aknapmn3xfn28by1gqbcir0y2jpf"; + }; + + beamDeps = [ plug ]; + }; + + cowboy = buildErlangMk rec { + name = "cowboy"; + version = "2.9.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1phv0a1zbgk7imfgcm0dlacm7hbjcdygb0pqmx4s26jf9f9rywic"; + }; + + beamDeps = [ cowlib ranch ]; + }; + + cowboy_telemetry = buildRebar3 rec { + name = "cowboy_telemetry"; + version = "0.3.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1bzhcdq12p837cii2jgvzjyrffiwgm5bsb1pra2an3hkcqrzsvis"; + }; + + beamDeps = [ cowboy telemetry ]; + }; + + cowlib = buildRebar3 rec { + name = "cowlib"; + version = "2.11.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1ac6pj3x4vdbsa8hvmbzpdfc4k0v1p102jbd39snai8wnah9sgib"; + }; + + beamDeps = []; + }; + + credo = buildMix rec { + name = "credo"; + version = "1.5.5"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1pj7h9fk3i3rhxs65z8d64nwbnddhqj0dwy9bn2nm5cif2mj71nx"; + }; + + beamDeps = [ bunt file_system jason ]; + }; + + crontab = buildMix rec { + name = "crontab"; + version = "1.1.8"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1gkb7ps38j789acj8dw2q7jnhhw43idyvh36fb3i52yjkhli7ra8"; + }; + + beamDeps = [ ecto ]; + }; + + custom_base = buildMix rec { + name = "custom_base"; + version = "0.2.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0qx47d4w2mxa3rr6mrxdasgk7prxqwd0y9zpjhz61jayrkx1kw4d"; + }; + + beamDeps = []; + }; + + db_connection = buildMix rec { + name = "db_connection"; + version = "2.4.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1j6psw0dxq1175b6zcqpm6vavv4n6sv72ji57l8b6qczmlhnqhdd"; + }; + + beamDeps = [ connection telemetry ]; + }; + + decimal = buildMix rec { + name = "decimal"; + version = "2.0.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0xzm8hfhn8q02rmg8cpgs68n5jz61wvqg7bxww9i1a6yanf6wril"; + }; + + beamDeps = []; + }; + + deep_merge = buildMix rec { + name = "deep_merge"; + version = "1.0.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0c2li2a3hxcc05nwvy4kpsal0315yk900kxyybld972b15gqww6f"; + }; + + beamDeps = []; + }; + + earmark = buildMix rec { + name = "earmark"; + version = "1.4.18"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0q15ypgdr94z425dxb3blp6wqzrphsg1b6wscsfd13lmldnkpb2p"; + }; + + beamDeps = [ earmark_parser ]; + }; + + earmark_parser = buildMix rec { + name = "earmark_parser"; + version = "1.4.17"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "08r06hp1wwfbfpalqqxwpq9lsd42pwvmhjr6bcb1r9pckyfchfpr"; + }; + + beamDeps = []; + }; + + eblurhash = buildRebar3 rec { + name = "eblurhash"; + version = "1.1.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "07dmkbyafpxffh8ar6af4riqfxiqc547rias7i73gpgx16fqhsrf"; + }; + + beamDeps = []; + }; + + ecto = buildMix rec { + name = "ecto"; + version = "3.6.2"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0kl893yi9jxzxnpd5gafivzazn96z2q24y04lfw8dyg60kxnvbgg"; + }; + + beamDeps = [ decimal jason telemetry ]; + }; + + ecto_enum = buildMix rec { + name = "ecto_enum"; + version = "1.4.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1r2ffrr020fhfviqn21cv06sd3sp4bf1jra0xrgb3hl1f445rdcg"; + }; + + beamDeps = [ ecto ecto_sql postgrex ]; + }; + + ecto_psql_extras = buildMix rec { + name = "ecto_psql_extras"; + version = "0.7.4"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1ra9jh2p1jp1hn4g7aynivbrj52y9c20aspmqw6ksbkp3cpv079i"; + }; + + beamDeps = [ ecto_sql postgrex table_rex ]; + }; + + ecto_sql = buildMix rec { + name = "ecto_sql"; + version = "3.6.2"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0syv5wjdkywaxx9mmps0x9sdawqp3nnakbnf7av3ksj2yzkdgjay"; + }; + + beamDeps = [ db_connection ecto postgrex telemetry ]; + }; + + eimp = buildRebar3 rec { + name = "eimp"; + version = "1.0.14"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1dl3xdfd42y389fc3sbssva163jgpy48pni2kqnvjy9027rk64ah"; + }; + + beamDeps = [ p1_utils ]; + }; + + elixir_make = buildMix rec { + name = "elixir_make"; + version = "0.6.2"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1na8agkks1hrwq1lxfj4yd96bvfcs4hk7mbra9z6lli2vanrxr03"; + }; + + beamDeps = []; + }; + + esshd = buildMix rec { + name = "esshd"; + version = "0.1.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "10cryiv674p2mn9gvncl9j3rzgv0523chz9q6sm91lq960g38gnp"; + }; + + beamDeps = []; + }; + + eternal = buildMix rec { + name = "eternal"; + version = "1.2.2"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "10p7m6kv2z2c16gw36wgiwnkykss4lfkmm71llxp09ipkhmy77rc"; + }; + + beamDeps = []; + }; + + ex2ms = buildMix rec { + name = "ex2ms"; + version = "1.5.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "13vh9yrs60cifqxzw52n6xxdp174w704vm1ks45k4avrzla763b7"; + }; + + beamDeps = []; + }; + + ex_aws = buildMix rec { + name = "ex_aws"; + version = "2.1.9"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "040dmj94xg3wnk9wplm0myr2q12zad4w1xz1zc0n01y90dkpfv1y"; + }; + + beamDeps = [ hackney jason sweet_xml ]; + }; + + ex_aws_s3 = buildMix rec { + name = "ex_aws_s3"; + version = "2.2.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1g91dd4jfmqp9ds8ji5kqlgcm2bk6ajci3mpi0grxqki6dhmq5qm"; + }; + + beamDeps = [ ex_aws sweet_xml ]; + }; + + ex_const = buildMix rec { + name = "ex_const"; + version = "0.2.4"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0rwppain0bd36krph1as0vxlxb42psc6mlkfi67jp6fc21k39zcn"; + }; + + beamDeps = []; + }; + + ex_doc = buildMix rec { + name = "ex_doc"; + version = "0.24.2"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1nmpdxydbc1khcayab98gfv7km2qrqmgp1s64kjdkf11x3cy2d71"; + }; + + beamDeps = [ earmark_parser makeup_elixir makeup_erlang ]; + }; + + ex_machina = buildMix rec { + name = "ex_machina"; + version = "2.7.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1y2v4j1zg1ji8q8di0fxpc3z3n2jmbnc85d6hx68j4fykfisg6j1"; + }; + + beamDeps = [ ecto ecto_sql ]; + }; + + ex_syslogger = buildMix rec { + name = "ex_syslogger"; + version = "1.5.2"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "16c376cvw0bcjz8a6gs3nhmg037i894gl5kgxi8jdinv6r0sp7xb"; + }; + + beamDeps = [ poison syslog ]; + }; + + excoveralls = buildMix rec { + name = "excoveralls"; + version = "0.12.3"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1nnsr9dv7mybcxx3y5p2gqzyy3p479w21c55vvsq6hi6dihkx2jn"; + }; + + beamDeps = [ hackney jason ]; + }; + + fast_html = buildMix rec { + name = "fast_html"; + version = "2.0.5"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "01k51qri44535b1hwixlxk7151vph6vapswlfq918g245544ypv0"; + }; + + beamDeps = [ elixir_make nimble_pool ]; + }; + + fast_sanitize = buildMix rec { + name = "fast_sanitize"; + version = "0.2.2"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0rj4x64rl7pspagp30dhw9yzal4q2c8937am1m5akbshjbdh9wk9"; + }; + + beamDeps = [ fast_html plug ]; + }; + + file_system = buildMix rec { + name = "file_system"; + version = "0.2.10"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1p0myxmnjjds8bbg69dd6fvhk8q3n7lb78zd4qvmjajnzgdmw6a1"; + }; + + beamDeps = []; + }; + + finch = buildMix rec { + name = "finch"; + version = "0.10.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0xwh7b4nap3w5xmvzqq1w7gpjys5wwbqap60zakbrpnv5si4ncl0"; + }; + + beamDeps = [ castore mint nimble_options nimble_pool telemetry ]; + }; + + flake_id = buildMix rec { + name = "flake_id"; + version = "0.1.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "09yq3dlqqrb7v4ysblwpz1al0q5qcmryldkwq1kx5b71zn881z1i"; + }; + + beamDeps = [ base62 ecto ]; + }; + + floki = buildMix rec { + name = "floki"; + version = "0.30.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1f3b2wd1pmsgkl8np13pwgp57161p0wxfwnnrjzlq73x8hj3bh79"; + }; + + beamDeps = [ html_entities ]; + }; + + gen_smtp = buildRebar3 rec { + name = "gen_smtp"; + version = "0.15.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "03s40l97j6z4mx6a84cbl9w94v3dvfw4f97dqx4hi61hh2l19g99"; + }; + + beamDeps = []; + }; + + gen_stage = buildMix rec { + name = "gen_stage"; + version = "0.14.3"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0xld8m2l9a7pbzmq7vp0r9mz4pkisrjpslgbjs9ikhwlkllf4lw4"; + }; + + beamDeps = []; + }; + + gen_state_machine = buildMix rec { + name = "gen_state_machine"; + version = "2.0.5"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1j21ih8cm0kkirjd2dh0gcxhngf5h3dvv4gqw6khj9ibww2x9b2w"; + }; + + beamDeps = []; + }; + + gun = buildRebar3 rec { + name = "gun"; + version = "2.0.0-rc.2"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1z2lsbbpl2925z8x2ri0rhp30ccn9d08pgqd2hkxf4342jp1x7bb"; + }; + + beamDeps = [ cowlib ]; + }; + + hackney = buildRebar3 rec { + name = "hackney"; + version = "1.18.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0pjwbf87nqj2ki3i076whrswh2cdhklj6cbaikdj1mq40xidmz4s"; + }; + + beamDeps = [ certifi idna metrics mimerl parse_trans ssl_verify_fun unicode_util_compat ]; + }; + + html_entities = buildMix rec { + name = "html_entities"; + version = "0.5.2"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1k7xyj0q38ms3n5hbn782pa6w1vgd6biwlxr4db6319l828a6fy5"; + }; + + beamDeps = []; + }; + + html_sanitize_ex = buildMix rec { + name = "html_sanitize_ex"; + version = "1.3.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1mhr2jnyzrqv0298m6vghnc9v2iwck11kwfhyh07gmc8v0x3kyxb"; + }; + + beamDeps = [ mochiweb ]; + }; + + http_signatures = buildMix rec { + name = "http_signatures"; + version = "0.1.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "18s2b5383xl2qjijkxag4mvwk2p5kv2fw58c9ii7pk12fc08lfyc"; + }; + + beamDeps = []; + }; + + httpoison = buildMix rec { + name = "httpoison"; + version = "1.8.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0fiwkdrbj7mmz449skp7laz2jdwsqn3svddncmicd46gk2m9w218"; + }; + + beamDeps = [ hackney ]; + }; + + idna = buildRebar3 rec { + name = "idna"; + version = "6.1.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1sjcjibl34sprpf1dgdmzfww24xlyy34lpj7mhcys4j4i6vnwdwj"; + }; + + beamDeps = [ unicode_util_compat ]; + }; + + inet_cidr = buildMix rec { + name = "inet_cidr"; + version = "1.0.4"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1g61i08cizr99ivy050lv8fmvnwia9zmipfvlwff8jkhi40x78k4"; + }; + + beamDeps = []; + }; + + jason = buildMix rec { + name = "jason"; + version = "1.2.2"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0y91s7q8zlfqd037c1mhqdhrvrf60l4ax7lzya1y33h5y3sji8hq"; + }; + + beamDeps = [ decimal ]; + }; + + joken = buildMix rec { + name = "joken"; + version = "2.3.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "07mwnzzb9slhzqjmd0nbs4dyjkbb3v06km82mhvdbi8fkjkn7cjp"; + }; + + beamDeps = [ jose ]; + }; + + jose = buildMix rec { + name = "jose"; + version = "1.11.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1i8szzpmiqc7xdv0lp38ng9fild7c5182b4pzkx4qbydnfgnr3q7"; + }; + + beamDeps = []; + }; + + jumper = buildMix rec { + name = "jumper"; + version = "1.0.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0cvlbfkapkvbwaijmjq3cxg5m6yv4rh69wvss9kfj862i83mk31i"; + }; + + beamDeps = []; + }; + + libring = buildMix rec { + name = "libring"; + version = "1.4.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "10bvf64jkviyyyff12hlhq4p2439gphyvmya8z85m0c6x1gg1shz"; + }; + + beamDeps = []; + }; + + linkify = buildMix rec { + name = "linkify"; + version = "0.5.2"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "11mbbqm7yi6rhza5d2hd4fxkhdy3ik5n7sybj0n9bn0q09lsqwcd"; + }; + + beamDeps = []; + }; + + # majic = buildMix rec { + # name = "majic"; + # version = "1.0.0"; + + # src = fetchHex { + # pkg = "${name}"; + # version = "${version}"; + # sha256 = "17hab8kmqc6gsiqicfgsaik0rvmakb6mbshlbxllj3b5fs7qa1br"; + # }; + + # beamDeps = [ elixir_make mime nimble_pool plug ]; + # }; + + makeup = buildMix rec { + name = "makeup"; + version = "1.0.5"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1a9cp9zp85yfybhdxapi9haa1yykzq91bw8abmk0qp1z5p05i8fg"; + }; + + beamDeps = [ nimble_parsec ]; + }; + + makeup_elixir = buildMix rec { + name = "makeup_elixir"; + version = "0.14.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "04fyrd0fcyfvv4i3ngm3gbykhfrp9z6l2p1bhgg9xv7ah0d8nhzj"; + }; + + beamDeps = [ makeup ]; + }; + + makeup_erlang = buildMix rec { + name = "makeup_erlang"; + version = "0.1.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1fvw0zr7vqd94vlj62xbqh0yrih1f7wwnmlj62rz0klax44hhk8p"; + }; + + beamDeps = [ makeup ]; + }; + + meck = buildRebar3 rec { + name = "meck"; + version = "0.9.2"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "09jq0jrsd3dwzjlnwqjv6m9r2rijgiv57yja6jl41p2p2db4yd41"; + }; + + beamDeps = []; + }; + + metrics = buildRebar3 rec { + name = "metrics"; + version = "1.0.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "05lz15piphyhvvm3d1ldjyw0zsrvz50d2m5f2q3s8x2gvkfrmc39"; + }; + + beamDeps = []; + }; + + mime = buildMix rec { + name = "mime"; + version = "1.6.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "19qrpnmaf3w8bblvkv6z5g82hzd10rhc7bqxvqyi88c37xhsi89i"; + }; + + beamDeps = []; + }; + + mimerl = buildRebar3 rec { + name = "mimerl"; + version = "1.2.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "08wkw73dy449n68ssrkz57gikfzqk3vfnf264s31jn5aa1b5hy7j"; + }; + + beamDeps = []; + }; + + mint = buildMix rec { + name = "mint"; + version = "1.4.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "05q22zxbdbakd1xxcr3szi02900mklcwijyw4a2vyp419ca9xa8h"; + }; + + beamDeps = [ castore ]; + }; + + mochiweb = buildRebar3 rec { + name = "mochiweb"; + version = "2.18.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "16j8cfn3hq0g474xc5xl8nk2v46hwvwpfwi9rkzavnsbaqg2ngmr"; + }; + + beamDeps = []; + }; + + mock = buildMix rec { + name = "mock"; + version = "0.3.7"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0p3yrx049fdw88kjidngd2lkwqkkyck5r51ng2dxj7z41539m92d"; + }; + + beamDeps = [ meck ]; + }; + + mogrify = buildMix rec { + name = "mogrify"; + version = "0.9.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "01bzbfd0c932acnla5s3b5f9gvyyiwi0rgs815f15lipjccdykhk"; + }; + + beamDeps = []; + }; + + mox = buildMix rec { + name = "mox"; + version = "1.0.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1pzlqq9y4i9i7d0dm8ah2c5a7y2h9649gkz9hfqamnmbnwh0l6r0"; + }; + + beamDeps = []; + }; + + nimble_options = buildMix rec { + name = "nimble_options"; + version = "0.4.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0bd0pi3sij9vxhiilv25x6n3jls75g3b38rljvm1x896ycd1qw76"; + }; + + beamDeps = []; + }; + + nimble_parsec = buildMix rec { + name = "nimble_parsec"; + version = "0.5.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1cx9p22kkywkg40yqy9xswy4ighdw7i8cc9x1481pzy1d620n12w"; + }; + + beamDeps = []; + }; + + nimble_pool = buildMix rec { + name = "nimble_pool"; + version = "0.2.4"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1ipaxd8ik23xl1kzfd955316s9vvnp6956ba9rv8gdrpw5qq0zin"; + }; + + beamDeps = []; + }; + + oban = buildMix rec { + name = "oban"; + version = "2.3.4"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1prgpp7v03lgkia63j60jz3ds479ymm4991f882iizaq8x1s0367"; + }; + + beamDeps = [ ecto_sql jason postgrex telemetry ]; + }; + + open_api_spex = buildMix rec { + name = "open_api_spex"; + version = "3.10.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0rc7q857b8zb9vc4c699arjihca353rzm3bfjc31z0ib7pg2pfrd"; + }; + + beamDeps = [ jason plug poison ]; + }; + + p1_utils = buildRebar3 rec { + name = "p1_utils"; + version = "1.0.18"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "120znzz0yw1994nk6v28zql9plgapqpv51n9g6qm6md1f4x7gj0z"; + }; + + beamDeps = []; + }; + + parse_trans = buildRebar3 rec { + name = "parse_trans"; + version = "3.3.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "12w8ai6b5s6b4hnvkav7hwxd846zdd74r32f84nkcmjzi1vrbk87"; + }; + + beamDeps = []; + }; + + pbkdf2_elixir = buildMix rec { + name = "pbkdf2_elixir"; + version = "1.2.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "07s862m4y74fyv9gwdhrhx04rvpfrwgqkjlyy51b9w1h8r50md6k"; + }; + + beamDeps = [ comeonin ]; + }; + + phoenix = buildMix rec { + name = "phoenix"; + version = "1.5.9"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0za2fpplmdq3axwng8736h6vz9wzlifhxy8apcgjy0bwlqhcwjvy"; + }; + + beamDeps = [ jason phoenix_html phoenix_pubsub plug plug_cowboy plug_crypto telemetry ]; + }; + + phoenix_ecto = buildMix rec { + name = "phoenix_ecto"; + version = "4.2.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1h23fy3pylaszh3l2zafq1a7fjwlwb3yw7dy09p0mb4wi6p1p2j7"; + }; + + beamDeps = [ ecto phoenix_html plug ]; + }; + + phoenix_html = buildMix rec { + name = "phoenix_html"; + version = "3.1.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1z1kxwfis59szldhy7irwhkmkvkx9icjlflqawv46qzsrsi9h2hc"; + }; + + beamDeps = [ plug ]; + }; + + phoenix_live_dashboard = buildMix rec { + name = "phoenix_live_dashboard"; + version = "0.6.2"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0ywfqndxhjwx0pxv381p2rj5xzbaxvy248s41c1bba1ciarwdijv"; + }; + + beamDeps = [ ecto ecto_psql_extras mime phoenix_live_view telemetry_metrics ]; + }; + + phoenix_live_view = buildMix rec { + name = "phoenix_live_view"; + version = "0.17.5"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1qxhb1lw68vkz6h7q6ki0502pklfxgsx8sf72j11pxsd7mm6wn65"; + }; + + beamDeps = [ jason phoenix phoenix_html telemetry ]; + }; + + phoenix_pubsub = buildMix rec { + name = "phoenix_pubsub"; + version = "2.0.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0wgpa19l6xar0k2m117iz2kq3cw433llp07sqswpf5969y698bf5"; + }; + + beamDeps = []; + }; + + phoenix_swoosh = buildMix rec { + name = "phoenix_swoosh"; + version = "0.3.3"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1k81cvhbzbc3czvin45j1rqagzp7drk3s0rp2xa5clz06bm0qm2a"; + }; + + beamDeps = [ hackney phoenix phoenix_html swoosh ]; + }; + + plug = buildMix rec { + name = "plug"; + version = "1.10.4"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1874ixvvjklg0hnxr6d990qzarvvfxhd4s35c5bfqbixwwzj67md"; + }; + + beamDeps = [ mime plug_crypto telemetry ]; + }; + + plug_cowboy = buildMix rec { + name = "plug_cowboy"; + version = "2.5.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "06p7rmx01fknkf0frvjjaqs3qsz6066aa41qyd378n72lljqjb2v"; + }; + + beamDeps = [ cowboy cowboy_telemetry plug telemetry ]; + }; + + plug_crypto = buildMix rec { + name = "plug_crypto"; + version = "1.2.2"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1nxnxj62iv4yvm4771jbxpj3l4brn2crz053y12s998lv5x1qqw7"; + }; + + beamDeps = []; + }; + + plug_static_index_html = buildMix rec { + name = "plug_static_index_html"; + version = "1.0.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1kxm1flxw3rnsj5jj24c2p23wq1wyblbl32n4rf6046i6k7lzzbr"; + }; + + beamDeps = [ plug ]; + }; + + poison = buildMix rec { + name = "poison"; + version = "3.1.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1kng8xadrs03i77irxvdk9vfncrqzncmgxc5gc8y8gkknw76dj7y"; + }; + + beamDeps = []; + }; + + poolboy = buildRebar3 rec { + name = "poolboy"; + version = "1.5.2"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1qq116314418jp4skxg8c6jx29fwp688a738lgaz6h2lrq29gmys"; + }; + + beamDeps = []; + }; + + postgrex = buildMix rec { + name = "postgrex"; + version = "0.15.9"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1vmd63vxwz8knid424b0rbp200vj7q7rz3xp98yj5cjc7q81j1v1"; + }; + + beamDeps = [ connection db_connection decimal jason ]; + }; + + pot = buildRebar3 rec { + name = "pot"; + version = "1.0.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0vgvpiwiy1gm2npfm3qdybwvg39jllw13aig8ll1bn9icnbzb1zd"; + }; + + beamDeps = []; + }; + + prometheus = buildMix rec { + name = "prometheus"; + version = "4.8.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1dgwd8wxw2cifwmsmjvkbgr1n686n125ssm4b0vxngh70dqy3hhg"; + }; + + beamDeps = []; + }; + + prometheus_ecto = buildMix rec { + name = "prometheus_ecto"; + version = "1.4.3"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "10pd5cmm6m62xwlfp7al8yj62zn181rjizc1v9zb64zrfygjhrld"; + }; + + beamDeps = [ ecto prometheus_ex ]; + }; + + prometheus_phoenix = buildMix rec { + name = "prometheus_phoenix"; + version = "1.3.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0xccdidbzffgy2mpy18p017ijcgav2kv47b0v9ixklz9qi541lf4"; + }; + + beamDeps = [ phoenix prometheus_ex ]; + }; + + prometheus_plugs = buildMix rec { + name = "prometheus_plugs"; + version = "1.1.5"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0ybazh6r52vjpf14gjcphsavl3ggk9iapc0rr9wnv4yb7i4acwq2"; + }; + + beamDeps = [ accept plug prometheus_ex ]; + }; + + quack = buildMix rec { + name = "quack"; + version = "0.1.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0hr5ppds4a9vih14hzs3lfj07r5069w8ifr7022fn4j18jkvydnp"; + }; + + beamDeps = [ poison tesla ]; + }; + + ranch = buildRebar3 rec { + name = "ranch"; + version = "1.8.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1rfz5ld54pkd2w25jadyznia2vb7aw9bclck21fizargd39wzys9"; + }; + + beamDeps = []; + }; + + recon = buildMix rec { + name = "recon"; + version = "2.5.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0j26nin8h3zzypppkdxsjiwgjc8jm8n73b6cikvdh8h1snvcc8ap"; + }; + + beamDeps = []; + }; + + sleeplocks = buildRebar3 rec { + name = "sleeplocks"; + version = "1.1.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1q823i5bisc83pyssgrqkggyxiasm7b8dygzj2r943adzyp3gvl4"; + }; + + beamDeps = []; + }; + + ssl_verify_fun = buildRebar3 rec { + name = "ssl_verify_fun"; + version = "1.1.6"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1026l1z1jh25z8bfrhaw0ryk5gprhrpnirq877zqhg253x3x5c5x"; + }; + + beamDeps = []; + }; + + sweet_xml = buildMix rec { + name = "sweet_xml"; + version = "0.6.6"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0wrm3wx1c4wg8xj8lx1pg9xdpxhsbbry71l3kwgsizwjz1cc87if"; + }; + + beamDeps = []; + }; + + swoosh = buildMix rec { + name = "swoosh"; + version = "1.3.11"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1bqkp41sh4h0q5yjmk0ywf5x979rwxshz16gp619jks5vd4a1qpi"; + }; + + beamDeps = [ cowboy finch gen_smtp hackney jason mime plug_cowboy ]; + }; + + syslog = buildRebar3 rec { + name = "syslog"; + version = "1.1.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1qarnqappln4xhlr700rhnhfnfvgvv9l3y1ywdxmh83y7hvl2sjc"; + }; + + beamDeps = []; + }; + + table_rex = buildMix rec { + name = "table_rex"; + version = "3.1.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "141404hwnwnpspvhs112j2la8dfnvkwr0xy14ff42w6nljmj72k7"; + }; + + beamDeps = []; + }; + + telemetry = buildRebar3 rec { + name = "telemetry"; + version = "0.4.3"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0hc0fr2bh97wah9ycpm7hb5jdqr5hnl1s3b2ibbbx9gxbwvbhwpb"; + }; + + beamDeps = []; + }; + + telemetry_metrics = buildMix rec { + name = "telemetry_metrics"; + version = "0.6.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1iilk2n75kn9i95fdp8mpxvn3rcn3ghln7p77cijqws13j3y1sbv"; + }; + + beamDeps = [ telemetry ]; + }; + + tesla = buildMix rec { + name = "tesla"; + version = "1.4.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "06i0rshkm1byzgsphbr3al4hns7bcrpl1rxy8lwlp31cj8sxxxcm"; + }; + + beamDeps = [ castore finch gun hackney jason mime mint poison telemetry ]; + }; + + timex = buildMix rec { + name = "timex"; + version = "3.7.5"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1r3l50p8f8mxgghh079v1y5g02kzqr15ijbi7mkfzwl0lvf0hmm1"; + }; + + beamDeps = [ combine gettext tzdata ]; + }; + + trailing_format_plug = buildMix rec { + name = "trailing_format_plug"; + version = "0.0.7"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0gv9z8m1kpfs5f5zcsh9m6vr36s88x1xc6g0k6lr7sgk2m6dwkxx"; + }; + + beamDeps = [ plug ]; + }; + + tzdata = buildMix rec { + name = "tzdata"; + version = "1.0.5"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0nia83zpk0pb4jkpvhkmmgw8i5p6kd6cf776q6aj0pcym6i9llam"; + }; + + beamDeps = [ hackney ]; + }; + + ueberauth = buildMix rec { + name = "ueberauth"; + version = "0.6.3"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "0q0vz7vlbw66a32d7yij3p5l4a59bi0sygiynn8na38ll7c97hmg"; + }; + + beamDeps = [ plug ]; + }; + + unicode_util_compat = buildRebar3 rec { + name = "unicode_util_compat"; + version = "0.7.0"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "08952lw8cjdw8w171lv8wqbrxc4rcmb3jhkrdb7n06gngpbfdvi5"; + }; + + beamDeps = []; + }; + + unsafe = buildMix rec { + name = "unsafe"; + version = "1.0.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "1rahpgz1lsd66r7ycns1ryz2qymamz1anrlps986900lsai2jxvc"; + }; + + beamDeps = []; + }; + + web_push_encryption = buildMix rec { + name = "web_push_encryption"; + version = "0.3.1"; + + src = fetchHex { + pkg = "${name}"; + version = "${version}"; + sha256 = "18p2f1gqkg209vf3nychjxy7xpxhgiwyhn4halvr7yr2fvjv50jg"; + }; + + beamDeps = [ httpoison jose ]; + }; + }; +in self diff --git a/pkgs/pleroma/updating.txt b/pkgs/pleroma/updating.txt new file mode 100644 index 000000000..62fbcb1a4 --- /dev/null +++ b/pkgs/pleroma/updating.txt @@ -0,0 +1,10 @@ +in default.nix: + update `rev` and recompute sha256. + use nix to-sri sha256: + +run mix2nix inside the pleroma git root and pipe the output into mix.nix + inside default.nix, update all git mix deps + inside mix.nix, change base64url to use buildRebar3 instead of buildMix + +move majic from mix.nix -> default.nix and add: + buildInputs = [ file ]; diff --git a/services-conf/gitea-configuration.nix b/services-conf/gitea-configuration.nix new file mode 100644 index 000000000..c46749d04 --- /dev/null +++ b/services-conf/gitea-configuration.nix @@ -0,0 +1,13 @@ +{ config, pkgs, lib, ... }: + +{ + services.gitea.enable = true; + services.gitea.user = "git"; # default is 'gitea' + services.gitea.database.type = "postgres"; + services.gitea.database.user = "git"; + services.gitea.appName = "Perfectly Sane Git"; + services.gitea.domain = "git.uninsane.org"; + services.gitea.rootUrl = "https://git.uninsane.org/"; + services.gitea.cookieSecure = true; + # services.gitea.disableRegistration = true; +} diff --git a/services-conf/jellyfin-configuration.nix b/services-conf/jellyfin-configuration.nix new file mode 100644 index 000000000..47841b66e --- /dev/null +++ b/services-conf/jellyfin-configuration.nix @@ -0,0 +1,5 @@ +{ config, pkgs, lib, ... }: + +{ + services.jellyfin.enable = true; +} diff --git a/services-conf/matrix-configuration.nix b/services-conf/matrix-configuration.nix new file mode 100644 index 000000000..6809601aa --- /dev/null +++ b/services-conf/matrix-configuration.nix @@ -0,0 +1,38 @@ +# docs: https://nixos.wiki/wiki/Matrix +# docs: https://nixos.org/manual/nixos/stable/index.html#module-services-matrix-synapse +{ config, pkgs, lib, ... }: + +{ + services.matrix-synapse.enable = true; + services.matrix-synapse.server_name = "uninsane.org"; + + # services.matrix-synapse.enable_registration_captcha = true; + # services.matrix-synapse.enable_registration_without_verification = true; + services.matrix-synapse.enable_registration = true; + # services.matrix-synapse.registration_shared_secret = ""; + + # default for listeners is port = 8448, tls = true, x_forwarded = false. + # we change this because the server is situated behind nginx. + services.matrix-synapse.listeners = [ + { + port = 8008; + bind_address = "127.0.0.1"; + type = "http"; + tls = false; + x_forwarded = true; + resources = [ + { + names = [ "client" "federation" ]; + compress = false; + } + ]; + } + ]; + + services.matrix-synapse.extraConfig = '' + registration_requires_token: true + ''; + + # new users may be registered on the CLI: + # register_new_matrix_user -c /nix/store/8n6kcka37jhmi4qpd2r03aj71pkyh21s-homeserver.yaml http://localhost:8008 +} diff --git a/services-conf/nginx-configuration.nix b/services-conf/nginx-configuration.nix new file mode 100644 index 000000000..7fe3076ef --- /dev/null +++ b/services-conf/nginx-configuration.nix @@ -0,0 +1,167 @@ +# docs: https://nixos.wiki/wiki/Nginx +{ config, pkgs, lib, ... }: + +{ + services.nginx.enable = true; + # services.nginx.config = pkgs.lib.readFile /etc/nixos/services/nginx.conf; + # services.nginx.httpConfig = '' + # server { + # server_name uninsane.org; + # listen 80; + # location / { + # root /home/nixos; + # index index.html; + # } + # + # location ~* \.(png|ico|gif|jpg|jpeg)$ { + # expires 60m; + # } + + # location /share/ { + # autoindex on; + # } + # } + # ''; + services.nginx.virtualHosts."uninsane.org" = { + root = "/mnt/storage/opt/uninsane/root"; + addSSL = true; + enableACME = true; + + # allow matrix users to discover that user@uninsane.org is reachable via matrix.uninsane.org + locations."= /.well-known/matrix/server".extraConfig = + let + # use 443 instead of the default 8448 port to unite + # the client-server and server-server port for simplicity + server = { "m.server" = "matrix.uninsane.org:443"; }; + in '' + add_header Content-Type application/json; + return 200 '${builtins.toJSON server}'; + ''; + locations."= /.well-known/matrix/client".extraConfig = + let + client = { + "m.homeserver" = { "base_url" = "https://matrix.uninsane.org"; }; + "m.identity_server" = { "base_url" = "https://vector.im"; }; + }; + # ACAO required to allow element-web on any URL to request this json file + in '' + add_header Content-Type application/json; + add_header Access-Control-Allow-Origin *; + return 200 '${builtins.toJSON client}'; + ''; + }; + + services.nginx.virtualHosts."fed.uninsane.org" = { + addSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://127.0.0.1:4000"; + extraConfig = '' + # XXX colin: this block is in the nixos examples: i don't understand all of it + add_header 'Access-Control-Allow-Origin' '*' always; + add_header 'Access-Control-Allow-Methods' 'POST, PUT, DELETE, GET, PATCH, OPTIONS' always; + add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, Idempotency-Key' always; + add_header 'Access-Control-Expose-Headers' 'Link, X-RateLimit-Reset, X-RateLimit-Limit, X-RateLimit-Remaining, X-Request-Id' always; + if ($request_method = OPTIONS) { + return 204; + } + + add_header X-XSS-Protection "1; mode=block"; + add_header X-Permitted-Cross-Domain-Policies none; + add_header X-Frame-Options DENY; + add_header X-Content-Type-Options nosniff; + add_header Referrer-Policy same-origin; + add_header X-Download-Options noopen; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + + # colin: added this due to Pleroma complaining in its logs + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + client_max_body_size 16m; + ''; + }; + }; + + services.nginx.virtualHosts."matrix.uninsane.org" = { + addSSL = true; + enableACME = true; + + # TODO colin: replace this with something helpful to the viewer + # locations."/".extraConfig = '' + # return 404; + # ''; + + locations."/" = { + proxyPass = "http://127.0.0.1:8008"; + }; + + # locations."/_matrix" = { + # proxyPass = "http://127.0.0.1:8008"; + # }; + }; + + services.nginx.virtualHosts."git.uninsane.org" = { + addSSL = true; + enableACME = true; + + locations."/" = { + proxyPass = "http://127.0.0.1:3000"; + }; + }; + + # this is mostly taken from the official jellfin.org docs + services.nginx.virtualHosts."jelly.uninsane.org" = { + addSSL = true; + enableACME = true; + + locations."/" = { + proxyPass = "http://127.0.0.1:8096"; + extraConfig = '' + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Protocol $scheme; + proxy_set_header X-Forwarded-Host $http_host; + + # Disable buffering when the nginx proxy gets very resource heavy upon streaming + proxy_buffering off; + ''; + }; + # locations."/web/" = { + # proxyPass = "http://127.0.0.1:8096/web/index.html"; + # extraConfig = '' + # proxy_set_header Host $host; + # proxy_set_header X-Real-IP $remote_addr; + # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Proto $scheme; + # proxy_set_header X-Forwarded-Protocol $scheme; + # proxy_set_header X-Forwarded-Host $http_host; + # ''; + # }; + locations."/socket" = { + proxyPass = "http://127.0.0.1:8096"; + extraConfig = '' + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Protocol $scheme; + proxy_set_header X-Forwarded-Host $http_host; + ''; + }; + }; + + security.acme.acceptTerms = true; + security.acme.email = "acme@uninsane.org"; +} diff --git a/services-conf/pleroma-configuration.nix b/services-conf/pleroma-configuration.nix new file mode 100644 index 000000000..35361276a --- /dev/null +++ b/services-conf/pleroma-configuration.nix @@ -0,0 +1,72 @@ +# docs: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/networking/pleroma.nix +# +# to run it in a oci-container: https://github.com/barrucadu/nixfiles/blob/master/services/pleroma.nix +{ config, pkgs, lib, ... }: + +{ + services.pleroma.enable = true; + # XXX colin: this isn't checked into git, so make sure to create it first: + services.pleroma.secretConfigFile = "/etc/nixos/services-conf/pleroma.secret.exs"; + # services.pleroma.secretConfigFile = "/var/lib/pleroma/prod.secret.exs"; + services.pleroma.configs = [ + '' + import Config + + config :pleroma, Pleroma.Web.Endpoint, + url: [host: "fed.uninsane.org", scheme: "https", port: 443], + http: [ip: {127, 0, 0, 1}, port: 4000] + + config :pleroma, :instance, + name: "Perfectly Sane", + email: "dev@null", + notify_email: "dev@null", + limit: 5000, + registrations_open: false + + config :pleroma, :media_proxy, + enabled: false, + redirect_on_failure: true + #base_url: "https://cache.pleroma.social" + + config :pleroma, Pleroma.Repo, + adapter: Ecto.Adapters.Postgres, + username: "pleroma", + database: "pleroma", + hostname: "localhost", + pool_size: 10, + prepare: :named, + parameters: [ + plan_cache_mode: "force_custom_plan" + ] + + config :pleroma, :database, rum_enabled: false + # config :pleroma, :instance, static_dir: "/mnt/storage/opt/pleroma.nix/instance/static" + # config :pleroma, Pleroma.Uploaders.Local, uploads: "/mnt/storage/opt/pleroma.nix/uploads" + config :pleroma, :instance, static_dir: "/var/lib/pleroma/instance/static" + config :pleroma, Pleroma.Uploaders.Local, uploads: "/var/lib/pleroma/uploads" + config :pleroma, configurable_from_database: false + + config :pleroma, Pleroma.Upload, filters: [Pleroma.Upload.Filter.Exiftool] + + + # (enabled by colin) + # Enable Strict-Transport-Security once SSL is working: + config :pleroma, :http_security, + sts: true + + # (added by colin; based on https://docs.pleroma.social/backend/configuration/cheatsheet/#logger) + config :logger, + backends: [:console, {ExSyslogger, :ex_syslogger}] + + config :logger, :ex_syslogger, + level: :warn + '' + ]; + + systemd.services.pleroma.path = [ + # something inside pleroma invokes `sh` w/o specifying it by path, so this is needed to allow pleroma to start + pkgs.bash + # used by Pleroma to strip geo tags from uploads + pkgs.exiftool + ]; +} diff --git a/services-conf/postgres-configuration.nix b/services-conf/postgres-configuration.nix new file mode 100644 index 000000000..bdfed12a9 --- /dev/null +++ b/services-conf/postgres-configuration.nix @@ -0,0 +1,15 @@ +{ config, pkgs, lib, ... }: + +{ + services.postgresql.enable = true; + services.postgresql.dataDir = "/mnt/storage/opt/postgresql/13"; + # XXX colin: for a proper deploy, we'd want to include something for Pleroma here too. + # services.postgresql.initialScript = pkgs.writeText "synapse-init.sql" '' + # CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD ''; + # CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse" + # TEMPLATE template0 + # ENCODING = "UTF8" + # LC_COLLATE = "C" + # LC_CTYPE = "C"; + # ''; +} diff --git a/user-configuration.nix b/user-configuration.nix new file mode 100644 index 000000000..211ec19a5 --- /dev/null +++ b/user-configuration.nix @@ -0,0 +1,66 @@ +{ config, pkgs, lib, ... }: + +# installer docs: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/profiles/installation-device.nix +{ + # Users are exactly these specified here; + # old ones will be deleted (from /etc/passwd, etc) upon upgrade. + users.mutableUsers = false; + + # docs: https://nixpkgs-manual-sphinx-markedown-example.netlify.app/generated/options-db.xml.html#users-users + users.users.nixos = { + # sets group to "users" (?) + isNormalUser = true; + home = "/home/nixos"; + uid = 1000; + # XXX colin: this is what the installer has, but is it necessary? + # group = "users"; + extraGroups = [ "wheel" ]; + initialHashedPassword = ""; + shell = pkgs.bashInteractive; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGSDe/y0e9PSeUwYlMPjzhW0UhNsGAGsW3lCG3apxrD5 colin@colin.desktop" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG+MZ/l5d8g5hbxMB9ed1uyvhV85jwNrSVNVxb5ujQjw colin@colin.laptop" + ]; + packages = [ + pkgs.fd + pkgs.file + pkgs.git + pkgs.htop + pkgs.matrix-synapse + pkgs.mix2nix + pkgs.nmap + pkgs.ripgrep + pkgs.sudo + (pkgs.vim_configurable.customize { + name = "vim"; + vimrcConfig.customRC = '' + " wtf vim project: NOBODY LIKES MOUSE FOR VISUAL MODE + set mouse-=a + ''; + }) + ]; + }; + + # Automatically log in at the virtual consoles. + services.getty.autologinUser = "nixos"; + + security.sudo = { + enable = lib.mkDefault true; + wheelNeedsPassword = lib.mkForce false; + }; + + services.openssh = { + enable = true; + permitRootLogin = "no"; + passwordAuthentication = false; + }; + + # gitea doesn't create the git user + users.users.git = { + description = "Gitea Service"; + home = "/var/lib/gitea"; + useDefaultShell = true; + group = "gitea"; + isSystemUser = true; + }; +}