Roya1jr / nixos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NixOS Configurations Repository

This repository contains the configuration files and dotfiles for setting up a NixOS environment across multiple devices. The structure is organized to support different machines and environments such as desktop, laptop, and WSL. Below is an overview of the directory structure and the purpose of each file and folder.

Repository Structure

configs/

This directory holds all the configuration files and modules needed to set up your NixOS environment.

  • dotfiles/: Contains configuration files for tools and utilities used in NixOS.

    • fastfetch/: Configuration for Fastfetch, a command-line utility for displaying system information.
      • config.conf: The main configuration file for Fastfetch.
    • fish/: Configuration files for the Fish shell.
      • config.fish: The configuration script for Fish shell.
    • helix/: Configuration for the Helix text editor.
      • config.toml: Main configuration file for Helix.
      • languages.toml: Language-specific configurations for Helix.
    • starship.toml: Configuration for the Starship prompt, a cross-shell prompt.
    • wezterm/: Configuration for WezTerm, a terminal emulator.
      • wezterm.lua: The configuration script for WezTerm.
  • home/: Contains home configurations for different devices.

    • desktop/: Configuration for the desktop setup.
      • default.nix: Nix configuration for the specific desktop environment.
      • hardware-configuration.nix: Hardware-specific configuration for the desktop.
    • laptop/: Configuration for the laptop setup.
      • default.nix: Nix configuration for the specific laptop environment.
      • hardware-configuration.nix: Hardware-specific configuration for the laptop.
    • wsl/: Configuration for WSL (Windows Subsystem for Linux).
      • default.nix: Nix configuration for the WSL environment.
      • hardware-configuration.nix: Hardware-specific configuration for WSL.
  • modules/: Contains custom NixOS modules.

    • nix-ld-config.nix: Configuration for loading dynamic libraries on NixOS.
  • shared-desktop.nix: Shared configuration for desktop environments, used across different linux desktop environment in this case the laptop and the desktop.

  • shared.nix: General shared configurations that apply to all environments.

Root Files

  • flake.lock: A lock file generated by the Nix flake system, ensuring reproducibility of the Nix environment.
  • flake.nix: The entry point for the Nix flake, defining the configurations and dependencies for the entire setup.
  • README.md: This file, providing an overview of the repository structure and purpose.

Usage

  1. Clone the repository:

Clone the repo to /etc/nixos or to where you keep your NixOS config

   git clone https://github.com/Roya1jr/nixos.git 
   cd nixos
  1. Apply Configuration:

    • Navigate to the appropriate directory for your device.
    • Change the username, email & other directory to the appropriate ones for your user in the relevant files.
    • Change the values in the default.nix & hardware-configuration.nix home files to the appropriate ones for your system(s)
    • Run sudo nixos-rebuild switch --flake .#<name of system defined in flake.nix> e.g. sudo nixos-rebuild switch --flake .#laptop to apply the laptop config.
    • For WSL run sudo nixos-rebuild switch --flake .#wsl --impure
  2. Customize Dotfiles:

    • Edit the files within dotfiles/ to customize your environment according to your preferences.
  3. Shared Configurations:

    • Use shared.nix and shared-desktop.nix to maintain common settings across multiple environments.

Tips

  1. Change the ownership of the .git directory to your non-root user so you can push your changes make sure to make the appropriate changes in the git section of the appropriate default.nix home file

  2. Run git fetch to pull latest changes then run sudo git merge to merge changes to your local repo

References

  • Thilo Hohlt who's nix config I used as the basis for mine.
  • NixOS-WSL a cool project for running NixOS on WLS
  • SoonHo Seo's fix to get NixOS-WSL working with Visual Studio Code.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

License:MIT License


Languages

Language:Nix 92.0%Language:Shell 4.3%Language:Lua 3.7%