Coder Social home page Coder Social logo

fleek's Introduction

Nix System Configuration

Build Status

This repository manages system configurations for all of my macOS, nixOS, and linux machines.

Structure

This repository is a flake. All system configurations are defined in flake.nix. Platorm specific configurations are found defined in the flake outputs darwinConfigurations, nixosConfigurations for macOS and NixOS respectively.

Overlapping Nix-Darwin and NixOS

Nix-Darwin and NixOS configurations share as much overlap as possible in the common module, ./modules/common.nix. Platform specific modules add onto the common module in ./modules/darwin/default.nix and ./modules/nixos/default.nix for macOS and NixOS respectively.

Decoupled Home Manager Configuration

My home-manager configuration is entirely decoupled from NixOS and nix-darwin configurations. This means that all of its modules are found in ./modules/home-manager. These modules are imported into all other configurations in the common module similarly to this:

{ config, pkgs, ... }: {
  home-manager.users.kclejeune = import ./home-manager/home.nix;
}

This means that home.nix is fully compatible as a standalone configuration, managed with the home-manager CLI. This allows close replication of any user config for any linux system running nix. These configurations are defined in the homeConfigurations output.

User Customization

User "profiles" are specified in ./profiles; these modules configure contextual, identity-specific settings such as SSL certificates or work vs. personal email addresses. When possible, home-manager functionality is extracted into ./profiles/home-manager, as mentioned previously

Installing a Configuration

Non-NixOS Prerequisite: Install Nix Package Manager

Run the installer script to perform a multi-user installation on darwin or linux:

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

Note that this step is naturally skipped on NixOS since nix is the package manager by default.

System Bootstrapping

NixOS

Follow the installation instructions, then run

sudo nixos-install --flake github:kclejeune/system#phil

Darwin/Linux

Clone this repository into ~/.nixpkgs with

git clone https://github.com/kclejeune/system ~/.nixpkgs

You can bootstrap a new system with the bootstrap command:

nix run .#sysdo bootstrap

This will attempt to detect the host system and install nix-darwin or home-manager, but this behavior can be overridden using the --darwin or --home-manager flags.

sysdo CLI

The sysdo utility is a python script that wraps nix, darwin-rebuild, nixos-rebuild, and home-manager commands to provide a consistent interface across multiple platforms. It has some dependencies which are defined in the devShell flake output. Documentation for this tool is found in sysdo.md.

fleek's People

Contributors

bristermitten avatar kclejeune 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.