Ever wanted reproducible shell highlighting/autocomplete etc when running nix develop? Me too, which is why I made Xome (“Zome”): a small flake that combines home-manager and nix develop. Basically makes a fake home (cached), uses home-manager to populate it, then makes use of that home to create a super isolated nix-develop shell.
Note! the sys command makes easy to escape the otherwise super-isolatedness. Want to run a quick git push? Then sys git push will do what you want. Same for sys sudo, sys vim, etc. They will be run using your real home and real path, so they’ll find your home git config, ssh keys, etc.
Example Usage
If you use flake utils you probably have something like this:
{
description = "My Project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
xome.url = "github:jeff-hykin/xome";
};
outputs = { self, nixpkgs, flake-utils, xome, ... }:
let
something = "something";
in
flake-utils.lib.eachDefaultSystem (system:
{
packages = { /* your normal stuff */ };
}
);
}
You can add Xome like this:
{
description = "My Project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
xome.url = "github:jeff-hykin/xome";
};
outputs = { self, nixpkgs, flake-utils, xome, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages = { /* your normal stuff */ };
devShells = xome.simpleMakeHomeFor {
inherit pkgs;
pure = true;
homeModule = {
# for home-manager examples, see:
# https://deepwiki.com/nix-community/home-manager/5-configuration-examples
# all home-manager options:
# https://nix-community.github.io/home-manager/options.xhtml
home.homeDirectory = "/tmp/virtual_homes/xome_simple";
home.stateVersion = "25.11";
home.packages = [
# vital stuff
pkgs.nix
pkgs.coreutils-full
# optional stuff
pkgs.gnugrep
pkgs.findutils
pkgs.wget
pkgs.curl
pkgs.unixtools.locale
pkgs.unixtools.more
pkgs.unixtools.ps
pkgs.unixtools.getopt
pkgs.unixtools.ifconfig
pkgs.unixtools.hostname
pkgs.unixtools.ping
pkgs.unixtools.hexdump
pkgs.unixtools.killall
pkgs.unixtools.mount
pkgs.unixtools.sysctl
pkgs.unixtools.top
pkgs.unixtools.umount
pkgs.git
pkgs.htop
pkgs.ripgrep
];
programs = {
home-manager = {
enable = true;
};
zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
shellAliases.ll = "ls -la";
history.size = 100000;
# this is kinda like .zshrc
initContent = ''
# this enables some impure stuff like sudo, comment it out to get FULL purity
export PATH="$PATH:/usr/bin/"
'';
};
starship = {
enable = true;
enableZshIntegration = true;
};
};
};
};
}
);
}
Run nix develop and you’ll get a fancy starship terminal, autocomplete, highlighting, etc.
Tagging @MattRixman since you mentioned a while ago you might be interested in this kind of thing.