Skip to content

Instantly share code, notes, and snippets.

@SamB
Created October 16, 2026 21:06
Show Gist options
  • Select an option

  • Save SamB/46add387cd30ddc67ca7c0c64745c9ec to your computer and use it in GitHub Desktop.

Select an option

Save SamB/46add387cd30ddc67ca7c0c64745c9ec to your computer and use it in GitHub Desktop.
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
# NixOS-WSL specific options are documented on the NixOS-WSL repository:
# https://github.com/nix-community/NixOS-WSL
{ config, lib, pkgs, ... }:
{
imports = [
# include NixOS-WSL modules
<nixos-wsl/modules>
];
wsl.enable = true;
wsl.defaultUser = "nixos";
# Enable the Flakes feature and the accompanying new nix command-line tool
nix.settings.experimental-features = [ "nix-command" "flakes" ];
environment.systemPackages = with pkgs; [
# Flakes clones its dependencies through the git command,
# so git must be installed first
git
tix
wget
direnv
let
asciidoc-grammar = lang: hash: pkgs.tree-sitter-grammars.overrideScope {
tree-sitter-asciidoc = pkgs.tree-sitter.buildGrammar {
language = lang;
version = "0.9.0";
src = fetchFromGithub {
owner = "cathaysia";
repo = "tree-sitter-asciidoc";
ref = "v0.9.0";
rootDir = "tree-sitter-${lang}";
hash = hash;
};
};
};
in
((emacsPackagesFor emacs).emacsWithPackages (epkgs: [
(epkgs.treesit-grammars.grammarPackage [
(asciidoc-grammar "asciidoc" "")
(asciidoc-grammar "asciidoc_inline "")
])
epkgs.nix-mode
epkgs.asciidoc-mode
]))
# Debug tools
strace
gdb
valgrind
(lib.getBin elfutils)
rr
libtree
xwininfo
mesa-demos
];
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-color-emoji
liberation_ttf
fira-code
fira-code-symbols
mplus-outline-fonts.githubRelease
dina-font
proggyfonts
];
# Set the default editor to emacs
environment.variables.EDITOR = "emacs";
# Emacs and I love documentation
documentation = {
dev.enable = true;
man.enable = true; # This is already the default
man.cache.enable = true;
man.cache.generateAtRuntime = true;
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "26.05"; # Did you read the comment?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment