Giter VIP home page Giter VIP logo

.nixrc.d's Introduction

Nix flake with the following features:

  • Ensures a clean system on every reboot by wiping root (rolling back an empty zfs snapshot), while preserving specified files across reboots.
  • The files that are designated to persist are all stored in a single location, simplifying the process of creating backups that only include important files.
  • The installation of NixOS is made convenient and consistent through declarative partitioning of disks, and a single install ssh command ( + additional setups if encrypted).
  • The flake manages the entire system, including secrets.
  • The flake is designed to be modular, making it easy to add to, and ensuring that all host outputs, whether NixOS or MacOS, look as similar as possible.
  • All NixOS systems are set to automatically check for updates every hour, keeping all hosts in sync and identical as possible.
Build on NixOS

Install a host that already has configuration:

  • boot the host into a nixos installer, and set the root password
  • complete the following steps on a different x86_64 machine with nix installed, and signed into 1password
  • run the script utilities/nixos-anywhere/remote-install-encrypt.sh HOSTNAME IPADDRESS-OF-TARGET
  • let the install complete, then unlock the drive manually (initrd ssh will not work yet)
  • hit * to ignore the error after unlocking if needed
  • remake the /etc/ssh/initrd host key and rebuild the nixos configuration
  • now upon rebooting, the system will have normal behavior and initrd ssh will function

Update the system(rebuild):

nixos-rebuild switch --flake github:yomaq/nix-config
NixDarwin (MacOS) Setup

Install Nix on MacOS: https://nixos.org/download.html#nix-install-macos (not tested, but likely better https://zero-to-nix.com/concepts/nix-installer)

sh <(curl -L https://nixos.org/nix/install)

Install Nix-Darwin (use all defaults): https://github.com/LnL7/nix-darwin

nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
./result/bin/darwin-installer

Enable Flakes: https://nixos.wiki/wiki/Flakes

mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf

Install Homebrew: https://docs.brew.sh/Installation (a couple packages are installed through homebrew as the nixpkgs appear broke on mac even tho they say it is supported)

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Get the flake

git clone https://github.com/yomaq/nix-config.git
cd nix-config

Remove the old nix.conf

sudo rm -f /etc/nix/nix.conf

Change computer name to match config

sudo scutil --set HostName midnight

Repeat the following step each time you build new updates

Build Darwin

darwin-rebuild switch --flake .

Or to build without cloning

darwin-rebuild switch --flake github:yomaq/nix-config
ToDo
  • Create a module to automatically backup every NixOS machine's /presist/save directories to a signle NixOS nas
  • Detail new device setup
  • Setup WSL ideally with the option to have nix configured GUI applications as well
  • Create Sunshine NixOS module for remote desktop
  • Work on module to declare non-NixOS vms in NixOS similar to KubeVirt
  • Build a stripped down Template for getting started
  • Decide how to manage a kubernetes cluster alongside my nix hosts

.nixrc.d's People

Contributors

yomaq avatar usrbinkat 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.