Skip to content

Commit fe2ec7d

Browse files
committed
Get rid of Docker, use Nix.
1 parent 075f3aa commit fe2ec7d

10 files changed

Lines changed: 78 additions & 154 deletions

File tree

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake .
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: 'Auto update flake lock file'
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 1'
6+
7+
jobs:
8+
AutoUpdateFlakeLock:
9+
uses: loophp/flake-lock-update-workflow/.github/workflows/auto-upgrade-flakes.yaml@main

.github/workflows/build.yml

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ jobs:
2121
name: Build PDF files
2222
runs-on: ubuntu-latest
2323
needs: dependencies
24-
strategy:
25-
matrix:
26-
sources:
27-
- input: src/cv/index
28-
output: cv
24+
2925
steps:
3026
- name: Set git to use LF
3127
run: |
@@ -43,23 +39,17 @@ jobs:
4339

4440
- name: Install Nix
4541
uses: cachix/install-nix-action@v17
46-
with:
47-
install_url: https://github.com/numtide/nix-unstable-installer/releases/download/nix-2.5pre20211026_5667822/install
48-
# Configure Nix to enable flakes
49-
extra_nix_config: |
50-
experimental-features = nix-command flakes
51-
52-
- name: Run the general flake checks
53-
run: nix flake check
5442

5543
- name: Build document
56-
run: nix develop --command make
44+
run: |
45+
nix build . --quiet
46+
cp result cv.pdf
5747
58-
- name: Upload build assets (${{ matrix.sources.input }})
48+
- name: Upload build assets
5949
uses: actions/upload-artifact@v3
6050
with:
61-
name: ${{ matrix.sources.output }}
62-
path: build/${{ matrix.sources.output }}.pdf
51+
name: assets
52+
path: cv.pdf
6353

6454
release:
6555
name: "Create tag/pre-release"
@@ -76,35 +66,27 @@ jobs:
7666
with:
7767
tag_name: v${{ github.run_number }}-${{ needs.dependencies.outputs.version }}
7868
release_name: Version ${{ github.run_number }} (${{ needs.dependencies.outputs.version }})
79-
draft: true
69+
draft: false
8070
prerelease: true
8171

8272
assets:
8373
name: Upload release assets
8474
runs-on: ubuntu-latest
8575
needs: [dependencies,release]
86-
strategy:
87-
matrix:
88-
assets:
89-
- input: cv
9076

9177
steps:
9278
- name: Download build assets (${{ matrix.assets.input }})
9379
uses: actions/download-artifact@v3
9480
with:
95-
name: ${{ matrix.assets.input }}
96-
path: ${{ matrix.assets.input }}
97-
98-
- name: List PDF files
99-
continue-on-error: true
100-
run: find . -name \*.pdf -print
81+
name: assets
82+
path: assets
10183

102-
- name: Upload release assets (${{ matrix.assets.input }}, ${{ needs.dependencies.outputs.version }})
84+
- name: Upload release assets
10385
uses: actions/upload-release-asset@v1
10486
env:
10587
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10688
with:
10789
upload_url: ${{ needs.release.outputs.upload_url }}
108-
asset_path: ${{ matrix.assets.input }}/${{ matrix.assets.input }}.pdf
109-
asset_name: ${{ matrix.assets.input }}.pdf
90+
asset_path: assets/cv.pdf
91+
asset_name: ${{ github.run_number }}--lrs--${{ needs.dependencies.outputs.version }}.pdf
11092
asset_content_type: application/pdf

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.direnv/
12
/build/
23
/bin/
34
/.vscode/

Makefile

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
INPUT ?= src/cv/index.tex
22
OUTPUT ?= $(shell basename "$(shell dirname "$(INPUT)")")
3-
DOCKER_COMPOSE = docker-compose
4-
UP = ${DOCKER_COMPOSE} up
53
OUTPUT_DIRECTORY = build
64
LATEXMK_ARGS ?= -halt-on-error -MP -logfilewarninglist -pdf -shell-escape -interaction=nonstopmode -file-line-error -output-directory=$(OUTPUT_DIRECTORY)
7-
DOCKER_TEXINPUTS = "/home/src//:"
85
TEXINPUTS = "$(shell pwd)/src//:"
96

