mirror of
https://github.com/cupcakearmy/nix-cli.git
synced 2025-12-09 15:25:02 +00:00
38 lines
1.4 KiB
Markdown
38 lines
1.4 KiB
Markdown
# My Nix Server Configuration
|
|
|
|
This Nix flake configures a server with common tools and shell aliases.
|
|
|
|
## Prerequisites
|
|
|
|
- [Nix](https://nixos.org/download.html) must be installed on the server.
|
|
|
|
## Installation
|
|
|
|
1. **Fork this repository on GitHub.**
|
|
|
|
2. **Customize your fork:**
|
|
|
|
In `flake.nix`, change the `username` variable 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.
|
|
|
|
3. **Apply the configuration on your server:**
|
|
|
|
```bash
|
|
nix run home-manager/master -- switch --flake github:<your-github-username>/nix-server#<your-username>
|
|
```
|
|
|
|
For example, if your GitHub username is `johndoe` and your server username is `john`:
|
|
|
|
```bash
|
|
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.
|
|
|
|
```bash
|
|
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.
|