My Nix Server Configuration
This Nix flake configures a server with common tools and shell aliases.
Prerequisites
- Nix must be installed on the server.
Installation
-
Fork this repository on GitHub.
-
Customize your fork:
In
flake.nix, change theusernamevariable to your actual username on the server. You can do this directly on GitHub or by cloning your fork locally, making the change, and pushing it. -
Apply the configuration on your server:
nix run home-manager/master -- switch --flake github:<your-github-username>/nix-server#<your-username>For example, if your GitHub username is
johndoeand your server username isjohn:nix run home-manager/master -- switch --flake github:johndoe/nix-server#john
Updating
To update the packages and your configuration on the server, simply run the same command again. Nix will automatically fetch the latest version of your flake from your GitHub repository.
nix run home-manager/master -- switch --flake github:<your-github-username>/nix-server#<your-username>
To update the flake's dependencies (like nixpkgs), you'll need to update the flake.lock file in your repository. You can do this by running nix flake update in a local clone of your repository and pushing the changes.