From 12acf07124e08aae73e56a8ace7b82cf3acb858a Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Sun, 24 Mar 2024 12:45:21 -0500 Subject: [PATCH 1/2] added devshell. --- .envrc | 1 + .gitignore | 3 +++ flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 22 ++++++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 72254e0..14491df 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # Created by https://www.gitignore.io/api/latex # Edit at https://www.gitignore.io/?templates=latex +# direnv +.direnv + *.pdf ### LaTeX ### diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..6a41a69 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1711163522, + "narHash": "sha256-YN/Ciidm+A0fmJPWlHBGvVkcarYWSC+s3NTPk/P+q3c=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "44d0940ea560dee511026a53f0e2e2cde489b4d4", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-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..109ec82 --- /dev/null +++ b/flake.nix @@ -0,0 +1,22 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + }; + + outputs = { self, nixpkgs }: + let + supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; + forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { + pkgs = import nixpkgs { inherit system; }; + }); + in + { + devShells = forEachSupportedSystem ({ pkgs }: { + default = pkgs.mkShell { + packages = with pkgs; [ texliveFull ]; + }; + }); + }; +} From d6c96c5e9a25a3860c0f5a70a42236db1e577961 Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Sun, 24 Mar 2024 13:38:57 -0500 Subject: [PATCH 2/2] added justfile. --- flake.lock | 34 ++++++++++++++++++++++++++++++++++ flake.nix | 24 ++++++++++++------------ justfile | 2 ++ 3 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 justfile diff --git a/flake.lock b/flake.lock index 6a41a69..942e223 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,23 @@ { "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1711163522, @@ -18,8 +36,24 @@ }, "root": { "inputs": { + "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 109ec82..997b6b2 100644 --- a/flake.nix +++ b/flake.nix @@ -2,21 +2,21 @@ description = "A very basic flake"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; }; - outputs = { self, nixpkgs }: - let - supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; - forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { - pkgs = import nixpkgs { inherit system; }; - }); + outputs = { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = import nixpkgs {inherit system;}; in - { - devShells = forEachSupportedSystem ({ pkgs }: { - default = pkgs.mkShell { - packages = with pkgs; [ texliveFull ]; + with pkgs; { + devShells.default = mkShell { + buildInputs = [texliveFull]; }; }); - }; } diff --git a/justfile b/justfile new file mode 100644 index 0000000..12e606e --- /dev/null +++ b/justfile @@ -0,0 +1,2 @@ +preview: + latexmk -pdf -pvc