Skip to content

Commit

Permalink
add darwin-rebuild to devshell
Browse files Browse the repository at this point in the history
  • Loading branch information
x0ba committed Dec 29, 2024
1 parent 1527ea2 commit 33678e3
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 11 deletions.
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,51 @@ Here are my cross-platform dotfiles using NixOS, home-manager, and nix-darwin.
- Editor: Neovim
- Other random bits of config tools I've collected over the years
- Window Manager (Linux only): niri + waybar

# Installation

## NixOS

1. Acquire a NixOS 24.05+ image:

```bash
wget -O https://channels.nixos.org/nixos-24.11/latest-nixos-minimal-x86_64-linux.iso
```

2. Write it to a USB drive. I prefer [Ventoy](https://www.ventoy.net/).
3. Restart and boot into the installer.
4. Clone these dotfiles somewhere and `cd` into them.
```bash
git clone https://github.com/x0ba/dotfiles.git
```
5. Set your desired encryption password.
```bash
echo -n "password" > /tmp/secret.key
```
6. Partition your disks using [disko](https://github.com/nix-community/disko). Make sure to replace the device arg with the hard disk you want to install NixOS on.
```bash
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --arg device '"/dev/nvme0n1"' --mode destroy,format,mount ./disks/default.nix
```
7. Create a host config in `systems`. See existing ones for examples.
8. Install NixOS
```bash
sudo nixos-install --root /mnt --flake .#host
```
9. Reboot and you're good to go!
10. [OPTIONAL] Set up an SSH key to decrypt sops secrets. Currently it's only being used to declaratively set my user password and for tailscale.

## Darwin

1. Install the XCode command line tools
```bash
sudo xcode-select --install
```
2. Install Homebrew.
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
3. Install Nix using the [Determinate installer](https://github.com/DeterminateSystems/nix-installer).
```bash
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \
sh -s -- install
```
29 changes: 18 additions & 11 deletions shells/default/default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
{pkgs, ...}:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
git
git-crypt
just
nix-output-monitor
nixd
nvd
sops
];
{
pkgs,
inputs,
lib,
...
}:
pkgs.mkShellNoCC {
buildInputs = with pkgs;
[
git
git-crypt
just
nix-output-monitor
nixd
nvd
sops
]
++ lib.optionals pkgs.stdenv.isDarwin [inputs.darwin.packages.darwin-rebuild];
}

0 comments on commit 33678e3

Please sign in to comment.