initial commit

This commit is contained in:
Ivan Dimitrov 2023-11-12 19:07:31 +02:00
commit a61bb35644
7 changed files with 155 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules

BIN
bun.lockb Executable file

Binary file not shown.

39
cv.tsx Normal file
View File

@ -0,0 +1,39 @@
import React from 'react';
import { Page, Text, View, Document, StyleSheet } from '@react-pdf/renderer';
import ReactPDF from '@react-pdf/renderer';
import fs from "fs"
const styles = StyleSheet.create({
page: {
flexDirection: 'row',
backgroundColor: '#E4E4E4'
},
section: {
margin: 10,
padding: 10,
flexGrow: 1
}
});
const MyDocument = () => (
<Document>
<Page size="A4" style={styles.page}>
<View style={styles.section}>
<Text>Section #1</Text>
</View>
<View style={styles.section}>
<Text>Section #2</Text>
</View>
</Page>
</Document>
);
const outDir = process.env.out || "./"
const pname = process.env.pname || "cv"
if (!fs.existsSync(outDir)) {
fs.mkdirSync(outDir, { recursive: true })
}
ReactPDF.render(<MyDocument />, `${outDir}/${pname}.pdf`);

63
flake.lock Normal file
View File

@ -0,0 +1,63 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": [
"systems"
]
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1699806023,
"narHash": "sha256-RqoU2yh61nzsfbtgjZwIrCMPwyxkUR7Eze+4hjEM6TY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "54da2986be07ad2ffbade0b3cefaf7f0c2553c88",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"systems": "systems"
}
},
"systems": {
"locked": {
"lastModified": 1680978846,
"narHash": "sha256-Gtqg8b/v49BFDpDetjclCYXm8mAnTrUzR0JnE2nv5aw=",
"owner": "nix-systems",
"repo": "x86_64-linux",
"rev": "2ecfcac5e15790ba6ce360ceccddb15ad16d08a8",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "x86_64-linux",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

38
flake.nix Normal file
View File

@ -0,0 +1,38 @@
{
description = "CV template";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
systems.url = "github:nix-systems/x86_64-linux";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
};
outputs = { self, nixpkgs, flake-utils, systems }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
pname = "cv";
version = "0.0.1";
src = ./.;
buildInputs = with pkgs; [
];
nativeBuildInputs = with pkgs; [
nodejs_20
bun
];
in
{
devShells.default = pkgs.mkShell {
inherit pname buildInputs nativeBuildInputs;
};
packages.default = pkgs.stdenv.mkDerivation {
inherit buildInputs nativeBuildInputs pname version src;
};
});
}

13
makefile Normal file
View File

@ -0,0 +1,13 @@
main = $(pname).tsx
default: all
all:
-bun $(main)
clean:
rm -f $(pname)
install: $(pname)
mkdir -p $(out)/bin
install $(pname).pdf $(out)/bin/$(pname)

1
package.json Normal file
View File

@ -0,0 +1 @@
{ "dependencies": { "@react-pdf/renderer": "^3.1.14", "@types/node": "^20.9.0", "@types/react": "^18.2.37", "react": "^18.2.0" } }