Giter Club home page Giter Club logo

nixos's Introduction

WookieeNix

Install

Install process is currently dumb basic.

NixOS

To restore a known host:

sudo mv /etc/nixos /etc/nixos-orig
sudo mkdir /etc/nixos
sudo chmod 0775 /etc/nixos
git clone [email protected]:Gipetto/nixos.git /etc/nixos
cd /etc/nixos

If this is a new host:

  • create host specific files in the hosts directory
  • update flake.nix to reflect necessary changes
make init
# test to make sure it looks good
make install

Open Question: what is the best way to do hardware configuration in the new flake world?

MacOS

git clone [email protected]:Gipetto/nixos.git ~/.nixos
cd ~/.nixos
make init
make install

Notes

Zsh

  • Local ad-hoc configuration can be done by adding a ~/.zshrc.local file

Git

  • The included config/gitconfig is registered as an include in /etc/gitconfig
  • The included config/gitignore is registered as a global exludes file in /etc/gitconfig
  • The declarations in home manager are supplied in ~/.config/git/gitconfig
  • Local overrides can still be made by adding and populating a ~/.gitconfig file

Docs

Cheat Sheet

Find details on Packages, NixOS options and Flakes: https://search.nixos.org

Nix-Env

Operation Command
Search nix-env -qaP '.*package.*'
Install nix-env -i package-name
Upgrade nix-channel --update nixpkgs
nix-env --upgrade '*'
Uninstall nix-env --uninstall package-name
Rollback nix-env --rollback
Info (short) nix-env -qaP --description '.*package.*'
Info (full) nix-env -qaP --description --json --meta '.*package.*'
List packages in the current environment
(non-system packages)
nix-env -qa --installed "*"

Nix Commands

Operation Command
Search nix search nixpkgs 'package'
Upgrade? nixos-rebuild switch --upgrade
Upgrade nix flake update
sudo nixos-rebuild switch --flake .

Nix-Shell

Operation Command
New shell with packages nix-shell -p pandoc

Garbage Collection & Pruning

Operation Command
Remove all generations nix-env --delete-generations old
Remove specific generations nix-env --delete-generations 10 11 14
Remove generagions by age nix-env --delete-generations 14d
Garbage collect nix-store --gc
Remove old & garbage collect nix-collect-garbage -d

Show installed packages

Operation Command
List packages in current environment nix-env -q
List packages in current system & current environment nix-store -q --requisites /run/current-system ~/.nix-profile
List direct dependencies of the current system nix-store -q --references /run/current-system

Mounting Drives (NixOS)

To permanently mount a drive, rebuild the hardware-configuration after the drive has been mounted. You many need to prune out Docker overlays before applying with nixos-rebuild.

nixos-regenerate-config
nixos-rebuild switch

Test in VM

nixos-rebuild build-vm --flake https://github.com/Gipetto/nixos/tarball/master
./result/bin/run-nixos-vm

More Info on VMs

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.