Hi! What does “dirty” mean at the beginning of boot, where I can choose generation?
I’m not 100 % sure, but usually in the nix context something being “dirty” is that there are uncommitted changes in the git repository.
How the boot entries are generated is terribly complicated.
That part of the boot entry is taken from the label
property of the system/boot.json
file. In turn, that is based on the value of the (hidden) NixOS option system.nixos.version
that defaults either to the NIXOS_LABEL_VERSION env variable if set or to system.nixos.release + system.nixos.versionSuffix
. The versionSuffix
, which is containing “dirty”, defaults to lib.trivial.versionSuffix
.
In turn, this returns the content of the file $nixpkgs/.version-suffix, where $nixpkgs is the Nixpkgs source you used to build the system, either some flake input or path downloaded with nix-channel
.
The file is written by nixos-rebuild
when it is called with nixpkgs pointing to a local git repository, based on the output of
git --git-dir="$nixpkgs" describe --always --dirty
So, assuming I didn’t miss some step, you built NixOS from a dirty checkout of the Nixpkgs repository, which in Git jargon means you made some change to a file tracked by Git but did not commit them yet.
Wow, thanks for your answer. I did create git repository in my /etc/nixos, but deleted it. This is my /etc/nixos:
[root@nix3:/etc/nixos]# ls -a
. .. configuration.nix dell-1 dell-3 flake.lock flake.nix import.nix packages.nix .stfolder .stignore systemd-services.nix users.nix
[root@nix3:/etc/nixos]#
.stignore is file required by syncthing. As far as I know there should be .git folder when there is a repository. I deleted it when I tried to delete this git repo.
You should still use git, or some version control system, so that you can track changes to your config and revert changes that cause issues. Backing up your config as well would be ideal.
I’m having some troubles using git, but I sync these files across my two laptops, and create backups.