Coder Social home page Coder Social logo

flakes's Introduction

NixOS Config

My Personal NixOS Configuration using Flake for use with Microsoft Surface laptop 4 with 2 external monitors setup.

Credit when Credit is Due

  • Config Originally adapted from ruixi-rebirth minimal install version with additional to some personal applications.

Applications included

Window Manager Hyprland
Bar Waybar
Notification SwayNc
Wallpaper swww
Terminal Kitty
Editor Neovim
NeoVim Config Astronvim
Browser Brave
Git Management Lazygit
App Launcher Rofi-wayland
Display Manager TTY
Networking NetworkManager
Input Fxitx5
File Manager nnn, Nemo
Lock screen SwayLock
shell fish
Music mpd, ncmpcpp, mpc, youtube-music, go-musicfox
Video mpv, youtube-tui
Image imv
PDF zathura
Icons Papirus
Fonts NerdFonts
Screenshot grimblast, swappy
Screen record wf-recorder, OBS
Clipboard wl-clipboard, cliphist
Other CLI Tools bat, fd, ripgrep, fzf, btop

Folder Structure and customisation

[TBA]

Setup and Install

  1. Prepare a 64-bit nixos minimal iso image and burn it, then enter the live system.

  2. Disk Partition (reference from)

parted /dev/sda -- mklabel gpt
parted /dev/sda -- mkpart primary 512MB -8GB
parted /dev/sda -- mkpart primary linux-swap -8GB 100%
parted /dev/sda -- mkpart ESP fat32 1MB 512MB
parted /dev/sda -- set 3 esp on
  1. Format the partition with swap
mkfs.ext4 -L nixos /dev/sda1
mkswap -L swap /dev/sda2
mkfs.fat -F 32 -n boot /dev/sda3
  1. Mount partition
mount /dev/disk/by-label/nixos /mnt
mkdir -p /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot
swapon /dev/sda2
  1. Generate a basic configuration
nixos-generate-config --root /mnt
  1. Clone the repository locally
nix-shell -p git
git clone  https://github.com/stewart86/flakes.git /mnt/etc/nixos/Flakes
cd /mnt/etc/nixos/Flakes/
nix develop --extra-experimental-features nix-command --extra-experimental-features flakes
  1. Copy hardware-configuration.nix from /mnt/etc/nixos to /mnt/etc/nixos/Flakes/hosts/laptop/hardware-configuration.nix
cp /mnt/etc/nixos/hardware-configuration.nix /mnt/etc/nixos/Flakes/hosts/laptop/hardware-configuration.nix
  1. remove '/mnt/etc/nixos/Flakes/.git'
rm -rf .git
  1. Perform install
nixos-install --no-root-passwd --flake .#laptop
  1. Reboot
reboot
  1. Enjoy it!

Cleanup

After successfully installed and booted into Hyprland, it is advisable to move the flake configs to your home folder so you don't have to edit in with sudo rights.

cp /etc/nixos/Flakes/ ~/Flakes

After making your changes all you need is to execute this command in the root folder of the config

sudo nixos-rebuild switch --flake .#laptop

You might want to add to your own git repository as a backup. By using git, all rebuild will only effect the portion of code where is it being committed into the repository.

Update packages

nix flake update
sudo nixos-rebuild switch --flake --upgrade .#laptop

cleanup generations

After tweaking the configuration around, old generations might pile up. To remove use these commands

sudo nix-env --delete-generations old --profile /nix/var/nix/profiles/system
sudo /nix/var/nix/profiles/system/bin/switch-to-configuration switch

test

flakes's People

Contributors

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