# Standalone NixOS module for nina — no flake inputs needed. # Generated by the installer into ~/nina.nix. Also importable directly. # # Usage (in configuration.nix): # imports = [ # "${builtins.fetchTarball "https://kepr.uk/nina/archive/HEAD.tar.gz"}/nixos-module.nix" # ]; # programs.nina.enable = true; # # For flake-based configs use the flake input instead — see flake.nix. { config, pkgs, lib, ... }: let nina-pkg = pkgs.stdenv.mkDerivation { pname = "nina"; version = builtins.replaceStrings [ "\n" "\r" " " "\t" ] [ "" "" "" "" ] (builtins.readFile ./VERSION); src = ./.; nativeBuildInputs = [ pkgs.zig_0_16 ]; dontConfigure = true; buildPhase = '' export ZIG_GLOBAL_CACHE_DIR="$TMPDIR/zig-cache" zig build -Doptimize=ReleaseSafe ''; installPhase = "install -Dm755 zig-out/bin/nina $out/bin/nina"; meta = { description = "The nix helper — manage your NixOS system from the command line"; mainProgram = "nina"; }; }; cfg = config.programs.nina; in { options.programs.nina = { enable = lib.mkEnableOption "nina, the NixOS helper"; package = lib.mkOption { type = lib.types.package; default = nina-pkg; description = "The nina package to install."; }; }; config = lib.mkIf cfg.enable { environment.systemPackages = [ cfg.package ]; }; }