From 1270dbff9ca7f13900d8ab0ce0011aa626029623 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 10 May 2022 17:56:40 -0700 Subject: add drone configuration and cleanup nix Add a drone configuration to run the deploy on a push to the main branch. Cleanup the nix configuration to only keep support for `nix run` (which will run the hugo server). --- flake.nix | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 59ef578..fa39b45 100644 --- a/flake.nix +++ b/flake.nix @@ -1,19 +1,23 @@ { description = "Franck Cuny's personal website."; - inputs = { nixpkgs.url = "github:nixos/nixpkgs"; }; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; - outputs = { self, nixpkgs }: - let pkgs = nixpkgs.legacyPackages.x86_64-linux; - in { - defaultApp.x86_64-linux = self.apps.server; - apps.server = pkgs.writers.writeBashBin "server" '' - set -e - set -o pipefail - PATH=${pkgs.lib.makeBinPath [ pkgs.hugo pkgs.git ]} - hugo server - ''; - devShell.x86_64-linux = - pkgs.mkShell { buildInputs = with pkgs; [ hugo flyctl git ]; }; - }; + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in { + defaultApp = pkgs.writers.writeBashBin "run-hugo" '' + set -e + set -o pipefail + export PATH=${pkgs.lib.makeBinPath [ pkgs.hugo pkgs.git ]} + hugo server -D + ''; + + devShell = + pkgs.mkShell { buildInputs = with pkgs; [ hugo flyctl git ]; }; + }); } -- cgit v1.2.3