diff options
| author | Franck Cuny <franck@fcuny.net> | 2022-05-07 18:18:35 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2022-05-08 14:55:09 -0700 |
| commit | 37bc4248220fe94d47772f974d80c58fc375bb16 (patch) | |
| tree | af1869555c8844efc41afab75d8491b33d2596f2 /users/fcuny/resume/flake.nix | |
| parent | drone: add configuration (diff) | |
| download | infra-37bc4248220fe94d47772f974d80c58fc375bb16.tar.gz | |
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`
Diffstat (limited to 'users/fcuny/resume/flake.nix')
| -rw-r--r-- | users/fcuny/resume/flake.nix | 37 |
1 files changed, 22 insertions, 15 deletions
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 ]; }; + }); } |
