diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 207b9c4..3a4d965 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -6,6 +6,7 @@ - [Nix basics](./nixbasics/index.md) - [Flakes](./nixbasics/flakes.md) - [Types](./nixbasics/types.md) + - [Language](./nixbasics/language.md) - [Configuration](./configuration/index.md) - [Drivers](./configuration/drivers.md) - [GUI](./configuration/GUI.md) diff --git a/src/configuration/clean.md b/src/configuration/clean.md index 19755f9..a82d50c 100644 --- a/src/configuration/clean.md +++ b/src/configuration/clean.md @@ -1,7 +1,7 @@ # Cleaning old packages By default, packages installed will be kept after each rebuild, even if they are not active anymore. -You can manually garbage collect with `nix-collect-garbage -d` to remove all the old generations. +You can manually garbage collect with `nix-collect-garbage -d` to remove all the old generations (`sudo` is needed for system packages). One can however do this automatically using the following: ```nix diff --git a/src/configuration/hm.md b/src/configuration/hm.md index 5d74292..dd79a78 100644 --- a/src/configuration/hm.md +++ b/src/configuration/hm.md @@ -60,7 +60,7 @@ This assumes that we are installing on an x86 system, if not, change the system # The home.packages option allows you to install Nix packages into your # environment. - home.packages = [ + home.packages = with pkgs; [ # # Adds the 'hello' command to your environment. It prints a friendly # # "Hello, world!" when run. # pkgs.hello diff --git a/src/configuration/new.md b/src/configuration/new.md index a129b00..d55e9c9 100644 --- a/src/configuration/new.md +++ b/src/configuration/new.md @@ -1 +1,22 @@ # How to find new software and configure + +So, you have a system, but how do you now install software that you want to use? + +## Finding packages +[search.nixos.org](https://search.nixos.org/packages?channel=unstable) is the way to search for packages. +Lets say that you want to add `nnn` to your user via home-manager. +First, search and make sure that `nnn` is available using the link earlier, then add it to the list `home.packages` in `home.nix`. +If you want to add it to the system environment, then add it to the list `environment.systemPackages` in `configuration.nix`. + +## Finding options +[search.nixos.org/options](https://search.nixos.org/options?channel=unstable) is the way to search for options. +Lets say, you want to enable adb, you can search adb. +The first option is `programs.adb.enable`, which says it enables adb, but you need to add your user to the `adbusers` group. +If you want to enable a service, such as `tailscale`, searching for it shows how to enable it. +But `service.tailscale` has a lot of extra options, that regulate how the service works. +`service.tailscale.useRoutingFeatures` for example determines how the system should handle routing. + +## Finding options for Home-manager +[home-manager-options.extranix.com](https://home-manager-options.extranix.com/) is the way to search for options for use in home-manager. +It works in the same way as [Finding options](#finding-options), but using the previous link. +It would allow one to find and configure `yazi` for example. diff --git a/src/nixbasics/flakes.md b/src/nixbasics/flakes.md index b250b3b..430f585 100644 --- a/src/nixbasics/flakes.md +++ b/src/nixbasics/flakes.md @@ -2,8 +2,8 @@ Flakes are as of writing this guide still an experimental feature. However, flakes provide concepts that I feel are fundamental to the concepts of Nix. -What flakes does is similar to `package-lock.json` from **npm**. -It makes sure that the inputs that are used, for example **nixpkgs**, are kept to a specific version. +What flakes does is similar to `package-lock.json` from `npm`. +It makes sure that the inputs that are used, for example `nixpkgs`, are kept to a specific version. To enable flakes to your config, add the following ```nix diff --git a/src/nixbasics/language.md b/src/nixbasics/language.md new file mode 100644 index 0000000..403a548 --- /dev/null +++ b/src/nixbasics/language.md @@ -0,0 +1 @@ +# Language