Getting Started
Prerequisites
- Nix installed with
nix-envandnix-prefetch-urlavailable inPATH - Optional:
direnvfor shell ergonomics
Install
bash
nix-env -f https://github.com/jpetrucciani/nix/archive/main.tar.gz -iA micaRun
bash
mica init
mica tuiinit creates a mica-managed default.nix in the target directory. tui opens the interactive interface.
Use From a Nix Flake
Example dev shell consuming this repository directly:
nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
mica-src.url = "github:gemologic/mica";
};
outputs = { self, nixpkgs, mica-src, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
mica = import mica-src { inherit pkgs; };
in {
devShells.${system}.default = pkgs.mkShell {
nativeBuildInputs = [
mica.bin
];
};
};
}Quick Flow
mica initmica tui- Search and toggle packages/presets
Ctrl+Sto savemica diffto inspect drift when needed
Project vs Global Mode
- Project mode (default): manages
./default.nix - Global mode (
--global): manages~/.config/mica/profile.tomland~/.config/mica/profile.nix
Common targeting examples:
bash
# target one specific managed file
mica --file ./default.nix list
mica --file ./default.nix diff
# operate on global profile state
mica --global list
mica --global add ripgrep
mica --global generations listUse mica --help to see global options:
-g, --global-f, --file <PATH>-d, --dir <PATH>-n, --dry-run-v, --verbose-q, --quiet