Skip to content
This repository has been archived by the owner on Apr 27, 2019. It is now read-only.
/ nixos-config Public archive

My configuration for NixOS operating system

Notifications You must be signed in to change notification settings

akirak/nixos-config

Repository files navigation

NixOS and Home Manager Configuration

This repository contains configuration files for NixOS and home-manager for my desktop machine(s).

Overview of the deployment

NixOS machines

This repository should be deployed to NixOS machines as follows:

  • /etc/nixos: This repository
  • /home/nix/.config: Symlinked to /etc/nixos/home
  • /home/nix/nixos: Symlinked to /etc/nixos to allow easily editing system configuration files

Other Linux distributions

Parts of the configuration can be installed to other Linux distributions by installing Nix package manager as a normal user:

  • /home/nix/.config

Installation and usage

Installing NixOS

First create file systems for /, /boot (which is a UEFI boot partition), /home, and swap and then mount them under /mnt.

Create a directory at /mnt/etc and clone this repository to /mnt/etc/nixos as a normal user with uid 1000. Don’t forget to check out the Git submodules.

Prepare configuration files

make config

Edit hardware-configuration.nix to suit your environment[fn:1] and run

make install

After booting into the installed system and logging in as the root user, set the password of nix user:

passwd nix

Rebuild the configuration of NixOS

As the normal procedure of NixOS, edit configuration files in this repository and run:

nixos-rebuild switch

Configuring the user environment

home-manager should take care of the configuration files under the home directory of nix user. To use the system, you first have to generate your configuration files using the tool.

First log in as nix user. Ensure that the following check points are satisfied:

  • ~/.config is a symbolic link to /etc/nixos/home.
  • The Git submodule at /etc/nixos/home-manager is checked out.
  • ~/.config/nixpkgs/home.nix contains your configuration.

Run the following command to install home-manager in the submodule:

nix-shell /etc/nixos/home-manager -A install

In subsequent use, you can use home-manager switch to regenerate the configuration. For details, see the documentation of home-manager.

Footnotes

[fn:1] If you use full-disk encryption, you will have to configure boot.initrd.luks.devices.

Releases

No releases published

Packages

No packages published