summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorChristian Segundo2024-07-25 02:12:22 +0200
committerChristian Segundo2024-07-28 12:58:19 +0200
commit15e3dedcee1d0830871ffc692143318a87646101 (patch)
tree3e15f8a3f5082b7df89d208a4c8189b8ad453998 /flake.nix
parenta248abee10bbcda6282982d72788acf689deb7aa (diff)
downloadcheck-caps-lock-15e3dedcee1d0830871ffc692143318a87646101.tar.gz
wip
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
+ '';
+ };
+ }
+ );
+ };
+}