{ inputs.nixpkgs.url = "github:nixos/nixpkgs"; outputs = { self , nixpkgs , }: let supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; forAllSystems = nixpkgs.lib.genAttrs supportedSystems; nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); in { packages = forAllSystems (system: let pkgs = nixpkgsFor.${system}; honk = self.packages.${system}.honk; files = pkgs.lib.fileset.toSource { root = ./.; fileset = pkgs.lib.fileset.unions [ ./. ]; }; in { honk = pkgs.buildGoModule { name = "honk"; rev = "master"; src = pkgs.lib.fileset.toSource { root = ./.; fileset = pkgs.lib.fileset.unions [ ./go.mod ./go.sum ./views ./memes ./schema.sql ./activity.go ./admin.go ./avatar.go ./backend.go ./backupdb.go ./bloat.go ./cli.go ./database.go ./deliverator.go ./encrypt.go ./fun.go ./hfcs.go ./honk.go ./import.go ./main.go ./masto.go ./masto_util.go ./sensors.go ./skulduggery.go ./syndicate.go ./unveil.go ./upgradedb.go ./util.go ./web.go ]; }; CGO_ENABLED = 1; nativeBuildInputs = [ pkgs.gcc pkgs.mercurial ]; buildInputs = [ pkgs.sqlite ]; vendorHash = "sha256-shn9d+w9+nE60zaLtEmwwHAL54JLebgmiolom2zFBxA="; }; docker = pkgs.dockerTools.buildLayeredImage { name = "sini:5000/honk"; tag = "latest"; contents = [ files honk pkgs.cacert pkgs.bashInteractive pkgs.coreutils pkgs.sqlite ]; config = { Entrypoint = [ "${honk}/bin/honk" ]; ExposedPorts = { "5555/tcp" = { }; }; }; }; }); defaultPackage = forAllSystems (system: self.packages.${system}.honk); devShells = forAllSystems (system: let pkgs = nixpkgsFor.${system}; in { default = pkgs.mkShell { buildInputs = [ pkgs.sqlite ]; nativeBuildInputs = with pkgs; [ go gcc ]; CGO_ENABLED = 1; CC = "${pkgs.gcc}/bin/gcc"; }; }); }; }