1. 38
    1. 7

      Out of curiosity, did you write a package that uses the binary releases out of simplicity, or did you run into issues using the Go tooling in Nixpkgs to build from source? (If the latter, I’d love to hear about them.)

      1. 4

        I’m new to Nix. I took the easiest way possible. It’d would be great if you can show me how to build GtS from source.

        1. 3
          { buildGoModule, fetchFromGitHub }:
          
          buildGoModule rec {
            pname = "gotosocial";
            version = "0.5.2";
            src = fetchFromGitHub {
              owner = "superseriousbusiness";
              repo = "gotosocial";
              rev = "v${version}";
              sha256 = "sha256-fQDxU2+sj0QhGOQQRVjKzlyi1PEm/O0B8/V4cac4Kdo=";
            };
            vendorSha256 = null;
          }
          

          You can then pkgs.callPackage the above file somwhere in your nix config. Or better, if you feel like spending a bit more time on this: clean up your module and this derivation (add the relevant meta attributes) open a PR in Nixpkgs adding this derivation and your module.

          [Edit]: there’s apparently somebody else working on this https://github.com/NixOS/nixpkgs/pull/202110 . You can potentially team up :)


          In general, the entry point to find out this kind of information for a lanugage you’re not familiar with is the nixpkgs manual. In that particular case, here’s the relevant golang section: https://nixos.org/manual/nixpkgs/stable/#sec-language-go

    2. 6

      Just a little nitpick

      Instead of import file.nix { inherit pkgs; } you can pkgs.callPackage file.nix { }.

      That way you can destructure the same way as people do in nixpkgs and can use the function override if you want later.

      You can also use a recursive attrset instead of that let expression.

      1. 2

        Thanks! I’m new to the ways of Nix.

      2. 1

        What would be the benefit of using rec attrset instead of the let expression?

        1. 2

          DRY

          rec attrset works like both an attrset and a let expression

          1. 2

            I prefer let … in … over rec attrsets, you can always use inherit for the fields to not repeat yourself that much and I had bad experience with rec in the past (the errors were not that helpful).

    3. 6

      I’ve been searching for a mastadon alternative written in Go, so that I can contribute if need be. I’m total n00b to fediverse and activitypub and so all of my searches never found this. Thank you greatly for posting.

      1. 6

        Another option that fits the small and hackable criteria is honk. There are a handful of people that run their own forks I’ve discovered since running my own instance.

        1. 3

          I’d say that if you’re wanting high compatibility with the fediverse, honk is probably further away than gotosocial and with less inclination to fix the issues.

          1. 8

            High compatibility with Mastodon, you mean. honk is perfectly ActivityPub compliant. Can’t blame honk if Mastodon does things in a non-standard way.

        2. 1

          I have been considering honk for a while but haven’t made the switch yet. Do you have experience with moving an account using the account migration feature from Mastodon? (https://docs.joinmastodon.org/user/moving/#move)

          1. 3

            Not sure about honk, but gotosocial doesn’t support the move activity yet, there’s an issue and the thing is on the roadmap for next year.

          2. 2

            Honk does have an import command for pulling in content from Mastodon and Twitter backups. I’ve never tried it before; I started with Honk and left my Twitter behind.

        3. 1

          One more question, do you maybe have some pointers to forks? I couldn’t find any and I’d like to remove the sqlite dependency and let honk serve tls itself instead of requiring relayd or a webserver in front of it.

            1. 2

              Thanks! Just added some patches myself: https://github.com/timkuijsten/honk

      2. 4

        GtS is still a young project, but definitely one that would benefit from those eager to help!

      3. 3

        There is also akkoma, which I’ve yet to have a good look at. Written in elexir i believe

    4. 3

      I wanted the same thing re: vanity username but I have zero faith in my ability to self host so I went for a different approach that leverages WebFinger to create an alias to my real Mastodon account, it might be of some interest to folks.

      1. 2

        Relatedly, something similar can be achieved with a redirect. Check out John’s post for another way to be findable on the Fediverse via your own domain.

    5. 3

      I have a wip gotosocial package and nixos module in the works. The PR might surface once I get postgres to behave

    6. 1

      You should use formats.yaml to generate the configuration file.

      1. 1

        Thanks. Changed it.

    7. 1

      Interestingly, I came up with a very similar configuration while standing up my own gotosocial instance on NixOS. This post is helpful since I didn’t know how to unpack web assets from the binary release and how GTS configuration can be generated. Thanks for sharing!

      1. 1

        I didn’t know how to unpack web assets from the binary release

        It seems that they’re just contained alongside the binary in the release tarball – what did you do instead? (Not the author or OP, just curious.)

        1. 1

          I just copied web assets manually, low tech, I know :)