Skip to content

Commit 83ae4ce

Browse files
committed
chore: setup nix flake and devcontainer
1 parent 567f8f4 commit 83ae4ce

4 files changed

Lines changed: 122 additions & 0 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
3+
{
4+
"name": "Debian",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/base:bullseye",
7+
"features": {
8+
"ghcr.io/devcontainers/features/github-cli:1": {},
9+
"ghcr.io/devcontainers/features/nix:1": {}
10+
},
11+
12+
// Features to add to the dev container. More info: https://containers.dev/features.
13+
// "features": {},
14+
15+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
16+
// "forwardPorts": [],
17+
18+
// Use 'postCreateCommand' to run commands after the container is created.
19+
"postCreateCommand": "nix develop --experimental-features \"nix-command flakes\""
20+
// Configure tool-specific properties.
21+
// "customizations": {},
22+
23+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
24+
// "remoteUser": "root"
25+
}

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,15 @@ pkg install libspatialite
6161
go install -v github.com/tsirysndr/mada@latest
6262
```
6363

64+
### Nix
65+
66+
```bash
67+
git clone https://github.com/tsirysndr/mada
68+
cd mada
69+
nix develop
70+
go install
71+
```
72+
6473
## 🚀 Usage
6574

6675
With Docker:

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
description = "A Nix-flake-based Go development environment";
3+
4+
inputs = {
5+
nixpkgs.url = "github:nixos/nixpkgs/release-23.05";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = {
10+
self,
11+
nixpkgs,
12+
flake-utils,
13+
}:
14+
flake-utils.lib.eachDefaultSystem
15+
(system: let
16+
pkgs = import nixpkgs {
17+
inherit system;
18+
};
19+
in {
20+
devShells.default = pkgs.mkShell {
21+
buildInputs = [
22+
pkgs.go
23+
pkgs.libspatialite
24+
];
25+
};
26+
});
27+
}

0 commit comments

Comments
 (0)