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:
git clone git@github.com:MatrixAI/nixpkgs-matrix-privatecp nixpkgs-matrix-private/profiles/install/home-manager-template/* ~- Edit the
flake.nixand 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 {
...
vscodeandvesktopare already there as a default package, so if you want to try it donix profile install nixpkgs#home-managerand thenhome-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.