Git Product home page Git Product logo

nix-config's Introduction

Generate SSH keys on new system to clone files from github.

ssh-keygen -t ed25519 -C "[email protected]"
cat ~/.ssh/id.pub

Install git if not available and clone the repo

nix run nixpkgs#git -- clone [email protected]:nazmir/nix-config.git

Enable / Install nix command

Install nix from determinate systems for non nixos systems. In case of Nixos enable experimental features - this should already be enabled in configuration.nix

On nixos systems to permanently enable add the following to configuration.nix

nix.settings.experimental-features = [ "nix-command" "flakes" ];

Install Home manager as a standalone using flakes

nix run home-manager/master -- init --switch ~/nix-config/home/

Backup the original configuration files and link to git configuration files

sudo ~/nix-config/bin/rename-and-link /etc/nixos/ ~/nix-config/nixos/

Doom Emacs configuration

Install Doom Emacs and make sure to run
doom doctor #To check for any issues

Backup ~/.emacs.d if it exists

mv ~/.emacs.d ~/.emacs.d.orig

Copy doom configuration files to ~/.nix-config/.config/doom

~/nix-config/bin/rename-and-link.sh ~/.config/doom/ ~/nix-config/.config/doom

sway config

~/nix-config/bin/rename-and-link ~/.config/sway/config ~/.config/sway/config

Kitty configuration

~/nix-config/bin/rename-and-link ~/.config/kitty/ ~/nix-config/.config/kitty 
#The result will be in current folder

To update the system

nix flake update

Using nh helper to rebuild system or home manager

nh os switch --ask #Ask for confirmation before applying configuration
nh home switch --ask

#To specify flakes explicitly use:
nh os switch --ask ~/nix-config/.#mir-nixos-thinkpad

#To use the current hostname and specify flake path reference use:
nh os switch --ask ~/nix-config/ 

Garbage collection using nh helper

nh clean all #Clean OS and Home profiles
nh clean user #clean user profiles

Cleaning specific profiles

nix profile list
nh clean profile -a nixGL #nixGL is profile name and -a asks for confirmation

Apply config via flakes in case nh helper is not installed

sudo nixos-rebuild switch --flake /home/mir/nix-config/.#mir-nixos-thinkpad
home-manager switch --flake /home/mir/nix-config/.#mir@mir-nixos-thinkpad

Nixos check build difference if nh helper is not installed

Build the result before switching

sudo nixos-rebuild build --flake /home/mir/nix-config/.#mir-nixos-thinkpad 

To compare current system with build result run

nvd diff /run/current-system/ ./result/ 
nvd diff $(ls -d1v /nix/var/nix/profiles/system-*-link|tail -n 2) #To compare result after switch

nvd uses nix store diff-closure, but with improved reporting. Syntax for nix store diff-closure is:

nix store diff-closures $(ls -d1v /nix/var/nix/profiles/system-*-link|tail -n 2)

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.