summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..e640075
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,43 @@
+{
+ outputs = { self, nixpkgs }@inputs:
+ let
+ forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
+ in
+ {
+ devShells = forAllSystems (system:
+ let pkgs = nixpkgs.legacyPackages.${system}; in
+ with pkgs; {
+ default = mkShell {
+ buildInputs = [
+ git
+ hugo
+ nodePackages_latest.prettier
+ ];
+ };
+ }
+ );
+ packages = forAllSystems (system:
+ let pkgs = nixpkgs.legacyPackages.${system}; in
+ with pkgs; {
+ default = buildGoModule {
+ name = "check-caps-lock";
+ src = ./.;
+ nativeBuildInputs = [ hugo git ];
+
+ vendorHash = "sha256-HMUsA2XlRAZfQOQCjQlby7UriY6d2h3xZlqPguhrwOw=";
+
+ buildPhase = ''
+ export HUGO_PARAMS_ENV=production
+ export HUGO_PARAMS_FOOTER_TEXT="built on $(date -u --iso-8601=seconds)"
+ hugo --logLevel debug
+ '';
+
+ postInstall = ''
+ rm -rf $out
+ cp -r public $out
+ '';
+ };
+ }
+ );
+ };
+}