Skip to content

Commit 3efb581

Browse files
committed
chore: add nix-flake-based development environment
1 parent bb28c3a commit 3efb581

5 files changed

Lines changed: 56 additions & 5 deletions

File tree

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ pnpm-debug.log*
1919

2020
# macOS-specific files
2121
.DS_Store
22+
23+
.direnv

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ This is my personal portfolio and blog template. It allows you to create blog po
1111
- Plausible Analytics: Analytics integration with Plausible allows you to track visitor statistics and gain insights into the site's performance.
1212
- Light and Dark Theme: The site includes both light and dark themes, and the current theme is set based on system settings.
1313

14-
## Installation
14+
## Development
15+
This repository includes a Nix Flakes-based development environment. If Nix is configured on your system, run `nix develop` to enter the development environment. Optionally, [direnv](https://github.com/direnv/direnv) can automatically do this for you, when you change into the directory.
1516

16-
1. Clone the repository to your local machine.
17-
2. Install the necessary dependencies by running `bun install`.
18-
3. Customize the site's content and configuration files to reflect your personal information and preferences.
19-
4. Deploy the site, according to [Astro's documentation](https://docs.astro.build/en/guides/deploy/), to your hosting provider of choice.
17+
1. Install the necessary dependencies by running `bun install`.
18+
2. Start the development server by running `bun dev`.
19+
20+
## Deployment
21+
This repository contains a workflow that automatically deploys to GitHub Pages, for other options refer to [Astro's deployment guide](https://docs.astro.build/en/guides/deploy/).
2022

2123
## Usage
2224

flake.lock

Lines changed: 25 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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
description = "A Nix-flake-based Bun development environment";
3+
inputs = {
4+
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*";
5+
};
6+
outputs = { self, nixpkgs }:
7+
let
8+
supportedSystems = [ "x86_64-linux" "aarch64-darwin" "x86_64-darwin" "aarch64-linux" ];
9+
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
10+
pkgs = import nixpkgs { inherit system; };
11+
});
12+
in {
13+
devShells = forEachSupportedSystem ({ pkgs }: {
14+
default = pkgs.mkShell {
15+
packages = with pkgs; [
16+
bun
17+
];
18+
};
19+
});
20+
};
21+
}

0 commit comments

Comments
 (0)