Installing Goshorly on NixOS Latest

Goshorly is an open-source URL shortener designed for high throughput with minimal latency. In this tutorial, we will show you how to install Goshorly on NixOS Latest using the Gitea repository.

Prerequisites

  • A NixOS Latest installation.
  • Basic knowledge of Nix package manager.

Installation

  1. Open configuration.nix file:
sudo nano /etc/nixos/configuration.nix
  1. Add the following lines at the bottom of the file:
  services.goshorly = {
    enable = true;
    listenPort = 8080;
  };

  nixpkgs.config.packageOverrides = pkgs: {
    goshorly = pkgs.golangPackages.go.tools.go.get {
      pname = "goshorly";
      fetch = {
        type = "git";
        url = "https://gitea.hackmi.ch/Phil/goshorly";
        rev = "v1.0.0";
        sha256 = "0000000000000000000000000000000000000000000000000000";
      };
    };
  };
  1. Save and close the file.

  2. Update the system:

sudo nixos-rebuild switch
  1. Start the Goshorly service:
sudo systemctl start goshorly
  1. Verify that the service is running:
sudo systemctl status goshorly

Conclusion

Congratulations! You have successfully installed Goshorly on NixOS Latest. Now you can use this URL shortener to easily create short links for your projects.