Skip to content

nooneknowspeter/dotfiles

Repository files navigation

dotfiles

My dotfiles utilizing the Nix ecosystem. Fully modular and reproducible dotfiles and system configuration for multiple operating systems and environments. Infrastructure and system configuration as code, I can be on whatever, whenever and however.

Overview

This setup uses:

  • Nix Flakes: for reproducible and composable configurations.
  • Home Manager: to manage user environments across platforms.
  • NixOS: declarative system configuration.
  • nix-darwin: Nix-based macOS system configuration.
  • nix-on-droid: Nix on Android's Termux.
  • WSL integration (both NixOS and Arch-based environments).
  • Traditional imperative distros (primarily Arch Linux)via bootstrapping scripts.

Features

Home Manager

Home Manager is the core of my dotfiles. Utilized to bootstrap my home; packages, dot configurations, preparing base look and feel, everything I need.

It is agnostic to any distro (linux and wsl) and macos.

Packages are seperated

├──  home
│   ├──  modules (modular code for clean codebase based on functionality)
│   └──  packages
│       ├──  gui-contentCreation (packages/suites used for content creation; blender, DAWs)
│       ├──  gui-devel (gui packages used for development; vscode)
│       ├──  gui-essentials (gui packages for general/daily use; browser, messaging)
│       ├──  headless-devel (cli and tui packages for terminal/tty development; neovim)
│       └──  headless-essentials (cli and tui packages for general/daily use; git, ssh, shell)

There are multiple configurations that can bootstrap packages by environment and class;

home-manager switch --flake /location/of/flake.nix#nooneknows@linux-headless --impure # all my cli and tui packages and dot configs for headless (terminal/tty) development; remote ssh, vps

home-manager switch --flake /location/of/flake.nix#nooneknows@linux-full # all my cli, tui, gui packages, desktop environment (hyprland); fully functional dekstop environent

There is also a stylix module. It unifies styling parameters, colorschemes and so on across my machines, consistent appearance; font, colorscheme (Black Metal Theme), etc.

Linux

  • Seperated by architecture
  • Utilize Home Manager; seperate user configs and packages per environment (tty, desktop, android)
  • Modular; specific system configurations and shared modules among systems
  • Scripts for bootstraping and imperative configuration on non-NixOS systems; Arch with Home Manager

NixOS

  • Seperate configurations and packages for each system while using home-manager for a unified home (user)
  • Shared modules between hosts; common features and configurations

Arch Linux (Imperative)

  • System configuration is handled by scripts; systemctl enable services
  • Package management via pacman for system-level packages
  • Nix is used declaratively at the user level via Home Manager

Android (Termux)

  • A headless aarch64 setup
  • Nix-on-droid setup; system/termux configuration
  • Utilizes Home Manager for user development environment; CLI and TUI packages

Headless

  • Home Manager x86-64 based headless linux development environment
  • No system configurations
  • Uses top-level flake parameters for easy configuration for ephemiral setups

macOS (nix-darwin)

  • Uses nix-darwin for system configuration; look and feel, preferences
  • Utilizes Home Manager
  • macOS-specific scripts and modules are isolated

Windows (WSL)

  • Powershell scripts to install windows packages; terminal, git and set up WSL
  • Options for:
    • NixOS-based WSL environments
    • Arch-based WSL environments
  • Home Manager is used inside WSL to manage user space

Backwards Compatibility

Although this repository is designed around Nix flakes and Home Manager(symlink bi-directionally using config.lib.file.mkOutOfStoreSymlink), it maintains backwards compatibility with traditional dotfiles management tools like stow and provides easy top-level access to frequently-edited configurations.

  • Commonly edited configs (e.g., nvim, tmux, git, etc.) are symlinked or surfaced in the top-level directory.
  • Compatible with both declarative (Nix-based) and imperative (stow/manual) workflows.
  • Great for bootstrapping or lightweight setups without full Nix integration.

Project Structure (Philosophy)

---
config:
  theme: 'dark'
