Git Product home page Git Product logo

home-flake's Introduction

home-flake

A nix home-manager flake to set up my stuff

Build and activate with

cd into/this/repo/
nix build
result/activate

Step by step Nix install

install nix

zsh # if fish is active

curl -L https://nixos.org/nix/install -o install.sh
sh install.sh --darwin-use-unencrypted-nix-store-volume

# reboot # no longer necessary?

add flake support

zsh # if fish is active

# nix-env -iA nixpkgs.nixFlakes
mkdir -p ~/.config/nix 
echo "experimental-features = nix-command flakes" > ~/.config/nix/nix.conf

install home-manager

This whole section is not needed

zsh # if fish is active
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin
nix-channel --update
export NIX_PATH=darwin-config=$HOME/.nixpkgs/darwin-configuration.nix:$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH
nix-shell '<home-manager>' -A install

install my stuff

cd ~/Documents/nix-home
git clone [email protected]:shrugalic/home-flake.git
cp home-flake/template/flake.nix .
# edit flake.nix as needed
nix build
result/activate

enable fish shell

sudo echo "$HOME/.nix-profile/bin/fish" >> /etc/shells
chsh -s ~/.nix-profile/bin/fish

Maintenance / usage tipps

Update nix itself

sudo -i sh -c 'nix-channel --update && nix-env -iA nixpkgs.nix && launchctl remove org.nixos.nix-daemon && launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist'

Update flakes

Everything:

nix flake update

Specific thing:

nix flake lock --update-input nixpkgs

Run nix-tree

Handy to see sizes etc.

For some reason have to type nix-tree again after starting nix-shell:

nix-shell -p nix-tree

On one installation there's a weird error message with that, use this instead:

nix run nixpkgs#nix-tree

Home-manager generations

Lists all previous result folders, for easy activation of an earlier version.

home-manager generations

Garbage collection

See also Garbage Collection in Nix Reference Manual.

To delete all old (non-current) generations of your current profile:

nix-env --delete-generations old

After removing appropriate old generations you can run the garbage collector as follows:

nix-store --gc

home-flake's People

Contributors

shrugalic avatar

Watchers

James Cloos avatar  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.