Giter Site home page Giter Site logo

nixos-config's Introduction

nixos-config

My "flake"-less Nix configuration for NixOS, macOS, and WSL.

This project documents my journey through learning Nix(OS), and largely using NixOS as my sole development environment, via a VM, running aarch64 NixOS, on a macOS laptop (MacBook Pro).

Ideally, I'm trying to keep flakes1 out of this project. I will use third-party apps (e.g. disko) which may, themselves, use flakes, where applicable.

Configuration

TBD

Install

Expects to be run on a NixOS Minimal ISO Image.

Use either the Online Install or Local Install instructions.

Installation Process

  1. Partitions the disk, then formats and mounts the partitions. Uses a similar process to the one outlined in NixOS Manual Installation.

  2. Uses, or retrieves, from GitHub, this Custom Configuration.

  3. Generates a basic configuration, which seems to be required for nixos-install.

  4. Installs, via nixos-install, from this Custom Configuration.

  5. Using the newly created /etc/passwd does the following:

    1. Prompts for user to own /mnt/etc/nixos/config directory.

    2. Asks if users' chezmoi dotfiles should be retrieved from GitHub.

      This is a Work in Progress and currently pretty rudimentary.

      • If yes, then loops though each user, asking to retrieve dotfiles for that user.
        • If yes, then retrieves the dotfiles to /home/<user>/dotfiles from GitHub using the following URL: https://github.com/<user>/dotfiles.git.
        • Asks if chezmoi install should be run at user's first login
          • If yes, then creates a script file and adds it to all login files for the user, i.e. /home/<user>/.{bash_profile,login,profile,zprofile}, to run chezmoi install file from dotfiles directory, i.e.

            sh "${HOME}/init-chezmoi.sh" && exec ${SHELL}
          • The script file init-chezmoi.sh does the following:

            • Run ${HOME}/dotfiles/install.sh.
            • Removes the calls to init-chezmoi.sh from the login files, i.e. /home/<user>/.{bash_profile,login,profile,zprofile}.
            • Removes itself, i.e. ${HOME}/init-chezmoi.sh.
  6. Asks if the system should reboot.

Online Install

  1. On the live Minimal ISO Image, run the following command:

    sh <(curl -fsSL https://raw.githubusercontent.com/jwinn/nixos-config/main/install.sh)

Local Install

  1. On the live Minimal ISO Image, run the following to get the IP address:

    ip route get 1.1.1.1 | grep -oP 'src \K[^ ]+'
  2. On the live Minimal ISO Image, update the default nixos user to have a password.

    passwd
  3. Copy the Custom Configuration to the above IP, usually done through scp, e.g.

    scp -r nixos-config nixos@<ip_address>:~/
  4. On the live Minimal ISO Image, run the install script.

    cd nixos-config && sh install.sh cd -

nixos-config's People

Contributors

jwinn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.