nix/README.md

1.9 KiB

My NixOS configuration

My machines and dotfiles management using Nix / NixOS.

Installation

Project contains a devshell installing all needed and a Taskfile is available to help manage elements whether Home-Manager or NixOS configuration.

task --list-all
task: Available tasks for this project:
* check:flake:               Check flake
* check:sh:                  Check SH files, will call all check:sh:* tasks
* check:sh:shellcheck:       Pass Shellcheck on all *.sh files
* check:sh:shfmt:            Pass shfmt in check mode on all sh files
* check:typos:               Check typos in all files
* home:*:*:                  Manage Home-Manager configuration, use home:verb:target format
* home:gc:                   Garbage collect Home-Manager packages
* home:list-gen:             List Home-Manager generations
* host:*:switch:             Switch both Home-Manager and NixOS generations
* host:*:update:             Update package version then build NixOS and Home-Manager
* nixos:*:*:                 Manage NixOS build, use nixos:verb:target format
* nixos:gc:                  Garbage collect NixOS
* nixos:list-gen:            List Nixos generations

Managing NixOS installation, you can use all nixos:* targets for example:

# build mrmeeseeks nixos:
task nixos:build:mrmeeseeks

# build/switch nixos installation for mrmeeseeks
task nixos:switch:mrmeeseeks

# build ephase home configuration for mrmeeseeks:
task home:build:mrmeeseeks

# build / switch ephase home configuration for mrmeeseeks

Update nixpkgs version

Update packages repositories version can be done with host:<hostname>:update:

task host:mrmeeseeks:update

flake.lock file will be updated then both NixOS and Home-Manager will be rebuilt. Note than new generation will not be activated, to do so you need to:

task host:mrmeeseeks:switch