diff --git a/README.md b/README.md index e279af2..4188469 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ Kickstart your Nix environment. ## Table of Contents - [Prerequisites](#prerequisites) -- [Initial Setup](#initial-setup) -- [Personalizing Your Environment](#personalizing-your-environment) +- [Setup macOS](#setup-macos) +- [Setup NixOS](#setup-nixos) ## Prerequisites @@ -16,11 +16,7 @@ Kickstart your Nix environment. - [GitHub CLI](https://github.com/cli/cli) (`gh`) installed for some commands. -## Initial Setup - -Choose the appropriate setup instructions based on your operating system. - -### macOS +## Setup macOS 1. Install `nixpkgs` with official script: @@ -56,8 +52,8 @@ Would you like to manage with nix-channel? [y/n] y 6. Create a new directory for your `flake.nix` configuration: ```bash -mkdir -p ~/Desktop/kickstart.nix -cd ~/Desktop/kickstart.nix +mkdir -p ~/kickstart.nix +cd ~/kickstart.nix ``` 7. Using `nix flake init` generate the `kickstart.nix` template locally: @@ -70,7 +66,8 @@ nix flake init --template github:ALT-F4-LLC/kickstart.nix#darwin ```nix let - username = ""; # replace + password = throw ""; # TODO: replace with password and remove throw + username = throw ""; # TODO: replace with user name and remove throw in ``` @@ -89,53 +86,62 @@ Be sure to explore the files below to get started customizing: - `module/configuration.nix` for `Nix` related settings - `module/home-manager.nix` for `Home Manager` related settings -### NixOS +### Setup NixOS + +1. Install NixOS using the [latest ISO image](https://nixos.org/download#nixos-iso). -1. Add the following to `/etc/nixos/configuration.nix` to enable `nix-command` and `flakes` features: +2. Add the following to `/etc/nixos/configuration.nix` to enable `nix-command` and `flakes` features: ```nix -nix.settings.experimental-features = [ "nix-command" "flakes" ]; +nix.extraOptions = "experimental-features = nix-command flakes"; ``` -2. Update you system to reflect the changes: +3. Update you system to reflect the changes: ```bash nixos-rebuild switch ``` -3. Fork this repository to create your own flake kickstart. - -> **Note** -> This can be done in the Github UI at: https://github.com/ALT-F4-LLC/kickstart.nix +4. Create a new directory for your `flake.nix` configuration: ```bash -gh repo fork ALT-F4-LLC/kickstart.nix +mkdir -p ~/kickstart.nix +cd ~/kickstart.nix ``` -4. Clone your new fork locally to customize: - -> **Note** -> If the following command does not work revist steps 1 & 2. +5. Using `nix flake init` generate the `kickstart.nix` template locally: ```bash -nix run nixpkgs#git clone https://github.com//kickstart.nix +nix flake init --template github:ALT-F4-LLC/kickstart.nix#nixos ``` -5. Update the following value(s) in `flake.nix` configuration: +6. Update the following value(s) in `flake.nix` configuration: + +> **Important** +> The default user password can be found in `flake.nix`. ```nix let - username = ""; # replace + password = throw ""; # TODO: replace with password and remove throw + username = throw ""; # TODO: replace with user name and remove throw in ``` -6. Switch to `kickstart.nix` environment for your system with flake configuration: +7. Switch to `kickstart.nix` environment for your system with flake configuration: ```bash -nixos-rebuild switch --flake ".#nixos-aarch64" # for ARM Chipsets -nixos-rebuild switch --flake ".#nixos-x86_64" # for Intel Chipsets +nixos-rebuild switch --flake ".#aarch64" # M Series Chipsets +nixos-rebuild switch --flake ".#x86_64" # Intel Chipsets ``` +Congrats! You've setup NixOS with Home Manager! + +Be sure to explore the files below to get started customizing: + +- `system/hardware-configuration.nix` for `NixOS` hardware related settings +- `system/nixos.nix` for `NixOS` system related settings +- `module/configuration.nix` for more `NixOS` system related settings +- `module/home-manager.nix` for `Home Manager` related settings ## Personalizing Your Environment diff --git a/template/darwin/flake.nix b/template/darwin/flake.nix index 7ac076a..6d91f9b 100644 --- a/template/darwin/flake.nix +++ b/template/darwin/flake.nix @@ -16,8 +16,8 @@ in { darwinConfigurations = { - darwin-aarch64 = darwin-system "aarch64-darwin"; - darwin-x86_64 = darwin-system "x86_64-darwin"; + aarch64 = darwin-system "aarch64-darwin"; + x86_64 = darwin-system "x86_64-darwin"; }; }; } diff --git a/template/nixos/flake.nix b/template/nixos/flake.nix index 4e2d288..69ce262 100644 --- a/template/nixos/flake.nix +++ b/template/nixos/flake.nix @@ -9,14 +9,15 @@ outputs = inputs@{ self, home-manager, nixpkgs, ... }: let - username = ""; # should match your host username + password = throw ""; # TODO: replace with password and remove throw + username = throw ""; # TODO: replace with user name and remove throw - nixos-system = import ./system/nixos.nix { inherit inputs username; }; + nixos-system = import ./system/nixos.nix { inherit inputs password username; }; in { nixosConfigurations = { - nixos-aarch64 = nixos-system "aarch64-linux"; - nixos-x86_64 = nixos-system "x86_64-linux"; + aarch64 = nixos-system "aarch64-linux"; + x86_64 = nixos-system "x86_64-linux"; }; }; } diff --git a/template/nixos/system/nixos.nix b/template/nixos/system/nixos.nix index b3fd9ca..a448ad1 100644 --- a/template/nixos/system/nixos.nix +++ b/template/nixos/system/nixos.nix @@ -1,4 +1,4 @@ -{ inputs, username }: +{ inputs, username, password }: system: @@ -23,7 +23,7 @@ inputs.nixpkgs.lib.nixosSystem { extraGroups = [ "wheel" ]; home = "/home/${username}"; isNormalUser = true; - password = "password"; + password = password; }; system.stateVersion = "23.05"; }