10-
DOCKER_TEXLIVE_RUN = ${DOCKER_COMPOSE} run -e TEXINPUTS=$(DOCKER_TEXINPUTS) texlive
11-
DOCKER_PANDOC_RUN = ${DOCKER_COMPOSE} run pandoc
12-
DOCKER_PLANTUML_RUN = ${DOCKER_COMPOSE} run plantuml
13-
DOCKER_CONVERT_RUN = ${DOCKER_COMPOSE} run convert
14-
DOCKER_LATEXMK_COMMAND = $(DOCKER_TEXLIVE_RUN) latexmk $(LATEXMK_ARGS)
15-
167
TEXLIVE_RUN = TEXINPUTS=$(TEXINPUTS)
178
PANDOC_RUN = pandoc
189
PLANTUML_RUN = plantuml
@@ -33,46 +24,20 @@ build :
3324
$(LATEXMK_COMMAND) -jobname=$(OUTPUT) $(INPUT)
3425
$(MAKE) chmodbuild
3526

36-
docker-build :
37-
$(DOCKER_LATEXMK_COMMAND) -jobname=$(OUTPUT) $(INPUT)
38-
$(MAKE) chmodbuild
39-
4027
plantuml :
4128
$(PLANTUML_RUN) -tsvg src/presentation/resources/*.plantuml
4229

43-
docker-plantuml :
44-
$(DOCKER_PLANTUML_RUN) -tsvg src/presentation/resources/*.plantuml
45-
4630
pandoc :
4731
$(PANDOC_RUN) -s $(INPUT) -o $(OUTPUT)
4832

49-
docker-pandoc :
50-
$(DOCKER_PANDOC_RUN) -s $(INPUT) -o $(OUTPUT)
51-
52-
docker-convert :
53-
$(DOCKER_CONVERT_RUN) -density 1200 $(INPUT) $(OUTPUT)
54-
5533
latexindent :
5634
$(TEXLIVE_RUN) latexindent
5735

58-
docker-latexindent :
59-
$(DOCKER_TEXLIVE_RUN) latexindent
60-
6136
clean :
6237
rm -rf build
6338

64-
docker-clean :
65-
$(DOCKER_TEXLIVE_RUN) rm -rf build
66-
67-
docker-lint :
68-
$(foreach file, $(call rwildcard,$(shell dirname "$(INPUT)"),*.tex), $(DOCKER_TEXLIVE_RUN) lacheck $(file);)
69-
$(foreach file, $(call rwildcard,$(shell dirname "$(INPUT)"),*.tex), $(DOCKER_TEXLIVE_RUN) chktex $(file);)
70-
$(foreach file, $(call rwildcard,$(shell dirname "$(INPUT)"),*.tex), $(DOCKER_TEXLIVE_RUN) latexindent $(file);)
71-
7239
lint :
73-
$(foreach file, $(call rwildcard,$(shell dirname "$(INPUT)"),*.tex), lacheck $(file);)
74-
$(foreach file, $(call rwildcard,$(shell dirname "$(INPUT)"),*.tex), chktex $(file);)
75-
$(foreach file, $(call rwildcard,$(shell dirname "$(INPUT)"),*.tex), latexindent $(file);)
40+
$(foreach file, $(call rwildcard,$(shell dirname "$(INPUT)"),*.tex), latexindent -l -w $(file);)
7641

7742
chmodbuild:
7843
$(TEXLIVE_RUN) chmod 777 build
@@ -81,10 +46,6 @@ watch:
8146
$(LATEXMK_COMMAND) -pvc -jobname=$(OUTPUT) $(INPUT)
8247
$(MAKE) chmodbuild
8348

84-
docker-watch:
85-
$(DOCKER_LATEXMK_COMMAND) -pvc -jobname=$(OUTPUT) $(INPUT)
86-
$(MAKE) chmodbuild
87-
8849
fresh:
8950
$(MAKE) chmodbuild clean build
9051

Taskfile.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

docker-compose.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

flake.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,51 @@
11
{
22
description = "LaTeX Document";
3+
34
inputs = {
4-
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
5+
nixpkgs.url = github:NixOS/nixpkgs/nixpkgs-unstable;
56
flake-utils.url = github:numtide/flake-utils;
7+
flake-utils.inputs.nixpkgs.follows = "nixpkgs";
68
};
9+
710
outputs = { self, nixpkgs, flake-utils }:
8-
with flake-utils.lib; eachDefaultSystem (system:
9-
let
10-
pkgs = nixpkgs.legacyPackages.${system};
11-
tex = pkgs.texlive.combine {
11+
with flake-utils.lib; eachSystem allSystems (system:
12+
let
13+
version = self.shortRev or self.lastModifiedDate;
14+
15+
pkgs = nixpkgs.legacyPackages.${system};
16+
17+
tex = pkgs.texlive.combine {
1218
inherit (pkgs.texlive) scheme-full latex-bin latexmk;
13-
};
14-
in rec {
15-
packages = {
16-
document = pkgs.stdenvNoCC.mkDerivation rec {
17-
name = "latex-document";
19+
};
20+
21+
documentProperties = {
22+
name = "cv";
23+
inputs = [
24+
pkgs.coreutils
25+
tex
26+
pkgs.gnumake
27+
];
28+
};
29+
30+
documentDrv = pkgs.stdenvNoCC.mkDerivation {
31+
name = documentProperties.name + "-" + version;
1832
src = self;
19-
buildInputs = [ pkgs.coreutils tex pkgs.gnumake ];
33+
buildInputs = documentProperties.inputs;
34+
installPhase = ''
35+
runHook preInstall
36+
cp build/cv.pdf $out
37+
runHook postInstall
38+
'';
39+
};
40+
in
41+
rec {
42+
# Nix shell / nix build
43+
defaultPackage = documentDrv;
44+
45+
# Nix develop
46+
devShell = pkgs.mkShellNoCC {
47+
name = documentProperties.name;
48+
buildInputs = documentProperties.inputs;
2049
};
21-
};
22-
defaultPackage = packages.document;
23-
});
50+
});
2451
}

src/cv/index.tex

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,13 @@
4747
\begin{minipage}[t]{.4\textwidth} % 40% of the page width for the introduction text
4848
\vspace{-\baselineskip} % Required for vertically aligning minipages
4949
\justify{
50-
I have been working with web development since 2010, the period during which I have worked in different environments,
51-
52-
from big consultancy companies to start-ups. \\\\I am a self-motivated and self-taught professional who likes to solve problems.
53-
\\\\Curious, meticulous, I appreciate the beauty of simple and efficient things.
50+
I have been working with web development since 2010, the period during which
51+
I have worked in different environments, from start-ups to consultancy
52+
companies.
53+
\\\\I am a self-motivated and self-taught professional who likes solving
54+
problems.
55+
\\\\Perpertual student, curious, meticulous, I appreciate the beauty of
56+
simple, natural and efficient solutions.
5457
}
5558
\end{minipage}
5659
\hfill % Whitespace between
@@ -65,7 +68,6 @@
6568
\baritem{Algorithm}{85}
6669
\baritem{Docker}{75}
6770
\baritem{LaTeX}{65}
68-
\baritem{Javascript}{60}
6971
\end{barchart}
7072
\end{minipage}
7173

@@ -89,7 +91,7 @@
8991

9092
In that team, I'm responsible for helping clients migrating from ColdFusion to PHP, providing help,
9193
custom bundle and packages, custom assistance and short-terms consultancy missions.
92-
\\ \texttt{PHP}\slashsep\texttt{Symfony}\slashsep\texttt{Doctrine}\slashsep\texttt{API Platform}\slashsep\texttt{Oracle}\slashsep\texttt{Docker}
94+
\\ \texttt{Nix}\slashsep\texttt{Symfony}\slashsep\texttt{Doctrine}\slashsep\texttt{API Platform}\slashsep\texttt{Oracle}\slashsep\texttt{Docker}\slashsep\texttt{InfrastructureAsCode}
9395
}
9496
\entry
9597
{6/2015 -- 6/2019}

0 commit comments

Comments
 (0)