-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
70 lines (63 loc) · 2.3 KB
/
flake.nix
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
description = "Development environment and build process for a Hugo app with Python requirements";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
config.allowUnfree = true;
});
mkDevShell = system:
let
pkgs = nixpkgsFor.${system};
in
{
default = pkgs.mkShell {
packages = with pkgs; [
hugo # Hugo for building the website
vscode # VSCode for development
python312Packages.feedparser # Python package: feedparser
python312Packages.requests # Python package: requests
python312Packages.pillow # Python package: Pillow
python312Packages.python-dateutil # Python package: dateutil
gnumake # GNU Make for build automation
];
shellHook = ''
export DIRENV_LOG_FORMAT=
echo "-----------------------"
echo "🌈 Your Hugo Dev Environment is ready."
echo "It provides hugo and vscode for use with the QGIS Planet Website Project"
echo ""
echo "🪛 VSCode:"
echo "--------------------------------"
echo "Start vscode like this:"
echo ""
echo "./vscode.sh"
echo ""
echo "🪛 Hugo:"
echo "--------------------------------"
echo "Start Hugo like this:"
echo ""
echo "hugo server"
echo "-----------------------"
'';
};
};
in
{
devShells = builtins.listToAttrs (map (system: {
name = system;
value = mkDevShell system;
}) supportedSystems);
packages = builtins.listToAttrs (map (system: {
name = system;
value = {
qgis-planet-website = nixpkgsFor.${system}.callPackage ./package.nix {};
};
}) supportedSystems);
};
}