Giter Site home page Giter Site logo

kevfrancisco / idempotentdots Goto Github PK

View Code? Open in Web Editor NEW

This project forked from samthepacman/idempotentdots

0.0 0.0 0.0 88.21 MB

dots configured after setting up NixOS on tmpfs

License: MIT License

Nix 11.54% Scheme 1.11% Shell 24.97% Emacs Lisp 1.26% Haskell 13.21% Lua 17.75% Perl 6.40% PHP 6.30% Python 6.49% Ruby 5.61% CSS 4.64% SCSS 0.55% Vim Script 0.15%

idempotentdots's Introduction

λ Idempotent Dotfiles

SETTING UP NIXOS , MY WAY


NixOS with tmpfs (Sway WM)

Disclaimer: This is not a community framework or distribution. It's a private configuration and an ongoing experiment while I feel out NixOS. I make no guarantees that it will work out of the box for anyone but myself. It may also change drastically and without warning.



System Default Apps

Shell: Zsh + Starship
DM: GreetD (tuigreet)
WM: Sway + Waybar + Eww
Editor: Neovim
Terminal: Foot (client-daemon mode)
Launcher: Wofi
Browser: Chromium
GTK Theme: Nordic

NVIM AND EWW CONFIG


Lets Begin

Flashing the Iso

    • Acquire NixOS 21.11 or newer here
    • Write it to a flash drive dd if=<ur-iso>.iso of=/dev/sdXXX bs=4k status=progress
    • Boot into the installer.
    • Setting up tmpfs

  • for legacy
# Defining a helper variable to make the following commands shorter.
DISK=/dev/disk/by-id/ata-VENDOR-ID-OF-THE-DRIVE

# Create partition table
parted $DISK -- mklabel msdos

# Create a /boot as $DISK-part1
parted $DISK -- mkpart primary ext4 1M 512M
parted $DISK -- set 1 boot on

# Create a /nix as $DISK-part2
parted $DISK -- mkpart primary ext4 512MiB 100%
  • for efi
# Defining a helper variable to make the following commands shorter.
DISK=/dev/disk/by-id/ata-VENDOR-ID-OF-THE-DRIVE

# Create partition table
parted $DISK -- mklabel gpt

# Create a /boot as $DISK-part1
parted $DISK -- mkpart ESP fat32 1MiB 512MiB
parted $DISK -- set 1 boot on

# Create a /nix as $DISK-part2
parted $DISK -- mkpart Nix 512MiB 100%

Step 2 - Creating the file systems

# /boot partition for legacy boot
mkfs.ext4 $DISK-part1

# /boot partition for EFI
mkfs.vfat $DISK-part1

# /nix partition
mkfs.ext4 $DISK-part2

Step 3 - Mounting the file systems

# Mount your root file system
mount -t tmpfs none /mnt

# Create directories
mkdir -p /mnt/{boot,nix,etc/nixos,var/log}

# Mount /boot and /nix
mount $DISK-part1 /mnt/boot
mount $DISK-part2 /mnt/nix

# Create a directory for persistent directories
mkdir -p /mnt/nix/persist/{etc/nixos,var/log}

# Bind mount the persistent configuration / logs
mount -o bind /mnt/nix/persist/etc/nixos /mnt/etc/nixos
mount -o bind /mnt/nix/persist/var/log /mnt/var/log

  1. Now go ahead and do a nixos-generate-config --root /mnt to get a basic configuration for your system.

    • # git clone https://github.com/hlissner/dotfiles /mnt/etc/nixos/repo
    • # mv /mnt/etc/nixos/repo/nixos/* /mnt/etc/nixos/
  2. cofigure your host under /mnt/etc/nixos/hosts with config you obtained from step 4 ( for a tmpfs layout check this out ). Also require the host file from config.nix

  3. make flakes available to nixos - nix-shell -p git nixFlakes ranger neovim

NOTE

  • the machine won't remember your password after reboot if you use 'passwd'
  • rather
     users.mutableUsers = false;
     # $ nix-shell --run 'mkpasswd -m SHA-512 -s' -p mkpasswd
     users.users.root.initialHashedPassword = "the has you got from the above command";
  1. Install nixOS

    # nixos-install --no-root-passwd --flake /mnt/etc/nixos

also shown here

  • Then reboot

Management

/bin/znx, Inspired by hlissner's /bin/hey ( but written in bash, way more messy and less functionality )

Usage: znx [flags]

   # SYSTEM MANAGEMENT
   rebase / switch - rebuild NixOS
   upgrade - upgrade NixOS
   conf-edit / conf-ed - list all System Config

   # FLAKE MANAGEMENT
   flake-edit / flk-ed - edit Flake config    
   flake-lock / flk-lc - recreate system flake lock [ not available ]
   flake-update / flk-up - update root flake

   # MANUAL GARBAGE COLLECTIONS
   garbage-collect / gc - clean nix store home
   garbage-collect -d / gcd - clean nix store root
   
  • Why tmpfs? because I have something similar to a OCD for perfection and I want my system to be as clean as possible

I use tmpfs for /home as mentioned here by creating /home/sam under /nix/persist and giving the user read-write permission to that directory

PS neovim config doesn't work properly but will be fixed soon


NOW TO THE DESKTOP PART

idempotentdots's People

Contributors

samthepacman 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.