dmytrokyrychuk / nixos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nixos

This repository contains my configuration for my Nixos systems. I don't provide any garantuees that it will work on other systems. In addition some of the scripts required for installation will destroy your data when used.

Originally forked from https://git.2li.ch/Nebucatnetzer/nixos

VM installation

This allows you to setup a VM with minimal effort. However this requires some prerequisites.

  • A VM running the minimal NixOS ISO reachable with SSH under nixos@nixos.home.kyrych.uk.
  • The VM runs UEFI.
  • You've set a password for the nixos user.
  1. ./scripts/install_new_vm.xsh
  2. Provide the required information and wait until the script is finished.
  3. Reboot and profit!

Creating fresh development VMs

TODO: add example CLI command to create VMs using qm

  1. Create a new VM in Proxmox (use UEFI instead if BIOS). The VM will have its hostname set to nixos and will be available within local network under the domain name of nixos.home.kyrych.uk.
  2. Create a new system under systems directory.
  3. Open the vm's console in Proxmox and set a password for the nixos user. This is needed for
  4. Run ./scripts/install_over_ssh.sh. If this script fails with WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!, run ssh-keygen -R nixos.home.kyrych.uk and retry.

Creating an LXC container with NixOS

Currently not working

  1. Run this on proxmox node:
pct create $(pvesh get /cluster/nextid) \
  local:vztmpl/nixos-22.05-default_188886451_x86_64.tar.xz \
  --description nixos-template \
  --hostname nixos-template \
  --arch amd64 \
  --ostype unmanaged \
  --cores 2 \
  --net0 name=eth0,ip=dhcp,bridge=vmbr0,firewall=1 \
  --storage local-zfs \
  --cmode console \
  --features nesting=1 \
  --unprivileged true \
  --template true

Hardware installation

  1. curl -L https://github.com/dmytrokyrychuk/nixos/archive/refs/heads/main.tar.gz | tar xz && mv nixos-main nixos
  2. cd nixos && nix-shell
  3. sudo python3 scripts/format-disk.py
  4. sudo nixos-install --no-root-passwd --root /mnt --impure --flake .#SYSTEMNAME

Update remote systems

Simply run the script scripts/update_all_systems.xsh and it will iterate over all defined systems. The script requires Xonsh but can be easily adapted to BASH or similar.

Non-Nixos System

  1. scripts/install-home-manager.sh

About

License:GNU General Public License v3.0


Languages

Language:Nix 46.4%Language:Emacs Lisp 41.4%Language:Python 7.8%Language:Shell 2.3%Language:YASnippet 2.2%