From 37411ee25f3fff58056e5fa94f3e84a61c49f770 Mon Sep 17 00:00:00 2001 From: Tastatur Date: Sat, 30 Dec 2023 21:23:24 +0100 Subject: [PATCH] Updated nix page --- docs/alpine-desktop-setup/post-install/nix.md | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/alpine-desktop-setup/post-install/nix.md b/docs/alpine-desktop-setup/post-install/nix.md index 4443013..d5e2554 100644 --- a/docs/alpine-desktop-setup/post-install/nix.md +++ b/docs/alpine-desktop-setup/post-install/nix.md @@ -21,29 +21,40 @@ experimental-features = nix-command flakes Don't forget to add your user to the nix group: ``` -adduser nix +# adduser nix ``` ## Usage -> From here on things have to be done per user. +Nix can be used to manage your `$HOME` with `home-manager` and `flakes`. ([Here a link explaining it all](https://juliu.is/tidying-your-home-with-nix/)) -Now that Nix is up and running utilize the `flake` that comes with the config files to set up our home for us: +Now that Nix is up and running utilize the `flake` that comes with the [config files](https://docs.bijl.us/alpine-desktop-setup/post-install/config-files/) to set up our home for us. But before initialising `nix` make sure that you set the correct `` in both `flake.nix` and `home.nix` which are located in `~/.config/home-manager`. Then after changing those simply run this command from that same directory: ``` -$ cd ~/.config/home-manager $ nix run . switch ``` -Now you are able to install packages as a user without root from `nixpkgs`: +This should have installed `nixpkgs-unstable` and `home-manager`. Verify this with: + +``` +$ home-manager --version +``` + +And thanks to `home-manager` we can easily set up and manage an entire graphical enviroment with all the necessary packages in one go. + +You are now also able to install packages as a user without root from `nixpkgs`: ``` $ nix-env -iA nixpkgs. ``` -> You can also test a package before installing it with `nix-shell -p ` +You can also test a package before installing it with `nix-shell -p ` -### Home-Manager +To update your system, in `~/.config/home-manager` run: + +``` +$ nix flake update +``` ### Nix-Bubblewrap