Skip to Content
Veila
Installation

NixOS

Install through the NixOS module or add the flake package directly

Install from Nixpkgs or use the flake’s NixOS and Home Manager modules.

Nixpkgs

Nixpkgs unstable repository

Configure the PAM service:

{
  environment.systemPackages = with pkgs; [ veila ];
  security.pam.services.veila = {};
}

NixOS Module

The flake module manages PAM, the user service, and idle locking.

Add it as a flake input:

{
  inputs.veila = {
    url = "github:naurissteins/Veila";
    inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs = { nixpkgs, veila, ... }: {
    nixosConfigurations.my-host = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        veila.nixosModules.default
        {
          programs.veila = {
            enable = true;
            service.enable = true;
            idle = {
              enable = true;
              lockAfter = 300;
              lockBeforeSleep = true;
            };
          };
        }
      ];
    };
  };
}

The module installs Veila and PAM. The optional service starts veila idle with your graphical session for idle, sleep, and logind Lock events. Manual locking needs no service. The Nix package provides only the veila command.

OptionWhat it does
enableInstalls the package and configures the PAM service
service.enableRuns optional veila idle as the veila.service systemd user service
idle.enableEnables inactivity locking in the watcher and starts the service
idle.lockAfterSeconds of inactivity before locking
idle.lockBeforeSleepLocks before suspend whenever the watcher runs; defaults to true independently of idle locking

Home Manager

Import veila.homeModules.default to manage Veila per user. settings becomes ~/.config/veila/config.toml:

{
  imports = [ veila.homeModules.default ];

  programs.veila = {
    enable = true;
    service.enable = true;
    settings = {
      theme = "santorini";
    };
    idle = {
      enable = true;
      lockAfter = 300;
      lockBeforeSleep = true;
    };
  };
}

Home Manager cannot configure PAM. Add this to your system config for password unlock:

security.pam.services.veila = {};

Nix-managed config is read-only. Edit programs.veila.settings and rebuild; CLI theme and init commands cannot rewrite it.

Package Only

Install the package directly from the flake:

nix profile install github:naurissteins/Veila#veila

Or add it to your system packages:

{
  environment.systemPackages = [
    inputs.veila.packages.${pkgs.system}.default
  ];

  security.pam.services.veila = {};
}

Configure PAM before locking; otherwise the correct password may fail.

Local Development Checkout

Install a local checkout with a path input:

inputs.veila = {
  url = "path:/home/ns/Projects/Veila/Veila";
  inputs.nixpkgs.follows = "nixpkgs";
};

Use your checkout’s path. Import veila.nixosModules.default and enable programs.veila.enable; add programs.veila.service.enable for the watcher. NixOS configures PAM; do not copy the Arch PAM file.

After each source change, refresh only Veila's snapshot and rebuild your system:

nix flake update veila --flake ~/nixos
sudo nixos-rebuild switch --flake ~/nixos#desktop

Replace desktop with your host. Refresh the input before rebuilding to pick up source changes. Restart veila.service after unlocking. After the first install, log out and back in, then run veila doctor.

For a writable config, leave programs.veila.settings unset and use veila init and veila check-config. Idle locking is opt-in; sleep locking defaults to enabled while the watcher runs.

For Cargo builds, enter the project's development shell:

cd /path/to/Veila
nix develop
cargo build --locked
cargo clippy --workspace --all-targets -- -D warnings

The shell supplies native libraries, pkg-config, Cargo Deny, and ShellCheck. Install stable Rust, rustfmt, and Clippy through rustup; flake package builds use Nixpkgs’ Rust.

For a one-shot release build:

nix develop --command cargo build --locked --release --workspace

The checkout includes .envrc for direnv. With direnv and nix-direnv enabled, authorize it once:

direnv allow

Re-enter the checkout to load the environment. Cargo output goes to ~/.cache/veila/target unless CARGO_TARGET_DIR is set, keeping artifacts out of flake snapshots.

Build Manually

Build from a local checkout:

git clone https://github.com/naurissteins/Veila.git
cd Veila
nix build .#veila
./result/bin/veila --help
./result/bin/veila idle --help
./result/bin/veila preview --help

Or build straight from the flake:

nix build github:naurissteins/Veila#veila

First Launch

Lock without a service:

veila lock

Stays in the foreground until unlock.

For keybinds or external idle tools:

veila lock --daemonize --wait-ready

For example, in Hyprland:

bind = SUPER, Escape, exec, veila lock --daemonize --wait-ready

Optional: start the idle/sleep watcher:

systemctl --user enable --now veila.service

Or start veila idle from your compositor. Run one watcher per display. For sweetidle, swayidle, and sleep hooks, see Lock control.

No config is required. Customize the default theme or choose another theme.

On this page