Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Installation

Prerequisites

  • Nix with flakes enabled
  • Rust 1.83+ (if building from source)

Shell hook

Optional. See flk hook.

From source

git clone https://gitlab.com/pixel-racks/flk.git
cd flk
cargo build --release
sudo cp target/release/flk /usr/local/bin/

From Cargo (crates.io)

cargo install flk

From release binaries

  1. Go to https://gitlab.com/pixel-racks/flk/-/releases
  2. Download the archive for your platform (Linux x86_64, macOS Intel, macOS ARM).
  3. Unpack it and put flk on your PATH.

Nix (with Cachix binaries)

Prebuilt binaries are on Cachix.

  1. Install Cachix (once):
nix profile install nixpkgs#cachix
  1. Trust the cache:
cachix use flk-cache

or add the cache to nix.conf:

substituters = https://flk-cache.cachix.org  ...
trusted-public-keys = flk-cache.cachix.org-1:6xobbpP9iIK5sIH/75DQrsJYKN/61nTOChcH9MJnBR0=  ...
  1. Use the flake:
  • Run (no install): nix run gitlab:pixel-racks/flk#flk
  • Install to your profile: nix profile install gitlab:pixel-racks/flk#flk

Nix flake input

Use the package directly or through the overlay.

Direct (no overlay):

{
  description = "My NixOS config with flk";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    flk.url = "gitlab:pixel-racks/flk";
  };

  outputs = { self, nixpkgs, flk, ... }:
    let
      system = "x86_64-linux"; # set per host
      pkgs = import nixpkgs { inherit system; };
    in {
      nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
        inherit system;
        modules = [
          {
            environment.systemPackages = [
              flk.packages.${system}.flk
            ];
          }
        ];
      };
    };
}

With overlay (exposes pkgs.flk):

{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  inputs.flk.url = "gitlab:pixel-racks/flk";

  outputs = { self, nixpkgs, flk, ... }:
    let
      system = "x86_64-linux"; # set per host

      pkgs = import nixpkgs {
        inherit system;
        overlays = [ flk.overlay ];
      };
    in {
      nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
        inherit system;
        modules = [
          { environment.systemPackages = [ pkgs.flk ]; }
        ];
      };
    };
}

Home Manager example (per-user install via flake):

{
  inputs.flk.url = "gitlab:pixel-racks/flk";

  outputs = { self, flk, ... }: {
    homeConfigurations.myhost = {
      # ...
      home.packages = [ flk.packages.${system}.flk ];
    };
  };
}

Architectures covered by the cache

  • x86_64-linux
  • x86_64-darwin
  • aarch64-darwin
  • aarch64-linux (built with qemu in CI, so occasionally missing)

Other systems build from source.

Next: Getting Started.