diff options
author | Franck Cuny <franck@fcuny.net> | 2022-05-23 17:43:02 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-05-23 17:43:02 -0700 |
commit | 14a5a6d480f0c2d71b3f43b272e07c5ce769ad83 (patch) | |
tree | 33c9de5c9d5d2da8d0dc16302dfb9500717a490b /users/fcuny/blog/flake.nix | |
parent | feat(tahoe): enable sourcegraph (diff) | |
parent | sign the drone configuration (diff) | |
download | world-14a5a6d480f0c2d71b3f43b272e07c5ce769ad83.tar.gz |
Merge remote-tracking branch 'blog/main' into fcuny/migrate-monorepo-blog
Diffstat (limited to 'users/fcuny/blog/flake.nix')
-rw-r--r-- | users/fcuny/blog/flake.nix | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/users/fcuny/blog/flake.nix b/users/fcuny/blog/flake.nix new file mode 100644 index 0000000..79e6953 --- /dev/null +++ b/users/fcuny/blog/flake.nix @@ -0,0 +1,46 @@ +{ + description = "Franck Cuny's personal website."; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in { + defaultPackage = with pkgs; + stdenv.mkDerivation { + pname = "fcuny.net"; + version = self.lastModifiedDate; + src = ./.; + buildInputs = [ hugo git ]; + buildPhase = '' + mkdir -p $out + hugo --minify --destination $out + ''; + dontInstall = true; + }; + + defaultApp = pkgs.writers.writeBashBin "run-hugo" '' + set -e + set -o pipefail + export PATH=${pkgs.lib.makeBinPath [ pkgs.hugo pkgs.git ]} + hugo server -D + ''; + + apps = { + deploy = pkgs.pkgs.writeShellScriptBin "run-deploy" '' + set -euxo pipefail + export PATH=${ + pkgs.lib.makeBinPath [ pkgs.hugo pkgs.git pkgs.jq pkgs.flyctl ] + }:$PATH + bash ./scripts/deploy.sh + ''; + }; + + devShell = + pkgs.mkShell { buildInputs = with pkgs; [ hugo flyctl git jq ]; }; + }); +} |