Skip to content

Commit 006ce4d

Browse files
committed
build(nix): Add Nix-based dev environment configuration
1 parent a26f40a commit 006ce4d

File tree

6 files changed

+91
-0
lines changed

6 files changed

+91
-0
lines changed

.direnv/.gitkeep

Whitespace-only changes.

.envrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# shellcheck shell=bash
2+
3+
if ! has nix_direnv_version || ! nix_direnv_version 1.6.1; then
4+
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/1.6.1/direnvrc" "sha256-aFwy76WtzXD7SVXWetpg+welXMZI/VcEUPQ2WUMXYSY="
5+
fi
6+
7+
dotenv_if_exists
8+
nix_direnv_watch_file shell.nix
9+
use flake

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,10 @@ __test__library__
88
*.swp
99

1010
dlang-tour-test-library
11+
12+
# Nix build artifact:
13+
result
14+
15+
# Direnv:
16+
.direnv/*
17+
!.direnv/.gitkeep

flake.lock

Lines changed: 43 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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
description = "Dlang Tour";
3+
4+
inputs = {
5+
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
6+
flake-utils.url = github:numtide/flake-utils;
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils }:
10+
flake-utils.lib.simpleFlake {
11+
inherit self nixpkgs;
12+
name = "dlang-tour";
13+
shell = ./shell.nix;
14+
};
15+
}

shell.nix

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{ pkgs ? import <nixpkgs> { } }: with pkgs;
2+
mkShell {
3+
buildInputs = [
4+
figlet
5+
glibc.static
6+
zlib.static
7+
(openssl.override { static = true; }).dev
8+
dmd
9+
dtools
10+
dub
11+
ldc
12+
];
13+
14+
shellHook = ''
15+
figlet "Welcome to Dlang Tour"
16+
'';
17+
}

0 commit comments

Comments
 (0)