From 311d59a48303d2a3bd6b05d47d68fb4c0f82bfae Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 1 May 2022 13:31:35 -0700 Subject: initial commit --- users/fcuny/resume/flake.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 users/fcuny/resume/flake.nix (limited to 'users/fcuny/resume/flake.nix') diff --git a/users/fcuny/resume/flake.nix b/users/fcuny/resume/flake.nix new file mode 100644 index 0000000..eae54f3 --- /dev/null +++ b/users/fcuny/resume/flake.nix @@ -0,0 +1,19 @@ +{ + description = "Franck Cuny's resume"; + inputs = { nixpkgs.url = "github:nixos/nixpkgs"; }; + + outputs = { self, nixpkgs }: + let pkgs = nixpkgs.legacyPackages.x86_64-linux; + in { + defaultApp.x86_64-linux = self.publishHTML; + + publishHTML = pkgs.writers.writeBashBin "html" '' + set -e + set -o pipefail + pandoc --self-contained --css styles/resume.css --from org --to html --output resume.html readme.org + ''; + + devShell.x86_64-linux = + pkgs.mkShell { buildInputs = with pkgs; [ git pandoc ]; }; + }; +} -- cgit v1.2.3 From 3fdd3ad757000937ce5641d39baa14e1c6c6f8ec Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sat, 7 May 2022 17:53:34 -0700 Subject: drone: add configuration --- users/fcuny/resume/flake.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'users/fcuny/resume/flake.nix') diff --git a/users/fcuny/resume/flake.nix b/users/fcuny/resume/flake.nix index eae54f3..476a981 100644 --- a/users/fcuny/resume/flake.nix +++ b/users/fcuny/resume/flake.nix @@ -7,6 +7,7 @@ in { defaultApp.x86_64-linux = self.publishHTML; + # run with `nix run .#publishHTML` publishHTML = pkgs.writers.writeBashBin "html" '' set -e set -o pipefail -- cgit v1.2.3 From 37bc4248220fe94d47772f974d80c58fc375bb16 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sat, 7 May 2022 18:18:35 -0700 Subject: simplify the build Running `nix build` is enough to generate the file `resume.html`. It will be created in the `result` directory automatically. The configuration for the build is also updated to run `nix build` --- users/fcuny/resume/flake.nix | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'users/fcuny/resume/flake.nix') diff --git a/users/fcuny/resume/flake.nix b/users/fcuny/resume/flake.nix index 476a981..fbb2755 100644 --- a/users/fcuny/resume/flake.nix +++ b/users/fcuny/resume/flake.nix @@ -1,20 +1,27 @@ { description = "Franck Cuny's resume"; - 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.publishHTML; + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in { + defaultPackage = pkgs.stdenv.mkDerivation { + name = "resume"; + buildInputs = with pkgs; [ pandoc ]; + src = ./.; + buildPhase = '' + pandoc --self-contained --css styles/resume.css --from org --to html --output resume.html readme.org + ''; - # run with `nix run .#publishHTML` - publishHTML = pkgs.writers.writeBashBin "html" '' - set -e - set -o pipefail - pandoc --self-contained --css styles/resume.css --from org --to html --output resume.html readme.org - ''; - - devShell.x86_64-linux = - pkgs.mkShell { buildInputs = with pkgs; [ git pandoc ]; }; - }; + installPhase = '' + mkdir -p $out + cp resume.html $out/ + ''; + }; + devShell = pkgs.mkShell { buildInputs = with pkgs; [ git pandoc ]; }; + }); } -- cgit v1.2.3