Giter Site home page Giter Site logo

yuanw / nix-home Goto Github PK

View Code? Open in Web Editor NEW
34.0 2.0 0.0 49.42 MB

My Nix dotfiles on MacOS/NixOS

Nix 63.48% Haskell 9.18% CSS 2.71% Shell 12.63% Lua 3.02% HTML 1.41% JavaScript 0.47% SCSS 0.35% HCL 1.14% YASnippet 1.52% C 3.46% Makefile 0.02% Just 0.05% Python 0.57%
nix nix-darwin home-manager dotfiles nixos

nix-home's Introduction

My nix-darwin/NixOS configuration

Welcome to my nix-home.

https://github.com/yuanw/nix-home/workflows/build/badge.svg https://builtwithnix.org/badge.svg

./screenshots/macos.png

The goal for this repo is to declaratively configure MacOS and Linux system using nixos/nix-darwin and home-manger.

feel free to take what you like.

Current MacOS setup

Shellzsh + starship
WMyabai + skhd + sketchybar
TerminalAlacritty + tmux
EditorDoom Emacs + astronvim + helix

Current NixOs setup

Shellzsh + starship
WMxmonad + xmobar
TerminalAlacritty + tmux
EditorDoom Emacs + astronvim + helix

Inspirations

https://github.com/stars/yuanw/lists/nix-home/

MacOS

Install

Install Nix (with daemon)

with official script sh <(curl -L https://nixos.org/nix/install) or using https://github.com/DeterminateSystems/nix-installer

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

Turn on flake

edit /etc/nix/nix.conf experimental-features = nix-command flakes

Install nix-darwin

https://github.com/LnL7/nix-darwin#install

nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
./result/bin/darwin-installer

install xcode

Install brew

there are lots of GUI programs, we cannot install nicely using pure nix. There is brew-module in nix-darwin. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh) What is benefits of this ? we can install/uninstall applications using nix don’t forget to do brew analytics off

import gpg keys (airdrop)

gpg --list-secret-keys or gpg --list-secret-keys [email protected]

pub   4096R/ABC12345 2020-01-01 [expires: 2025-12-31]
uid                  Your Name <[email protected]>
sub   4096R/DEF67890 2020-01-01 [expires: 2025-12-31]

ID of your key (second column e.g “ABC12345”)

gpg --export-secret-keys YOUR_ID_HERE > private.key

font font book

Import

gpg --import private.key

ssh file

.ssh/config

Host *
  IgnoreUnknown UseKeychain
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id_ed25519

nix flake update --recreate-lock-file

build on macos?

nix build .#yuan-mac

switch ?

./result/sw/bin/darwin-rebuild switch --flake .

How to rollback

darwin-rebuild –rollback

Nixos

$ nixos-rebuild switch --flake '.#' -user-remote-sudo

Caveats

Exclude Nix directory from Spotlight index

nix-darwin permission issue

sudo chown -R whoami:staff /nix/store

sometime yabai cannot manage emacsclient window

just do pkill yabai to restart yabai, that always fix the issue for me. I bind skhd key for pkill yabai and reload skhd sometime I found I have to sudo yabai --install-sa sudo yabai --load-sa

nix-home's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar yuanw avatar yuanwang-wf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nix-home's Issues

does not provide attribute 'packages.aarch64-darwin.[hostname]

Hi Yuan,

Have been trying to install your configuration on to a new MacOs system, though:

error: flake 'git+file:///Users/ldnsh/Code/nix-home' does not provide attribute 'packages.aarch64-darwin.ldnsh-mac', 'legacyPackages.aarch64-darwin.ldnsh-mac' or 'ldnsh-mac'

This is after running the build command nix build .#ldnsh-mac

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.