docs: update README

This commit is contained in:
Yorick Barbanneau 2024-10-12 22:24:39 +02:00
parent 8fd30ecb0a
commit 3e497c997a

View file

@ -1,36 +1,57 @@
My NixOS configuration # My NixOS configuration
----------------------
My configurations for NixOS using flakes. For now only my desktop computer is My machines and dotfiles management using Nix / NixOS.
configured with this system.
## Install ## Installation
Project contains a devshell installing all needed and a
[Taskfile](https://Taskfile.dev) is available to help manage elements whether
Home-Manager or NixOS configuration.
``` ```
doas nixos-rebuild switch --flake ".#mrmeeseeks" 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
``` ```
## Update the flakes.lock Managing *NixOS* installation, you can use all `nixos:*` targets for example:
```
nix flake update
doas nixos-rebuild switch --flake ".#mrmeeseeks"
```
## Update manual packages from github
Some modules use `fetchFromGithub` who need *SHA-256* hash to meet
reproductibility. Theses hashed can be obtain with `nix-prefetch-github`:
```shell ```shell
$ nix-shell -p nix-prefetch-github # build mrmeeseeks nixos:
$ nix-prefetch-ghithub --rev v1.22.0 sindresorhus pure task nixos:build:mrmeeseeks
{
"owner": "sindresorhus", # build/switch nixos installation for mrmeeseeks
"repo": "pure", task nixos:switch:mrmeeseeks
"rev": "87e6f5dd4c793f6d980532205aaefe196780606f",
"sha256": "TR4CyBZ+KoZRs9XDmWE5lJuUXXU1J8E2Z63nt+FS+5w=" # build ephase home configuration for mrmeeseeks:
} task home:build:mrmeeseeks
# build / switch ephase home configuration for mrmeeseeks
``` ```
In this example we have obtained the hash for the specific 1.22.0 version. ## 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
```