From a441eebeac1c1e39a8d127419c35dc9a6e65bbe3 Mon Sep 17 00:00:00 2001 From: Tastatur Date: Mon, 1 Apr 2024 13:54:50 +0200 Subject: [PATCH] Fixed up the nix and decryption page --- .../post-install/automatic-decryption.md | 17 ++++---------- docs/alpine-desktop-setup/post-install/nix.md | 22 +++++++++---------- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/docs/alpine-desktop-setup/post-install/automatic-decryption.md b/docs/alpine-desktop-setup/post-install/automatic-decryption.md index 392de08..bf884c6 100644 --- a/docs/alpine-desktop-setup/post-install/automatic-decryption.md +++ b/docs/alpine-desktop-setup/post-install/automatic-decryption.md @@ -2,16 +2,7 @@ Our system can utilize it's TPM2 to automatically decrypt. This can be done because the bootchain is secure and it's a bit tedious to enter an encryption password everytime the system boots up. -First off the packages `clevis` and `tpm2-tools` have to be installed: - -``` -# -$ -``` - -> Not yet doable (but will be don't worry ;) ) - -Now bind our LUKS volume to TPM with clevis: +If `home-manager` was installed correctly then it should have also installed both `clevis` and `tpm2-tools`. This allows for the binding of the LUKS volume to TPM with clevis: ``` # clevis luks bind -d /dev/ tpm2 '{"pcr_bank":"sha256","pcr_ids":"0,1,5,7"}' @@ -19,13 +10,13 @@ Now bind our LUKS volume to TPM with clevis: After rebooting it should automatically decrypt your disk. -Clevis can be envoked again if you have made any changes to secureboot or system and it doesn't automatically decrypt the disk. +Clevis can be envoked again if you have made any changes to secureboot or to the system and it doesn't automatically decrypt the disk. -First find the keyslot clevis is using and then "regen" the key: +First find the keyslot clevis is using and then regenerate the key: ``` # cryptsetup luksDump /dev/ # clevis luks regen -d /dev/ -s ``` -It should now work again. +If done correctly it should now work again. diff --git a/docs/alpine-desktop-setup/post-install/nix.md b/docs/alpine-desktop-setup/post-install/nix.md index 63efc9b..470a776 100644 --- a/docs/alpine-desktop-setup/post-install/nix.md +++ b/docs/alpine-desktop-setup/post-install/nix.md @@ -1,9 +1,11 @@ -# Nix (WIP - don't follow yet) +# Nix -The *Nix package manager* is a package manager which allows for user independent packages and a whole lot more (although it's not necessarily minimal). To set it up install it's package and activate it's service: +The *Nix package manager* is a package manager which allows for user independent packages and a whole lot more (although it's not necessarily minimal). ## Setup +To set `nix` up install its package and activate its service: + ``` # apk add nix # rc-update add nix-daemon default @@ -12,12 +14,6 @@ The *Nix package manager* is a package manager which allows for user independent > (The `nix` package is only available in the `edge` and `apk-ample` repositories) -And add this line to `/etc/nix/nix.conf` to globally enable some features so they can be used later if necessary: - -``` -experimental-features = nix-command flakes -``` - Don't forget to add your user to the nix group: ``` @@ -29,8 +25,8 @@ Don't forget to add your user to the nix group: For `nix` to be able to install packages it is necessary to add a few channels: ``` -$ nix-channel --add https://nixos.org/channels/nixos-23.11 nixos -$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs +$ nix-channel --add https://nixos.org/channels/nixos-23.11 nixpkgs +$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs-unstable $ nix-channel --update ``` @@ -39,7 +35,7 @@ $ nix-channel --update Nix can be used to manage your `$HOME` with `home-manager`. First install `home-manager` through: ``` -$ nix-env -iA nixos.home-manager +$ nix-env -iA nixpkgs.home-manager ``` Now that Nix is up and running utilize the `home.nix` 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 `home.nix` which is located in `~/.config/home-manager`. Then after changing that simply run this command: @@ -56,6 +52,8 @@ You are now also able to install packages as a user without root from `nixpkgs`: $ nix-env -iA nixpkgs. ``` +But for reproducability it's better to use `home-manager` by declaring them in a `.nix` file and importing that within `home.nix`. + You can also test a package before installing it with `nix-shell -p ` ### NixGL @@ -64,5 +62,5 @@ You can also test a package before installing it with `nix-shell -p ` ``` $ nix-channel --add https://github.com/nix-community/nixGL/archive/main.tar.gz nixgl && nix-channel --update -$ nix-env -iA nixgl.auto.nixGLDefault nixgl.VulkanIntel +$ nix-env -iA nixgl.auto.nixGLDefault nixgl.nixVulkanIntel ```