cultist.club-website/flake.nix

59 lines
1.6 KiB
Nix
Raw Normal View History

2026-05-19 22:36:24 +03:00
{
description = "cultist.club landing page";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
};
outputs = { self, nixpkgs }:
let
systems = [
"x86_64-linux"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
in
{
packages = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
cultist-website = pkgs.buildGoModule {
pname = "cultist-website";
version = "0.1.0";
src = ./.;
vendorHash = null;
2026-05-19 22:56:16 +03:00
env.CGO_ENABLED = "0";
2026-05-19 22:36:24 +03:00
nativeBuildInputs = [ pkgs.makeWrapper ];
ldflags = [ "-s" "-w" ];
postInstall =
2026-05-19 22:53:01 +03:00
let
linuxWrap = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isLinux ''
2026-05-19 22:36:24 +03:00
wrapProgram $out/bin/cultist-website \
--prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.procps ]}
2026-05-19 22:53:01 +03:00
'';
in
''
mv $out/bin/website $out/bin/cultist-website
${linuxWrap}
'';
2026-05-19 22:36:24 +03:00
};
in
{
default = cultist-website;
cultist-website = cultist-website;
});
apps = forAllSystems (system: {
default = {
type = "app";
program = "${self.packages.${system}.default}/bin/cultist-website";
};
});
devShells = forAllSystems (system: {
default = import nixpkgs { inherit system; }.mkShell {
packages = [ (import nixpkgs { inherit system; }).go ];
};
});
};
}