chore(template): parameterize user accounts and update README onboarding instructions

This commit is contained in:
Sridhar Ratnakumar 2026-02-19 14:22:11 -05:00
parent 1bf5049ebb
commit 62890af2cc
3 changed files with 14 additions and 12 deletions

View file

@ -1,10 +1,16 @@
[![AGPL](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://en.wikipedia.org/wiki/Affero_General_Public_License) [![AGPL](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://en.wikipedia.org/wiki/Affero_General_Public_License)
This repository contains the Nix / NixOS configuration for all of my systems. See [nixos-unified](https://nixos-unified.org)—specifically [nixos-unified-template](https://github.com/juspay/nixos-unified-template)—if you wish to create your own configuration from scratch. This is my Nix / NixOS configuration for all of my systems. See [nixos-unified](https://nixos-unified.org)—specifically [nixos-unified-template](https://github.com/juspay/nixos-unified-template)—if you wish to create your own configuration from scratch.
## Setup ## Setup
To use this repository as base configuration for your new machine running: If you are using this repository as a starting template for your own configuration, perform these initial steps:
1. Edit `config.nix` in the repository root to set your primary user information (`username`, `fullname`, `email`, `sshKey`).
2. Replace the SSH keys in `secrets/secrets.nix` with your own, or delete the file if you do not use `agenix`.
3. Delete any files in `configurations/` that you do not need, and create/rename files to match your hostnames.
After preparing your template, to install on a new machine running:
### NixOS Linux ### NixOS Linux
@ -23,16 +29,12 @@ To use this repository as base configuration for your new machine running:
- X1 Carbon: https://srid.ca/x1c7-install - X1 Carbon: https://srid.ca/x1c7-install
- Windows (via WSL): https://github.com/nix-community/NixOS-WSL - Windows (via WSL): https://github.com/nix-community/NixOS-WSL
- Clone this repo anywhere - Clone this repo anywhere
- Rename `./configurations/nixos/??.nix` to match your current system hostname
- Edit `config.nix` to set your primary user information
- Run `nix run`. That's it. Re-open your terminal. - Run `nix run`. That's it. Re-open your terminal.
### macOS ### macOS
- [Install Nix](https://nixos.asia/en/install) - [Install Nix](https://nixos.asia/en/install)
- Clone this repo anywhere - Clone this repo anywhere
- Rename `./configurations/darwin/??.nix` to match your current system hostname
- Edit `config.nix` to set your primary user information
- Run `nix run`.[^cleanup] That's it. Re-open your terminal. - Run `nix run`.[^cleanup] That's it. Re-open your terminal.
[^cleanup]: You might have to `rm -rf /etc/nix/nix.conf`, so our flake.nix can do its thing. [^cleanup]: You might have to `rm -rf /etc/nix/nix.conf`, so our flake.nix can do its thing.

View file

@ -2,7 +2,7 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }: { config, flake, pkgs, ... }:
{ {
imports = imports =
@ -54,9 +54,9 @@
# services.xserver.libinput.enable = true; # services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users.srid = { users.users.${flake.config.me.username} = {
isNormalUser = true; isNormalUser = true;
description = "Sridhar Ratnakumar"; description = flake.config.me.fullname;
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [ "networkmanager" "wheel" ];
}; };

View file

@ -2,7 +2,7 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }: { config, flake, pkgs, ... }:
{ {
imports = imports =
@ -64,9 +64,9 @@
# services.xserver.libinput.enable = true; # services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users.srid = { users.users.${flake.config.me.username} = {
isNormalUser = true; isNormalUser = true;
description = "Sridhar Ratnakumar"; description = flake.config.me.fullname;
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [ "networkmanager" "wheel" ];
}; };