https://github.com/vst/gidek
Backup Git(Hub) Repositories
https://github.com/vst/gidek
Last synced: 6 months ago
JSON representation
Backup Git(Hub) Repositories
- Host: GitHub
- URL: https://github.com/vst/gidek
- Owner: vst
- License: mit
- Created: 2023-12-19T00:32:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-01-10T12:57:31.000Z (7 months ago)
- Last Synced: 2026-01-11T03:59:47.975Z (6 months ago)
- Language: Haskell
- Homepage: https://thenegation.com/posts/backup-github-repos/
- Size: 105 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# gidek - Backup Git(Hub) Repositories
> **TODO** Provide minimum viable documentation.
`gidek` lets you backup Git repositories hosted (for now only) on [GitHub].
The idea is that you specify a list of GitHub repositories to backup and `gidek`
keeps cloning them everytime it is invoked. The list of GitHub repositories of
interest can be specified as:
1. Specific GitHub repositories by their `[owner]/[repository-name]` handle, or
2. All GitHub repositories which belong to specific GitHub users or
organizations, ie. owners.
## Quickstart
A NixOS module is provided for both classic and flake-based Nix setups. Add
following to your configuration and edit it as per your needs:
```nix
imports = [
"${sources.gidek}/nix/modules/nixos"
];
services.gidek = {
enable = true;
user = "vst";
schedule = "Sat *-*-* 00:00:01";
};
programs.gidek = {
enable = true;
config = {
store = "/data/gidek";
token_file = config.sops.secrets.github_token.path;
repos = [
{ type = "single"; name = "vst/gidek"; }
# { type = "user"; name = "vst"; }
# { type = "organization"; name = "fourmolu"; }
];
};
```
Alternatively, clone the repository:
```sh
git clone git@github.com:vst/gidek.git
cd gidek
```
Using `nix profile`:
```sh
nix profile install --file default.nix app
```
Using `nix-env`
```sh
nix-env -i -f default.nix -A app
```
Create a configuration file:
```sh
cat < config.yaml
store: /tmp/gidek/store
token: $(gh auth token)
token_file: /var/run/secrets/github_token
repos:
- type: single
name: vst/gidek
- type: user
name: vst
- type: organization
name: fourmolu
EOF
```
Plan backups:
```sh
gidek --config config.yaml plan
```
Run backups:
```sh
gidek --config config.yaml backup
```
## Development
Provision `direnv`:
```sh
direnv allow
```
Check, lint, test and build everything with this:
```sh
cabal verify [-c | --clean]
```
[GitHub]: https://github.com