-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
42 lines (38 loc) · 1.52 KB
/
flake.nix
File metadata and controls
42 lines (38 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
description = "Hugo isolated development environment for myBlog";
inputs = {
# Using nixos-unstable ensures you get the absolute latest version of Hugo
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
# Required because Microsoft Edge is proprietary/unfree software
config.allowUnfree = true;
};
in
{
devShells.default = pkgs.mkShell {
# These packages are temporarily added to your PATH when in this directory
buildInputs = with pkgs; [
hugo # Note: The Nixpkgs hugo is the "extended" version by default!
nodejs # Replaces your nvm install
gh # GitHub CLI
microsoft-edge # Installed seamlessly for your VS Code headless debugging
];
shellHook = ''
echo "🚀 Welcome to the myBlog Nix Shell!"
echo "Hugo version: $(hugo version | awk '{print $2}')"
echo "Node version: $(node -v)"
# This ensures any global npm packages (like blowfish-tools)
# you install locally stay isolated to this project folder.
export NPM_CONFIG_PREFIX=$PWD/.npm-global
export PATH=$NPM_CONFIG_PREFIX/bin:$PATH
'';
};
}
);
}