diff options
author | Alan Pearce | 2024-06-18 12:20:06 +0200 |
---|---|---|
committer | Alan Pearce | 2024-06-18 12:22:12 +0200 |
commit | cf0da6d13edc55c003564f31d56a659cfa681e0c (patch) | |
tree | fc39a25b1a69b7922106b538c80fc2ecd9bb08ae /nix | |
parent | f690e8cb7a820b0685b98f83a6761cfc169487e4 (diff) | |
download | website-cf0da6d13edc55c003564f31d56a659cfa681e0c.tar.lz website-cf0da6d13edc55c003564f31d56a659cfa681e0c.tar.zst website-cf0da6d13edc55c003564f31d56a659cfa681e0c.zip |
remove flake and docker setup
Diffstat (limited to 'nix')
-rw-r--r-- | nix/default.nix | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/nix/default.nix b/nix/default.nix deleted file mode 100644 index 095b3f7..0000000 --- a/nix/default.nix +++ /dev/null @@ -1,101 +0,0 @@ -{ pkgs, self }: -let - version = "unstable"; - shortSHA = self.shortRev or self.dirtyShortRev; - fullSHA = self.rev or self.dirtyRev; - mkDocker = type: { server, website }: - let - PORT = 80; - in - pkgs.dockerTools.${type} { - name = "registry.fly.io/alanpearce-eu"; - tag = fullSHA; - contents = [ - website - ]; - config = { - Cmd = [ "${server}/bin/server" ]; - Env = [ - "PRODUCTION=true" - "LISTEN_ADDRESS=::" - "PORT=${builtins.toString PORT}" - ]; - ExposedPorts = { - "${builtins.toString PORT}/tcp" = { }; - }; - }; - }; - mkDockerStream = mkDocker "streamLayeredImage"; - mkDockerImage = mkDocker "buildLayeredImage"; -in -with pkgs; rec { - default = server; - builder = buildGoApplication { - pname = "website-builder"; - inherit version; - CGO_ENABLED = 0; - src = with lib.fileset; toSource { - root = ./..; - fileset = unions [ - ./../go.mod - ./../go.sum - ./../cmd/build - ./../internal - ]; - }; - modules = ./gomod2nix.toml; - subPackages = [ "cmd/build" ]; - }; - website = runCommandLocal "build" - { - src = with lib.fileset; toSource { - root = ./..; - fileset = unions [ - ./../config.toml - ./../content - ./../static - ./../templates - ]; - }; - } '' - ${builder}/bin/build -s $src -d $out - ''; - server = buildGoApplication { - pname = "server"; - inherit version; - CGO_ENABLED = 0; - src = with lib.fileset; toSource { - root = ./..; - fileset = unions [ - ./../go.mod - ./../go.sum - ./../cmd/server - ./../internal - ]; - }; - modules = ./gomod2nix.toml; - subPackages = [ "cmd/server" ]; - ldflags = [ - "-s" - "-w" - "-X" - "website/internal/server.CommitSHA=${fullSHA}" - "-X" - "website/internal/server.ShortSHA=${shortSHA}" - ]; - }; - docker-stream = mkDockerStream { inherit server website; }; - docker-stream-aarch64-linux = mkDockerStream { - inherit website; server = (self.packages.aarch64-linux.server); - }; - docker-stream-x86_64-linux = mkDockerStream { - inherit website; server = (self.packages.x86_64-linux.server); - }; - docker-image = mkDockerImage { inherit server website; }; - docker-image-aarch64-linux = mkDockerImage { - inherit website; server = (self.packages.aarch64-linux.server); - }; - docker-image-x86_64-linux = mkDockerImage { - inherit website; server = (self.packages.x86_64-linux.server); - }; -} |