dotfiles/README.md

108 lines
2.9 KiB
Markdown
Raw Normal View History

2023-02-21 01:26:14 +00:00
# System Configurations
2022-07-20 15:50:04 +00:00
This repository contains configuration files for my NixOS, macOS, and WSL
hosts.
2022-09-23 18:35:14 +00:00
They are organized and managed by [Nix](https://nixos.org), so some of the
configuration may be difficult to translate to a non-Nix system.
However, some of the configurations are easier to lift directly:
- [Neovim](https://github.com/nmasur/dotfiles/tree/master/modules/common/neovim/config)
- [Fish functions](https://github.com/nmasur/dotfiles/tree/master/modules/common/shell/fish/functions)
- [More fish aliases](https://github.com/nmasur/dotfiles/blob/master/modules/common/shell/fish/default.nix)
- [Git aliases](https://github.com/nmasur/dotfiles/blob/master/modules/common/shell/git.nix)
2022-09-23 18:35:14 +00:00
- [Hammerspoon](https://github.com/nmasur/dotfiles/tree/master/modules/darwin/hammerspoon)
2023-02-21 01:26:14 +00:00
Try out my Neovim config (requires [nix](https://nixos.org/download.html)):
2022-11-30 03:48:46 +00:00
```bash
nix run github:nmasur/dotfiles#neovim
```
2023-02-21 01:26:14 +00:00
Or build it as a package (requires [nix](https://nixos.org/download.html)):
2022-11-30 03:48:46 +00:00
```bash
nix build github:nmasur/dotfiles#neovim
```
2022-12-07 00:40:13 +00:00
If you already have a Neovim configuration, you may need to move it out of
2023-02-21 01:26:14 +00:00
`~/.config/nvim` or set `XDG_CONFIG_HOME` to another value; otherwise both
2022-12-07 00:40:13 +00:00
configs might conflict with each other.
2022-07-20 15:50:04 +00:00
---
2023-02-21 01:26:14 +00:00
# Full Installation
2022-07-27 23:13:41 +00:00
2022-07-20 15:50:04 +00:00
## NixOS - From Live Disk
Format drives and build system from any NixOS host, including the live
installer disk:
**This will erase your drives; use at your own risk!**
```bash
lsblk # Choose the disk you want to wipe
2022-10-01 21:42:33 +00:00
nix-shell -p nixVersions.stable
2023-02-21 01:26:14 +00:00
nix run github:nmasur/dotfiles#installer -- nvme0n1 tempest
2022-07-20 15:50:04 +00:00
```
## NixOS - From Existing System
If you're already running NixOS, you can switch to this configuration with the
following command:
```bash
2022-10-01 21:42:33 +00:00
nix-shell -p nixVersions.stable
2023-02-20 22:48:11 +00:00
sudo nixos-rebuild switch --flake github:nmasur/dotfiles#tempest
2022-07-20 15:50:04 +00:00
```
## Windows - From NixOS WSL
After [installing NixOS on
WSL](https://xeiaso.net/blog/nix-flakes-4-wsl-2022-05-01), you can switch to
the WSL configuration:
```
2022-10-01 21:42:33 +00:00
nix-shell -p nixVersions.stable
2023-02-21 01:26:14 +00:00
sudo nixos-rebuild switch --flake github:nmasur/dotfiles#hydra
2022-07-20 15:50:04 +00:00
```
You should also download the
[FiraCode](https://github.com/ryanoasis/nerd-fonts/releases/download/v2.2.2/FiraCode.zip)
font and install it on Windows. Install [Alacritty](https://alacritty.org/) and
move the `windows/alacritty.yml` file to
`C:\Users\<user>\AppData\Roaming\alacritty`.
2022-07-20 15:50:04 +00:00
## macOS
To get started on a bare macOS installation, first install Nix:
```bash
sh -c "$(curl -L https://nixos.org/nix/install)"
```
Then use Nix to build nix-darwin:
```bash
nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
./result/bin/darwin-installer
```
Then switch to the macOS configuration:
```bash
2023-02-21 01:13:52 +00:00
darwin-rebuild switch --flake github:nmasur/dotfiles#lookingglass
2022-07-27 01:11:07 +00:00
```
2022-07-27 23:13:41 +00:00
---
# Flake Templates
2022-07-20 15:50:04 +00:00
2022-07-27 23:13:41 +00:00
You can also use the [templates](./templates/) as flakes for starting new
projects:
2022-07-20 15:50:04 +00:00
```bash
nix flake init --template github:nmasur/dotfiles#poetry
```