Skip to main content

Platforms

At our company, we now make use of a standardised way to unify all of our device platforms.

Home Manager

To customise your own device, you can make use of home-manager, a user-space configuration tool in Nix.

Installation

Steps to use it:

  1. git clone git@github.com:MatrixAI/nixpkgs-matrix-private
  2. cp nixpkgs-matrix-private/profiles/install/home-manager-template/* ~
  3. Edit the flake.nix and change the following line (remove the and replace with your user account username for linux):
...
outputs = { nixpkgs, home-manager, ... }@inputs:
let
system = "x86_64-linux";
--> username = "REPLACE THIS";

in {
...
  1. vscode and vesktop are already there as a default package, so if you want to try it do nix profile install nixpkgs#home-manager and then home-manager switch --flake ~

How to add new packages

Inside your home.nix, under the home.packages you may add your own custom packages.

You can use https://mynixos.com or https://search.nixos.org/packages to find packages of your choice.

Example:

diff --git a/home.nix b/home.nix
index c07f8e2..385650c 100644
--- a/home.nix
+++ b/home.nix
@@ -4,7 +4,12 @@ let homeDirectory = "/home/${username}";
in {
imports = [ inputs.polykey-cli.homeModules.default ];

- home.packages = with pkgs; [ vscode vesktop ];
+ home.packages = with pkgs; [
+ vscode
+ firefox
+ brave
+ vesktop
+ ];

After modifying this file, you can do a home-manager switch --flake ~ to install your changes.

If you wish to uninstall a package, simply remove it from the list of packages.

Updating packages

To perform an update, you can do nix flake update and then a home-mananger switch --flake ~ to update to the latest version.

Transitioning from nix profile install or nix-env -iA

You can do nix profile remove '.*' and nix-env --uninstall '*' to completely purge your packages if you used them with those commands previously. You can then follow the guide above to get your packages back.

Additional Home Manager documentation