diff --git a/README.md b/README.md index bf24ef8..5fa2f6a 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,16 @@ [![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 -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 @@ -23,16 +29,12 @@ To use this repository as base configuration for your new machine running: - X1 Carbon: https://srid.ca/x1c7-install - Windows (via WSL): https://github.com/nix-community/NixOS-WSL - 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. ### macOS - [Install Nix](https://nixos.asia/en/install) - 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. [^cleanup]: You might have to `rm -rf /etc/nix/nix.conf`, so our flake.nix can do its thing. diff --git a/configurations/nixos/pureintent/configuration.nix b/configurations/nixos/pureintent/configuration.nix index cbf3a02..d80c1b1 100644 --- a/configurations/nixos/pureintent/configuration.nix +++ b/configurations/nixos/pureintent/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ config, flake, pkgs, ... }: { imports = @@ -54,9 +54,9 @@ # services.xserver.libinput.enable = true; # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.srid = { + users.users.${flake.config.me.username} = { isNormalUser = true; - description = "Sridhar Ratnakumar"; + description = flake.config.me.fullname; extraGroups = [ "networkmanager" "wheel" ]; }; diff --git a/configurations/nixos/vixen/configuration.nix b/configurations/nixos/vixen/configuration.nix index 99d3808..9c7b5db 100644 --- a/configurations/nixos/vixen/configuration.nix +++ b/configurations/nixos/vixen/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ config, flake, pkgs, ... }: { imports = @@ -64,9 +64,9 @@ # services.xserver.libinput.enable = true; # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.srid = { + users.users.${flake.config.me.username} = { isNormalUser = true; - description = "Sridhar Ratnakumar"; + description = flake.config.me.fullname; extraGroups = [ "networkmanager" "wheel" ]; };