Skip to content

Commit 7a2fe11

Browse files
authored
feat: add flake (#2)
1 parent b4c94c2 commit 7a2fe11

File tree

4 files changed

+71
-0
lines changed

4 files changed

+71
-0
lines changed

.envrc

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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.hugo_build.lock
33
/resources/**
44
*.cast
5+
.direnv

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: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
description = "Hugo Blog Flake";
3+
4+
# Flake inputs
5+
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
6+
7+
# Flake outputs
8+
outputs = { self, nixpkgs }:
9+
let
10+
# The systems supported for this flake
11+
supportedSystems = [
12+
"x86_64-linux" # 64-bit Intel/AMD Linux
13+
"aarch64-linux" # 64-bit ARM Linux
14+
"x86_64-darwin" # 64-bit Intel macOS
15+
"aarch64-darwin" # 64-bit ARM macOS
16+
];
17+
18+
# Helper to provide system-specific attributes
19+
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
20+
pkgs = import nixpkgs { inherit system; };
21+
});
22+
in
23+
{
24+
devShells = forEachSupportedSystem ({ pkgs }: {
25+
default = pkgs.mkShell {
26+
packages = with pkgs; [
27+
hugo
28+
gnumake
29+
];
30+
31+
env = { };
32+
33+
shellHook = ''
34+
echo
35+
printf '\033[32mCreate new site:\033[0m\n'
36+
echo hugo new posts/sed.md
37+
echo
38+
printf '\033[32mServe blog locally:\033[0m\n'
39+
echo make serve
40+
'';
41+
};
42+
});
43+
};
44+
}

0 commit comments

Comments
 (0)