From 3b14e4662e1cf99b5fde1cca1f88738432a79138 Mon Sep 17 00:00:00 2001 From: Victor Mignot Date: Sat, 28 Sep 2024 21:44:54 +0200 Subject: [PATCH] remove hugo's build lock and add flake overlay --- .gitignore | 1 + .hugo_build.lock | 0 default.nix | 18 ++++++++++++++++++ flake.nix | 11 +++++++++++ shell.nix | 5 +++++ 5 files changed, 35 insertions(+) delete mode 100644 .hugo_build.lock create mode 100644 default.nix create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore index 44e486b..c35a3d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ result/ public/ resources/ +.hugo_build.lock diff --git a/.hugo_build.lock b/.hugo_build.lock deleted file mode 100644 index e69de29..0000000 diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..2156961 --- /dev/null +++ b/default.nix @@ -0,0 +1,18 @@ +{ stdenv, lib, hugo, ... }: +stdenv.mkDerivation { + name = "dalaran.fr"; + + src = lib.cleanSource ./.; + + nativeBuildInputs = [ + hugo + ]; + + buildPhase = '' + hugo --minify + ''; + + installPhase = '' + mv public $out + ''; +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..dde2f33 --- /dev/null +++ b/flake.nix @@ -0,0 +1,11 @@ +{ + description = "Victor Mignot's blog"; + + inputs = { }; + + outputs = { self, ... }: { + overlays.default = final: prev: { + dalaran-fr-blog = prev.callPackage ./default.nix { }; + }; + }; +} diff --git a/shell.nix b/shell.nix index 19ef8cf..ba73ad6 100644 --- a/shell.nix +++ b/shell.nix @@ -2,6 +2,11 @@ pkgs.mkShell { name = "hugo-shell"; + packages = with pkgs; [ + nixfmt-rfc-style + nil + ]; + nativeBuildInputs = with pkgs; [ hugo ];