Skip to content

Commit

Permalink
flake
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Dec 17, 2024
1 parent 924094a commit 794b4ab
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 0 deletions.
1 change: 1 addition & 0 deletions .direnv/flake-profile
1 change: 1 addition & 0 deletions .direnv/flake-profile-3-link
6 changes: 6 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# If we are a computer with nix-shell available, then use that to setup
# the build environment with exactly what we need.
if has nix; then
watch_file nix/{devShell}.nix
use flake
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ yarn-error.log*

# .env files
.env*
!.envrc
!.env.sample

# vercel
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
SHELL := /usr/bin/env bash

.PHONY: dev
dev: node_modules/.installed .env.local
source .env.local && npm run dev
Expand Down
61 changes: 61 additions & 0 deletions flake.lock

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

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

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/release-24.11";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = {
self,
flake-utils,
nixpkgs,
...
}: flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
in {
devShell = pkgs.callPackage ./nix/devShell.nix {};
formatter = pkgs.alejandra;
}
);
}
16 changes: 16 additions & 0 deletions nix/devShell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ mkShell
, bash
, nodejs_22
}: mkShell rec {
name = "ghostty.org";

packages = [
# Our Makefile requires a modern bash. If the developer computer is
# running macOS then it ships with an old broken version of bash.
# This ensures that the Makefile works. Alternately, we can just
# fix the Makefile.
bash

nodejs_22
];
}

0 comments on commit 794b4ab

Please sign in to comment.