Skip to content

Commit

Permalink
Bunch of updates.
Browse files Browse the repository at this point in the history
Needed to add syntaxes to syntaxes/ because apparently using
extra_syntaxes results in the default syntaxes not working anymore:

getzola/zola#1309
  • Loading branch information
Mukund Lakshman committed Jun 4, 2021
1 parent f3b6b65 commit 33a45ac
Show file tree
Hide file tree
Showing 15 changed files with 3,831 additions and 104 deletions.
11 changes: 6 additions & 5 deletions config.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
base_url = "https://blog.yaymukund.com"
title = "yaymukund's weblog"
description = "thoughts i'd like to keep around"
default_language = "en"
compile_sass = true
build_search_index = true
compile_sass = true
default_language = "en"
description = "thoughts i'd like to keep around"
generate_feed = true
title = "yaymukund's weblog"

[markdown]
extra_syntaxes = ["syntaxes"]
highlight_code = true
highlight_theme = "inspired-github"
extra_syntaxes = ["syntaxes"]
smart_punctuation = true

[extra]
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ date = 2020-11-11
title = "How to configure API Gateway v2 using Terraform"
+++

## How to configure API Gateway v2 using Terraform

Here's how you wire up an AWS lambda into an HTTP API using Terraform
and AWS's API Gateway v2 resources.

Expand Down
70 changes: 70 additions & 0 deletions content/posts/nixos-overriding-packages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
+++
date = 2021-06-02
title = "NixOS: Overriding packages"
+++

## Overriding packages in NixOS

In NixOS, it's sometimes desirable to override a package in order to extend
or modify its behavior. For example, I override my Neovim to add plugins so
they get all the benefits of being in the nix store. Here's how I do it.

<!-- more -->

```nix
# in configuration.nix
nixpkgs.overlays = [
(import ./overlays.nix)
];
# in overlays.nix
self: super: {
neovim-mukund = self.callPackage ./packages/neovim-mukund.nix {};
}
# finally, in packages/neovim-mukund.nix
{ pkgs }:
neovim.override {
vimAlias = true;
viAlias = true;
configure = {
packages.mukund-plugins = with pkgs.vimPlugins; {
start = [
ale
fzf-vim
# ...
];
};
};
}
# putting it all together
environment.systemPackages = [
neovim-mukund
];
```

### Bonus: Installing a single package from `main`

If you need to install a single package from the `main` branch but keep the
rest of your code on your nix channel (usually the main channel or
`nixos-unstable`), then try this:

```nix
# in packages/neovim-mukund.nix
let neovim-master = (import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/master.tar.gz") {}).neovim
in
environment.systemPackage = [
neovim-master
]
```
This time, I'm fetching and installing from the `master.tar.gz` file. This is
handy if there's an update upstream that you want to use immediately. For
example, I often use this when `Discord` releases an update. Nixpkgs usually
merges the version bump fairly quickly, but it doesn't reach the release
channels for many days during which Discord is unusable.

### References

- [NixOS Wiki: Overlays](https://nixos.wiki/wiki/Overlays)
- [/r/NixOS: Install a package from specific version of NixOS](https://old.reddit.com/r/NixOS/comments/a3w67x/install_a_package_from_a_specific_version_of/eb9q19s/?context=3)
2 changes: 2 additions & 0 deletions content/posts/panicking-unsafe-and-you.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ date = 2020-05-30
title = "Panicking, unsafe, and you"
+++

## Panicking, unsafe, and you

In Jon Gjengset's *Demystifying Unsafe Code* talk at Rust NYC, he gives a very
interesting example of unsafe code. [Here's the link-- please go and watch
it--][jonhoo_talk] but I've transcribed it here along with my paraphrased
Expand Down
2 changes: 2 additions & 0 deletions content/posts/rust-magic.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ date = 2021-02-02
title = "Rust Magic"
+++

## Rust magic

This is a list of places in Rust where implementing a trait or using a struct
affects the syntax of your code. I think of these features as "magical" because
using them can change the behavior of very basic Rust code (`let`, `for-in`,
Expand Down
43 changes: 0 additions & 43 deletions content/posts/speak-without-a-tongue.md

This file was deleted.

53 changes: 0 additions & 53 deletions he-to-me-or-me-to-him.md

This file was deleted.

5 changes: 3 additions & 2 deletions sass/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ ul.toc {
padding: 1rem 2rem 0 1rem;

&__meta {
margin-left: 0.5rem;
font-weight: bold;
margin-left: 1rem;
}

&__readmore {
Expand Down Expand Up @@ -108,7 +109,7 @@ ul.toc {
border-style: dashed;
}

p { line-height: 1.4rem; }
p { line-height: 1.5rem; }

p, h2, h3, h4 {
padding-left: 1rem;
Expand Down
6 changes: 6 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
zola
];
}
Loading

0 comments on commit 33a45ac

Please sign in to comment.