Various information and commands and techniques to get things done.
- Unstable always takes the latest LTS release
- Stable sticks with the LTS at the time of the first release
- Stable also provides a backport of the latest from unstable (linuxPackages_latest)
nix run github:bluskript/nix-inpsect
nix repl
nix repl --expr 'import <nixpkgs>{}
Get derivation params
nix eval -f '<nixpkgs>' 'vscode.version'
Get list of all packages
nix eval nixpkgs#legacyPackages.x86_64-linux --apply builtins.attrNames
Get list of linux packages
nix eval nixpkgs#legacyPackages.x86_64-linux.linuxPackages --apply builtins.attrNames
Get linux kernel version (not necessarily the installed one)
nix eval nixpkgs#legacyPackages.x86_64-linux.linuxPackages.kernel.baseVersion --apply builtins.attrNames
Get list of builtins
nix eval nixpkgs#lib --apply builtins.attrNames
In an attempt to find out why conflicting Nvidia drivers were being built, I was told by ElvishJerricco on Element to try the following:
nix eval .#nixosConfigurations.upaya.options.boot.extraModulePackages.definitionsWithLocations --apply 'map (x: x.file)'
nix eval .#nixosConfigurations.upaya.options.boot.extraModulePackages.definitionsWithLocations --apply 'xs: builtins.listToAttrs (map (x: { name = toString x.file; value = toString x.value; }) xs)'
In the process, it turns out that using
inputs.nixpkgs.lib.nixosSystem {
modules = [
(import ./hosts/upaya/configuration.nix)`
];
};
kills debug information, and is better done as:
inputs.nixpkgs.lib.nixosSystem {
modules = [
./hosts/upaya/configuration.nix
];
};
- https://discourse.nixos.org/t/nix-inspect-a-tui-for-browsing-nix-configs-and-other-expressions/43180
- https://github.com/bluskript/nix-inspect
nix-inspect .
sudo mkdir /mnt/store_rw
sudo mount -o rw --bind /nix/store /mnt/store_rw/
sudo rm /mnt/store_rw/<path>/file
sudo umount /mnt/store_rw