Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves Linux guide #47

Merged
merged 5 commits into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 40 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Kickstart your Nix environments.
![kickstart.nix](preview/kickstart.nix.webp)

## Guides
- [Setup Home Manager](#setup-home-manager)
- [Setup NixOS](#setup-nixos)
- [Setup Linux](#setup-linux)
- [Setup macOS](#setup-macos)
- [Setup NixOS](#setup-nixos)
## Templates
- Languages
- [Bash](#bash)
Expand All @@ -26,20 +26,25 @@ Kickstart your Nix environments.
- [Python (package)](#python-package)
- [Rust](#rust)
- Systems
- [macOS (desktop)](#macos-desktop)
- [NixOS (desktop)](#nixos-desktop)
- [NixOS (minimal)](#nixos-minimal)
- Linux
- [Home Manager](#home-manager)
- macOS
- [Desktop](#macos)
- NixOS
- [Desktop](#nixos-desktop)
- [Headless](#nixos-headless)

### Guides

#### Setup Home Manager
#### Setup Linux

Guide for setting up Nix on non-NixOS based Linux systems.

1. Install `nixpkgs` with official script:

> [!NOTE]
> The offical docs suggest using `daemon` mode to install with this approach. Nix currently does not support SELINUX enabled.


```bash
sh <(curl -L https://nixos.org/nix/install) --daemon
```
Expand All @@ -65,6 +70,9 @@ nix flake init -t github:ALT-F4-LLC/kickstart.nix#home-manager

5. Update following value(s) in `flake.nix` configuration:

> [!IMPORTANT]
> Both `homeDirectory` and `username` must be updated with your user home directory and username. Once updated, remove `throw` before each value to remove errors while switching.

```nix
homeManagerModule = import ./module/home-manager.nix {
homeDirectory = throw "<enter homeDirectory in flake.nix>"; # TODO: home directory of the user
Expand Down Expand Up @@ -102,9 +110,10 @@ Be sure to explore the files below to get started customizing:
- `module/home-manager.nix` for `Home Manager` related settings
- `flake.nix` for flake related settings


#### Setup macOS

Guide for setting up Nix on macOS based systems.

1. Install `nixpkgs` with official script:

```bash
Expand Down Expand Up @@ -151,6 +160,9 @@ nix flake init -t github:ALT-F4-LLC/kickstart.nix#darwin

8. Update the following value(s) in `flake.nix` configuration:

> [!IMPORTANT]
> The `username` value must be updated with your system username. Once updated, remove `throw` to remove error while switching.

```nix
let
username = throw "<username>"; # TODO: replace with user name and remove throw
Expand All @@ -175,6 +187,8 @@ Be sure to explore the files below to get started customizing:

#### Setup NixOS

Guide for setting up NixOS based systems.

1. Install NixOS using the [latest ISO image](https://nixos.org/download#nixos-iso) for your system.

2. Add the following to `/etc/nixos/configuration.nix` to enable `nix-command` and `flakes` features:
Expand Down Expand Up @@ -208,6 +222,9 @@ nix flake init -t github:ALT-F4-LLC/kickstart.nix#nixos-minimal

- For `desktop` flake template:

> [!IMPORTANT]
> Both `username` and `password` must be updated with your user username. Once updated, remove `throw` before each value to remove errors while switching. If you'd rather use a [hashed password](https://nixpkgs-manual-sphinx-markedown-example.netlify.app/generated/options-db.xml.html?highlight=hashedpassword#users-users-name-hashedpassword) replace `password` with `hashedPassword` with your password hash.

```nix
let
nixos-system = import ./system/nixos.nix {
Expand All @@ -234,7 +251,7 @@ in
7. Switch to `kickstart.nix` environment for your system with flake configuration:

> [!IMPORTANT]
> We use `--impure` due to how `/etc/nixos/hardware-configuration.nix` is generated and stored on the system after installation. To avoid using this flag, copy `hardware-configuration.nix` file locally and replace import in the template [(see example here)](https://github.com/ALT-F4-LLC/dotfiles-nixos/blob/main/lib/default.nix#L30).
> We use `--impure` due to how `/etc/nixos/hardware-configuration.nix` is generated and stored on the system after installation. To avoid using this flag, copy `hardware-configuration.nix` file locally and replace import in the template [see example](https://github.com/ALT-F4-LLC/dotfiles-nixos/blob/main/lib/default.nix#L54).

- For `aarch64` platforms:

Expand Down Expand Up @@ -368,9 +385,19 @@ nix flake init -t github:ALT-F4-LLC/kickstart.nix#rust

### Systems

#### macOS (desktop)
#### Home Manager

Home Manager template allows you to run Nix with Home Manager on non-NixOS based Linux systems.

> [!TIP]
> This setup is ideal for developers interested in running Linux distros other than NixOS.

```bash
nix flake init -t github:ALT-F4-LLC/kickstart.nix#nixos-minimal
```
#### macOS

macOS template allows you to run Nix tools on your native Mac hardware.
macOS template allows you to run Nix tools on native Apple hardware.

> [!TIP]
> This setup is ideal for developers already using macOS.
Expand All @@ -390,9 +417,9 @@ NixOS desktop template includes base operating system with GNOME (default) windo
nix flake init -t github:ALT-F4-LLC/kickstart.nix#nixos-desktop
```

#### NixOS (minimal)
#### NixOS (headless)

NixOS minimal template includes base operating system without any windows manager.
NixOS headless (minimal) template includes base operating system without any windows manager.

> [!TIP]
> This setup is ideal for servers and other headless tasks.
Expand Down
Loading