---
flowchart TD
    subgraph home-manager [Home Manager]
        usr_configs[User
        Configurations]

        user_pkgs[User
        Packages]
    end

    subgraph globalSharedModules [Global Shared Modules]
    end

    home-manager hm1@----> archNode1User
    home-manager hm2@----> nixosNode1User
    home-manager hm4@----> androidNode1User
    home-manager hm3@----> macosNode1User

    globalSharedModules <---> androidNode1SystemConfig
    globalSharedModules <---> nixosNode1SystemConfig
    globalSharedModules <---> macosNode1SystemConfig

    subgraph linux [Linux]
        subgraph linuxSharedModules [Linux Shared Modules]
        end

        linuxSharedModules <----> nixosNode1SystemConfig
        linuxSharedModules <----> androidNode1SystemConfig

        subgraph arch [Arch]
            subgraph archNode1 [Arch Node 1]
                direction TB
                archNode1User[User]
                archNode1SystemConfig[System Configuration]
            end
        end

        subgraph nixos [NixOS]

            subgraph nixosSharedModules [NixOS Shared Modules]
            end

            nixosSharedModules <----> nixosNode1SystemConfig

            subgraph nixosNode1 [NixOS Node 1]
                direction TB
                nixosNode1User[User]
                nixosNode1SystemConfig[System Configuration]
            end
        end

        subgraph android [Nix-on-Droid]

            subgraph androidSharedModules [Android Shared Modules]
            end

            androidSharedModules <----> androidNode1SystemConfig

            subgraph androidNode1 [Android Node 1]
                direction TB
                androidNode1User[User]
                androidNode1SystemConfig[System Configuration]
            end
        end


    end

    subgraph darwin [Darwin]

        subgraph darwinSharedModules [Darwin Shared Modules]
        end

        darwinSharedModules <----> macosNode1SystemConfig

        subgraph nix-darwin [macOS]
            subgraph macosNode1 [macOS Node 1]
                direction TB
                macosNode1User[User]
                macosNode1SystemConfig[System Configuration]
            end
        end
    end

    %% style
    hm1@{ animate: true }
    hm2@{ animate: true }
    hm3@{ animate: true }
    hm4@{ animate: true }

    style linux fill:transparent
    style darwin fill:transparent

    style android fill:green
    style nixos fill:purple
    style arch fill:lightblue
    style nix-darwin fill:orange
Loading

Setup

Initial Setup

git clone --recursive [email protected]:nooneknowspeter/dotfiles.git

Home Manger Configuration

Temorarily fetch and link home-manager in current shell instance

Note

home-manager is loaded temporaily in the current shell instance, if shell is exited without running home-manager (home-manager installs and manages itself after the initial bootstrap)

Note

--extra-experimental-features "nix-command flakes" flag is used on the initial bootstrap of home-manager

nix --extra-experimental-features "nix-command flakes" shell nixpkgs#home-manager

Bootstrap config

#                                                                                                  username       env
home-manager --extra-experimental-features "nix-command flakes" switch --flake /path/to/flake.nix#nooneknows@linux-headless

NixOS Configuration

Note

Using --extra-experimental-features "nix-command flakes" can be ommitted if home-manager was bootstraped prior

#                                                                                                   system configuration
sudo nixos-rebuild --extra-experimental-features "nix-command flakes" switch --flake /path/to/flake.nix#peter-legion

Arch (Post Install) / Non-NixOS

Setup Zsh

Note

Zsh must be installed through pacman since the change is system level

sudo pacman install -S zsh --noconfirm

Install the Nix

Note

The multi-user installation is recommended for daemon access; systemd control

sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon

Bootstrap [home-manager](### Home Manger Configuration)

or

Use the post Arch setup script to bootstrap a headless developer environment

cd ~/dotfiles

chmod +x ./scripts/*.sh

sudo ./scripts/init-arch.sh

Nix-on-droid

nix-on-droid switch --flake /path/to/flake.nix#configName

Systems Information

My essentials packages can be found here and raw dot configs here, but a quick overview on my daily driver:

NixOS

nixos, hyprland, waybar nixos, hyprland, ghostty

Desktop Environment Setup

NixOS Specific Configuration


WSL

wezterm, archlinux wsl, tmux, neovim

Windows Setup


Nix-on-droid

scrcpy, android, termux, nix-on-droid, zsh

References

NixOS and Flakes book

NixOS for the confused

Sample repo utilizing Nix

VeigPhunt dotfiles

Wallpapaers

hayyaoe dotfiles

ryan4yin dotfiles

yannik sander's guide on nix shells

Nix Manual

Unofficial Nix Wiki

About

My dotfiles utilizing nix to configure my machines (Linux, macOS, WSL)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •