From 680dacf4a2713368c44cc8a5cf14d4e7e631dab1 Mon Sep 17 00:00:00 2001 From: Erik Grobecker Date: Tue, 15 Oct 2024 13:04:51 +0200 Subject: [PATCH] added direnv to automatically pull relevant packages --- .envrc | 1 + .gitignore | 1 + flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 26 ++++++++++++++++++++++++++ shell.nix | 9 +++++++++ 5 files changed, 64 insertions(+) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 shell.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..65326bb --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use nix \ No newline at end of file diff --git a/.gitignore b/.gitignore index 06db7cd..f74b0a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.pdf sozialwissenschaften/assets/pdfs/Probeklausur_SU_Q2-OCR.pdf.txt +.direnv diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..0793da5 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1728538411, + "narHash": "sha256-f0SBJz1eZ2yOuKUr5CA9BHULGXVSn6miBuUWdTyhUhU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b69de56fac8c2b6f8fd27f2eca01dcda8e0a4221", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..0f4ab32 --- /dev/null +++ b/flake.nix @@ -0,0 +1,26 @@ +{ + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + + outputs = + { nixpkgs, ... }: + { + /* + This example assumes your system is x86_64-linux + change as neccesary + */ + devShells.x86_64-linux = + let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + in + { + default = pkgs.mkShell { + packages = [ + pkgs.typst + pkgs.typstyle + pkgs.tinymist + ]; + }; + }; + }; +} + diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..2d9175f --- /dev/null +++ b/shell.nix @@ -0,0 +1,9 @@ +{ pkgs ? import {} }: + + pkgs.mkShell { + packages = [ + pkgs.typst + pkgs.typstyle + pkgs.tinymist + ]; +}