Skip to content

FG42 — Future Gadgets 42

FG42 is a self-contained, reproducible Emacs distribution built with Nix. It ships preconfigured with 40+ modules for programming languages, tools, and an optional X11 window manager — all without relying on any Emacs package manager.

Every dependency, from Emacs itself to language servers, formatters, and elisp packages, is managed by Nix. No MELPA, no ELPA, no package.el. Just reproducible builds that work the same everywhere.

Why FG42?

  • Reproducible: Nix pins every dependency. No more "works on my machine".
  • Modular: NixOS-style modules you can enable, disable, or override. Only build what you need.
  • Shareable: Publish your modules as Nix flakes. Others pull them in and compose them with their own setup.
  • Batteries included: Language support, completion, git integration, org-mode, window manager — ready out of the box.
  • Hackable: If you know Nix and Elisp, you can customize everything.

Quick Start

Requirements

The only requirement is Nix with flakes enabled.

Use with Home Manager

Add FG42 as a flake input and import the Home Manager module:

{
  description = "My system";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    fg42.url = "git+https://git.sr.ht/~lxsameer/FG42";
    home-manager.url = "github:nix-community/home-manager";
  };

  outputs = { self, nixpkgs, fg42, home-manager, ... }:
    let
      system = "x86_64-linux";
    in {
      nixosConfigurations.yourhost = nixpkgs.lib.nixosSystem {
        inherit system;
        modules = [
          home-manager.nixosModules.home-manager
          fg42.homeManagerModules.${system}.default
          {
            home-manager.users.youruser = {
              programs.fg42 = {
                enable = true;
              };
            };
          }
        ];
      };
    };
}

Install directly

nix profile install "git+https://git.sr.ht/~lxsameer/FG42#"

Or build without installing:

nix build "git+https://git.sr.ht/~lxsameer/FG42#"
./result/bin/fg42

Configuration

FG42 is configured primarily through Nix modules. Each module declares typed options that control which packages are included, what tools are on the PATH, and how elisp is configured.

Enabling and disabling modules

All modules are enabled by default. To disable one:

programs.fg42 = {
  enable = true;
  extraModules = [
    ({ ... }: {
      fg42.rust.enable = false;
      fg42.haskell.enable = false;
    })
  ];
};

User init file

For runtime tweaks that don't need Nix, edit ~/.config/fg42/init.el. This file is loaded after all modules are initialized.

Writing custom modules

You can write your own FG42 modules and share them as Nix flakes. A module is a Nix file that declares options and contributes elisp packages, system paths, and configuration. See Writing Modules for details.

Window Manager

FG42 doubles as an X11 window manager via EXWM. Run fg42-wm instead of fg42 to launch it as your window manager.

# Test in a nested X session
nix run '.#x'    # starts Xephyr
nix run '.#wm'   # launches FG42-WM inside it

Debugging

Debugging is off by default. Set the FG42_DEBUG environment variable to 1 to enable it.

The Name

FG42 is named after the Future Gadgets from Steins;Gate.

License

FG42 is free software under the GNU General Public License v2.