Skip to content

Commit

Permalink
build(nix): Add Nix-based dev environment configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
PetarKirov committed Mar 30, 2022
1 parent a26f40a commit 006ce4d
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 0 deletions.
Empty file added .direnv/.gitkeep
Empty file.
9 changes: 9 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# shellcheck shell=bash

if ! has nix_direnv_version || ! nix_direnv_version 1.6.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/1.6.1/direnvrc" "sha256-aFwy76WtzXD7SVXWetpg+welXMZI/VcEUPQ2WUMXYSY="
fi

dotenv_if_exists
nix_direnv_watch_file shell.nix
use flake
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ __test__library__
*.swp

dlang-tour-test-library

# Nix build artifact:
result

# Direnv:
.direnv/*
!.direnv/.gitkeep
43 changes: 43 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
description = "Dlang Tour";

inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
flake-utils.url = github:numtide/flake-utils;
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.simpleFlake {
inherit self nixpkgs;
name = "dlang-tour";
shell = ./shell.nix;
};
}
17 changes: 17 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ pkgs ? import <nixpkgs> { } }: with pkgs;
mkShell {
buildInputs = [
figlet
glibc.static
zlib.static
(openssl.override { static = true; }).dev
dmd
dtools
dub
ldc
];

shellHook = ''
figlet "Welcome to Dlang Tour"
'';
}

0 comments on commit 006ce4d

Please sign in to comment.