r/Nix

What does the hash in a /nix/store path actually name? (not always "the inputs")
▲ 0 r/Nix+1 crossposts

What does the hash in a /nix/store path actually name? (not always "the inputs")

"The hash comes from the inputs" is the usual answer, and it's incomplete — it never says what Nix hashed: the file you wrote, the derivation it evaluates to, the built bytes, or the dependencies.

- Most package paths are input-addressed. Nix names the output from the derivation (the concrete build recipe) before the build runs. That's why editing a .nix file doesn't always move the path — two expressions can evaluate to the same recipe — and why changing a real recipe input does.

- Some paths are content-addressed. `nix store add` hashes bytes that already exist. Both live under /nix/store, so calling every store path "content-addressed" misses the split.

The name is also only part of the record: built paths reference other paths, Nix records the graph, and the closure is everything that must travel with a path to another machine.

Disclosure: I build LabCraft, and I just shipped this as a free, hands-on lesson. You inspect a real NixOS machine (the OS itself is the biggest store object) and predict what moves a path before the machine answers. No Nix language required: https://www.labcraft.dev/blog/nix-store-paths?utm_source=reddit-personal&utm_medium=social&utm_campaign=nix-store-paths-2026q3&utm_content=r-nixos-hash-names-01

u/anandsuresh81 — 1 day ago
▲ 1 r/Nix+2 crossposts

Home-Manager doesn't work with void Linux

i had weird problem where home-manager was working very well with cachyos but when i use it in void linux its doesn't seem to get the path right

PS: i just needed to add programs.fish.enable = true; thanks for everyones help

void-home.nix

{
  config,
  pkgs,
  ...
}: let
  dotfiles = "${config.home.homeDirectory}/nixchad/config";
  MkSymlink = path: config.lib.file.mkOutOfStoreSymlink path;
  configs = {
    mango = "mango";
  };
in {
  home = {
    username = "comst4r";
    homeDirectory = "/home/comst4r";
    stateVersion = "25.11";
  };
  home.sessionPath = [
  "${config.home.homeDirectory}/.nix-profile/bin"
  ];
  imports = [
    ./../../Modules/programs/nixvim/init.nix
  ];

  xdg.configFile =
    builtins.mapAttrs
    (name: subpath: {
      source = MkSymlink "${dotfiles}/${subpath}";
      recursive = true;
    })
    configs;

  home.packages = with pkgs; [
    btop
    lsd
    kitty
    zoxide
    ncdu
    xclip
    fastfetch
    dysk
    fishPlugins.bobthefish
    nixd
    alejandra
    yank
  ];
}

flake.nix

{
  description = "myFlake";

  inputs = {
    nixpkgs = {
      url = "github:nixos/nixpkgs/nixos-25.11";
    };
    nixpkgs-unstable = {
      url = "github:nixos/nixpkgs/nixos-unstable";
    };

    home-manager = {
      url = "github:nix-community/home-manager/release-25.11";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    nixos-hardware = {
      url = "github:NixOS/nixos-hardware/master";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    nixvim = {
      url = "github:nix-community/nixvim/nixos-25.11";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    mac-style-plymouth = {
      url = "github:SergioRibera/s4rchiso-plymouth-theme";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = inputs @ {
  nixpkgs,
  home-manager,
  ...
  }: let
  system = "x86_64-linux";
  pkgs = import nixpkgs {
  inherit system;
  config.allowUnfree = true;
  };
  uns-pkgs = import inputs.nixpkgs-unstable {
  inherit system;
  config.allowUnfree = true;
  };
  in {
  nixosConfigurations.Thinkchad = nixpkgs.lib.nixosSystem {
  inherit system;
  specialArgs = {
  inherit inputs uns-pkgs;
  };
  modules = [
  ...
  home-manager.nixosModules.home-manager
  {
  home-manager = {
  useGlobalPkgs = true;
  useUserPackages = true;
  backupFileExtension = "backup";
  users.comst4r = import ./Hosts/Thinkchad/home.nix;
  extraSpecialArgs = {
  inherit inputs uns-pkgs;
  };
  sharedModules = [
  inputs.nixvim.homeModules.nixvim
  ];
  };
  }
  ];
  };
  homeConfigurations = {
  comst4r = home-manager.lib.homeManagerConfiguration {
  inherit pkgs;
  extraSpecialArgs = {
  inherit inputs uns-pkgs;
  };
  modules = [
  inputs.nixvim.homeModules.nixvim
  ./Hosts/Thinkchad/home.nix
  ];
  };
  void = home-manager.lib.homeManagerConfiguration {
  inherit pkgs;
  extraSpecialArgs = {
  inherit inputs uns-pkgs;
  };
  modules = [
  inputs.nixvim.homeModules.nixvim
  ./Hosts/Voidchad/void-home.nix
  ];
  };
  };
  };
}

my path's

/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin

$ ls ~/.nix-profile/bin

accessdb   btop    fastfetch  lexgrog  man-recode  ncdu                  whatis          xclip-cutfile    zoxide
alejandra  catman  kitten     lsd      mandb       nixd                  xclip           xclip-pastefile
apropos    dysk    kitty      man      manpath     update-mime-database  xclip-copyfile  yank
reddit.com
u/com4ster — 3 days ago
▲ 1 r/Nix+1 crossposts

Nix with other (immutable) distro

Hello, I am a Nix beginner. I am trying to create a config that I could deploy easily on different systems (cachyOS on gaming rig, fedora atomic on my laptop, etc.).

When it comes to packages invoked through $PATH, Nix already has priority, so it's obvious that the package I am running is the one provided by Nix.

Now let's say I am trying to configure a GUI application like Ghostty. On some systems, Ghostty is not present by default, and the Nix binary will always be used. But for example on the atomic Fedora image I have, Ghostty is already provided. Therefore, depending on how I invoke Ghostty (via app launcher, niri shortcut, or shell), in some cases the Nix binary will be running, and in others it will be the system's one.

Since my primary goal is to have a config that I can easiky reproduce everywhere, how should I handle this? Should I assume some packages are always provided by the system? Should I accept that I will work with different versions of the same package?

Thanks :)

reddit.com
u/EndedHereByMistake — 5 days ago