untitleable commit: read description

new template dropped, especially useful for me since now I can just load up a TeX environment whenever I need to. also added some names to my devShells.
This commit is contained in:
Artur Manuel 2024-08-27 00:38:16 +01:00
commit 1e373bd299
Failed to generate hash of commit
15 changed files with 2117 additions and 3 deletions

View file

@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
if [[ ! -d "/home/amadal/Templates/templates/docs" ]]; then
echo "Cannot find source directory; Did you move it?"
echo "(Looking for "/home/amadal/Templates/templates/docs")"
echo 'Cannot force reload with this script - use "direnv reload" manually and then try again'
exit 1
fi
# rebuild the cache forcefully
_nix_direnv_force_reload=1 direnv exec "/home/amadal/Templates/templates/docs" true
# Update the mtime for .envrc.
# This will cause direnv to reload again - but without re-building.
touch "/home/amadal/Templates/templates/docs/.envrc"
# Also update the timestamp of whatever profile_rc we have.
# This makes sure that we know we are up to date.
touch -r "/home/amadal/Templates/templates/docs/.envrc" "/home/amadal/Templates/templates/docs/.direnv"/*.rc

View file

@ -0,0 +1 @@
/nix/store/52bigbj1vfhdkwzqg0yrh3fdawz0pflj-source

View file

@ -0,0 +1 @@
/nix/store/7yv4gv5k7jcbnqbf16869gp7l89ri3d0-source

View file

@ -0,0 +1 @@
/nix/store/ia1zpg1s63v6b3vin3n7bxxjgcs51s2r-source

View file

@ -0,0 +1 @@
/nix/store/sfycwi72zfjsspidinx56ajaiffpyh17-source

View file

@ -0,0 +1 @@
/nix/store/rfrg66910v5nz44qfdnn6idip75amv12-work-world-env

File diff suppressed because it is too large Load diff

1
templates/docs/.envrc Normal file
View file

@ -0,0 +1 @@
use flake ".#" --impure

62
templates/docs/flake.lock generated Normal file
View file

@ -0,0 +1,62 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1724479785,
"narHash": "sha256-pP3Azj5d6M5nmG68Fu4JqZmdGt4S4vqI5f8te+E/FTw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d0e1602ddde669d5beb01aec49d71a51937ed7be",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1723637854,
"narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"treefmt": "treefmt"
}
},
"treefmt": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1724338379,
"narHash": "sha256-kKJtaiU5Ou+e/0Qs7SICXF22DLx4V/WhG1P6+k4yeOE=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "070f834771efa715f3e74cd8ab93ecc96fabc951",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

39
templates/docs/flake.nix Normal file
View file

@ -0,0 +1,39 @@
{
description = "Flake for creating documents, such as Math papers, just any old document, etc.";
inputs = {
nixpkgs = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
ref = "nixos-unstable";
};
treefmt = {
type = "github";
owner = "numtide";
repo = "treefmt-nix";
};
};
outputs = inputs@{ self, nixpkgs, ... }: let
systems = [ "x86_64-linux" "aarch64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f {
pkgs = import nixpkgs {
inherit system;
};
});
treefmtEval = forAllSystems ({pkgs}: inputs.treefmt.lib.evalModule pkgs ({
programs.nixfmt.enable = true;
}));
in {
devShells = forAllSystems ({pkgs}: {
default = (pkgs.mkShell {
name = "work-world";
packages = [
pkgs.texliveFull
];
});
});
formatter = forAllSystems ({pkgs}: treefmtEval.config.build.wrapper);
};
}

View file

@ -17,7 +17,7 @@ type Quote struct {
} }
func (q Quote) PrintQuote() { func (q Quote) PrintQuote() {
fmt.Printf("\"%s\" - %s\n", q.Quote, q.Author) fmt.Printf("\"%s\"\n\t- %s\n", q.Quote, q.Author)
} }
func GetResponse() (*http.Response, error) { func GetResponse() (*http.Response, error) {

View file

@ -1,4 +1,4 @@
{ buildGoModule, lib }: { buildGoModule }:
let let
pname = "go-app"; pname = "go-app";
version = "0.1.0"; version = "0.1.0";

View file

@ -1,6 +1,6 @@
{ mkShell, go, go-app, gopls, go-tools, gotools }: { mkShell, go, go-app, gopls, go-tools, gotools }:
mkShell { mkShell {
name = "Go Development Shell"; name = "Gopherborough";
inputsFrom = [ go-app ]; inputsFrom = [ go-app ];
buildInputs = [ buildInputs = [
go go

View file

@ -1,5 +1,6 @@
{ mkShell, python-app, python312Packages }: { mkShell, python-app, python312Packages }:
mkShell { mkShell {
name = "Python Palace";
inputsFrom = [ python-app ]; inputsFrom = [ python-app ];
nativeBuildInputs = [ nativeBuildInputs = [
python312Packages.ruff-lsp python312Packages.ruff-lsp

View file

@ -1,5 +1,6 @@
{ mkShell, rust-app, rust-bin }: { mkShell, rust-app, rust-bin }:
mkShell { mkShell {
name = "Rust Rivers";
inputsFrom = [ rust-app ]; inputsFrom = [ rust-app ];
buildInputs = [ buildInputs = [
rust-bin.stable.latest.default rust-bin.stable.latest.default