To install Zen Browser on NixOS, you can utilize community-maintained Nix flakes that package the browser for seamless integration. Here's a step-by-step guide:
-
Enable Flakes and Nix Command: Ensure that your NixOS configuration supports flakes and the Nix command by adding the following line to your configuration.nix:
nix.settings.experimental-features = ["nix-command" "flakes"];
-
Add the Zen Browser Flake: In your flake.nix, include the Zen Browser flake as an input. For instance, using the flake from MarceColl:
{
inputs = {
zen-browser.url = "github:MarceColl/zen-browser-flake";
# ... other inputs
};
outputs = { self, nixpkgs, zen-browser, ... }@inputs: {
nixosConfigurations.your-hostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
# Import the Zen Browser module
zen-browser.nixosModules.default
];
};
};
}
Replace "your-hostname" with your actual hostname. This configuration imports the Zen Browser module into your NixOS system[1].
-
Configure Zen Browser in configuration.nix: Within your configuration.nix, enable Zen Browser by adding:
{
# ... other configurations
programs.zen-browser.enable = true;
}
This setting activates the Zen Browser program[2].
-
Rebuild Your System: Apply the changes by rebuilding your NixOS configuration:
sudo nixos-rebuild switch
After the rebuild, Zen Browser should be installed and accessible on your system.
Alternative Method Using Home Manager:
If you prefer managing user-specific applications, you can use Home Manager:
-
Add the Zen Browser Flake: In your flake.nix, include the Zen Browser flake as an input, similar to the previous method.
-
Configure Home Manager: In your Home Manager configuration (e.g., home.nix), add:
{
# ... other configurations
programs.zen-browser.enable = true;
}
-
Apply Home Manager Configuration: Run the following command to apply the changes:
home-manager switch
This approach installs Zen Browser for the specific user[2].
Note: These methods rely on community-maintained flakes. Ensure you trust the source and review the flake's code if necessary. For more details, refer to the respective GitHub repositories:
- MarceColl's Zen Browser Flake[1]:
- LunaCOLON3's Zen Browser Nix[2]:
By following these steps, you can successfully install Zen Browser on your NixOS system.