This commit is contained in:
Michael Zhang 2024-08-21 23:34:07 -05:00
commit 7122683d4a
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B
6 changed files with 117 additions and 0 deletions

6
.gitignore vendored Normal file
View file

@ -0,0 +1,6 @@
/result*
/include.nix
/ubuntu-24.04.tar.gz
/gitit.tar.gz
/docker-data

13
build.sh Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env sh
set -euo pipefail
docker pull ubuntu:24.04
docker image save -o ubuntu-24.04.tar.gz ubuntu:24.04
NAME=$(nix store add-file ./ubuntu-24.04.tar.gz)
echo $NAME > include.nix
git add -f include.nix
nix build -o gitit.tar.gz
git rm --cached include.nix
docker load < gitit.tar.gz
docker tag gitit:0.15.1.2 git.mzhang.io/michael/gitit:0.15.1.2
# docker push git.mzhang.io/michael/gitit:0.15.1.2

6
docker-compose.yml Normal file
View file

@ -0,0 +1,6 @@
services:
gitit:
image: gitit:0.15.1.2
ports: [8000:5001]
volumes:
- ./docker-data:/data

60
flake.lock Normal file
View file

@ -0,0 +1,60 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"id": "flake-utils",
"type": "indirect"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1723991338,
"narHash": "sha256-Grh5PF0+gootJfOJFenTTxDTYPidA3V28dqJ/WV7iis=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8a3354191c0d7144db9756a74755672387b702ba",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

27
flake.nix Normal file
View file

@ -0,0 +1,27 @@
{
description = "A very basic flake";
inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; };
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
version = "0.15.1.2";
gitit = pkgs.dockerTools.buildImage {
name = "gitit";
tag = version;
fromImage = import ./include.nix;
config = {
Cmd = [ "${pkgs.gitit}/bin/gitit" ];
Env = [ "LANG=C.UTF-8" ];
WorkDir = "/data";
};
copyToRoot = [ pkgs.gnugrep pkgs.git ];
};
in rec {
packages = flake-utils.lib.flattenTree { inherit gitit; };
defaultPackage = packages.gitit;
});
}

5
publish.sh Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env sh
set -euo pipefail
docker tag gitit:0.15.1.2 git.mzhang.io/michael/gitit:0.15.1.2
docker push git.mzhang.io/michael/gitit:0.15.1.2