Skip to content

sotormd/homepage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

homepage

A pure Nix static homepage generator. Clean, keyboard-navigable startpages with zero dependencies and full control over layout, colors, etc.

homepage

Contents

Features

  • Declarative layout: define your homepage structure entirely in Nix.
  • Theming via sotormd/colors: consistent Nord-like palette for backgrounds, text, accents and fonts.
  • Keyboard shortcuts: type the short name to instantly open a link.
  • Dynamic hover colors: links smoothly change to aurora tones on hover.
  • Pure Nix: uses only builtins, so it works anywhere without external dependencies.

Example

You can build and preview the included example homepage directly:

nix build github:sotormd/homepage

This creates a symlink result in the current working directory, which can be opened in the browser.

How It Works

The flake exposes a single function:

lib.makeHomepage

It takes a layout list, where each element is either:

  • a list of links, or
  • the string "separator" (to visually separate sections).

Example

home.lib.makeHomepage {
  layout = [
    [
      { short = "re"; full = "reddit"; url = "https://reddit.com"; }
      { short = "dc"; full = "discord"; url = "https://discord.com/app"; }
    ]

    "separator"

    [
      { short = "yt"; full = "youtube"; url = "https://youtube.com"; }
      { short = "gh"; full = "github"; url = "https://github.com"; }
    ]
  ];

  n = 2;                    # grid size (columns per row)
}

Customizing Colors

By default, it uses sotormd/colors. You can override this by passing your own color flake (see the flakes for expected schema).

{
  description = "Custom themed homepage";

  inputs = {
    colors.url = "github:myUsername/colors"; # your own color flake
    home = {
      url = "github:sotormd/homepage";
      inputs.colors.follows = "colors";
    };
  };

  outputs = { self, home, colors, ... }: {
    packages.x86_64-linux.default =
      let
        layout = [
          [
            { short = "yt"; full = "youtube"; url = "https://youtube.com"; }
            { short = "gh"; full = "github"; url = "https://github.com"; }
          ]
        ];

        html = home.lib.makeHomepage {
          inherit layout;
          n = 4;
        };
      in
      builtins.toFile "homepage.html" html;
  };
}

Layout Reference

Each layout element can be one of:

Type Description Example
List of links A row of link boxes [ { short = "yt"; full = "youtube"; url = "https://youtube.com"; } ... ]
"separator" Horizontal line between rows "separator"

Each link entry looks like:

{ short = "yt"; full = "youtube"; url = "https://youtube.com"; }

Outputs

Output Description
lib.makeHomepage Function that generates static HTML
packages.<system>.default Example homepage (nix build .)

Keyboard Shortcuts

Each link can be opened by typing its short name directly in the browser.

For example, in the provided example package:

yt → opens YouTube 
gh → opens GitHub

About

A pure Nix static homepage generator.

Topics

Resources

License

Stars

Watchers

Forks

Languages