commit 76368e6ae8b02ffcaaa2479a518fbe7df495884a
parent 7c5cc12d42882890c533e78a1dcdfdf9a263b2b9
Author: Chris <chris@echoz.io>
Date: Thu, 6 Nov 2025 19:54:01 +0100
chore: add flake w/ devshell w/ hugo
Diffstat:
5 files changed, 79 insertions(+), 1 deletion(-)
diff --git a/.editorconfig b/.editorconfig
@@ -1,4 +1,8 @@
-root=true
[*]
+charset = utf-8
+end_of_line = lf
indent_style = space
+insert_final_newline = true
+max_line_length = 100
+trim_trailing_whitespace = true
indent_size = 2
diff --git a/.envrc b/.envrc
@@ -0,0 +1 @@
+use flake
diff --git a/.gitignore b/.gitignore
@@ -1,3 +1,6 @@
.hugo_build.lock
/public
/resources
+result
+.direnv
+.env
diff --git a/flake.lock b/flake.lock
@@ -0,0 +1,26 @@
+{
+ "nodes": {
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1762111121,
+ "narHash": "sha256-4vhDuZ7OZaZmKKrnDpxLZZpGIJvAeMtK6FKLJYUtAdw=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "b3d51a0365f6695e7dd5cdf3e180604530ed33b4",
+ "type": "github"
+ },
+ "original": {
+ "id": "nixpkgs",
+ "ref": "nixos-unstable",
+ "type": "indirect"
+ }
+ },
+ "root": {
+ "inputs": {
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
@@ -0,0 +1,44 @@
+{
+ inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
+
+ outputs =
+ { nixpkgs, ... }:
+ let
+ lib = nixpkgs.lib;
+ systems = [
+ "aarch64-darwin"
+ "aarch64-linux"
+ "x86_64-darwin"
+ "x86_64-linux"
+ ];
+ argsFor = system: {
+ pkgs = nixpkgs.legacyPackages.${system};
+ };
+ forAllSystems = f: lib.genAttrs systems (system: f (argsFor system));
+ in
+ {
+ devShells = forAllSystems (
+ { pkgs, ... }:
+ {
+ default = pkgs.mkShell {
+ packages = with pkgs; [
+ hugo
+ ];
+ };
+ }
+ );
+
+ formatter = forAllSystems (
+ { pkgs, ... }:
+ pkgs.treefmt.withConfig {
+ settings = {
+ on-unmatched = "info";
+ formatter.nixfmt = {
+ command = lib.getExe pkgs.nixfmt-rfc-style;
+ includes = [ "*.nix" ];
+ };
+ };
+ }
+ );
+ };
+}