├── .gitattributes ├── .github └── images │ └── screenshot.png ├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── flake.lock ├── flake.nix ├── lib ├── mksystem.nix └── overlays.nix ├── machines ├── hardware │ ├── vm-aarch64-prl.nix │ ├── vm-aarch64-utm.nix │ ├── vm-aarch64.nix │ └── vm-intel.nix ├── macbook-pro-m1.nix ├── vm-aarch64-prl.nix ├── vm-aarch64-utm.nix ├── vm-aarch64.nix ├── vm-intel.nix ├── vm-shared.nix └── wsl.nix ├── modules ├── parallels-guest.nix ├── specialization │ ├── gnome-ibus.nix │ ├── i3.nix │ └── plasma.nix └── vmware-guest.nix ├── nix ├── sources.json └── sources.nix ├── overlays ├── buildpack.nix ├── default.nix └── go.nix ├── pkgs ├── 1password.nix ├── consul-bin.nix ├── create-dmg.nix ├── hashicorp │ └── generic.nix ├── nomad-bin.nix ├── parallels-tools │ ├── default.nix │ ├── prl-tools-5.18.patch │ ├── prl-tools-5.19.patch │ └── prl-tools-6.0.patch └── terraform-bin.nix └── users └── mitchellh ├── RectangleConfig.json ├── Xresources ├── alacritty.yml ├── bashrc ├── config.fish ├── config.nu ├── darwin.nix ├── gdbinit ├── ghostty.linux ├── home-manager.nix ├── i3 ├── i3status ├── inputrc ├── jujutsu.toml ├── kitty ├── nixos.nix ├── omp.json ├── rofi ├── textobjects.scm ├── vim-config.nix └── vim.nix /.gitattributes: -------------------------------------------------------------------------------- 1 | .gitattributes !filter !diff 2 | secret/** filter=git-crypt diff=git-crypt 3 | -------------------------------------------------------------------------------- /.github/images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mitchellh/nixos-config/1c02d0e1e124d88a7b13d9166e707cf8bda142f5/.github/images/screenshot.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | result 3 | iso/nixos.iso 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Mitchell Hashimoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Connectivity info for Linux VM 2 | NIXADDR ?= unset 3 | NIXPORT ?= 22 4 | NIXUSER ?= mitchellh 5 | 6 | # Get the path to this Makefile and directory 7 | MAKEFILE_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))) 8 | 9 | # The name of the nixosConfiguration in the flake 10 | NIXNAME ?= vm-intel 11 | 12 | # SSH options that are used. These aren't meant to be overridden but are 13 | # reused a lot so we just store them up here. 14 | SSH_OPTIONS=-o PubkeyAuthentication=no -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no 15 | 16 | # We need to do some OS switching below. 17 | UNAME := $(shell uname) 18 | 19 | switch: 20 | ifeq ($(UNAME), Darwin) 21 | NIXPKGS_ALLOW_UNFREE=1 nix build --impure --extra-experimental-features nix-command --extra-experimental-features flakes ".#darwinConfigurations.${NIXNAME}.system" 22 | sudo NIXPKGS_ALLOW_UNFREE=1 ./result/sw/bin/darwin-rebuild switch --impure --flake "$$(pwd)#${NIXNAME}" 23 | else 24 | sudo NIXPKGS_ALLOW_UNFREE=1 NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nixos-rebuild switch --impure --flake ".#${NIXNAME}" 25 | endif 26 | 27 | test: 28 | ifeq ($(UNAME), Darwin) 29 | NIXPKGS_ALLOW_UNFREE=1 nix build --impure ".#darwinConfigurations.${NIXNAME}.system" 30 | sudo NIXPKGS_ALLOW_UNFREE=1 ./result/sw/bin/darwin-rebuild test --impure --flake "$$(pwd)#${NIXNAME}" 31 | else 32 | sudo NIXPKGS_ALLOW_UNFREE=1 NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nixos-rebuild test --impure --flake ".#$(NIXNAME)" 33 | endif 34 | 35 | # This builds the given NixOS configuration and pushes the results to the 36 | # cache. This does not alter the current running system. This requires 37 | # cachix authentication to be configured out of band. 38 | cache: 39 | nix build '.#nixosConfigurations.$(NIXNAME).config.system.build.toplevel' --json \ 40 | | jq -r '.[].outputs | to_entries[].value' \ 41 | | cachix push mitchellh-nixos-config 42 | 43 | # bootstrap a brand new VM. The VM should have NixOS ISO on the CD drive 44 | # and just set the password of the root user to "root". This will install 45 | # NixOS. After installing NixOS, you must reboot and set the root password 46 | # for the next step. 47 | # 48 | # NOTE(mitchellh): I'm sure there is a way to do this and bootstrap all 49 | # in one step but when I tried to merge them I got errors. One day. 50 | vm/bootstrap0: 51 | ssh $(SSH_OPTIONS) -p$(NIXPORT) root@$(NIXADDR) " \ 52 | parted /dev/sda -- mklabel gpt; \ 53 | parted /dev/sda -- mkpart primary 512MB -8GB; \ 54 | parted /dev/sda -- mkpart primary linux-swap -8GB 100\%; \ 55 | parted /dev/sda -- mkpart ESP fat32 1MB 512MB; \ 56 | parted /dev/sda -- set 3 esp on; \ 57 | sleep 1; \ 58 | mkfs.ext4 -L nixos /dev/sda1; \ 59 | mkswap -L swap /dev/sda2; \ 60 | mkfs.fat -F 32 -n boot /dev/sda3; \ 61 | sleep 1; \ 62 | mount /dev/disk/by-label/nixos /mnt; \ 63 | mkdir -p /mnt/boot; \ 64 | mount /dev/disk/by-label/boot /mnt/boot; \ 65 | nixos-generate-config --root /mnt; \ 66 | sed --in-place '/system\.stateVersion = .*/a \ 67 | nix.package = pkgs.nixVersions.latest;\n \ 68 | nix.extraOptions = \"experimental-features = nix-command flakes\";\n \ 69 | nix.settings.substituters = [\"https://mitchellh-nixos-config.cachix.org\"];\n \ 70 | nix.settings.trusted-public-keys = [\"mitchellh-nixos-config.cachix.org-1:bjEbXJyLrL1HZZHBbO4QALnI5faYZppzkU4D2s0G8RQ=\"];\n \ 71 | services.openssh.enable = true;\n \ 72 | services.openssh.settings.PasswordAuthentication = true;\n \ 73 | services.openssh.settings.PermitRootLogin = \"yes\";\n \ 74 | users.users.root.initialPassword = \"root\";\n \ 75 | ' /mnt/etc/nixos/configuration.nix; \ 76 | nixos-install --no-root-passwd && reboot; \ 77 | " 78 | 79 | # after bootstrap0, run this to finalize. After this, do everything else 80 | # in the VM unless secrets change. 81 | vm/bootstrap: 82 | NIXUSER=root $(MAKE) vm/copy 83 | NIXUSER=root $(MAKE) vm/switch 84 | $(MAKE) vm/secrets 85 | ssh $(SSH_OPTIONS) -p$(NIXPORT) $(NIXUSER)@$(NIXADDR) " \ 86 | sudo reboot; \ 87 | " 88 | 89 | # copy our secrets into the VM 90 | vm/secrets: 91 | # GPG keyring 92 | rsync -av -e 'ssh $(SSH_OPTIONS)' \ 93 | --exclude='.#*' \ 94 | --exclude='S.*' \ 95 | --exclude='*.conf' \ 96 | $(HOME)/.gnupg/ $(NIXUSER)@$(NIXADDR):~/.gnupg 97 | # SSH keys 98 | rsync -av -e 'ssh $(SSH_OPTIONS)' \ 99 | --exclude='environment' \ 100 | $(HOME)/.ssh/ $(NIXUSER)@$(NIXADDR):~/.ssh 101 | 102 | # copy the Nix configurations into the VM. 103 | vm/copy: 104 | rsync -av -e 'ssh $(SSH_OPTIONS) -p$(NIXPORT)' \ 105 | --exclude='vendor/' \ 106 | --exclude='.git/' \ 107 | --exclude='.git-crypt/' \ 108 | --exclude='.jj/' \ 109 | --exclude='iso/' \ 110 | --rsync-path="sudo rsync" \ 111 | $(MAKEFILE_DIR)/ $(NIXUSER)@$(NIXADDR):/nix-config 112 | 113 | # run the nixos-rebuild switch command. This does NOT copy files so you 114 | # have to run vm/copy before. 115 | vm/switch: 116 | ssh $(SSH_OPTIONS) -p$(NIXPORT) $(NIXUSER)@$(NIXADDR) " \ 117 | sudo NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nixos-rebuild switch --flake \"/nix-config#${NIXNAME}\" \ 118 | " 119 | 120 | # Build a WSL installer 121 | .PHONY: wsl 122 | wsl: 123 | nix build ".#nixosConfigurations.wsl.config.system.build.installer" 124 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NixOS System Configurations 2 | 3 | This repository contains my NixOS system configurations. This repository 4 | isn't meant to be a turnkey solution to copying my setup or learning Nix, 5 | so I want to apologize to anyone trying to look for something "easy". I've 6 | tried to use very simple Nix practices wherever possible, but if you wish 7 | to copy from this, you'll have to learn the basics of Nix, NixOS, etc. 8 | 9 | I don't claim to be an expert at Nix or NixOS, so there are certainly 10 | improvements that could be made! Feel free to suggest them, but please don't 11 | be offended if I don't integrate them, I value having my config work over 12 | having it be optimal. 13 | 14 | ## How I Work 15 | 16 | I like to use macOS as the host OS and NixOS within a VM as my primary 17 | development environment. I use the graphical applications on the host 18 | (browser, calendars, mail app, iMessage, etc.) but I do almost everything 19 | dev-related in the VM (editor, compilation, databases, etc.). 20 | 21 | Inevitably I get asked **why?** I genuinely like the macOS application 22 | ecosystem, and I'm pretty "locked in" to their various products such as 23 | iMessage. I like the Apple hardware, and I particularly like that my hardware 24 | always Just Works with excellent performance, battery life, and service. 25 | However, I prefer the Linux environment for almost all my dev work. I find 26 | that modern computers are plenty fast enough for the best of both worlds. 27 | 28 | Here is what it ends up looking like: 29 | 30 | ![Screenshot](https://raw.githubusercontent.com/mitchellh/nixos-config/main/.github/images/screenshot.png) 31 | 32 | Note that I usually full screen the VM so there isn't actually a window, 33 | and I three-finger swipe or use other keyboard shortcuts to active that 34 | window. 35 | 36 | ### Common Questions Related To This Workflow 37 | 38 | **How does web application development work?** I use the VM's IP. Even 39 | though it isn't strictly static, it never changes since I rarely run 40 | other VMs. You just have to make sure software in the VM listens 41 | on `0.0.0.0` so that it isn't only binding to loopback. 42 | 43 | **Does copy/paste work?** Yes. 44 | 45 | **Do you use shared folders?** I set up a shared folder so I can access 46 | the home directory of my host OS user, but I very rarely use it. I primarily 47 | only use it to access browser downloads. You can see this setup in these 48 | Nix files. 49 | 50 | **Do you ever launch graphical applications in the VM?** Sometimes, but rarely. 51 | I'll sometimes do OAuth flows and stuff using FireFox in the VM. Most of the 52 | time, I use the host OS browser. 53 | 54 | **Do you have graphical performance issues?** For the types of graphical 55 | applications I run (GUIs, browsers, etc.), not really. VMware (and other 56 | hypervisors) support 3D acceleration on macOS and I get really smooth 57 | rendering because of it. 58 | 59 | **This can't actually work! This only works on a powerful workstation!** 60 | I've been doing this since late 2020, and I've developed 61 | [a lot of very real software](https://www.hashicorp.com/). It works for me. 62 | I also use this VM on a MacBook Pro (to be fair, it is maxed out on specs), 63 | and I have no issues whatsoever. 64 | 65 | **Does this work with Apple Silicon Macs?** Yes, I use VMware Fusion 66 | but my configurations also work for Parallels and UTM. Folder syncing, 67 | clipboards, and graphics acceleration all work. I've been using an 68 | Apple Silicon Mac full time since Nov 2021 with this setup. 69 | 70 | **Does this work on Windows?** Yes, I've tested this setup with both 71 | Hyper-V and VMware Workstation Pro and it works great in either case. 72 | 73 | ## Setup (VM) 74 | 75 | Video: https://www.youtube.com/watch?v=ubDMLoWz76U 76 | 77 | **Note:** This setup guide will cover VMware Fusion because that is the 78 | hypervisor I use day to day. The configurations in this repository also 79 | work with UTM (see `vm-aarch64-utm`) and Parallels (see `vm-aarch64-prl`) but 80 | I'm not using that full time so they may break from time to time. I've also 81 | successfully set up this environment on Windows with VMware Workstation and 82 | Hyper-V. 83 | 84 | You can download the NixOS ISO from the 85 | [official NixOS download page](https://nixos.org/download.html#nixos-iso). 86 | There are ISOs for both `x86_64` and `aarch64` at the time of writing this. 87 | 88 | Create a VMware Fusion VM with the following settings. My configurations 89 | are made for VMware Fusion exclusively currently and you will have issues 90 | on other virtualization solutions without minor changes. 91 | 92 | * ISO: NixOS 23.05 or later. 93 | * Disk: SATA 150 GB+ 94 | * CPU/Memory: I give at least half my cores and half my RAM, as much as you can. 95 | * Graphics: Full acceleration, full resolution, maximum graphics RAM. 96 | * Network: Shared with my Mac. 97 | * Remove sound card, remove video camera, remove printer. 98 | * Profile: Disable almost all keybindings 99 | * Boot Mode: UEFI 100 | 101 | Boot the VM, and using the graphical console, change the root password to "root": 102 | 103 | ``` 104 | $ sudo su 105 | $ passwd 106 | # change to root 107 | ``` 108 | 109 | At this point, verify `/dev/sda` exists. This is the expected block device 110 | where the Makefile will install the OS. If you setup your VM to use SATA, 111 | this should exist. If `/dev/nvme` or `/dev/vda` exists instead, you didn't 112 | configure the disk properly. Note, these other block device types work fine, 113 | but you'll have to modify the `bootstrap0` Makefile task to use the proper 114 | block device paths. 115 | 116 | Also at this point, I recommend making a snapshot in case anything goes wrong. 117 | I usually call this snapshot "prebootstrap0". This is entirely optional, 118 | but it'll make it super easy to go back and retry if things go wrong. 119 | 120 | Run `ifconfig` and get the IP address of the first device. It is probably 121 | `192.168.58.XXX`, but it can be anything. In a terminal with this repository 122 | set this to the `NIXADDR` env var: 123 | 124 | ``` 125 | $ export NIXADDR= 126 | ``` 127 | 128 | The Makefile assumes an Intel processor by default. If you are using an 129 | ARM-based processor (M1, etc.), you must change `NIXNAME` so that the ARM-based 130 | configuration is used: 131 | 132 | ``` 133 | $ export NIXNAME=vm-aarch64 134 | ``` 135 | 136 | **Other Hypervisors:** If you are using Parallels, use `vm-aarch64-prl`. 137 | If you are using UTM, use `vm-aarch64-utm`. Note that the environments aren't 138 | _exactly_ equivalent between hypervisors but they're very close and they 139 | all work. 140 | 141 | Perform the initial bootstrap. This will install NixOS on the VM disk image 142 | but will not setup any other configurations yet. This prepares the VM for 143 | any NixOS customization: 144 | 145 | ``` 146 | $ make vm/bootstrap0 147 | ``` 148 | 149 | After the VM reboots, run the full bootstrap, this will finalize the 150 | NixOS customization using this configuration: 151 | 152 | ``` 153 | $ make vm/bootstrap 154 | ``` 155 | 156 | You should have a graphical functioning dev VM. 157 | 158 | At this point, I never use Mac terminals ever again. I clone this repository 159 | in my VM and I use the other Make tasks such as `make test`, `make switch`, etc. 160 | to make changes my VM. 161 | 162 | ## Setup (macOS/Darwin) 163 | 164 | **THIS IS OPTIONAL AND UNRELATED TO THE VM WORK.** I recommend you ignore 165 | this unless you're interested in using Nix to manage your Mac too. 166 | 167 | I share some of my Nix configurations with my Mac host and use Nix 168 | to manage _some_ aspects of my macOS installation, too. This uses the 169 | [nix-darwin](https://github.com/LnL7/nix-darwin) project. I don't manage 170 | _everything_ with Nix, for example I don't manage apps, some of my system 171 | settings, Homebrew, etc. I plan to migrate some of those in time. 172 | 173 | To utilize the Mac setup, first install Nix using some Nix installer. 174 | There are two great installers right now: 175 | [nix-installer](https://github.com/DeterminateSystems/nix-installer) 176 | by Determinate Systems and [Flox](https://floxdev.com/). The point of both 177 | for my configs is just to get the `nix` CLI with flake support installed. 178 | 179 | Once installed, clone this repo and run `make`. If there are any errors, 180 | follow the error message (some folders may need permissions changed, 181 | some files may need to be deleted). That's it. 182 | 183 | **WARNING: Don't do this without reading the source.** This repository 184 | is and always has been _my_ configurations. If you blindly run this, 185 | your system may be changed in ways that you don't want. Read my source! 186 | 187 | ## Setup (WSL) 188 | 189 | **THIS IS OPTIONAL AND UNRELATED TO THE VM WORK.** I recommend you ignore 190 | this unless you're interested in using Nix to manage your WSL 191 | (Windows Subsystem for Linux) environment, too. 192 | 193 | I use Nix to build a WSL root tarball for Windows. I then have my entire 194 | Nix environment on Windows in WSL too, which I use to for example run 195 | Neovim amongst other things. My general workflow is that I only modify 196 | my WSL environment outside of WSL, rebuild my root filesystem, and 197 | recreate the WSL distribution each time there are system changes. My system 198 | changes are rare enough that this is not annoying at all. 199 | 200 | To create a WSL root tarball, you must be running on a Linux machine 201 | that is able to build `x86_64` binaries (either directly or cross-compiling). 202 | My `aarch64` VMs are all properly configured to cross-compile to `x86_64` 203 | so if you're using my NixOS configurations you're already good to go. 204 | 205 | Run `make wsl`. This will take some time but will ultimately output 206 | a tarball in `./result/tarball`. Copy that to your Windows machine. 207 | Once it is copied over, run the following steps on Windows: 208 | 209 | ``` 210 | $ wsl --import nixos .\nixos .\path\to\tarball.tar.gz 211 | ... 212 | 213 | $ wsl -d nixos 214 | ... 215 | 216 | # Optionally, make it the default 217 | $ wsl -s nixos 218 | ``` 219 | 220 | After the `wsl -d` command, you should be dropped into the Nix environment. 221 | _Voila!_ 222 | 223 | ## FAQ 224 | 225 | ### Why do you still use `niv`? 226 | 227 | I am still transitioning into a fully flaked setup. During this transition 228 | (which is indefinite, I'm in no rush), I'm using both. 229 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "darwin": { 4 | "inputs": { 5 | "nixpkgs": [ 6 | "nixpkgs" 7 | ] 8 | }, 9 | "locked": { 10 | "lastModified": 1748373722, 11 | "narHash": "sha256-qi6aDGP2W6GyAUNEhg+slQWEpUiJ8LNIrQkmxHpzadI=", 12 | "owner": "nix-darwin", 13 | "repo": "nix-darwin", 14 | "rev": "75b99daa12b1fffd646d6c3cf13b06f1fa5cef63", 15 | "type": "github" 16 | }, 17 | "original": { 18 | "owner": "nix-darwin", 19 | "ref": "nix-darwin-25.05", 20 | "repo": "nix-darwin", 21 | "type": "github" 22 | } 23 | }, 24 | "flake-compat": { 25 | "flake": false, 26 | "locked": { 27 | "lastModified": 1747046372, 28 | "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", 29 | "owner": "edolstra", 30 | "repo": "flake-compat", 31 | "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", 32 | "type": "github" 33 | }, 34 | "original": { 35 | "owner": "edolstra", 36 | "repo": "flake-compat", 37 | "type": "github" 38 | } 39 | }, 40 | "flake-compat_2": { 41 | "flake": false, 42 | "locked": { 43 | "lastModified": 1696426674, 44 | "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", 45 | "owner": "edolstra", 46 | "repo": "flake-compat", 47 | "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", 48 | "type": "github" 49 | }, 50 | "original": { 51 | "owner": "edolstra", 52 | "repo": "flake-compat", 53 | "type": "github" 54 | } 55 | }, 56 | "flake-compat_3": { 57 | "locked": { 58 | "lastModified": 1696426674, 59 | "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", 60 | "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", 61 | "revCount": 57, 62 | "type": "tarball", 63 | "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" 64 | }, 65 | "original": { 66 | "type": "tarball", 67 | "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" 68 | } 69 | }, 70 | "flake-compat_4": { 71 | "flake": false, 72 | "locked": { 73 | "lastModified": 1673956053, 74 | "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", 75 | "owner": "edolstra", 76 | "repo": "flake-compat", 77 | "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", 78 | "type": "github" 79 | }, 80 | "original": { 81 | "owner": "edolstra", 82 | "repo": "flake-compat", 83 | "type": "github" 84 | } 85 | }, 86 | "flake-compat_5": { 87 | "flake": false, 88 | "locked": { 89 | "lastModified": 1696426674, 90 | "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", 91 | "owner": "edolstra", 92 | "repo": "flake-compat", 93 | "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", 94 | "type": "github" 95 | }, 96 | "original": { 97 | "owner": "edolstra", 98 | "repo": "flake-compat", 99 | "type": "github" 100 | } 101 | }, 102 | "flake-parts": { 103 | "inputs": { 104 | "nixpkgs-lib": [ 105 | "neovim-nightly-overlay", 106 | "nixpkgs" 107 | ] 108 | }, 109 | "locked": { 110 | "lastModified": 1748821116, 111 | "narHash": "sha256-F82+gS044J1APL0n4hH50GYdPRv/5JWm34oCJYmVKdE=", 112 | "owner": "hercules-ci", 113 | "repo": "flake-parts", 114 | "rev": "49f0870db23e8c1ca0b5259734a02cd9e1e371a1", 115 | "type": "github" 116 | }, 117 | "original": { 118 | "owner": "hercules-ci", 119 | "repo": "flake-parts", 120 | "type": "github" 121 | } 122 | }, 123 | "flake-parts_2": { 124 | "inputs": { 125 | "nixpkgs-lib": [ 126 | "neovim-nightly-overlay", 127 | "hercules-ci-effects", 128 | "nixpkgs" 129 | ] 130 | }, 131 | "locked": { 132 | "lastModified": 1743550720, 133 | "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", 134 | "owner": "hercules-ci", 135 | "repo": "flake-parts", 136 | "rev": "c621e8422220273271f52058f618c94e405bb0f5", 137 | "type": "github" 138 | }, 139 | "original": { 140 | "id": "flake-parts", 141 | "type": "indirect" 142 | } 143 | }, 144 | "flake-parts_3": { 145 | "inputs": { 146 | "nixpkgs-lib": "nixpkgs-lib" 147 | }, 148 | "locked": { 149 | "lastModified": 1733312601, 150 | "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", 151 | "owner": "hercules-ci", 152 | "repo": "flake-parts", 153 | "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", 154 | "type": "github" 155 | }, 156 | "original": { 157 | "owner": "hercules-ci", 158 | "repo": "flake-parts", 159 | "type": "github" 160 | } 161 | }, 162 | "flake-utils": { 163 | "inputs": { 164 | "systems": "systems" 165 | }, 166 | "locked": { 167 | "lastModified": 1731533236, 168 | "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 169 | "owner": "numtide", 170 | "repo": "flake-utils", 171 | "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 172 | "type": "github" 173 | }, 174 | "original": { 175 | "owner": "numtide", 176 | "repo": "flake-utils", 177 | "type": "github" 178 | } 179 | }, 180 | "flake-utils_2": { 181 | "inputs": { 182 | "systems": "systems_2" 183 | }, 184 | "locked": { 185 | "lastModified": 1692799911, 186 | "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=", 187 | "owner": "numtide", 188 | "repo": "flake-utils", 189 | "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44", 190 | "type": "github" 191 | }, 192 | "original": { 193 | "owner": "numtide", 194 | "repo": "flake-utils", 195 | "type": "github" 196 | } 197 | }, 198 | "flake-utils_3": { 199 | "inputs": { 200 | "systems": "systems_3" 201 | }, 202 | "locked": { 203 | "lastModified": 1705309234, 204 | "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", 205 | "owner": "numtide", 206 | "repo": "flake-utils", 207 | "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", 208 | "type": "github" 209 | }, 210 | "original": { 211 | "owner": "numtide", 212 | "repo": "flake-utils", 213 | "type": "github" 214 | } 215 | }, 216 | "git-hooks": { 217 | "inputs": { 218 | "flake-compat": "flake-compat_2", 219 | "gitignore": "gitignore", 220 | "nixpkgs": [ 221 | "neovim-nightly-overlay", 222 | "nixpkgs" 223 | ] 224 | }, 225 | "locked": { 226 | "lastModified": 1747372754, 227 | "narHash": "sha256-2Y53NGIX2vxfie1rOW0Qb86vjRZ7ngizoo+bnXU9D9k=", 228 | "owner": "cachix", 229 | "repo": "git-hooks.nix", 230 | "rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46", 231 | "type": "github" 232 | }, 233 | "original": { 234 | "owner": "cachix", 235 | "repo": "git-hooks.nix", 236 | "type": "github" 237 | } 238 | }, 239 | "gitignore": { 240 | "inputs": { 241 | "nixpkgs": [ 242 | "neovim-nightly-overlay", 243 | "git-hooks", 244 | "nixpkgs" 245 | ] 246 | }, 247 | "locked": { 248 | "lastModified": 1709087332, 249 | "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", 250 | "owner": "hercules-ci", 251 | "repo": "gitignore.nix", 252 | "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", 253 | "type": "github" 254 | }, 255 | "original": { 256 | "owner": "hercules-ci", 257 | "repo": "gitignore.nix", 258 | "type": "github" 259 | } 260 | }, 261 | "hercules-ci-effects": { 262 | "inputs": { 263 | "flake-parts": "flake-parts_2", 264 | "nixpkgs": [ 265 | "neovim-nightly-overlay", 266 | "nixpkgs" 267 | ] 268 | }, 269 | "locked": { 270 | "lastModified": 1748000383, 271 | "narHash": "sha256-EaAJhwfJGBncgIV/0NlJviid2DP93cTMc9h0q6P6xXk=", 272 | "owner": "hercules-ci", 273 | "repo": "hercules-ci-effects", 274 | "rev": "231726642197817d20310b9d39dd4afb9e899489", 275 | "type": "github" 276 | }, 277 | "original": { 278 | "owner": "hercules-ci", 279 | "repo": "hercules-ci-effects", 280 | "type": "github" 281 | } 282 | }, 283 | "home-manager": { 284 | "inputs": { 285 | "nixpkgs": [ 286 | "nixpkgs" 287 | ] 288 | }, 289 | "locked": { 290 | "lastModified": 1748487945, 291 | "narHash": "sha256-e9zc/rHdoH9i+sFFhhQiKoF6IuD+T2rB/nUyPaO7CCg=", 292 | "owner": "nix-community", 293 | "repo": "home-manager", 294 | "rev": "0d13ea58d565d3c1c1468ddae1f623316dc395d9", 295 | "type": "github" 296 | }, 297 | "original": { 298 | "owner": "nix-community", 299 | "ref": "release-25.05", 300 | "repo": "home-manager", 301 | "type": "github" 302 | } 303 | }, 304 | "jujutsu": { 305 | "inputs": { 306 | "flake-utils": "flake-utils", 307 | "nixpkgs": "nixpkgs", 308 | "rust-overlay": "rust-overlay" 309 | }, 310 | "locked": { 311 | "lastModified": 1746474145, 312 | "narHash": "sha256-5l40KhmZ3398eGebbFy+nRpKf1l8wIpcAK2jJFKXlvo=", 313 | "owner": "martinvonz", 314 | "repo": "jj", 315 | "rev": "489f693c47ac317c55ee1840ba9bc0878b14374f", 316 | "type": "github" 317 | }, 318 | "original": { 319 | "owner": "martinvonz", 320 | "repo": "jj", 321 | "type": "github" 322 | } 323 | }, 324 | "neovim-nightly-overlay": { 325 | "inputs": { 326 | "flake-compat": "flake-compat", 327 | "flake-parts": "flake-parts", 328 | "git-hooks": "git-hooks", 329 | "hercules-ci-effects": "hercules-ci-effects", 330 | "neovim-src": "neovim-src", 331 | "nixpkgs": "nixpkgs_2", 332 | "treefmt-nix": "treefmt-nix" 333 | }, 334 | "locked": { 335 | "lastModified": 1748838808, 336 | "narHash": "sha256-mSAJD41472sC55IW+lUQGAjn9gsh7w/ClNvfukMvHEc=", 337 | "owner": "nix-community", 338 | "repo": "neovim-nightly-overlay", 339 | "rev": "4fb826468dd110892a4784a0106ef6f3a34f0907", 340 | "type": "github" 341 | }, 342 | "original": { 343 | "owner": "nix-community", 344 | "repo": "neovim-nightly-overlay", 345 | "type": "github" 346 | } 347 | }, 348 | "neovim-src": { 349 | "flake": false, 350 | "locked": { 351 | "lastModified": 1748816622, 352 | "narHash": "sha256-KWkPOptegP3DP+Y8tPM9KvtZ20pVusfinMM/brTwIIo=", 353 | "owner": "neovim", 354 | "repo": "neovim", 355 | "rev": "52991d8728c876366cd28f75be29ee579a0a8605", 356 | "type": "github" 357 | }, 358 | "original": { 359 | "owner": "neovim", 360 | "repo": "neovim", 361 | "type": "github" 362 | } 363 | }, 364 | "nix-snapd": { 365 | "inputs": { 366 | "flake-compat": "flake-compat_3", 367 | "flake-parts": "flake-parts_3", 368 | "nixpkgs": [ 369 | "nixpkgs" 370 | ] 371 | }, 372 | "locked": { 373 | "lastModified": 1734935829, 374 | "narHash": "sha256-/7Y+EZoU8O+N2PgEIvJKwp6qLBuwiOq3MeC0YLezX/w=", 375 | "owner": "nix-community", 376 | "repo": "nix-snapd", 377 | "rev": "355a1ed0141b6fd3093e3cb7b3492e6e67913681", 378 | "type": "github" 379 | }, 380 | "original": { 381 | "owner": "nix-community", 382 | "repo": "nix-snapd", 383 | "type": "github" 384 | } 385 | }, 386 | "nixos-wsl": { 387 | "inputs": { 388 | "flake-compat": "flake-compat_4", 389 | "flake-utils": "flake-utils_2", 390 | "nixpkgs": [ 391 | "nixpkgs" 392 | ] 393 | }, 394 | "locked": { 395 | "lastModified": 1694522206, 396 | "narHash": "sha256-mb34WlyHi/whE6gIMEtXKfGRALzvB6/U7CYdUnJKN+c=", 397 | "owner": "nix-community", 398 | "repo": "NixOS-WSL", 399 | "rev": "e7d93d0f478b6fbb47c00d03449dc3d08b90abb7", 400 | "type": "github" 401 | }, 402 | "original": { 403 | "owner": "nix-community", 404 | "repo": "NixOS-WSL", 405 | "type": "github" 406 | } 407 | }, 408 | "nixpkgs": { 409 | "locked": { 410 | "lastModified": 1744157173, 411 | "narHash": "sha256-bWSjxDwq7iVePrhmA7tY2dyMWHuNJo8knkO4y+q4ZkY=", 412 | "owner": "NixOS", 413 | "repo": "nixpkgs", 414 | "rev": "6a39c6e495eefabc935d8ddf66aa45d85b85fa3f", 415 | "type": "github" 416 | }, 417 | "original": { 418 | "owner": "NixOS", 419 | "ref": "nixpkgs-unstable", 420 | "repo": "nixpkgs", 421 | "type": "github" 422 | } 423 | }, 424 | "nixpkgs-lib": { 425 | "locked": { 426 | "lastModified": 1733096140, 427 | "narHash": "sha256-1qRH7uAUsyQI7R1Uwl4T+XvdNv778H0Nb5njNrqvylY=", 428 | "type": "tarball", 429 | "url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz" 430 | }, 431 | "original": { 432 | "type": "tarball", 433 | "url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz" 434 | } 435 | }, 436 | "nixpkgs-old-ibus": { 437 | "locked": { 438 | "lastModified": 1716715802, 439 | "narHash": "sha256-usk0vE7VlxPX8jOavrtpOqphdfqEQpf9lgedlY/r66c=", 440 | "owner": "nixos", 441 | "repo": "nixpkgs", 442 | "rev": "e2dd4e18cc1c7314e24154331bae07df76eb582f", 443 | "type": "github" 444 | }, 445 | "original": { 446 | "owner": "nixos", 447 | "repo": "nixpkgs", 448 | "rev": "e2dd4e18cc1c7314e24154331bae07df76eb582f", 449 | "type": "github" 450 | } 451 | }, 452 | "nixpkgs-unstable": { 453 | "locked": { 454 | "lastModified": 1748792178, 455 | "narHash": "sha256-BHmgfHlCJVNisJShVaEmfDIr/Ip58i/4oFGlD1iK6lk=", 456 | "owner": "nixos", 457 | "repo": "nixpkgs", 458 | "rev": "5929de975bcf4c7c8d8b5ca65c8cd9ef9e44523e", 459 | "type": "github" 460 | }, 461 | "original": { 462 | "owner": "nixos", 463 | "ref": "nixpkgs-unstable", 464 | "repo": "nixpkgs", 465 | "type": "github" 466 | } 467 | }, 468 | "nixpkgs_2": { 469 | "locked": { 470 | "lastModified": 1748662220, 471 | "narHash": "sha256-7gGa49iB9nCnFk4h/g9zwjlQAyjtpgcFkODjcOQS0Es=", 472 | "owner": "NixOS", 473 | "repo": "nixpkgs", 474 | "rev": "59138c7667b7970d205d6a05a8bfa2d78caa3643", 475 | "type": "github" 476 | }, 477 | "original": { 478 | "owner": "NixOS", 479 | "ref": "nixpkgs-unstable", 480 | "repo": "nixpkgs", 481 | "type": "github" 482 | } 483 | }, 484 | "nixpkgs_3": { 485 | "locked": { 486 | "lastModified": 1748302896, 487 | "narHash": "sha256-ixMT0a8mM091vSswlTORZj93WQAJsRNmEvqLL+qwTFM=", 488 | "owner": "nixos", 489 | "repo": "nixpkgs", 490 | "rev": "7848cd8c982f7740edf76ddb3b43d234cb80fc4d", 491 | "type": "github" 492 | }, 493 | "original": { 494 | "owner": "nixos", 495 | "ref": "nixos-25.05", 496 | "repo": "nixpkgs", 497 | "type": "github" 498 | } 499 | }, 500 | "nixpkgs_4": { 501 | "locked": { 502 | "lastModified": 1708161998, 503 | "narHash": "sha256-6KnemmUorCvlcAvGziFosAVkrlWZGIc6UNT9GUYr0jQ=", 504 | "owner": "NixOS", 505 | "repo": "nixpkgs", 506 | "rev": "84d981bae8b5e783b3b548de505b22880559515f", 507 | "type": "github" 508 | }, 509 | "original": { 510 | "owner": "NixOS", 511 | "ref": "nixos-23.11", 512 | "repo": "nixpkgs", 513 | "type": "github" 514 | } 515 | }, 516 | "nvim-codecompanion": { 517 | "flake": false, 518 | "locked": { 519 | "lastModified": 1744574649, 520 | "narHash": "sha256-RNcEkOF96sUvdubWRhOUCeREBPM3dtIbwBSBUhbcx2Y=", 521 | "owner": "olimorris", 522 | "repo": "codecompanion.nvim", 523 | "rev": "d71d8b96c0b1ec8c047fb938552035864d530bb1", 524 | "type": "github" 525 | }, 526 | "original": { 527 | "owner": "olimorris", 528 | "repo": "codecompanion.nvim", 529 | "type": "github" 530 | } 531 | }, 532 | "nvim-conform": { 533 | "flake": false, 534 | "locked": { 535 | "lastModified": 1739657764, 536 | "narHash": "sha256-H9JLiRtixDKDN50SH6gkqgjlhLzHMAaOT1pc69ZFdco=", 537 | "owner": "stevearc", 538 | "repo": "conform.nvim", 539 | "rev": "a6f5bdb78caa305496357d17e962bbc4c0b392e2", 540 | "type": "github" 541 | }, 542 | "original": { 543 | "owner": "stevearc", 544 | "ref": "v9.0.0", 545 | "repo": "conform.nvim", 546 | "type": "github" 547 | } 548 | }, 549 | "nvim-dressing": { 550 | "flake": false, 551 | "locked": { 552 | "lastModified": 1723846795, 553 | "narHash": "sha256-6T2p0hI7/WqaDFQodaDq7uiyuplVqeekayQ2equ/mC0=", 554 | "owner": "stevearc", 555 | "repo": "dressing.nvim", 556 | "rev": "c5775a888adbc50652cb370073fcfec963eca93e", 557 | "type": "github" 558 | }, 559 | "original": { 560 | "owner": "stevearc", 561 | "repo": "dressing.nvim", 562 | "type": "github" 563 | } 564 | }, 565 | "nvim-gitsigns": { 566 | "flake": false, 567 | "locked": { 568 | "lastModified": 1742140868, 569 | "narHash": "sha256-qWusbKY+3d1dkW5oLYDyfSLdt1qFlJdDeXgFWqQ4hUI=", 570 | "owner": "lewis6991", 571 | "repo": "gitsigns.nvim", 572 | "rev": "7010000889bfb6c26065e0b0f7f1e6aa9163edd9", 573 | "type": "github" 574 | }, 575 | "original": { 576 | "owner": "lewis6991", 577 | "ref": "v1.0.2", 578 | "repo": "gitsigns.nvim", 579 | "type": "github" 580 | } 581 | }, 582 | "nvim-lspconfig": { 583 | "flake": false, 584 | "locked": { 585 | "lastModified": 1724394001, 586 | "narHash": "sha256-HqXMMxf4/wy+X9wT7CPpRMm+JLLfxQQnjtEJglhMSm8=", 587 | "owner": "neovim", 588 | "repo": "nvim-lspconfig", 589 | "rev": "911167921d49cd5c1c9b2436031d0da3945e787f", 590 | "type": "github" 591 | }, 592 | "original": { 593 | "owner": "neovim", 594 | "repo": "nvim-lspconfig", 595 | "type": "github" 596 | } 597 | }, 598 | "nvim-lualine": { 599 | "flake": false, 600 | "locked": { 601 | "lastModified": 1723473562, 602 | "narHash": "sha256-gCm7m96PkZyrgjmt7Efc+NMZKStAq1zr7JRCYOgGDuE=", 603 | "owner": "nvim-lualine", 604 | "repo": "lualine.nvim", 605 | "rev": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056", 606 | "type": "github" 607 | }, 608 | "original": { 609 | "owner": "nvim-lualine", 610 | "repo": "lualine.nvim", 611 | "type": "github" 612 | } 613 | }, 614 | "nvim-nui": { 615 | "flake": false, 616 | "locked": { 617 | "lastModified": 1719375254, 618 | "narHash": "sha256-o2iNktcWxL0oCtCkbARMiWnTlZA8QWQHy2qeOanBlO4=", 619 | "owner": "MunifTanjim", 620 | "repo": "nui.nvim", 621 | "rev": "61574ce6e60c815b0a0c4b5655b8486ba58089a1", 622 | "type": "github" 623 | }, 624 | "original": { 625 | "owner": "MunifTanjim", 626 | "repo": "nui.nvim", 627 | "type": "github" 628 | } 629 | }, 630 | "nvim-plenary": { 631 | "flake": false, 632 | "locked": { 633 | "lastModified": 1739311008, 634 | "narHash": "sha256-8FV5RjF7QbDmQOQynpK7uRKONKbPRYbOPugf9ZxNvUs=", 635 | "owner": "nvim-lua", 636 | "repo": "plenary.nvim", 637 | "rev": "857c5ac632080dba10aae49dba902ce3abf91b35", 638 | "type": "github" 639 | }, 640 | "original": { 641 | "owner": "nvim-lua", 642 | "repo": "plenary.nvim", 643 | "type": "github" 644 | } 645 | }, 646 | "nvim-render-markdown": { 647 | "flake": false, 648 | "locked": { 649 | "lastModified": 1745385935, 650 | "narHash": "sha256-+KQ8KNj4hOXlk/VSKcAhuXg+Oa1oOF58rvEcx8YXUhM=", 651 | "owner": "MeanderingProgrammer", 652 | "repo": "render-markdown.nvim", 653 | "rev": "642222acbab66d56727ac0f38d9432649a479ed4", 654 | "type": "github" 655 | }, 656 | "original": { 657 | "owner": "MeanderingProgrammer", 658 | "repo": "render-markdown.nvim", 659 | "type": "github" 660 | } 661 | }, 662 | "nvim-telescope": { 663 | "flake": false, 664 | "locked": { 665 | "lastModified": 1716532947, 666 | "narHash": "sha256-e1ulhc4IIvUgpjKQrSqPY4WpXuez6wlxL6Min9U0o5Q=", 667 | "owner": "nvim-telescope", 668 | "repo": "telescope.nvim", 669 | "rev": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026", 670 | "type": "github" 671 | }, 672 | "original": { 673 | "owner": "nvim-telescope", 674 | "ref": "0.1.8", 675 | "repo": "telescope.nvim", 676 | "type": "github" 677 | } 678 | }, 679 | "nvim-treesitter-context": { 680 | "flake": false, 681 | "locked": { 682 | "lastModified": 1743773493, 683 | "narHash": "sha256-4nvtD4Tz20o3bjWIJdt0grEvq3UQ+iqM+Fs0RNS3qRM=", 684 | "owner": "nvim-treesitter", 685 | "repo": "nvim-treesitter-context", 686 | "rev": "439789a9a8df9639ecd749bb3286b77117024a6f", 687 | "type": "github" 688 | }, 689 | "original": { 690 | "owner": "nvim-treesitter", 691 | "repo": "nvim-treesitter-context", 692 | "type": "github" 693 | } 694 | }, 695 | "nvim-web-devicons": { 696 | "flake": false, 697 | "locked": { 698 | "lastModified": 1722734411, 699 | "narHash": "sha256-TeWMlfNTA5+tiPq6D2TVWjdfJVr3FOwpqUDU8kfFZ8E=", 700 | "owner": "nvim-tree", 701 | "repo": "nvim-web-devicons", 702 | "rev": "3722e3d1fb5fe1896a104eb489e8f8651260b520", 703 | "type": "github" 704 | }, 705 | "original": { 706 | "owner": "nvim-tree", 707 | "repo": "nvim-web-devicons", 708 | "type": "github" 709 | } 710 | }, 711 | "root": { 712 | "inputs": { 713 | "darwin": "darwin", 714 | "home-manager": "home-manager", 715 | "jujutsu": "jujutsu", 716 | "neovim-nightly-overlay": "neovim-nightly-overlay", 717 | "nix-snapd": "nix-snapd", 718 | "nixos-wsl": "nixos-wsl", 719 | "nixpkgs": "nixpkgs_3", 720 | "nixpkgs-old-ibus": "nixpkgs-old-ibus", 721 | "nixpkgs-unstable": "nixpkgs-unstable", 722 | "nvim-codecompanion": "nvim-codecompanion", 723 | "nvim-conform": "nvim-conform", 724 | "nvim-dressing": "nvim-dressing", 725 | "nvim-gitsigns": "nvim-gitsigns", 726 | "nvim-lspconfig": "nvim-lspconfig", 727 | "nvim-lualine": "nvim-lualine", 728 | "nvim-nui": "nvim-nui", 729 | "nvim-plenary": "nvim-plenary", 730 | "nvim-render-markdown": "nvim-render-markdown", 731 | "nvim-telescope": "nvim-telescope", 732 | "nvim-treesitter-context": "nvim-treesitter-context", 733 | "nvim-web-devicons": "nvim-web-devicons", 734 | "vim-copilot": "vim-copilot", 735 | "vim-misc": "vim-misc", 736 | "zig": "zig" 737 | } 738 | }, 739 | "rust-overlay": { 740 | "inputs": { 741 | "nixpkgs": [ 742 | "jujutsu", 743 | "nixpkgs" 744 | ] 745 | }, 746 | "locked": { 747 | "lastModified": 1744252416, 748 | "narHash": "sha256-Vrs2GxaL0tLi9GCIUrutHgPSr+g7GYCetu7argsNrB4=", 749 | "owner": "oxalica", 750 | "repo": "rust-overlay", 751 | "rev": "2af83121f9d2c5281796e60e2b048906a84b9fac", 752 | "type": "github" 753 | }, 754 | "original": { 755 | "owner": "oxalica", 756 | "repo": "rust-overlay", 757 | "type": "github" 758 | } 759 | }, 760 | "systems": { 761 | "locked": { 762 | "lastModified": 1681028828, 763 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 764 | "owner": "nix-systems", 765 | "repo": "default", 766 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 767 | "type": "github" 768 | }, 769 | "original": { 770 | "owner": "nix-systems", 771 | "repo": "default", 772 | "type": "github" 773 | } 774 | }, 775 | "systems_2": { 776 | "locked": { 777 | "lastModified": 1681028828, 778 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 779 | "owner": "nix-systems", 780 | "repo": "default", 781 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 782 | "type": "github" 783 | }, 784 | "original": { 785 | "owner": "nix-systems", 786 | "repo": "default", 787 | "type": "github" 788 | } 789 | }, 790 | "systems_3": { 791 | "locked": { 792 | "lastModified": 1681028828, 793 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 794 | "owner": "nix-systems", 795 | "repo": "default", 796 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 797 | "type": "github" 798 | }, 799 | "original": { 800 | "owner": "nix-systems", 801 | "repo": "default", 802 | "type": "github" 803 | } 804 | }, 805 | "treefmt-nix": { 806 | "inputs": { 807 | "nixpkgs": [ 808 | "neovim-nightly-overlay", 809 | "nixpkgs" 810 | ] 811 | }, 812 | "locked": { 813 | "lastModified": 1748243702, 814 | "narHash": "sha256-9YzfeN8CB6SzNPyPm2XjRRqSixDopTapaRsnTpXUEY8=", 815 | "owner": "numtide", 816 | "repo": "treefmt-nix", 817 | "rev": "1f3f7b784643d488ba4bf315638b2b0a4c5fb007", 818 | "type": "github" 819 | }, 820 | "original": { 821 | "owner": "numtide", 822 | "repo": "treefmt-nix", 823 | "type": "github" 824 | } 825 | }, 826 | "vim-copilot": { 827 | "flake": false, 828 | "locked": { 829 | "lastModified": 1746466057, 830 | "narHash": "sha256-dWkmdjcpZyd45QTErkUQb1cgbyCYhxfXJUdYz2PO04E=", 831 | "owner": "github", 832 | "repo": "copilot.vim", 833 | "rev": "18f485d892b56b311fd752039d6977333ebc2a0f", 834 | "type": "github" 835 | }, 836 | "original": { 837 | "owner": "github", 838 | "ref": "v1.48.0", 839 | "repo": "copilot.vim", 840 | "type": "github" 841 | } 842 | }, 843 | "vim-misc": { 844 | "flake": false, 845 | "locked": { 846 | "lastModified": 1744576085, 847 | "narHash": "sha256-wrz7LMGE2uRaSYGzRb1FXAUO9YHi2aRuTY2ii9fU18I=", 848 | "owner": "mitchellh", 849 | "repo": "vim-misc", 850 | "rev": "fddb7ee3a856b298fe33fb6ef0c8c67f79b801d9", 851 | "type": "github" 852 | }, 853 | "original": { 854 | "owner": "mitchellh", 855 | "repo": "vim-misc", 856 | "type": "github" 857 | } 858 | }, 859 | "zig": { 860 | "inputs": { 861 | "flake-compat": "flake-compat_5", 862 | "flake-utils": "flake-utils_3", 863 | "nixpkgs": "nixpkgs_4" 864 | }, 865 | "locked": { 866 | "lastModified": 1742690075, 867 | "narHash": "sha256-LVZI6NL+eu8aFotXHrg12lMvwGk/Uxu9SOmq3LzkQFI=", 868 | "owner": "mitchellh", 869 | "repo": "zig-overlay", 870 | "rev": "57c9aa1f3f2f861ebce3102fcbb9db6d5b1460a0", 871 | "type": "github" 872 | }, 873 | "original": { 874 | "owner": "mitchellh", 875 | "repo": "zig-overlay", 876 | "type": "github" 877 | } 878 | } 879 | }, 880 | "root": "root", 881 | "version": 7 882 | } 883 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "NixOS systems and tools by mitchellh"; 3 | 4 | inputs = { 5 | # Pin our primary nixpkgs repository. This is the main nixpkgs repository 6 | # we'll use for our configurations. Be very careful changing this because 7 | # it'll impact your entire system. 8 | nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; 9 | 10 | # Used to get ibus 1.5.29 which has some quirks we want to test. 11 | nixpkgs-old-ibus.url = "github:nixos/nixpkgs/e2dd4e18cc1c7314e24154331bae07df76eb582f"; 12 | 13 | # We use the unstable nixpkgs repo for some packages. 14 | nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; 15 | 16 | # Build a custom WSL installer 17 | nixos-wsl.url = "github:nix-community/NixOS-WSL"; 18 | nixos-wsl.inputs.nixpkgs.follows = "nixpkgs"; 19 | 20 | # snapd 21 | nix-snapd.url = "github:nix-community/nix-snapd"; 22 | nix-snapd.inputs.nixpkgs.follows = "nixpkgs"; 23 | 24 | home-manager = { 25 | url = "github:nix-community/home-manager/release-25.05"; 26 | inputs.nixpkgs.follows = "nixpkgs"; 27 | }; 28 | 29 | darwin = { 30 | url = "github:nix-darwin/nix-darwin/nix-darwin-25.05"; 31 | inputs.nixpkgs.follows = "nixpkgs"; 32 | }; 33 | 34 | # I think technically you're not supposed to override the nixpkgs 35 | # used by neovim but recently I had failures if I didn't pin to my 36 | # own. We can always try to remove that anytime. 37 | neovim-nightly-overlay = { 38 | url = "github:nix-community/neovim-nightly-overlay"; 39 | }; 40 | 41 | # Other packages 42 | jujutsu.url = "github:martinvonz/jj"; 43 | zig.url = "github:mitchellh/zig-overlay"; 44 | 45 | # Non-flakes 46 | nvim-codecompanion.url = "github:olimorris/codecompanion.nvim"; 47 | nvim-codecompanion.flake = false; 48 | nvim-conform.url = "github:stevearc/conform.nvim/v9.0.0"; 49 | nvim-conform.flake = false; 50 | nvim-dressing.url = "github:stevearc/dressing.nvim"; 51 | nvim-dressing.flake = false; 52 | nvim-gitsigns.url = "github:lewis6991/gitsigns.nvim/v1.0.2"; 53 | nvim-gitsigns.flake = false; 54 | nvim-lspconfig.url = "github:neovim/nvim-lspconfig"; 55 | nvim-lspconfig.flake = false; 56 | nvim-lualine.url ="github:nvim-lualine/lualine.nvim"; 57 | nvim-lualine.flake = false; 58 | nvim-nui.url = "github:MunifTanjim/nui.nvim"; 59 | nvim-nui.flake = false; 60 | nvim-plenary.url = "github:nvim-lua/plenary.nvim"; 61 | nvim-plenary.flake = false; 62 | nvim-render-markdown.url = "github:MeanderingProgrammer/render-markdown.nvim"; 63 | nvim-render-markdown.flake = false; 64 | nvim-telescope.url = "github:nvim-telescope/telescope.nvim/0.1.8"; 65 | nvim-telescope.flake = false; 66 | nvim-treesitter-context.url = "github:nvim-treesitter/nvim-treesitter-context"; 67 | nvim-treesitter-context.flake = false; 68 | nvim-web-devicons.url = "github:nvim-tree/nvim-web-devicons"; 69 | nvim-web-devicons.flake = false; 70 | vim-copilot.url = "github:github/copilot.vim/v1.48.0"; 71 | vim-copilot.flake = false; 72 | vim-misc.url = "github:mitchellh/vim-misc"; 73 | vim-misc.flake = false; 74 | }; 75 | 76 | outputs = { self, nixpkgs, home-manager, darwin, ... }@inputs: let 77 | # Overlays is the list of overlays we want to apply from flake inputs. 78 | overlays = [ 79 | inputs.jujutsu.overlays.default 80 | inputs.zig.overlays.default 81 | 82 | (final: prev: rec { 83 | # gh CLI on stable has bugs. 84 | gh = inputs.nixpkgs-unstable.legacyPackages.${prev.system}.gh; 85 | 86 | # Want the latest version of these 87 | claude-code = inputs.nixpkgs-unstable.legacyPackages.${prev.system}.claude-code; 88 | nushell = inputs.nixpkgs-unstable.legacyPackages.${prev.system}.nushell; 89 | 90 | ibus = ibus_stable; 91 | ibus_stable = inputs.nixpkgs.legacyPackages.${prev.system}.ibus; 92 | ibus_1_5_29 = inputs.nixpkgs-old-ibus.legacyPackages.${prev.system}.ibus; 93 | ibus_1_5_31 = inputs.nixpkgs-unstable.legacyPackages.${prev.system}.ibus; 94 | }) 95 | ]; 96 | 97 | mkSystem = import ./lib/mksystem.nix { 98 | inherit overlays nixpkgs inputs; 99 | }; 100 | in { 101 | nixosConfigurations.vm-aarch64 = mkSystem "vm-aarch64" { 102 | system = "aarch64-linux"; 103 | user = "mitchellh"; 104 | }; 105 | 106 | nixosConfigurations.vm-aarch64-prl = mkSystem "vm-aarch64-prl" rec { 107 | system = "aarch64-linux"; 108 | user = "mitchellh"; 109 | }; 110 | 111 | nixosConfigurations.vm-aarch64-utm = mkSystem "vm-aarch64-utm" rec { 112 | system = "aarch64-linux"; 113 | user = "mitchellh"; 114 | }; 115 | 116 | nixosConfigurations.vm-intel = mkSystem "vm-intel" rec { 117 | system = "x86_64-linux"; 118 | user = "mitchellh"; 119 | }; 120 | 121 | nixosConfigurations.wsl = mkSystem "wsl" { 122 | system = "x86_64-linux"; 123 | user = "mitchellh"; 124 | wsl = true; 125 | }; 126 | 127 | darwinConfigurations.macbook-pro-m1 = mkSystem "macbook-pro-m1" { 128 | system = "aarch64-darwin"; 129 | user = "mitchellh"; 130 | darwin = true; 131 | }; 132 | }; 133 | } 134 | -------------------------------------------------------------------------------- /lib/mksystem.nix: -------------------------------------------------------------------------------- 1 | # This function creates a NixOS system based on our VM setup for a 2 | # particular architecture. 3 | { nixpkgs, overlays, inputs }: 4 | 5 | name: 6 | { 7 | system, 8 | user, 9 | darwin ? false, 10 | wsl ? false 11 | }: 12 | 13 | let 14 | # True if this is a WSL system. 15 | isWSL = wsl; 16 | 17 | # True if Linux, which is a heuristic for not being Darwin. 18 | isLinux = !darwin && !isWSL; 19 | 20 | # The config files for this system. 21 | machineConfig = ../machines/${name}.nix; 22 | userOSConfig = ../users/${user}/${if darwin then "darwin" else "nixos" }.nix; 23 | userHMConfig = ../users/${user}/home-manager.nix; 24 | 25 | # NixOS vs nix-darwin functionst 26 | systemFunc = if darwin then inputs.darwin.lib.darwinSystem else nixpkgs.lib.nixosSystem; 27 | home-manager = if darwin then inputs.home-manager.darwinModules else inputs.home-manager.nixosModules; 28 | in systemFunc rec { 29 | inherit system; 30 | 31 | modules = [ 32 | # Apply our overlays. Overlays are keyed by system type so we have 33 | # to go through and apply our system type. We do this first so 34 | # the overlays are available globally. 35 | { nixpkgs.overlays = overlays; } 36 | 37 | # Allow unfree packages. 38 | { nixpkgs.config.allowUnfree = true; } 39 | 40 | # Bring in WSL if this is a WSL build 41 | (if isWSL then inputs.nixos-wsl.nixosModules.wsl else {}) 42 | 43 | # Snapd on Linux 44 | (if isLinux then inputs.nix-snapd.nixosModules.default else {}) 45 | 46 | machineConfig 47 | userOSConfig 48 | home-manager.home-manager { 49 | home-manager.useGlobalPkgs = true; 50 | home-manager.useUserPackages = true; 51 | home-manager.users.${user} = import userHMConfig { 52 | isWSL = isWSL; 53 | inputs = inputs; 54 | }; 55 | } 56 | 57 | # We expose some extra arguments so that our modules can parameterize 58 | # better based on these values. 59 | { 60 | config._module.args = { 61 | currentSystem = system; 62 | currentSystemName = name; 63 | currentSystemUser = user; 64 | isWSL = isWSL; 65 | inputs = inputs; 66 | }; 67 | } 68 | ]; 69 | } 70 | -------------------------------------------------------------------------------- /lib/overlays.nix: -------------------------------------------------------------------------------- 1 | /* This configures nixpkgs.overlays to include our overlays/ directory. 2 | */ 3 | let path = ../overlays; in with builtins; 4 | map (n: import (path + ("/" + n))) 5 | (filter (n: match ".*\\.nix" n != null || 6 | pathExists (path + ("/" + n + "/default.nix"))) 7 | (attrNames (readDir path))) 8 | -------------------------------------------------------------------------------- /machines/hardware/vm-aarch64-prl.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { config, lib, pkgs, modulesPath, ... }: 5 | 6 | { 7 | imports = [ ]; 8 | 9 | boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" "sr_mod" ]; 10 | boot.initrd.kernelModules = [ ]; 11 | boot.kernelModules = [ ]; 12 | boot.extraModulePackages = [ ]; 13 | 14 | fileSystems."/" = 15 | { device = "/dev/disk/by-label/nixos"; 16 | fsType = "ext4"; 17 | }; 18 | 19 | fileSystems."/boot" = 20 | { device = "/dev/disk/by-label/boot"; 21 | fsType = "vfat"; 22 | }; 23 | 24 | swapDevices = [ ]; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /machines/hardware/vm-aarch64-utm.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { config, lib, pkgs, modulesPath, ... }: 5 | 6 | { 7 | imports = [ 8 | (modulesPath + "/profiles/qemu-guest.nix") 9 | ]; 10 | 11 | boot.initrd.availableKernelModules = [ "xhci_pci" "uhci_hcd" "virtio_pci" "usbhid" "usb_storage" "sr_mod" ]; 12 | boot.initrd.kernelModules = [ ]; 13 | boot.kernelModules = [ ]; 14 | boot.extraModulePackages = [ ]; 15 | 16 | fileSystems."/" = 17 | { device = "/dev/disk/by-label/nixos"; 18 | fsType = "ext4"; 19 | }; 20 | 21 | fileSystems."/boot" = 22 | { device = "/dev/disk/by-label/boot"; 23 | fsType = "vfat"; 24 | }; 25 | 26 | swapDevices = [ ]; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /machines/hardware/vm-aarch64.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { config, lib, pkgs, modulesPath, ... }: 5 | 6 | { 7 | imports = [ ]; 8 | 9 | boot.initrd.availableKernelModules = [ "uhci_hcd" "ahci" "xhci_pci" "nvme" "usbhid" "sr_mod" ]; 10 | boot.initrd.kernelModules = [ ]; 11 | boot.kernelModules = [ ]; 12 | boot.extraModulePackages = [ ]; 13 | 14 | fileSystems."/" = 15 | { device = "/dev/disk/by-label/nixos"; 16 | fsType = "ext4"; 17 | }; 18 | 19 | fileSystems."/boot" = 20 | { device = "/dev/disk/by-label/boot"; 21 | fsType = "vfat"; 22 | }; 23 | 24 | swapDevices = [ ]; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /machines/hardware/vm-intel.nix: -------------------------------------------------------------------------------- 1 | # This file is normally automatically generated. Since we build a VM 2 | # and have full control over that hardware I can hardcode this into my 3 | # repository. 4 | { config, lib, pkgs, modulesPath, ... }: 5 | 6 | { 7 | imports = [ ]; 8 | 9 | boot.initrd.availableKernelModules = [ 10 | "ata_piix" "mptspi" "uhci_hcd" "ehci_pci" "sd_mod" "sr_mod" "nvme" ]; 11 | boot.initrd.kernelModules = [ ]; 12 | boot.kernelModules = [ ]; 13 | boot.extraModulePackages = [ ]; 14 | 15 | fileSystems."/" = 16 | { device = "/dev/disk/by-label/nixos"; 17 | fsType = "ext4"; 18 | }; 19 | 20 | fileSystems."/boot" = 21 | { device = "/dev/disk/by-label/boot"; 22 | fsType = "vfat"; 23 | }; 24 | 25 | swapDevices = [ ]; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /machines/macbook-pro-m1.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: { 2 | # Set in Sept 2024 as part of the macOS Sequoia release. 3 | system.stateVersion = 5; 4 | 5 | # This makes it work with the Determinate Nix installer 6 | ids.gids.nixbld = 30000; 7 | 8 | # We use proprietary software on this machine 9 | nixpkgs.config.allowUnfree = true; 10 | 11 | # Keep in async with vm-shared.nix. (todo: pull this out into a file) 12 | nix = { 13 | # We need to enable flakes 14 | extraOptions = '' 15 | experimental-features = nix-command flakes 16 | keep-outputs = true 17 | keep-derivations = true 18 | ''; 19 | 20 | # Enable the Linux builder so we can run Linux builds on our Mac. 21 | # This can be debugged by running `sudo ssh linux-builder` 22 | linux-builder = { 23 | enable = true; 24 | ephemeral = true; 25 | maxJobs = 4; 26 | config = ({ pkgs, ... }: { 27 | # Make our builder beefier since we're on a beefy machine. 28 | virtualisation = { 29 | cores = 6; 30 | darwin-builder = { 31 | diskSize = 100 * 1024; # 100GB 32 | memorySize = 32 * 1024; # 32GB 33 | }; 34 | }; 35 | 36 | # Add some common debugging tools we can see whats up. 37 | environment.systemPackages = [ 38 | pkgs.htop 39 | ]; 40 | }); 41 | }; 42 | 43 | # public binary cache that I use for all my derivations. You can keep 44 | # this, use your own, or toss it. Its typically safe to use a binary cache 45 | # since the data inside is checksummed. 46 | settings = { 47 | substituters = ["https://mitchellh-nixos-config.cachix.org"]; 48 | trusted-public-keys = ["mitchellh-nixos-config.cachix.org-1:bjEbXJyLrL1HZZHBbO4QALnI5faYZppzkU4D2s0G8RQ="]; 49 | 50 | # Required for the linux builder 51 | trusted-users = ["@admin"]; 52 | }; 53 | }; 54 | 55 | # zsh is the default shell on Mac and we want to make sure that we're 56 | # configuring the rc correctly with nix-darwin paths. 57 | programs.zsh.enable = true; 58 | programs.zsh.shellInit = '' 59 | # Nix 60 | if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then 61 | . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' 62 | fi 63 | # End Nix 64 | ''; 65 | 66 | programs.fish.enable = true; 67 | programs.fish.shellInit = '' 68 | # Nix 69 | if test -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish' 70 | source '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish' 71 | end 72 | # End Nix 73 | ''; 74 | 75 | environment.shells = with pkgs; [ bashInteractive zsh fish ]; 76 | environment.systemPackages = with pkgs; [ 77 | cachix 78 | ]; 79 | } 80 | -------------------------------------------------------------------------------- /machines/vm-aarch64-prl.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, lib, modulesPath, ... }: { 2 | imports = [ 3 | # Parallels is qemu under the covers. This brings in important kernel 4 | # modules to get a lot of the stuff working. 5 | (modulesPath + "/profiles/qemu-guest.nix") 6 | 7 | ./hardware/vm-aarch64-prl.nix 8 | ../modules/parallels-guest.nix 9 | ./vm-shared.nix 10 | ]; 11 | 12 | # The official parallels guest support does not work currently. 13 | # https://github.com/NixOS/nixpkgs/pull/153665 14 | disabledModules = [ "virtualisation/parallels-guest.nix" ]; 15 | hardware.parallels = { 16 | enable = true; 17 | package = (config.boot.kernelPackages.callPackage ../pkgs/parallels-tools/default.nix { }); 18 | }; 19 | 20 | # Interface is this on my M1 21 | networking.interfaces.enp0s5.useDHCP = true; 22 | 23 | # Lots of stuff that uses aarch64 that claims doesn't work, but actually works. 24 | nixpkgs.config.allowUnfree = true; 25 | nixpkgs.config.allowUnsupportedSystem = true; 26 | } 27 | -------------------------------------------------------------------------------- /machines/vm-aarch64-utm.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, modulesPath, ... }: { 2 | imports = [ 3 | ./hardware/vm-aarch64-utm.nix 4 | ./vm-shared.nix 5 | ]; 6 | 7 | # Interface is this on my M1 8 | networking.interfaces.enp0s10.useDHCP = true; 9 | 10 | # Qemu 11 | services.spice-vdagentd.enable = true; 12 | 13 | # For now, we need this since hardware acceleration does not work. 14 | environment.variables.LIBGL_ALWAYS_SOFTWARE = "1"; 15 | 16 | # Lots of stuff that uses aarch64 that claims doesn't work, but actually works. 17 | nixpkgs.config.allowUnfree = true; 18 | nixpkgs.config.allowUnsupportedSystem = true; 19 | } 20 | -------------------------------------------------------------------------------- /machines/vm-aarch64.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, lib, ... }: { 2 | imports = [ 3 | ./hardware/vm-aarch64.nix 4 | ../modules/vmware-guest.nix 5 | ./vm-shared.nix 6 | ]; 7 | 8 | # Setup qemu so we can run x86_64 binaries 9 | boot.binfmt.emulatedSystems = ["x86_64-linux"]; 10 | 11 | # Disable the default module and import our override. We have 12 | # customizations to make this work on aarch64. 13 | disabledModules = [ "virtualisation/vmware-guest.nix" ]; 14 | 15 | # Interface is this on M1 16 | networking.interfaces.ens160.useDHCP = true; 17 | 18 | # Lots of stuff that uses aarch64 that claims doesn't work, but actually works. 19 | nixpkgs.config.allowUnfree = true; 20 | nixpkgs.config.allowUnsupportedSystem = true; 21 | 22 | # This works through our custom module imported above 23 | virtualisation.vmware.guest.enable = true; 24 | 25 | # Share our host filesystem 26 | fileSystems."/host" = { 27 | fsType = "fuse./run/current-system/sw/bin/vmhgfs-fuse"; 28 | device = ".host:/"; 29 | options = [ 30 | "umask=22" 31 | "uid=1000" 32 | "gid=1000" 33 | "allow_other" 34 | "auto_unmount" 35 | "defaults" 36 | ]; 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /machines/vm-intel.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: { 2 | imports = [ 3 | ./hardware/vm-intel.nix 4 | ./vm-shared.nix 5 | ]; 6 | 7 | virtualisation.vmware.guest.enable = true; 8 | 9 | # Interface is this on Intel Fusion 10 | networking.interfaces.ens33.useDHCP = true; 11 | 12 | # Shared folder to host works on Intel 13 | fileSystems."/host" = { 14 | fsType = "fuse./run/current-system/sw/bin/vmhgfs-fuse"; 15 | device = ".host:/"; 16 | options = [ 17 | "umask=22" 18 | "uid=1000" 19 | "gid=1000" 20 | "allow_other" 21 | "auto_unmount" 22 | "defaults" 23 | ]; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /machines/vm-shared.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, lib, currentSystem, currentSystemName,... }: 2 | 3 | { 4 | imports = [ 5 | ../modules/specialization/plasma.nix 6 | ../modules/specialization/i3.nix 7 | ../modules/specialization/gnome-ibus.nix 8 | ]; 9 | 10 | # Be careful updating this. 11 | boot.kernelPackages = pkgs.linuxPackages_latest; 12 | 13 | nix = { 14 | package = pkgs.nixVersions.latest; 15 | extraOptions = '' 16 | experimental-features = nix-command flakes 17 | keep-outputs = true 18 | keep-derivations = true 19 | ''; 20 | 21 | # public binary cache that I use for all my derivations. You can keep 22 | # this, use your own, or toss it. Its typically safe to use a binary cache 23 | # since the data inside is checksummed. 24 | settings = { 25 | substituters = ["https://mitchellh-nixos-config.cachix.org"]; 26 | trusted-public-keys = ["mitchellh-nixos-config.cachix.org-1:bjEbXJyLrL1HZZHBbO4QALnI5faYZppzkU4D2s0G8RQ="]; 27 | }; 28 | }; 29 | 30 | nixpkgs.config.permittedInsecurePackages = [ 31 | # Needed for k2pdfopt 2.53. 32 | "mupdf-1.17.0" 33 | ]; 34 | 35 | # Use the systemd-boot EFI boot loader. 36 | boot.loader.systemd-boot.enable = true; 37 | boot.loader.efi.canTouchEfiVariables = true; 38 | 39 | # VMware, Parallels both only support this being 0 otherwise you see 40 | # "error switching console mode" on boot. 41 | boot.loader.systemd-boot.consoleMode = "0"; 42 | 43 | # Define your hostname. 44 | networking.hostName = "dev"; 45 | 46 | # Set your time zone. 47 | time.timeZone = "America/Los_Angeles"; 48 | 49 | # The global useDHCP flag is deprecated, therefore explicitly set to false here. 50 | # Per-interface useDHCP will be mandatory in the future, so this generated config 51 | # replicates the default behaviour. 52 | networking.useDHCP = false; 53 | 54 | # Don't require password for sudo 55 | security.sudo.wheelNeedsPassword = false; 56 | 57 | # Virtualization settings 58 | virtualisation.docker.enable = true; 59 | virtualisation.lxd = { 60 | enable = true; 61 | }; 62 | 63 | # Select internationalisation properties. 64 | i18n = { 65 | defaultLocale = "en_US.UTF-8"; 66 | inputMethod = { 67 | enable = true; 68 | type = "fcitx5"; 69 | fcitx5.addons = with pkgs; [ 70 | fcitx5-chinese-addons 71 | fcitx5-gtk 72 | fcitx5-hangul 73 | fcitx5-mozc 74 | ]; 75 | }; 76 | }; 77 | 78 | # Enable tailscale. We manually authenticate when we want with 79 | # "sudo tailscale up". If you don't use tailscale, you should comment 80 | # out or delete all of this. 81 | services.tailscale.enable = true; 82 | 83 | # Define a user account. Don't forget to set a password with ‘passwd’. 84 | users.mutableUsers = false; 85 | 86 | # Manage fonts. We pull these from a secret directory since most of these 87 | # fonts require a purchase. 88 | fonts = { 89 | fontDir.enable = true; 90 | 91 | packages = [ 92 | pkgs.fira-code 93 | pkgs.jetbrains-mono 94 | ]; 95 | }; 96 | 97 | # List packages installed in system profile. To search, run: 98 | # $ nix search wget 99 | environment.systemPackages = with pkgs; [ 100 | cachix 101 | gnumake 102 | killall 103 | niv 104 | xclip 105 | 106 | # For hypervisors that support auto-resizing, this script forces it. 107 | # I've noticed not everyone listens to the udev events so this is a hack. 108 | (writeShellScriptBin "xrandr-auto" '' 109 | xrandr --output Virtual-1 --auto 110 | '') 111 | ] ++ lib.optionals (currentSystemName == "vm-aarch64") [ 112 | # This is needed for the vmware user tools clipboard to work. 113 | # You can test if you don't need this by deleting this and seeing 114 | # if the clipboard sill works. 115 | gtkmm3 116 | ]; 117 | 118 | # Our default non-specialised desktop environment. 119 | services.xserver = lib.mkIf (config.specialisation != {}) { 120 | enable = true; 121 | xkb.layout = "us"; 122 | desktopManager.gnome.enable = true; 123 | displayManager.gdm.enable = true; 124 | }; 125 | 126 | # Some programs need SUID wrappers, can be configured further or are 127 | # started in user sessions. 128 | # programs.mtr.enable = true; 129 | # programs.gnupg.agent = { 130 | # enable = true; 131 | # enableSSHSupport = true; 132 | # }; 133 | 134 | # Enable the OpenSSH daemon. 135 | services.openssh.enable = true; 136 | services.openssh.settings.PasswordAuthentication = true; 137 | services.openssh.settings.PermitRootLogin = "no"; 138 | 139 | # Enable flatpak. I don't use any flatpak apps but I do sometimes 140 | # test them so I keep this enabled. 141 | services.flatpak.enable = true; 142 | 143 | # Enable snap. I don't really use snap but I do sometimes test them 144 | # and release snaps so we keep this enabled. 145 | services.snap.enable = true; 146 | 147 | # Disable the firewall since we're in a VM and we want to make it 148 | # easy to visit stuff in here. We only use NAT networking anyways. 149 | networking.firewall.enable = false; 150 | 151 | # This value determines the NixOS release from which the default 152 | # settings for stateful data, like file locations and database versions 153 | # on your system were taken. It‘s perfectly fine and recommended to leave 154 | # this value at the release version of the first install of this system. 155 | # Before changing this value read the documentation for this option 156 | # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). 157 | system.stateVersion = "20.09"; # Did you read the comment? 158 | } 159 | -------------------------------------------------------------------------------- /machines/wsl.nix: -------------------------------------------------------------------------------- 1 | { pkgs, currentSystemUser, ... }: { 2 | imports = []; 3 | 4 | wsl = { 5 | enable = true; 6 | wslConf.automount.root = "/mnt"; 7 | defaultUser = currentSystemUser; 8 | startMenuLaunchers = true; 9 | }; 10 | 11 | nix = { 12 | package = pkgs.nixUnstable; 13 | extraOptions = '' 14 | experimental-features = nix-command flakes 15 | keep-outputs = true 16 | keep-derivations = true 17 | ''; 18 | }; 19 | 20 | system.stateVersion = "23.05"; 21 | } 22 | -------------------------------------------------------------------------------- /modules/parallels-guest.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | with lib; 4 | 5 | let 6 | prl-tools = config.hardware.parallels.package; 7 | aarch64 = pkgs.stdenv.hostPlatform.system == "aarch64-linux"; 8 | in 9 | 10 | { 11 | 12 | options = { 13 | hardware.parallels = { 14 | 15 | enable = mkOption { 16 | type = types.bool; 17 | default = false; 18 | description = '' 19 | This enables Parallels Tools for Linux guests, along with provided 20 | video, mouse and other hardware drivers. 21 | ''; 22 | }; 23 | 24 | autoMountShares = mkOption { 25 | type = types.bool; 26 | default = true; 27 | description = '' 28 | Control prlfsmountd service. When this service is running, shares can not be manually 29 | mounted through `mount -t prl_fs ...` as this service will remount and trample any set options. 30 | Recommended to enable for simple file sharing, but extended share use such as for code should 31 | disable this to manually mount shares. 32 | ''; 33 | }; 34 | 35 | package = mkOption { 36 | type = types.nullOr types.package; 37 | default = config.boot.kernelPackages.prl-tools; 38 | defaultText = "config.boot.kernelPackages.prl-tools"; 39 | example = literalExpression "config.boot.kernelPackages.prl-tools"; 40 | description = '' 41 | Defines which package to use for prl-tools. Override to change the version. 42 | ''; 43 | }; 44 | }; 45 | 46 | }; 47 | 48 | config = mkIf config.hardware.parallels.enable { 49 | services.udev.packages = [ prl-tools ]; 50 | 51 | environment.systemPackages = [ prl-tools ]; 52 | 53 | boot.extraModulePackages = [ prl-tools ]; 54 | 55 | boot.kernelModules = [ "prl_fs" "prl_fs_freeze" "prl_tg" ] ++ optional aarch64 "prl_notifier"; 56 | 57 | # services.timesyncd.enable = false; 58 | 59 | systemd.services.prltoolsd = { 60 | description = "Parallels Tools' service"; 61 | wantedBy = [ "multi-user.target" ]; 62 | serviceConfig = { 63 | ExecStart = "${prl-tools}/bin/prltoolsd -f"; 64 | PIDFile = "/var/run/prltoolsd.pid"; 65 | }; 66 | }; 67 | 68 | systemd.services.prlfsmountd = mkIf config.hardware.parallels.autoMountShares { 69 | description = "Parallels Shared Folders Daemon"; 70 | wantedBy = [ "multi-user.target" ]; 71 | serviceConfig = rec { 72 | ExecStart = "${prl-tools}/sbin/prlfsmountd ${PIDFile}"; 73 | ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p /media"; 74 | ExecStopPost = "${prl-tools}/sbin/prlfsmountd -u"; 75 | PIDFile = "/run/prlfsmountd.pid"; 76 | }; 77 | }; 78 | 79 | systemd.services.prlshprint = { 80 | description = "Parallels Shared Printer Tool"; 81 | wantedBy = [ "multi-user.target" ]; 82 | bindsTo = [ "cups.service" ]; 83 | serviceConfig = { 84 | Type = "forking"; 85 | ExecStart = "${prl-tools}/bin/prlshprint"; 86 | }; 87 | }; 88 | 89 | systemd.user.services = { 90 | prlcc = { 91 | description = "Parallels Control Center"; 92 | wantedBy = [ "graphical-session.target" ]; 93 | serviceConfig = { 94 | ExecStart = "${prl-tools}/bin/prlcc"; 95 | }; 96 | }; 97 | prldnd = { 98 | description = "Parallels Control Center"; 99 | wantedBy = [ "graphical-session.target" ]; 100 | serviceConfig = { 101 | ExecStart = "${prl-tools}/bin/prldnd"; 102 | }; 103 | }; 104 | prlcp = { 105 | description = "Parallels CopyPaste Tool"; 106 | wantedBy = [ "graphical-session.target" ]; 107 | serviceConfig = { 108 | ExecStart = "${prl-tools}/bin/prlcp"; 109 | Restart = "always"; 110 | }; 111 | }; 112 | prlsga = { 113 | description = "Parallels Shared Guest Applications Tool"; 114 | wantedBy = [ "graphical-session.target" ]; 115 | serviceConfig = { 116 | ExecStart = "${prl-tools}/bin/prlsga"; 117 | }; 118 | }; 119 | prlshprof = { 120 | description = "Parallels Shared Profile Tool"; 121 | wantedBy = [ "graphical-session.target" ]; 122 | serviceConfig = { 123 | ExecStart = "${prl-tools}/bin/prlshprof"; 124 | }; 125 | }; 126 | }; 127 | 128 | }; 129 | } 130 | -------------------------------------------------------------------------------- /modules/specialization/gnome-ibus.nix: -------------------------------------------------------------------------------- 1 | # Gnome with ibus 2 | { lib, pkgs, ... }: { 3 | specialisation."gnome-ibus".configuration = { 4 | services.xserver = { 5 | enable = true; 6 | xkb.layout = "us"; 7 | desktopManager.gnome.enable = true; 8 | displayManager.gdm.enable = true; 9 | }; 10 | 11 | i18n.inputMethod = lib.mkForce { 12 | enable = true; 13 | type = "ibus"; 14 | ibus.engines = with pkgs; [ 15 | # None yet 16 | ]; 17 | }; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /modules/specialization/i3.nix: -------------------------------------------------------------------------------- 1 | # i3 (X11) 2 | { pkgs, ... }: { 3 | specialisation.i3.configuration = { 4 | # We need an XDG portal for various applications to work properly, 5 | # such as Flatpak applications. 6 | xdg.portal = { 7 | enable = true; 8 | extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; 9 | config.common.default = "*"; 10 | }; 11 | 12 | services.xserver = { 13 | enable = true; 14 | xkb.layout = "us"; 15 | dpi = 220; 16 | 17 | desktopManager = { 18 | xterm.enable = false; 19 | wallpaper.mode = "fill"; 20 | }; 21 | 22 | displayManager = { 23 | defaultSession = "none+i3"; 24 | lightdm.enable = true; 25 | 26 | # AARCH64: For now, on Apple Silicon, we must manually set the 27 | # display resolution. This is a known issue with VMware Fusion. 28 | sessionCommands = '' 29 | ${pkgs.xorg.xset}/bin/xset r rate 200 40 30 | ''; 31 | }; 32 | 33 | windowManager = { 34 | i3.enable = true; 35 | }; 36 | }; 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /modules/specialization/plasma.nix: -------------------------------------------------------------------------------- 1 | # KDE Plasma (Wayland) 2 | { pkgs, ... }: { 3 | specialisation.plasma.configuration = { 4 | services.xserver.enable = true; 5 | services.displayManager.sddm.enable = true; 6 | services.displayManager.sddm.wayland.enable = true; 7 | services.desktopManager.plasma6.enable = true; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /modules/vmware-guest.nix: -------------------------------------------------------------------------------- 1 | # This is based on the official vmware-guest module, but modified 2 | # for aarch64 to disable certain features and add support. I'm unsure 3 | # how to upstream this because I just don't use certain features... maybe 4 | # making them toggle-able? I'm not sure. 5 | 6 | { config, lib, pkgs, ... }: 7 | 8 | with lib; 9 | 10 | let 11 | cfg = config.virtualisation.vmware.guest; 12 | open-vm-tools = if cfg.headless then pkgs.open-vm-tools-headless else pkgs.open-vm-tools; 13 | xf86inputvmmouse = pkgs.xorg.xf86inputvmmouse; 14 | in 15 | { 16 | imports = [ 17 | (mkRenamedOptionModule [ "services" "vmwareGuest" ] [ "virtualisation" "vmware" "guest" ]) 18 | ]; 19 | 20 | options.virtualisation.vmware.guest = { 21 | enable = mkEnableOption "VMWare Guest Support"; 22 | headless = mkOption { 23 | type = types.bool; 24 | default = false; 25 | description = "Whether to disable X11-related features."; 26 | }; 27 | }; 28 | 29 | config = mkIf cfg.enable { 30 | assertions = [ { 31 | assertion = pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64 || pkgs.stdenv.isAarch64; 32 | message = "VMWare guest is not currently supported on ${pkgs.stdenv.hostPlatform.system}"; 33 | } ]; 34 | 35 | boot.initrd.availableKernelModules = [ "mptspi" ]; 36 | # boot.initrd.kernelModules = [ "vmw_pvscsi" ]; 37 | 38 | environment.systemPackages = [ open-vm-tools ]; 39 | 40 | systemd.services.vmware = 41 | { description = "VMWare Guest Service"; 42 | wantedBy = [ "multi-user.target" ]; 43 | after = [ "display-manager.service" ]; 44 | unitConfig.ConditionVirtualization = "vmware"; 45 | serviceConfig.ExecStart = "${open-vm-tools}/bin/vmtoolsd"; 46 | }; 47 | 48 | # Mount the vmblock for drag-and-drop and copy-and-paste. 49 | systemd.mounts = [ 50 | { 51 | description = "VMware vmblock fuse mount"; 52 | documentation = [ "https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/vmblock-fuse/design.txt" ]; 53 | unitConfig.ConditionVirtualization = "vmware"; 54 | what = "${open-vm-tools}/bin/vmware-vmblock-fuse"; 55 | where = "/run/vmblock-fuse"; 56 | type = "fuse"; 57 | options = "subtype=vmware-vmblock,default_permissions,allow_other"; 58 | wantedBy = [ "multi-user.target" ]; 59 | } 60 | ]; 61 | 62 | security.wrappers.vmware-user-suid-wrapper = 63 | { setuid = true; 64 | owner = "root"; 65 | group = "root"; 66 | source = "${open-vm-tools}/bin/vmware-user-suid-wrapper"; 67 | }; 68 | 69 | environment.etc.vmware-tools.source = "${open-vm-tools}/etc/vmware-tools/*"; 70 | 71 | services.xserver = mkIf (!cfg.headless) { 72 | # TODO: does not build on aarch64 73 | # modules = [ xf86inputvmmouse ]; 74 | 75 | config = '' 76 | Section "InputClass" 77 | Identifier "VMMouse" 78 | MatchDevicePath "/dev/input/event*" 79 | MatchProduct "ImPS/2 Generic Wheel Mouse" 80 | Driver "vmmouse" 81 | EndSection 82 | ''; 83 | 84 | displayManager.sessionCommands = '' 85 | ${open-vm-tools}/bin/vmware-user-suid-wrapper 86 | ''; 87 | }; 88 | 89 | services.udev.packages = [ open-vm-tools ]; 90 | }; 91 | } 92 | -------------------------------------------------------------------------------- /nix/sources.json: -------------------------------------------------------------------------------- 1 | { 2 | "fish-foreign-env": { 3 | "branch": "master", 4 | "description": "Run foreign bash scripts and capture exported environment variables", 5 | "homepage": "", 6 | "owner": "oh-my-fish", 7 | "repo": "plugin-foreign-env", 8 | "rev": "dddd9213272a0ab848d474d0cbde12ad034e65bc", 9 | "sha256": "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs", 10 | "type": "tarball", 11 | "url": "https://github.com/oh-my-fish/plugin-foreign-env/archive/dddd9213272a0ab848d474d0cbde12ad034e65bc.tar.gz", 12 | "url_template": "https://github.com///archive/.tar.gz" 13 | }, 14 | "fish-fzf": { 15 | "branch": "master", 16 | "description": "Ef-🐟-ient fish keybindings for fzf", 17 | "homepage": "", 18 | "owner": "jethrokuan", 19 | "repo": "fzf", 20 | "rev": "24f4739fc1dffafcc0da3ccfbbd14d9c7d31827a", 21 | "sha256": "0kz057nr07ybh0y06ww3p424rgk8pi84pnch9jzb040qqn9a8823", 22 | "type": "tarball", 23 | "url": "https://github.com/jethrokuan/fzf/archive/24f4739fc1dffafcc0da3ccfbbd14d9c7d31827a.tar.gz", 24 | "url_template": "https://github.com///archive/.tar.gz" 25 | }, 26 | "go": { 27 | "branch": "go1.15.6", 28 | "description": "The Go programming language", 29 | "homepage": "https://golang.org", 30 | "owner": "golang", 31 | "repo": "go", 32 | "rev": "9b955d2d3fcff6a5bc8bce7bafdc4c634a28e95b", 33 | "sha256": "0pg811lfw1pdp0cba4jvsqbwjaqrqz6m7jspbc80r17snd7flk2z", 34 | "type": "tarball", 35 | "url": "https://github.com/golang/go/archive/9b955d2d3fcff6a5bc8bce7bafdc4c634a28e95b.tar.gz", 36 | "url_template": "https://github.com///archive/.tar.gz" 37 | }, 38 | "niv": { 39 | "branch": "master", 40 | "description": "Easy dependency management for Nix projects", 41 | "homepage": "https://github.com/nmattia/niv", 42 | "owner": "nmattia", 43 | "repo": "niv", 44 | "rev": "f73bf8d584148677b01859677a63191c31911eae", 45 | "sha256": "0jlmrx633jvqrqlyhlzpvdrnim128gc81q5psz2lpp2af8p8q9qs", 46 | "type": "tarball", 47 | "url": "https://github.com/nmattia/niv/archive/f73bf8d584148677b01859677a63191c31911eae.tar.gz", 48 | "url_template": "https://github.com///archive/.tar.gz" 49 | }, 50 | "nixpkgs": { 51 | "branch": "release-21.05", 52 | "description": "Nix Packages collection", 53 | "homepage": "", 54 | "owner": "NixOS", 55 | "repo": "nixpkgs", 56 | "rev": "3b1789322fcbcb5cf51228d732752714f1bf77da", 57 | "sha256": "0m6gcl2pzvicwbflsvmccdyf03ki1zl3d9dl8rn8hj1gdgssj6vr", 58 | "type": "tarball", 59 | "url": "https://github.com/NixOS/nixpkgs/archive/3b1789322fcbcb5cf51228d732752714f1bf77da.tar.gz", 60 | "url_template": "https://github.com///archive/.tar.gz" 61 | }, 62 | "nvim-comment": { 63 | "branch": "master", 64 | "description": ":brain: :muscle: // Smart and powerful comment plugin for neovim. Supports treesitter, dot repeat, left-right/up-down motions, hooks, and more", 65 | "homepage": "", 66 | "owner": "numToStr", 67 | "repo": "Comment.nvim", 68 | "rev": "79b356d00586ab9e6ffd1fbf732bf4f076c95d20", 69 | "sha256": "02f312dh0z71p0hfpx6y6a512p3i6w0bpd9yw51iyxcdkp9i40wl", 70 | "type": "tarball", 71 | "url": "https://github.com/numToStr/Comment.nvim/archive/79b356d00586ab9e6ffd1fbf732bf4f076c95d20.tar.gz", 72 | "url_template": "https://github.com///archive/.tar.gz" 73 | }, 74 | "nvim-lspconfig": { 75 | "branch": "master", 76 | "description": "Quickstart configurations for the Nvim LSP client", 77 | "homepage": "", 78 | "owner": "neovim", 79 | "repo": "nvim-lspconfig", 80 | "rev": "1c0e6d39aa93deebdee35d4945889641e764619e", 81 | "sha256": "0mfjy7jhis96n2az1g9rh9nyv721nhaadifslpczmw6driii9q59", 82 | "type": "tarball", 83 | "url": "https://github.com/neovim/nvim-lspconfig/archive/1c0e6d39aa93deebdee35d4945889641e764619e.tar.gz", 84 | "url_template": "https://github.com///archive/.tar.gz" 85 | }, 86 | "nvim-magma": { 87 | "branch": "main", 88 | "description": "Interact with Jupyter from NeoVim.", 89 | "homepage": null, 90 | "owner": "dccsillag", 91 | "repo": "magma-nvim", 92 | "rev": "395b48e2e202d82fca76c15d2dcd8785c125d686", 93 | "sha256": "0fn2r1z3lx1zh2dxm5bpqpqb959pcylviag4xndv4z3gyyli4khn", 94 | "type": "tarball", 95 | "url": "https://github.com/dccsillag/magma-nvim/archive/395b48e2e202d82fca76c15d2dcd8785c125d686.tar.gz", 96 | "url_template": "https://github.com///archive/.tar.gz" 97 | }, 98 | "nvim-plenary": { 99 | "branch": "master", 100 | "description": "plenary: full; complete; entire; absolute; unqualified. All the lua functions I don't want to write twice.", 101 | "homepage": null, 102 | "owner": "nvim-lua", 103 | "repo": "plenary.nvim", 104 | "rev": "9069d14a120cadb4f6825f76821533f2babcab92", 105 | "sha256": "0pgzi0brqn4kcbv1k5d50xm0bcwaq50sk5jnj3q9ls2pvv7lb9a0", 106 | "type": "tarball", 107 | "url": "https://github.com/nvim-lua/plenary.nvim/archive/9069d14a120cadb4f6825f76821533f2babcab92.tar.gz", 108 | "url_template": "https://github.com///archive/.tar.gz" 109 | }, 110 | "nvim-telescope": { 111 | "branch": "master", 112 | "description": "Find, Filter, Preview, Pick. All lua, all the time.", 113 | "homepage": "", 114 | "owner": "nvim-telescope", 115 | "repo": "telescope.nvim", 116 | "rev": "b923665e64380e97294af09117e50266c20c71c7", 117 | "sha256": "0iwlmr94kdr1xwsn2l7ryxx7x1cicpbk86flxzza6877dmig226w", 118 | "type": "tarball", 119 | "url": "https://github.com/nvim-telescope/telescope.nvim/archive/b923665e64380e97294af09117e50266c20c71c7.tar.gz", 120 | "url_template": "https://github.com///archive/.tar.gz" 121 | }, 122 | "nvim-treesitter": { 123 | "branch": "master", 124 | "description": "Nvim Treesitter configurations and abstraction layer", 125 | "homepage": "", 126 | "owner": "nvim-treesitter", 127 | "repo": "nvim-treesitter", 128 | "rev": "957aefe8148902897aad877e508ae7e747f155fc", 129 | "sha256": "19fd08k3ns65sqclr2b3pfrqirm92fwmzvxa726dawxfpq3m26mc", 130 | "type": "tarball", 131 | "url": "https://github.com/nvim-treesitter/nvim-treesitter/archive/957aefe8148902897aad877e508ae7e747f155fc.tar.gz", 132 | "url_template": "https://github.com///archive/.tar.gz" 133 | }, 134 | "nvim-treesitter-playground": { 135 | "branch": "master", 136 | "description": "Treesitter playground integrated into Neovim", 137 | "homepage": "", 138 | "owner": "nvim-treesitter", 139 | "repo": "playground", 140 | "rev": "2b81a018a49f8e476341dfcb228b7b808baba68b", 141 | "sha256": "1b7h4sih8dc55w12f0v5knk9cxfpy0iffhbvmg0g84if55ar616v", 142 | "type": "tarball", 143 | "url": "https://github.com/nvim-treesitter/playground/archive/2b81a018a49f8e476341dfcb228b7b808baba68b.tar.gz", 144 | "url_template": "https://github.com///archive/.tar.gz" 145 | }, 146 | "nvim-treesitter-textobjects": { 147 | "branch": "master", 148 | "description": null, 149 | "homepage": "", 150 | "owner": "nvim-treesitter", 151 | "repo": "nvim-treesitter-textobjects", 152 | "rev": "35a60f093fa15a303874975f963428a5cd24e4a0", 153 | "sha256": "16yxsqa5ppb9p8l3r6j11ak6a5448l6wy9dj4ag58i0r18l0cfj9", 154 | "type": "tarball", 155 | "url": "https://github.com/nvim-treesitter/nvim-treesitter-textobjects/archive/35a60f093fa15a303874975f963428a5cd24e4a0.tar.gz", 156 | "url_template": "https://github.com///archive/.tar.gz" 157 | }, 158 | "pack": { 159 | "branch": "v0.11.0", 160 | "description": "CLI for building apps using Cloud Native Buildpacks", 161 | "homepage": "https://buildpacks.io", 162 | "owner": "buildpacks", 163 | "repo": "pack", 164 | "rev": "2cf2c3442f574a2239ea3ee17aad7058fefe5410", 165 | "sha256": "1pa7ml9x4cpp7v08720xjqllxkxqsqap987gdzzsa26k218q1fhz", 166 | "type": "tarball", 167 | "url": "https://github.com/buildpacks/pack/archive/2cf2c3442f574a2239ea3ee17aad7058fefe5410.tar.gz", 168 | "url_template": "https://github.com///archive/.tar.gz" 169 | }, 170 | "theme-bobthefish": { 171 | "branch": "master", 172 | "description": "A Powerline-style, Git-aware fish theme optimized for awesome.", 173 | "homepage": "", 174 | "owner": "oh-my-fish", 175 | "repo": "theme-bobthefish", 176 | "rev": "1eaed8c39951029fa7839859abd5518977a80f83", 177 | "sha256": "18c5bmg5in6shy57l6sqfshda2dp91r5kgzrysmm10kihqxw0562", 178 | "type": "tarball", 179 | "url": "https://github.com/oh-my-fish/theme-bobthefish/archive/1eaed8c39951029fa7839859abd5518977a80f83.tar.gz", 180 | "url_template": "https://github.com///archive/.tar.gz" 181 | }, 182 | "tmux-dracula": { 183 | "branch": "master", 184 | "description": "🧛🏻‍♂️ Dark theme for tmux", 185 | "homepage": "https://draculatheme.com/tmux", 186 | "owner": "dracula", 187 | "repo": "tmux", 188 | "rev": "d311e94d868b0d59a896a4c09b6f658b1059519f", 189 | "sha256": "0i8vy40agd36vlgdn29idy26k06wn006kma8j1pnp3715jdiq1az", 190 | "type": "tarball", 191 | "url": "https://github.com/dracula/tmux/archive/d311e94d868b0d59a896a4c09b6f658b1059519f.tar.gz", 192 | "url_template": "https://github.com///archive/.tar.gz" 193 | }, 194 | "tmux-pain-control": { 195 | "branch": "master", 196 | "description": "standard pane key-bindings for tmux", 197 | "homepage": "", 198 | "owner": "tmux-plugins", 199 | "repo": "tmux-pain-control", 200 | "rev": "2db63de3b08fc64831d833240749133cecb67d92", 201 | "sha256": "0w7a6n4n86ysiqcqj12j2hg9r5fznvbp3dz8pzas9q1k3avlk0zk", 202 | "type": "tarball", 203 | "url": "https://github.com/tmux-plugins/tmux-pain-control/archive/2db63de3b08fc64831d833240749133cecb67d92.tar.gz", 204 | "url_template": "https://github.com///archive/.tar.gz" 205 | }, 206 | "tree-sitter-hcl": { 207 | "branch": "main", 208 | "description": "A tree-sitter grammar for HCL (HashiCorp Configuration Language), used by projects such as Terraform.", 209 | "homepage": "", 210 | "owner": "mitchellh", 211 | "repo": "tree-sitter-hcl", 212 | "rev": "e01cf34478d5869209a7b1a80a12e63b40952754", 213 | "sha256": "08hk1h93qjndfs5gi5ggsl0sbssq4s4dgx2890pwg4h6l2x1m3xz", 214 | "type": "tarball", 215 | "url": "https://github.com/mitchellh/tree-sitter-hcl/archive/e01cf34478d5869209a7b1a80a12e63b40952754.tar.gz", 216 | "url_template": "https://github.com///archive/.tar.gz" 217 | }, 218 | "tree-sitter-proto": { 219 | "branch": "main", 220 | "description": "A tree-sitter grammar for protocol buffer files (proto3).", 221 | "homepage": null, 222 | "owner": "mitchellh", 223 | "repo": "tree-sitter-proto", 224 | "rev": "42d82fa18f8afe59b5fc0b16c207ee4f84cb185f", 225 | "sha256": "001y2z2683fagryqj5f0gs3rcgx2nbw3x3r9afydhss80ihb8zvi", 226 | "type": "tarball", 227 | "url": "https://github.com/mitchellh/tree-sitter-proto/archive/42d82fa18f8afe59b5fc0b16c207ee4f84cb185f.tar.gz", 228 | "url_template": "https://github.com///archive/.tar.gz" 229 | }, 230 | "vim-copilot": { 231 | "branch": "release", 232 | "description": "Neovim plugin for GitHub Copilot", 233 | "homepage": null, 234 | "owner": "github", 235 | "repo": "copilot.vim", 236 | "rev": "1358e8e45ecedc53daf971924a0541ddf6224faf", 237 | "sha256": "171ypwb85ya8n63zykdnb8d4ni2jbn728x7r6ph1m67k06g0w4pb", 238 | "type": "tarball", 239 | "url": "https://github.com/github/copilot.vim/archive/1358e8e45ecedc53daf971924a0541ddf6224faf.tar.gz", 240 | "url_template": "https://github.com///archive/.tar.gz" 241 | }, 242 | "vim-cue": { 243 | "branch": "master", 244 | "description": "cuelang/cue syntax highlighting plugin for vim, derived from google/vim-jsonnet", 245 | "homepage": null, 246 | "owner": "jjo", 247 | "repo": "vim-cue", 248 | "rev": "bd1a62303d096aa24fe4160a475645087f8770b3", 249 | "sha256": "01f89ki0w2j58pfdvb8w0sf1x5nqgqh3bldinifpd4pysnqhniai", 250 | "type": "tarball", 251 | "url": "https://github.com/jjo/vim-cue/archive/bd1a62303d096aa24fe4160a475645087f8770b3.tar.gz", 252 | "url_template": "https://github.com///archive/.tar.gz" 253 | }, 254 | "vim-devicons": { 255 | "branch": "master", 256 | "description": "Adds file type icons to Vim plugins such as: NERDTree, vim-airline, CtrlP, unite, Denite, lightline, vim-startify and many more", 257 | "homepage": "", 258 | "owner": "ryanoasis", 259 | "repo": "vim-devicons", 260 | "rev": "71f239af28b7214eebb60d4ea5bd040291fb7e33", 261 | "sha256": "0kshppxgi63wn96a8h9zv7drwqcbljin5jhszh8q7pqw2xsd83gn", 262 | "type": "tarball", 263 | "url": "https://github.com/ryanoasis/vim-devicons/archive/71f239af28b7214eebb60d4ea5bd040291fb7e33.tar.gz", 264 | "url_template": "https://github.com///archive/.tar.gz" 265 | }, 266 | "vim-dracula": { 267 | "branch": "master", 268 | "description": "🧛🏻‍♂️ Dark theme for Vim", 269 | "homepage": "https://draculatheme.com/vim", 270 | "owner": "dracula", 271 | "repo": "vim", 272 | "rev": "d7723a842a6cfa2f62cf85530ab66eb418521dc2", 273 | "sha256": "1qzil8rwpdzf64gq63ds0cf509ldam77l3fz02g1mia5dry75r02", 274 | "type": "tarball", 275 | "url": "https://github.com/dracula/vim/archive/d7723a842a6cfa2f62cf85530ab66eb418521dc2.tar.gz", 276 | "url_template": "https://github.com///archive/.tar.gz" 277 | }, 278 | "vim-fish": { 279 | "branch": "master", 280 | "description": "Vim support for editing fish scripts", 281 | "homepage": null, 282 | "owner": "dag", 283 | "repo": "vim-fish", 284 | "rev": "50b95cbbcd09c046121367d49039710e9dc9c15f", 285 | "sha256": "1yvjlm90alc4zsdsppkmsja33wsgm2q6kkn9dxn6xqwnq4jw5s7h", 286 | "type": "tarball", 287 | "url": "https://github.com/dag/vim-fish/archive/50b95cbbcd09c046121367d49039710e9dc9c15f.tar.gz", 288 | "url_template": "https://github.com///archive/.tar.gz" 289 | }, 290 | "vim-fugitive": { 291 | "branch": "master", 292 | "description": "fugitive.vim: A Git wrapper so awesome, it should be illegal", 293 | "homepage": "https://www.vim.org/scripts/script.php?script_id=2975", 294 | "owner": "tpope", 295 | "repo": "vim-fugitive", 296 | "rev": "5f0d280b517cacb16f59316659966c7ca5e2bea2", 297 | "sha256": "0qgxchrsydxznxwz3gwksqg3nal1ypmwi0ibpkf4whc62a8xxgl6", 298 | "type": "tarball", 299 | "url": "https://github.com/tpope/vim-fugitive/archive/5f0d280b517cacb16f59316659966c7ca5e2bea2.tar.gz", 300 | "url_template": "https://github.com///archive/.tar.gz" 301 | }, 302 | "vim-glsl": { 303 | "branch": "master", 304 | "description": "Vim runtime files for OpenGL Shading Language", 305 | "homepage": null, 306 | "owner": "tikhomirov", 307 | "repo": "vim-glsl", 308 | "rev": "28a6dfbcd96095226bee90985b7f12c5679dbbb6", 309 | "sha256": "051f0q5bkgp77pz0izh5mvqsmxy0rzlvriwq4j7qzslqk7i850p2", 310 | "type": "tarball", 311 | "url": "https://github.com/tikhomirov/vim-glsl/archive/28a6dfbcd96095226bee90985b7f12c5679dbbb6.tar.gz", 312 | "url_template": "https://github.com///archive/.tar.gz" 313 | }, 314 | "vim-misc": { 315 | "branch": "master", 316 | "description": "My Vim configuration files.", 317 | "homepage": null, 318 | "owner": "mitchellh", 319 | "repo": "vim-misc", 320 | "rev": "ca7946cbecc2d63a7c83ad0a894d8c2653fd1963", 321 | "sha256": "0bq3i36dnrl3c3xx09ny7mrdz30sp5c9yiaqi2f68sy0vj6qlga4", 322 | "type": "tarball", 323 | "url": "https://github.com/mitchellh/vim-misc/archive/ca7946cbecc2d63a7c83ad0a894d8c2653fd1963.tar.gz", 324 | "url_template": "https://github.com///archive/.tar.gz" 325 | }, 326 | "vim-nord": { 327 | "branch": "develop", 328 | "description": "An arctic, north-bluish clean and elegant Vim theme.", 329 | "homepage": "https://www.nordtheme.com/ports/vim", 330 | "owner": "crispgm", 331 | "repo": "nord-vim", 332 | "rev": "cc5b0e9f472bdcbdaa701c94302796fb1e64e8d4", 333 | "sha256": "0zb4a0xmk6q7ha8x0b28xb02vk390aypn82kcqy3ilv1l43pxly0", 334 | "type": "tarball", 335 | "url": "https://github.com/crispgm/nord-vim/archive/cc5b0e9f472bdcbdaa701c94302796fb1e64e8d4.tar.gz", 336 | "url_template": "https://github.com///archive/.tar.gz" 337 | }, 338 | "vim-pgsql": { 339 | "branch": "master", 340 | "description": "The best PostgreSQL plugin for Vim!", 341 | "homepage": null, 342 | "owner": "lifepillar", 343 | "repo": "pgsql.vim", 344 | "rev": "d5ed1475088e85654281902a08637a632ff7409c", 345 | "sha256": "18bz65llksdj0yvafnifvs74g0qhar9vg0xx3s46q4iq6zr6cybv", 346 | "type": "tarball", 347 | "url": "https://github.com/lifepillar/pgsql.vim/archive/d5ed1475088e85654281902a08637a632ff7409c.tar.gz", 348 | "url_template": "https://github.com///archive/.tar.gz" 349 | }, 350 | "vim-pigeon": { 351 | "branch": "master", 352 | "description": "Vim syntax for https://github.com/mna/pigeon, a parser generator built for Go.", 353 | "homepage": "", 354 | "owner": "jasontbradshaw", 355 | "repo": "pigeon.vim", 356 | "rev": "a7f149c99b7259437032af45db57c53d4c41e68b", 357 | "sha256": "079krbw1z4bjwa7qfz33fwjy5h0fry0i2a02wnvqkrqnxmzq5dxs", 358 | "type": "tarball", 359 | "url": "https://github.com/jasontbradshaw/pigeon.vim/archive/a7f149c99b7259437032af45db57c53d4c41e68b.tar.gz", 360 | "url_template": "https://github.com///archive/.tar.gz" 361 | }, 362 | "vim-tla": { 363 | "branch": "master", 364 | "description": "Vim plugin for TLA+ and PlusCal", 365 | "homepage": null, 366 | "owner": "hwayne", 367 | "repo": "tla.vim", 368 | "rev": "0d6d453a401542ce1db247c6fd139ac99b8a5add", 369 | "sha256": "1bfxnvx3g5679jan7v5prh7zk0f77m81g8c9ngq75nxdn20ihl7l", 370 | "type": "tarball", 371 | "url": "https://github.com/hwayne/tla.vim/archive/0d6d453a401542ce1db247c6fd139ac99b8a5add.tar.gz", 372 | "url_template": "https://github.com///archive/.tar.gz" 373 | }, 374 | "vim-zig": { 375 | "branch": "master", 376 | "description": "Vim configuration for Zig", 377 | "homepage": null, 378 | "owner": "ziglang", 379 | "repo": "zig.vim", 380 | "rev": "0c4f965468259ab6e47fd7c6b2127583a8860eb1", 381 | "sha256": "052jmw1pzqydg4icsq2s7vn66wyn2ki4lzpln2fzxx9r9hbwfi8m", 382 | "type": "tarball", 383 | "url": "https://github.com/ziglang/zig.vim/archive/0c4f965468259ab6e47fd7c6b2127583a8860eb1.tar.gz", 384 | "url_template": "https://github.com///archive/.tar.gz" 385 | } 386 | } 387 | -------------------------------------------------------------------------------- /nix/sources.nix: -------------------------------------------------------------------------------- 1 | # This file has been generated by Niv. 2 | 3 | let 4 | 5 | # 6 | # The fetchers. fetch_ fetches specs of type . 7 | # 8 | 9 | fetch_file = pkgs: name: spec: 10 | let 11 | name' = sanitizeName name + "-src"; 12 | in 13 | if spec.builtin or true then 14 | builtins_fetchurl { inherit (spec) url sha256; name = name'; } 15 | else 16 | pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; 17 | 18 | fetch_tarball = pkgs: name: spec: 19 | let 20 | name' = sanitizeName name + "-src"; 21 | in 22 | if spec.builtin or true then 23 | builtins_fetchTarball { name = name'; inherit (spec) url sha256; } 24 | else 25 | pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; 26 | 27 | fetch_git = name: spec: 28 | let 29 | ref = 30 | if spec ? ref then spec.ref else 31 | if spec ? branch then "refs/heads/${spec.branch}" else 32 | if spec ? tag then "refs/tags/${spec.tag}" else 33 | abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; 34 | submodules = if spec ? submodules then spec.submodules else false; 35 | submoduleArg = 36 | let 37 | nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0; 38 | emptyArgWithWarning = 39 | if submodules == true 40 | then 41 | builtins.trace 42 | ( 43 | "The niv input \"${name}\" uses submodules " 44 | + "but your nix's (${builtins.nixVersion}) builtins.fetchGit " 45 | + "does not support them" 46 | ) 47 | {} 48 | else {}; 49 | in 50 | if nixSupportsSubmodules 51 | then { inherit submodules; } 52 | else emptyArgWithWarning; 53 | in 54 | builtins.fetchGit 55 | ({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg); 56 | 57 | fetch_local = spec: spec.path; 58 | 59 | fetch_builtin-tarball = name: throw 60 | ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. 61 | $ niv modify ${name} -a type=tarball -a builtin=true''; 62 | 63 | fetch_builtin-url = name: throw 64 | ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. 65 | $ niv modify ${name} -a type=file -a builtin=true''; 66 | 67 | # 68 | # Various helpers 69 | # 70 | 71 | # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695 72 | sanitizeName = name: 73 | ( 74 | concatMapStrings (s: if builtins.isList s then "-" else s) 75 | ( 76 | builtins.split "[^[:alnum:]+._?=-]+" 77 | ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name) 78 | ) 79 | ); 80 | 81 | # The set of packages used when specs are fetched using non-builtins. 82 | mkPkgs = sources: system: 83 | let 84 | sourcesNixpkgs = 85 | import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; }; 86 | hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; 87 | hasThisAsNixpkgsPath = == ./.; 88 | in 89 | if builtins.hasAttr "nixpkgs" sources 90 | then sourcesNixpkgs 91 | else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then 92 | import {} 93 | else 94 | abort 95 | '' 96 | Please specify either (through -I or NIX_PATH=nixpkgs=...) or 97 | add a package called "nixpkgs" to your sources.json. 98 | ''; 99 | 100 | # The actual fetching function. 101 | fetch = pkgs: name: spec: 102 | 103 | if ! builtins.hasAttr "type" spec then 104 | abort "ERROR: niv spec ${name} does not have a 'type' attribute" 105 | else if spec.type == "file" then fetch_file pkgs name spec 106 | else if spec.type == "tarball" then fetch_tarball pkgs name spec 107 | else if spec.type == "git" then fetch_git name spec 108 | else if spec.type == "local" then fetch_local spec 109 | else if spec.type == "builtin-tarball" then fetch_builtin-tarball name 110 | else if spec.type == "builtin-url" then fetch_builtin-url name 111 | else 112 | abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; 113 | 114 | # If the environment variable NIV_OVERRIDE_${name} is set, then use 115 | # the path directly as opposed to the fetched source. 116 | replace = name: drv: 117 | let 118 | saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name; 119 | ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; 120 | in 121 | if ersatz == "" then drv else 122 | # this turns the string into an actual Nix path (for both absolute and 123 | # relative paths) 124 | if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; 125 | 126 | # Ports of functions for older nix versions 127 | 128 | # a Nix version of mapAttrs if the built-in doesn't exist 129 | mapAttrs = builtins.mapAttrs or ( 130 | f: set: with builtins; 131 | listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) 132 | ); 133 | 134 | # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 135 | range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1); 136 | 137 | # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 138 | stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); 139 | 140 | # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 141 | stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); 142 | concatMapStrings = f: list: concatStrings (map f list); 143 | concatStrings = builtins.concatStringsSep ""; 144 | 145 | # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 146 | optionalAttrs = cond: as: if cond then as else {}; 147 | 148 | # fetchTarball version that is compatible between all the versions of Nix 149 | builtins_fetchTarball = { url, name ? null, sha256 }@attrs: 150 | let 151 | inherit (builtins) lessThan nixVersion fetchTarball; 152 | in 153 | if lessThan nixVersion "1.12" then 154 | fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) 155 | else 156 | fetchTarball attrs; 157 | 158 | # fetchurl version that is compatible between all the versions of Nix 159 | builtins_fetchurl = { url, name ? null, sha256 }@attrs: 160 | let 161 | inherit (builtins) lessThan nixVersion fetchurl; 162 | in 163 | if lessThan nixVersion "1.12" then 164 | fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) 165 | else 166 | fetchurl attrs; 167 | 168 | # Create the final "sources" from the config 169 | mkSources = config: 170 | mapAttrs ( 171 | name: spec: 172 | if builtins.hasAttr "outPath" spec 173 | then abort 174 | "The values in sources.json should not have an 'outPath' attribute" 175 | else 176 | spec // { outPath = replace name (fetch config.pkgs name spec); } 177 | ) config.sources; 178 | 179 | # The "config" used by the fetchers 180 | mkConfig = 181 | { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null 182 | , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile) 183 | , system ? builtins.currentSystem 184 | , pkgs ? mkPkgs sources system 185 | }: rec { 186 | # The sources, i.e. the attribute set of spec name to spec 187 | inherit sources; 188 | 189 | # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers 190 | inherit pkgs; 191 | }; 192 | 193 | in 194 | mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } 195 | -------------------------------------------------------------------------------- /overlays/buildpack.nix: -------------------------------------------------------------------------------- 1 | let sources = import ../nix/sources.nix; in 2 | self: super: { 3 | buildpack = super.buildpack.overrideAttrs (oldAttrs: rec { 4 | version = super.lib.strings.removePrefix "v" sources.pack.branch; 5 | src = sources.pack; 6 | buildFlagsArray = [ "-ldflags=-s -w -X github.com/buildpacks/pack/cmd.Version=${version}" ]; 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /overlays/default.nix: -------------------------------------------------------------------------------- 1 | /* This contains various packages we want to overlay. Note that the 2 | * other ".nix" files in this directory are automatically loaded. 3 | */ 4 | final: prev: { 5 | consul-bin = final.callPackage ../pkgs/consul-bin.nix {}; 6 | create-dmg = final.callPackage ../pkgs/create-dmg.nix {}; 7 | nomad-bin = final.callPackage ../pkgs/nomad-bin.nix {}; 8 | terraform-bin = final.callPackage ../pkgs/terraform-bin.nix {}; 9 | 10 | # Fix 1password not working properly on Linux arm64. 11 | #_1password = final.callPackage ../pkgs/1password.nix {}; 12 | } 13 | -------------------------------------------------------------------------------- /overlays/go.nix: -------------------------------------------------------------------------------- 1 | let sources = import ../nix/sources.nix; in 2 | self: super: { 3 | /* 4 | I use a shell.nix in most places so let's just use what Nix provides. 5 | 6 | go = super.go.overrideAttrs (oldAttrs: rec { 7 | version = super.lib.strings.removePrefix "go" sources.go.branch; 8 | src = sources.go; 9 | }); 10 | */ 11 | } 12 | -------------------------------------------------------------------------------- /pkgs/1password.nix: -------------------------------------------------------------------------------- 1 | /* copy from nixpkgs but updated to fix arm64 support */ 2 | { lib, stdenv, fetchzip, autoPatchelfHook, fetchurl, xar, cpio }: 3 | 4 | stdenv.mkDerivation rec { 5 | pname = "1password"; 6 | version = "1.12.2"; 7 | src = 8 | if stdenv.isLinux then 9 | fetchzip 10 | { 11 | url = { 12 | "i686-linux" = "https://cache.agilebits.com/dist/1P/op/pkg/v${version}/op_linux_386_v${version}.zip"; 13 | "x86_64-linux" = "https://cache.agilebits.com/dist/1P/op/pkg/v${version}/op_linux_amd64_v${version}.zip"; 14 | "aarch64-linux" = "https://cache.agilebits.com/dist/1P/op/pkg/v${version}/op_linux_arm64_v${version}.zip"; 15 | }.${stdenv.hostPlatform.system}; 16 | sha256 = { 17 | "i686-linux" = "tCm/vDBASPN9FBSVRJ6BrFc7hdtZWPEAgvokJhjazPg="; 18 | "x86_64-linux" = "3VkVMuTAfeEowkguJi2fd1kG7GwO1VN5GBPgNaH3Zv4="; 19 | "aarch64-linux" = "sha256-17cS/Sf+DPZDlUsDYrO37vI6zjkeDhWXWQ/wk1jSAYo="; 20 | }.${stdenv.hostPlatform.system}; 21 | stripRoot = false; 22 | } else 23 | fetchurl { 24 | url = "https://cache.agilebits.com/dist/1P/op/pkg/v${version}/op_apple_universal_v${version}.pkg"; 25 | sha256 = "xG/6YZdkJxr5Py90rkIyG4mK40yFTmNSfih9jO2uF+4="; 26 | }; 27 | 28 | buildInputs = lib.optionals stdenv.isDarwin [ xar cpio ]; 29 | 30 | unpackPhase = lib.optionalString stdenv.isDarwin '' 31 | xar -xf $src 32 | zcat op.pkg/Payload | cpio -i 33 | ''; 34 | 35 | installPhase = '' 36 | install -D op $out/bin/op 37 | ''; 38 | 39 | dontStrip = stdenv.isDarwin; 40 | 41 | nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ]; 42 | 43 | doInstallCheck = true; 44 | 45 | installCheckPhase = '' 46 | $out/bin/op --version 47 | ''; 48 | 49 | meta = with lib; { 50 | description = "1Password command-line tool"; 51 | homepage = "https://support.1password.com/command-line/"; 52 | downloadPage = "https://app-updates.agilebits.com/product_history/CLI"; 53 | maintainers = with maintainers; [ joelburget marsam ]; 54 | license = licenses.unfree; 55 | platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; 56 | }; 57 | } 58 | -------------------------------------------------------------------------------- /pkgs/consul-bin.nix: -------------------------------------------------------------------------------- 1 | { callPackage ? pkgs.callPackage 2 | , pkgs ? import {} }: 3 | 4 | callPackage (import ./hashicorp/generic.nix) { 5 | name = "consul"; 6 | version = "1.7.3"; 7 | sha256 = "1hws7zfj2g1ag20hqv1yvcrn95q1l7r8ay9vhkwc2aqcbnm18f25"; 8 | } 9 | -------------------------------------------------------------------------------- /pkgs/create-dmg.nix: -------------------------------------------------------------------------------- 1 | { stdenv, fetchFromGitHub, makeWrapper }: 2 | 3 | stdenv.mkDerivation rec { 4 | pname = "create-dmg"; 5 | version = "1.0.0.7"; 6 | 7 | src = fetchFromGitHub { 8 | owner = "andreyvit"; 9 | repo = pname; 10 | rev = "v${version}"; 11 | sha256 = "0cczlp7ds0ylczgb2sn0nzl0jlhy41b7xy40fz4caal2agm7wdbv"; 12 | }; 13 | 14 | nativeBuildInputs = [ makeWrapper ]; 15 | 16 | installPhase = '' 17 | mkdir -p $out/bin 18 | makeWrapper $src/create-dmg $out/bin/create-dmg 19 | ''; 20 | 21 | meta = with stdenv.lib; { 22 | homepage = "https://github.com/andreyvit/create-dmg"; 23 | description = "A shell script to build fancy DMGs"; 24 | license = licenses.mit; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /pkgs/hashicorp/generic.nix: -------------------------------------------------------------------------------- 1 | /* This function creates a derivation for installing binaries directly 2 | * from releases.hashicorp.com. 3 | */ 4 | { name 5 | , version 6 | , sha256 7 | , system ? builtins.currentSystem 8 | , pname ? "${name}-bin" 9 | 10 | , lib 11 | , stdenv 12 | , fetchurl 13 | , unzip 14 | , autoPatchelfHook 15 | }: 16 | 17 | let 18 | # Mapping of Nix systems to the GOOS/GOARCH pairs. 19 | systemMap = { 20 | x86_64-linux = "linux_amd64"; 21 | i686-linux = "linux_386"; 22 | x86_64-darwin = "darwin_amd64"; 23 | i686-darwin = "darwin_386"; 24 | aarch64-linux = "linux_arm64"; 25 | }; 26 | 27 | # Get our system 28 | goSystem = systemMap.${system} or (throw "unsupported system: ${system}"); 29 | 30 | # url for downloading composed of all the other stuff we built up. 31 | url = "https://releases.hashicorp.com/${name}/${version}/${name}_${version}_${goSystem}.zip"; 32 | in stdenv.mkDerivation { 33 | inherit pname version; 34 | src = fetchurl { inherit url sha256; }; 35 | 36 | # Our source is right where the unzip happens, not in a "src/" directory (default) 37 | sourceRoot = "."; 38 | 39 | # Stripping breaks darwin Go binaries 40 | dontStrip = lib.strings.hasPrefix "darwin" goSystem; 41 | 42 | nativeBuildInputs = [ unzip ] ++ (if stdenv.isLinux then [ 43 | # On Linux we need to do this so executables work 44 | autoPatchelfHook 45 | ] else []); 46 | 47 | installPhase = '' 48 | mkdir -p $out/bin 49 | mv ${name} $out/bin 50 | ''; 51 | } 52 | -------------------------------------------------------------------------------- /pkgs/nomad-bin.nix: -------------------------------------------------------------------------------- 1 | { callPackage ? pkgs.callPackage 2 | , pkgs ? import {} }: 3 | 4 | callPackage (import ./hashicorp/generic.nix) { 5 | name = "nomad"; 6 | version = "1.0.4"; 7 | sha256 = "0h78akj9hczgv4wrzwy93wxh8ki51b0g55n39i8ak3kc6sqvif6v"; 8 | } 9 | -------------------------------------------------------------------------------- /pkgs/parallels-tools/default.nix: -------------------------------------------------------------------------------- 1 | # Credit: https://github.com/wegank/nixos-config/tree/main/hardware/parallels-unfree 2 | { stdenv 3 | , lib 4 | , makeWrapper 5 | , p7zip 6 | , gawk 7 | , util-linux 8 | , xorg 9 | , glib 10 | , dbus-glib 11 | , zlib 12 | , kernel 13 | , libsOnly ? false 14 | , fetchurl 15 | , undmg 16 | , perl 17 | , autoPatchelfHook 18 | }: 19 | 20 | stdenv.mkDerivation rec { 21 | version = "18.3.1-53614"; 22 | pname = "prl-tools"; 23 | 24 | # We download the full distribution to extract prl-tools-lin.iso from 25 | # => ${dmg}/Parallels\ Desktop.app/Contents/Resources/Tools/prl-tools-lin.iso 26 | src = fetchurl { 27 | url = "https://download.parallels.com/desktop/v${lib.versions.major version}/${version}/ParallelsDesktop-${version}.dmg"; 28 | sha256 = "sha256-MZtNxByY2GSoPFeH9mPieCPPNfUgfla+lYgpeD+SgOc="; 29 | }; 30 | 31 | # patches = [./prl-tools-6.0.patch]; 32 | 33 | hardeningDisable = [ "pic" "format" ]; 34 | 35 | nativeBuildInputs = [ p7zip undmg perl autoPatchelfHook ] 36 | ++ lib.optionals (!libsOnly) [ makeWrapper ] ++ kernel.moduleBuildDependencies; 37 | 38 | buildInputs = with xorg; [ libXrandr libXext libX11 libXcomposite libXinerama ] 39 | ++ lib.optionals (!libsOnly) [ libXi glib dbus-glib zlib ]; 40 | 41 | runtimeDependencies = [ glib xorg.libXrandr ]; 42 | 43 | inherit libsOnly; 44 | 45 | unpackPhase = '' 46 | undmg "${src}" 47 | export sourceRoot=prl-tools-build 48 | 7z x "Parallels Desktop.app/Contents/Resources/Tools/prl-tools-lin${lib.optionalString stdenv.isAarch64 "-arm"}.iso" -o$sourceRoot 49 | if test -z "$libsOnly"; then 50 | ( cd $sourceRoot/kmods; tar -xaf prl_mod.tar.gz ) 51 | fi 52 | ''; 53 | 54 | kernelVersion = lib.optionalString (!libsOnly) kernel.modDirVersion; 55 | kernelDir = lib.optionalString (!libsOnly) "${kernel.dev}/lib/modules/${kernelVersion}"; 56 | scriptPath = lib.concatStringsSep ":" (lib.optionals (!libsOnly) [ "${util-linux}/bin" "${gawk}/bin" ]); 57 | 58 | buildPhase = '' 59 | if test -z "$libsOnly"; then 60 | ( # kernel modules 61 | cd kmods 62 | make -f Makefile.kmods \ 63 | KSRC=$kernelDir/source \ 64 | HEADERS_CHECK_DIR=$kernelDir/source \ 65 | KERNEL_DIR=$kernelDir/build \ 66 | SRC=$kernelDir/build \ 67 | KVER=$kernelVersion 68 | ) 69 | fi 70 | ''; 71 | 72 | installPhase = '' 73 | if test -z "$libsOnly"; then 74 | ( # kernel modules 75 | cd kmods 76 | mkdir -p $out/lib/modules/${kernelVersion}/extra 77 | cp prl_fs/SharedFolders/Guest/Linux/prl_fs/prl_fs.ko $out/lib/modules/${kernelVersion}/extra 78 | cp prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.ko $out/lib/modules/${kernelVersion}/extra 79 | cp prl_tg/Toolgate/Guest/Linux/prl_tg/prl_tg.ko $out/lib/modules/${kernelVersion}/extra 80 | ${lib.optionalString stdenv.isAarch64 81 | "cp prl_notifier/Installation/lnx/prl_notifier/prl_notifier.ko $out/lib/modules/${kernelVersion}/extra"} 82 | ) 83 | fi 84 | ( # tools 85 | cd tools/tools${if stdenv.isAarch64 then "-arm64" else if stdenv.isx86_64 then "64" else "32"} 86 | mkdir -p $out/lib 87 | if test -z "$libsOnly"; then 88 | # install binaries 89 | for i in bin/* sbin/prl_nettool sbin/prl_snapshot; do 90 | install -Dm755 $i $out/$i 91 | done 92 | mkdir -p $out/bin 93 | install -Dm755 ../../tools/prlfsmountd.sh $out/sbin/prlfsmountd 94 | wrapProgram $out/sbin/prlfsmountd \ 95 | --prefix PATH ':' "$scriptPath" 96 | for i in lib/libPrl*.0.0; do 97 | cp $i $out/lib 98 | ln -s $out/$i $out/''${i%.0.0} 99 | done 100 | mkdir -p $out/share/man/man8 101 | install -Dm644 ../mount.prl_fs.8 $out/share/man/man8 102 | mkdir -p $out/etc/pm/sleep.d 103 | install -Dm644 ../99prltoolsd-hibernate $out/etc/pm/sleep.d 104 | fi 105 | ) 106 | ''; 107 | 108 | meta = with lib; { 109 | description = "Parallels Tools for Linux guests"; 110 | homepage = "https://parallels.com"; 111 | platforms = [ "aarch64-linux" "i686-linux" "x86_64-linux" ]; 112 | license = licenses.unfree; 113 | }; 114 | } 115 | -------------------------------------------------------------------------------- /pkgs/parallels-tools/prl-tools-5.18.patch: -------------------------------------------------------------------------------- 1 | diff -puNr prl-tools-build/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c prl-tools-build/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c 2 | --- prl-tools-build/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c 3 | +++ prl-tools-build/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c 4 | @@ -382,7 +382,7 @@ static int prl_tg_initialize(struct tg_d 5 | } 6 | #endif 7 | /* Set DMA ability. Only lower 4G is possible to address */ 8 | - rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(64)); 9 | + rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)); 10 | if (rc) { 11 | printk(KERN_ERR "no usable DMA configuration\n"); 12 | goto err_out; 13 | diff -puNr prl-tools-build/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c prl-tools-build/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c 14 | --- prl-tools-build/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c 15 | +++ prl-tools-build/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c 16 | @@ -76,7 +76,7 @@ static int tg_req_map_internal(struct TG 17 | uple->p[i] = vmalloc_to_page(mem); 18 | page_cache_get(uple->p[i]); 19 | 20 | - dst->RequestPages[i] = pci_map_page(pdev, uple->p[i], 0, PAGE_SIZE, DMA_BIDIRECTIONAL) >> PAGE_SHIFT; 21 | + dst->RequestPages[i] = dma_map_page(&pdev->dev, uple->p[i], 0, PAGE_SIZE, DMA_BIDIRECTIONAL) >> PAGE_SHIFT; 22 | if (!dst->RequestPages[i]) { 23 | page_cache_release(uple->p[i]); 24 | goto err; 25 | @@ -88,7 +88,7 @@ static int tg_req_map_internal(struct TG 26 | 27 | err: 28 | for (i = 0; i < uple->count; i++) { 29 | - pci_unmap_page(pdev, dst->RequestPages[i] << PAGE_SHIFT, PAGE_SIZE, DMA_BIDIRECTIONAL); 30 | + dma_unmap_page(&pdev->dev, dst->RequestPages[i] << PAGE_SHIFT, PAGE_SIZE, DMA_BIDIRECTIONAL); 31 | page_cache_release(uple->p[i]); 32 | } 33 | kfree(uple); 34 | @@ -129,7 +129,7 @@ static TG_PAGED_BUFFER *tg_req_map_user_ 35 | pfn = (u64 *)dbuf - 1; 36 | 37 | for (; npages > 0; npages--, mapped++) { 38 | - dma_addr_t addr = pci_map_page(pdev, uple->p[npages-1], 0, PAGE_SIZE, DMA_BIDIRECTIONAL); 39 | + dma_addr_t addr = dma_map_page(&pdev->dev, uple->p[npages-1], 0, PAGE_SIZE, DMA_BIDIRECTIONAL); 40 | 41 | if (!addr) { 42 | DPRINTK("[3] %d < %d \n", got, npages); 43 | @@ -144,7 +144,7 @@ static TG_PAGED_BUFFER *tg_req_map_user_ 44 | 45 | err_unmap: 46 | for (i = 0; i < mapped; i++, pfn++) 47 | - pci_unmap_page(pdev, *pfn << PAGE_SHIFT, PAGE_SIZE, DMA_BIDIRECTIONAL); 48 | + dma_unmap_page(&pdev->dev, *pfn << PAGE_SHIFT, PAGE_SIZE, DMA_BIDIRECTIONAL); 49 | 50 | err_put: 51 | for(i = 0; i < got; i++) 52 | @@ -176,7 +176,7 @@ static TG_PAGED_BUFFER *tg_req_map_kerne 53 | goto err; 54 | } 55 | 56 | - addr = pci_map_page(pdev, page, 0, PAGE_SIZE, DMA_BIDIRECTIONAL); 57 | + addr = dma_map_page(&pdev->dev, page, 0, PAGE_SIZE, DMA_BIDIRECTIONAL); 58 | if (!addr) { 59 | DPRINTK("[2] va:%p can't map\n", buffer); 60 | goto err; 61 | @@ -189,7 +189,7 @@ static TG_PAGED_BUFFER *tg_req_map_kerne 62 | 63 | err: 64 | for (; i > 0; i--, pfn--) 65 | - pci_unmap_page(pdev, *pfn << PAGE_SHIFT, PAGE_SIZE, DMA_BIDIRECTIONAL); 66 | + dma_unmap_page(&pdev->dev, *pfn << PAGE_SHIFT, PAGE_SIZE, DMA_BIDIRECTIONAL); 67 | 68 | return ERR_PTR(-ENOMEM); 69 | } 70 | @@ -203,7 +203,7 @@ static inline int tg_req_unmap_internal( 71 | dst->RequestSize + ~PAGE_MASK) >> PAGE_SHIFT; 72 | 73 | for (i = 0; i < count; i++) 74 | - pci_unmap_page(req->dev->pci_dev, dst->RequestPages[i] << PAGE_SHIFT, PAGE_SIZE, DMA_BIDIRECTIONAL); 75 | + dma_unmap_page(&req->dev->pci_dev->dev, dst->RequestPages[i] << PAGE_SHIFT, PAGE_SIZE, DMA_BIDIRECTIONAL); 76 | 77 | return count; 78 | } 79 | @@ -264,7 +264,7 @@ static void tg_req_unmap_pages(struct TG 80 | 81 | pfn = (u64 *)(dbuf + 1); 82 | for (; npages > 0; npages--, pfn++) 83 | - pci_unmap_page(pdev, (*pfn) << PAGE_SHIFT, PAGE_SIZE, DMA_BIDIRECTIONAL); 84 | + dma_unmap_page(&pdev->dev, (*pfn) << PAGE_SHIFT, PAGE_SIZE, DMA_BIDIRECTIONAL); 85 | 86 | dbuf = (TG_PAGED_BUFFER *)pfn; 87 | } 88 | @@ -374,7 +374,7 @@ static int tg_req_submit(struct TG_PENDI 89 | * also no any offset inside page needed. 90 | */ 91 | req->pg = vmalloc_to_page(dst); 92 | - req->phys = pci_map_page(dev->pci_dev, vmalloc_to_page(dst), 0, PAGE_SIZE, DMA_BIDIRECTIONAL); 93 | + req->phys = dma_map_page(&dev->pci_dev->dev, vmalloc_to_page(dst), 0, PAGE_SIZE, DMA_BIDIRECTIONAL); 94 | if (!req->phys) { 95 | DPRINTK("Can not allocate memory for DMA mapping\n"); 96 | goto out; 97 | @@ -405,7 +405,7 @@ static int tg_req_submit(struct TG_PENDI 98 | out: 99 | if (ret != TG_STATUS_PENDING) { 100 | page_cache_release(req->pg); 101 | - pci_unmap_page(dev->pci_dev, req->phys, PAGE_SIZE, DMA_BIDIRECTIONAL); 102 | + dma_unmap_page(&dev->pci_dev->dev, req->phys, PAGE_SIZE, DMA_BIDIRECTIONAL); 103 | } 104 | 105 | DPRINTK("EXIT\n"); 106 | @@ -460,7 +460,7 @@ out_wait: 107 | wait_for_completion(&req->waiting); 108 | out: 109 | page_cache_release(req->pg); 110 | - pci_unmap_page(dev->pci_dev, req->phys, PAGE_SIZE, DMA_BIDIRECTIONAL); 111 | + dma_unmap_page(&dev->pci_dev->dev, req->phys, PAGE_SIZE, DMA_BIDIRECTIONAL); 112 | DPRINTK("EXIT\n"); 113 | return ret; 114 | } 115 | diff -puNr prl-tools-build/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c prl-tools-build/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c 116 | --- prl-tools-build/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c 117 | +++ prl-tools-build/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c 118 | @@ -16,6 +16,7 @@ 119 | #include 120 | #include 121 | #include 122 | +#include 123 | 124 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 40)) && \ 125 | (LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)) 126 | @@ -57,7 +58,7 @@ unsigned long *prlfs_dfl( struct dentry 127 | } 128 | 129 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) 130 | -#define prl_uaccess_kernel() uaccess_kernel() 131 | +#define prl_uaccess_kernel() (false) 132 | #else 133 | #define prl_uaccess_kernel() segment_eq(get_fs(), KERNEL_DS) 134 | #endif 135 | @@ -954,7 +955,7 @@ static const struct address_space_operat 136 | .writepage = prlfs_writepage, 137 | .write_begin = simple_write_begin, 138 | .write_end = prlfs_write_end, 139 | - .set_page_dirty = __set_page_dirty_nobuffers, 140 | + .dirty_folio = filemap_dirty_folio, 141 | }; 142 | 143 | 144 | -------------------------------------------------------------------------------- /pkgs/parallels-tools/prl-tools-5.19.patch: -------------------------------------------------------------------------------- 1 | diff -puNr prl-tools-build/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c prl-tools-build/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c 2 | --- prl-tools-build/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c 3 | +++ prl-tools-build/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c 4 | @@ -851,7 +851,7 @@ ssize_t prlfs_rw(struct inode *inode, char *buf, size_t size, 5 | loff_t *off, unsigned int rw, int user, int flags); 6 | 7 | 8 | -int prlfs_readpage(struct file *file, struct page *page) { 9 | +int prlfs_read_folio(struct file *file, struct folio *folio) { 10 | char *buf; 11 | ssize_t ret; 12 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) 13 | @@ -859,6 +859,7 @@ int prlfs_readpage(struct file *file, struct page *page) { 14 | #else 15 | struct inode *inode = file->f_dentry->d_inode; 16 | #endif 17 | + struct page *page = &folio->page; 18 | loff_t off = page->index << PAGE_SHIFT; 19 | 20 | if (!file) { 21 | @@ -950,7 +951,7 @@ out: 22 | } 23 | 24 | static const struct address_space_operations prlfs_aops = { 25 | - .readpage = prlfs_readpage, 26 | + .read_folio = prlfs_read_folio, 27 | .writepage = prlfs_writepage, 28 | .write_begin = simple_write_begin, 29 | .write_end = prlfs_write_end, 30 | -------------------------------------------------------------------------------- /pkgs/parallels-tools/prl-tools-6.0.patch: -------------------------------------------------------------------------------- 1 | diff --git a/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c b/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c 2 | index baa8a19..6788791 100644 3 | --- a/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c 4 | +++ b/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c 5 | @@ -306,7 +306,7 @@ int seq_show(struct seq_file *file, void *data) 6 | char buf[BDEVNAME_SIZE]; 7 | 8 | fsb = list_entry((struct list_head*)data, struct frozen_sb, list); 9 | - bdevname(fsb->sb->s_bdev, buf); 10 | + snprintf(buf, sizeof(buf), "%pg", fsb->sb->s_bdev); 11 | seq_printf(file, "%s\n", buf); 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /pkgs/terraform-bin.nix: -------------------------------------------------------------------------------- 1 | { callPackage ? pkgs.callPackage 2 | , pkgs ? import {} }: 3 | 4 | callPackage (import ./hashicorp/generic.nix) { 5 | name = "terraform"; 6 | version = "1.0.4"; 7 | sha256 = "XAvk1S3nIUPizXjkF+4t1YLOIp1zeE/RlEREX6bhM14="; 8 | } 9 | -------------------------------------------------------------------------------- /users/mitchellh/RectangleConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "bundleId" : "com.knollsoft.Rectangle", 3 | "defaults" : { 4 | "allowAnyShortcut" : { 5 | "bool" : true 6 | }, 7 | "almostMaximizeHeight" : { 8 | "float" : 0 9 | }, 10 | "almostMaximizeWidth" : { 11 | "float" : 0 12 | }, 13 | "alternateDefaultShortcuts" : { 14 | "bool" : true 15 | }, 16 | "altThirdCycle" : { 17 | "int" : 0 18 | }, 19 | "alwaysAccountForStage" : { 20 | "int" : 0 21 | }, 22 | "applyGapsToMaximize" : { 23 | "int" : 0 24 | }, 25 | "applyGapsToMaximizeHeight" : { 26 | "int" : 0 27 | }, 28 | "attemptMatchOnNextPrevDisplay" : { 29 | "int" : 0 30 | }, 31 | "autoMaximize" : { 32 | "int" : 0 33 | }, 34 | "cascadeAllDeltaSize" : { 35 | "float" : 30 36 | }, 37 | "centeredDirectionalMove" : { 38 | "int" : 0 39 | }, 40 | "centerHalfCycles" : { 41 | "int" : 0 42 | }, 43 | "cornerSnapAreaSize" : { 44 | "float" : 20 45 | }, 46 | "curtainChangeSize" : { 47 | "int" : 0 48 | }, 49 | "disabledApps" : { 50 | 51 | }, 52 | "dragFromStage" : { 53 | "int" : 0 54 | }, 55 | "enhancedUI" : { 56 | "int" : 1 57 | }, 58 | "footprintAlpha" : { 59 | "float" : 0.30000001192092896 60 | }, 61 | "footprintAnimationDurationMultiplier" : { 62 | "float" : 0 63 | }, 64 | "footprintBorderWidth" : { 65 | "float" : 2 66 | }, 67 | "footprintColor" : { 68 | 69 | }, 70 | "footprintFade" : { 71 | "int" : 0 72 | }, 73 | "fullIgnoreBundleIds" : { 74 | 75 | }, 76 | "gapSize" : { 77 | "float" : 0 78 | }, 79 | "hideMenubarIcon" : { 80 | "bool" : true 81 | }, 82 | "ignoredSnapAreas" : { 83 | "int" : 0 84 | }, 85 | "landscapeSnapAreas" : { 86 | 87 | }, 88 | "launchOnLogin" : { 89 | "bool" : true 90 | }, 91 | "minimumWindowHeight" : { 92 | "float" : 0 93 | }, 94 | "minimumWindowWidth" : { 95 | "float" : 0 96 | }, 97 | "missionControlDragging" : { 98 | "int" : 0 99 | }, 100 | "missionControlDraggingAllowedOffscreenDistance" : { 101 | "float" : 25 102 | }, 103 | "missionControlDraggingDisallowedDuration" : { 104 | "int" : 250 105 | }, 106 | "moveCursor" : { 107 | "int" : 0 108 | }, 109 | "moveCursorAcrossDisplays" : { 110 | "int" : 0 111 | }, 112 | "notifiedOfProblemApps" : { 113 | "bool" : false 114 | }, 115 | "obtainWindowOnClick" : { 116 | "int" : 0 117 | }, 118 | "portraitSnapAreas" : { 119 | 120 | }, 121 | "relaunchOpensMenu" : { 122 | "bool" : false 123 | }, 124 | "resizeOnDirectionalMove" : { 125 | "bool" : false 126 | }, 127 | "screenEdgeGapBottom" : { 128 | "float" : 0 129 | }, 130 | "screenEdgeGapLeft" : { 131 | "float" : 0 132 | }, 133 | "screenEdgeGapRight" : { 134 | "float" : 0 135 | }, 136 | "screenEdgeGapsOnMainScreenOnly" : { 137 | "bool" : false 138 | }, 139 | "screenEdgeGapTop" : { 140 | "float" : 0 141 | }, 142 | "shortEdgeSnapAreaSize" : { 143 | "float" : 145 144 | }, 145 | "showAllActionsInMenu" : { 146 | "int" : 0 147 | }, 148 | "sixthsSnapArea" : { 149 | "int" : 0 150 | }, 151 | "sizeOffset" : { 152 | "float" : 0 153 | }, 154 | "snapEdgeMarginBottom" : { 155 | "float" : 5 156 | }, 157 | "snapEdgeMarginLeft" : { 158 | "float" : 5 159 | }, 160 | "snapEdgeMarginRight" : { 161 | "float" : 5 162 | }, 163 | "snapEdgeMarginTop" : { 164 | "float" : 5 165 | }, 166 | "snapModifiers" : { 167 | "int" : 0 168 | }, 169 | "specifiedHeight" : { 170 | "float" : 1050 171 | }, 172 | "specifiedWidth" : { 173 | "float" : 1680 174 | }, 175 | "stageSize" : { 176 | "float" : 190 177 | }, 178 | "subsequentExecutionMode" : { 179 | "int" : 1 180 | }, 181 | "SUEnableAutomaticChecks" : { 182 | "bool" : true 183 | }, 184 | "todo" : { 185 | "int" : 0 186 | }, 187 | "todoApplication" : { 188 | 189 | }, 190 | "todoMode" : { 191 | "bool" : false 192 | }, 193 | "todoSidebarWidth" : { 194 | "float" : 400 195 | }, 196 | "traverseSingleScreen" : { 197 | "int" : 0 198 | }, 199 | "unsnapRestore" : { 200 | "int" : 0 201 | }, 202 | "windowSnapping" : { 203 | "int" : 0 204 | } 205 | }, 206 | "shortcuts" : { 207 | "bottomHalf" : { 208 | "keyCode" : 125, 209 | "modifierFlags" : 786432 210 | }, 211 | "bottomLeft" : { 212 | "keyCode" : 38, 213 | "modifierFlags" : 786432 214 | }, 215 | "bottomRight" : { 216 | "keyCode" : 40, 217 | "modifierFlags" : 786432 218 | }, 219 | "center" : { 220 | "keyCode" : 8, 221 | "modifierFlags" : 786432 222 | }, 223 | "centerThird" : { 224 | "keyCode" : 3, 225 | "modifierFlags" : 786432 226 | }, 227 | "firstThird" : { 228 | "keyCode" : 2, 229 | "modifierFlags" : 786432 230 | }, 231 | "firstTwoThirds" : { 232 | "keyCode" : 14, 233 | "modifierFlags" : 786432 234 | }, 235 | "larger" : { 236 | "keyCode" : 24, 237 | "modifierFlags" : 786432 238 | }, 239 | "lastThird" : { 240 | "keyCode" : 5, 241 | "modifierFlags" : 786432 242 | }, 243 | "lastTwoThirds" : { 244 | "keyCode" : 17, 245 | "modifierFlags" : 786432 246 | }, 247 | "leftHalf" : { 248 | "keyCode" : 4, 249 | "modifierFlags" : 1310720 250 | }, 251 | "maximize" : { 252 | "keyCode" : 3, 253 | "modifierFlags" : 1310720 254 | }, 255 | "maximizeHeight" : { 256 | "keyCode" : 126, 257 | "modifierFlags" : 917504 258 | }, 259 | "nextDisplay" : { 260 | "keyCode" : 124, 261 | "modifierFlags" : 1835008 262 | }, 263 | "previousDisplay" : { 264 | "keyCode" : 123, 265 | "modifierFlags" : 1835008 266 | }, 267 | "restore" : { 268 | "keyCode" : 51, 269 | "modifierFlags" : 786432 270 | }, 271 | "rightHalf" : { 272 | "keyCode" : 37, 273 | "modifierFlags" : 1310720 274 | }, 275 | "smaller" : { 276 | "keyCode" : 27, 277 | "modifierFlags" : 786432 278 | }, 279 | "topHalf" : { 280 | "keyCode" : 126, 281 | "modifierFlags" : 786432 282 | }, 283 | "topLeft" : { 284 | "keyCode" : 32, 285 | "modifierFlags" : 786432 286 | }, 287 | "topRight" : { 288 | "keyCode" : 34, 289 | "modifierFlags" : 786432 290 | } 291 | }, 292 | "version" : "71" 293 | } -------------------------------------------------------------------------------- /users/mitchellh/Xresources: -------------------------------------------------------------------------------- 1 | ! URXVT FONT SETTINGS 2 | !------------------------------------------------ 3 | Xft.dpi: 180 4 | Xft.autohint: true 5 | Xft.antialias: true 6 | Xft.hinting: true 7 | Xft.hintstyle: hintslight 8 | Xft.rgba: rgb 9 | Xft.lcdfilter: lcddefault 10 | 11 | ! TERMINAL COLORS 12 | !------------------------------------------------ 13 | *background: #1D1F21 14 | *foreground: #C5C8C6 15 | *cursorColor: #C3FF00 16 | 17 | ! black 18 | *color0: #282A2E 19 | *color8: #373B41 20 | ! red 21 | *color1: #A54242 22 | *color9: #CC6666 23 | ! green 24 | *color2: #8C9440 25 | *color10: #B5BD68 26 | ! yellow 27 | *color3: #DE935F 28 | *color11: #F0C674 29 | ! blue 30 | *color4: #5F819D 31 | *color12: #81A2BE 32 | ! magenta 33 | *color5: #85678F 34 | *color13: #B294BB 35 | ! cyan 36 | *color6: #5E8D87 37 | *color14: #8ABEB7 38 | ! white 39 | *color7: #707880 40 | *color15: #C5C8C6 41 | 42 | ! URXVT 43 | !---------------------------------------------------------------------- 44 | ! Colors 45 | ! bold, italic, underline 46 | URxvt.colorBD: #B5BD68 47 | URxvt.colorIT: #B294BB 48 | URxvt.colorUL: #81A2BE 49 | -------------------------------------------------------------------------------- /users/mitchellh/alacritty.yml: -------------------------------------------------------------------------------- 1 | window: 2 | # Make the window match better 3 | decorations: transparent 4 | 5 | # We require padding so that with a transparent window the prompt 6 | # doesn't start right up at the top. 7 | padding: 8 | y: 27 9 | 10 | # Fish uses the title so let this happen 11 | dynamic_title: true 12 | 13 | cursor: 14 | style: Block 15 | 16 | font: 17 | size: 13.0 18 | normal: 19 | family: "Monaco for Powerline" 20 | 21 | key_bindings: 22 | - { key: K, mods: Command, action: ClearHistory } 23 | - { key: V, mods: Command, action: Paste } 24 | - { key: C, mods: Command, action: Copy } 25 | - { key: Key0, mods: Command, action: ResetFontSize } 26 | - { key: Equals, mods: Command, action: IncreaseFontSize } 27 | - { key: Plus, mods: Command, action: IncreaseFontSize } 28 | - { key: NumpadAdd, mods: Command, action: IncreaseFontSize } 29 | - { key: Minus, mods: Command, action: DecreaseFontSize } 30 | - { key: NumpadSubtract, mods: Command, action: DecreaseFontSize } 31 | 32 | #- { key: K, mods: Command, mode: ~Vi, chars: "\x0c" } 33 | #- { key: Key0, mods: Command, action: ResetFontSize } 34 | #- { key: Equals, mods: Command, action: IncreaseFontSize } 35 | #- { key: Plus, mods: Command, action: IncreaseFontSize } 36 | #- { key: NumpadAdd, mods: Command, action: IncreaseFontSize } 37 | #- { key: Minus, mods: Command, action: DecreaseFontSize } 38 | #- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize } 39 | #- { key: K, mods: Command, action: ClearHistory } 40 | #- { key: C, mods: Command, mode: Vi, action: ClearSelection } 41 | #- { key: H, mods: Command, action: Hide } 42 | #- { key: M, mods: Command, action: Minimize } 43 | #- { key: Q, mods: Command, action: Quit } 44 | #- { key: W, mods: Command, action: Quit } 45 | #- { key: N, mods: Command, action: SpawnNewInstance } 46 | #- { key: F, mods: Command|Control, action: ToggleFullscreen } 47 | #- { key: F, mods: Command, action: SearchForward } 48 | #- { key: B, mods: Command, action: SearchBackward } 49 | 50 | -------------------------------------------------------------------------------- /users/mitchellh/bashrc: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------- 2 | # Prompt 3 | #--------------------------------------------------------------------------- 4 | RED="\033[0;31m" 5 | BROWN="\033[0;33m" 6 | GREY="\033[0;97m" 7 | GREEN="\033[0;32m" 8 | BLUE="\033[0;34m" 9 | PS_CLEAR="\033[0m" 10 | SCREEN_ESC="\033k\033\134" 11 | 12 | COLOR1="${BLUE}" 13 | COLOR2="${BLUE}" 14 | P="\$" 15 | 16 | prompt_simple() { 17 | unset PROMPT_COMMAND 18 | PS1="\W\$(parse_git_branch) → " 19 | PS2="> " 20 | } 21 | 22 | prompt_compact() { 23 | unset PROMPT_COMMAND 24 | PS1="${COLOR1}${P}${PS_CLEAR} " 25 | PS2="> " 26 | } 27 | 28 | prompt_color() { 29 | PS1="${GREEN}\W\$(parse_git_branch) → ${GREY}" 30 | PS2="\033[33;1mcontinue \033[0m\033[1m> " 31 | } 32 | 33 | parse_git_branch() { 34 | [ -d .git ] || return 1 35 | git symbolic-ref HEAD 2> /dev/null | sed 's#\(.*\)\/\([^\/]*\)$# \2#' 36 | } 37 | 38 | # Set default prompt if interactive 39 | test -n "$PS1" && 40 | prompt_color 41 | 42 | # Ghostty setup. For testing. 43 | # if [ -n "$GHOSTTY_RESOURCES_DIR" ]; then 44 | # builtin source "${GHOSTTY_RESOURCES_DIR}/shell-integration/bash/ghostty.bash" 45 | # fi 46 | -------------------------------------------------------------------------------- /users/mitchellh/config.fish: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------- 2 | # SSH Agent 3 | #------------------------------------------------------------------------------- 4 | function __ssh_agent_is_started -d "check if ssh agent is already started" 5 | if begin; test -f $SSH_ENV; and test -z "$SSH_AGENT_PID"; end 6 | source $SSH_ENV > /dev/null 7 | end 8 | 9 | if test -z "$SSH_AGENT_PID" 10 | return 1 11 | end 12 | 13 | ssh-add -l > /dev/null 2>&1 14 | if test $status -eq 2 15 | return 1 16 | end 17 | end 18 | 19 | function __ssh_agent_start -d "start a new ssh agent" 20 | ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV 21 | chmod 600 $SSH_ENV 22 | source $SSH_ENV > /dev/null 23 | ssh-add 24 | end 25 | 26 | if not test -d $HOME/.ssh 27 | mkdir -p $HOME/.ssh 28 | chmod 0700 $HOME/.ssh 29 | end 30 | 31 | if test -d $HOME/.gnupg 32 | chmod 0700 $HOME/.gnupg 33 | end 34 | 35 | if test -z "$SSH_ENV" 36 | set -xg SSH_ENV $HOME/.ssh/environment 37 | end 38 | 39 | if not __ssh_agent_is_started 40 | __ssh_agent_start 41 | end 42 | 43 | #------------------------------------------------------------------------------- 44 | # Ghostty Shell Integration 45 | #------------------------------------------------------------------------------- 46 | # Ghostty supports auto-injection but Nix-darwin hard overwrites XDG_DATA_DIRS 47 | # which make it so that we can't use the auto-injection. We have to source 48 | # manually. 49 | if set -q GHOSTTY_RESOURCES_DIR 50 | source "$GHOSTTY_RESOURCES_DIR/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish" 51 | end 52 | 53 | #------------------------------------------------------------------------------- 54 | # Programs 55 | #------------------------------------------------------------------------------- 56 | # Vim: We should move this somewhere else but it works for now 57 | mkdir -p $HOME/.vim/{backup,swap,undo} 58 | 59 | # Homebrew 60 | if test -d "/opt/homebrew" 61 | set -gx HOMEBREW_PREFIX "/opt/homebrew"; 62 | set -gx HOMEBREW_CELLAR "/opt/homebrew/Cellar"; 63 | set -gx HOMEBREW_REPOSITORY "/opt/homebrew"; 64 | set -q PATH; or set PATH ''; set -gx PATH "/opt/homebrew/bin" "/opt/homebrew/sbin" $PATH; 65 | set -q MANPATH; or set MANPATH ''; set -gx MANPATH "/opt/homebrew/share/man" $MANPATH; 66 | set -q INFOPATH; or set INFOPATH ''; set -gx INFOPATH "/opt/homebrew/share/info" $INFOPATH; 67 | end 68 | 69 | # Hammerspoon 70 | if test -d "/Applications/Hammerspoon.app" 71 | set -q PATH; or set PATH ''; set -gx PATH "/Applications/Hammerspoon.app/Contents/Frameworks/hs" $PATH; 72 | end 73 | 74 | # Add ~/.local/bin 75 | set -q PATH; or set PATH ''; set -gx PATH "$HOME/.local/bin" $PATH; 76 | 77 | #------------------------------------------------------------------------------- 78 | # Prompt 79 | #------------------------------------------------------------------------------- 80 | # Do not show any greeting 81 | set --universal --erase fish_greeting 82 | function fish_greeting; end 83 | funcsave fish_greeting 84 | 85 | # bobthefish theme 86 | set -g theme_color_scheme dracula 87 | 88 | # My color scheme 89 | set -U fish_color_normal normal 90 | set -U fish_color_command F8F8F2 91 | set -U fish_color_quote F1FA8C 92 | set -U fish_color_redirection 8BE9FD 93 | set -U fish_color_end 50FA7B 94 | set -U fish_color_error FF5555 95 | set -U fish_color_param 5FFFFF 96 | set -U fish_color_comment 6272A4 97 | set -U fish_color_match --background=brblue 98 | set -U fish_color_selection white --bold --background=brblack 99 | set -U fish_color_search_match bryellow --background=brblack 100 | set -U fish_color_history_current --bold 101 | set -U fish_color_operator 00a6b2 102 | set -U fish_color_escape 00a6b2 103 | set -U fish_color_cwd green 104 | set -U fish_color_cwd_root red 105 | set -U fish_color_valid_path --underline 106 | set -U fish_color_autosuggestion BD93F9 107 | set -U fish_color_user brgreen 108 | set -U fish_color_host normal 109 | set -U fish_color_cancel -r 110 | set -U fish_pager_color_completion normal 111 | set -U fish_pager_color_description B3A06D yellow 112 | set -U fish_pager_color_prefix white --bold --underline 113 | set -U fish_pager_color_progress brwhite --background=cyan 114 | 115 | # Override the nix prompt for the theme so that we show a more concise prompt 116 | function __bobthefish_prompt_nix -S -d 'Display current nix environment' 117 | [ "$theme_display_nix" = 'no' -o -z "$IN_NIX_SHELL" ] 118 | and return 119 | 120 | __bobthefish_start_segment $color_nix 121 | echo -ns N ' ' 122 | 123 | set_color normal 124 | end 125 | 126 | #------------------------------------------------------------------------------- 127 | # Vars 128 | #------------------------------------------------------------------------------- 129 | # Modify our path to include our Go binaries 130 | contains $HOME/code/go/bin $fish_user_paths; or set -Ua fish_user_paths $HOME/code/go/bin 131 | contains $HOME/bin $fish_user_paths; or set -Ua fish_user_paths $HOME/bin 132 | 133 | # Exported variables 134 | if isatty 135 | set -x GPG_TTY (tty) 136 | end 137 | 138 | # Editor 139 | set -gx EDITOR nvim 140 | 141 | #------------------------------------------------------------------------------- 142 | # Functions 143 | #------------------------------------------------------------------------------- 144 | # Shortcut to setup a nix-shell with fish. This lets you do something like 145 | # `fnix -p go` to get an environment with Go but use the fish shell along 146 | # with it. 147 | alias fnix "nix-shell --run fish" 148 | -------------------------------------------------------------------------------- /users/mitchellh/config.nu: -------------------------------------------------------------------------------- 1 | $env.config.show_banner = false 2 | $env.config.highlight_resolved_externals = true 3 | 4 | # Homebrew setup 5 | if ('/opt/homebrew' | path type) == 'dir' { 6 | $env.HOMEBREW_PREFIX = '/opt/homebrew' 7 | $env.HOMEBREW_CELLAR = '/opt/homebrew/Cellar' 8 | $env.HOMEBREW_REPOSITORY = '/opt/homebrew' 9 | $env.PATH = $env.PATH? | prepend [ 10 | '/opt/homebrew/bin' 11 | '/opt/homebrew/sbin' 12 | ] 13 | $env.MANPATH = $env.MANPATH? | prepend '/opt/homebrew/share/man' 14 | $env.INFOPATH = $env.INFOPATH? | prepend '/opt/homebrew/share/info' 15 | } 16 | 17 | # Ensure we can use the terminal for GPG signing 18 | if (is-terminal --stdin) { 19 | $env.GPG_TTY = (tty) 20 | } 21 | 22 | # Override some commands to use 1password 23 | alias amp = op run -- amp 24 | alias codex = op run -- codex 25 | -------------------------------------------------------------------------------- /users/mitchellh/darwin.nix: -------------------------------------------------------------------------------- 1 | { inputs, pkgs, ... }: 2 | 3 | { 4 | nixpkgs.overlays = import ../../lib/overlays.nix ++ [ 5 | (import ./vim.nix { inherit inputs; }) 6 | ]; 7 | 8 | homebrew = { 9 | enable = true; 10 | casks = [ 11 | "1password" 12 | "cleanshot" 13 | "discord" 14 | "google-chrome" 15 | "hammerspoon" 16 | "imageoptim" 17 | "istat-menus" 18 | "monodraw" 19 | "raycast" 20 | "rectangle" 21 | "screenflow" 22 | "slack" 23 | "spotify" 24 | ]; 25 | }; 26 | 27 | # The user should already exist, but we need to set this up so Nix knows 28 | # what our home directory is (https://github.com/LnL7/nix-darwin/issues/423). 29 | users.users.mitchellh = { 30 | home = "/Users/mitchellh"; 31 | shell = pkgs.fish; 32 | }; 33 | 34 | # Required for some settings like homebrew to know what user to apply to. 35 | system.primaryUser = "mitchellh"; 36 | } 37 | -------------------------------------------------------------------------------- /users/mitchellh/gdbinit: -------------------------------------------------------------------------------- 1 | set confirm off 2 | set print pretty on 3 | set prompt \033[31mgdb $ \033[0m 4 | 5 | # Load gdbinit files wherever they are when we drop into gdb. 6 | set auto-load safe-path / 7 | 8 | #-------------------------------------------------------------------- 9 | # Functions 10 | 11 | define var 12 | if $argc == 0 13 | info variables 14 | end 15 | if $argc == 1 16 | info variables $arg0 17 | end 18 | if $argc > 1 19 | help var 20 | end 21 | end 22 | document var 23 | Print all global and static variable names (symbols), or those matching REGEXP. 24 | Usage: var 25 | end 26 | -------------------------------------------------------------------------------- /users/mitchellh/ghostty.linux: -------------------------------------------------------------------------------- 1 | command = bash -l -c nu 2 | font-size = 12 3 | font-family = JetBrains Mono 4 | background-opacity = 0.95 5 | background-blur-radius = 20 6 | macos-non-native-fullscreen = visible-menu 7 | macos-option-as-alt = left 8 | mouse-hide-while-typing = true 9 | 10 | # Keybinds to match macOS since this is a VM 11 | keybind = super+c=copy_to_clipboard 12 | keybind = super+v=paste_from_clipboard 13 | keybind = super+shift+c=copy_to_clipboard 14 | keybind = super+shift+v=paste_from_clipboard 15 | keybind = super+equal=increase_font_size:1 16 | keybind = super+minus=decrease_font_size:1 17 | keybind = super+zero=reset_font_size 18 | keybind = super+q=quit 19 | keybind = super+shift+comma=reload_config 20 | keybind = super+k=clear_screen 21 | keybind = super+n=new_window 22 | keybind = super+w=close_surface 23 | keybind = super+shift+w=close_window 24 | keybind = super+t=new_tab 25 | keybind = super+shift+left_bracket=previous_tab 26 | keybind = super+shift+right_bracket=next_tab 27 | keybind = super+d=new_split:right 28 | keybind = super+shift+d=new_split:down 29 | keybind = super+right_bracket=goto_split:next 30 | keybind = super+left_bracket=goto_split:previous 31 | -------------------------------------------------------------------------------- /users/mitchellh/home-manager.nix: -------------------------------------------------------------------------------- 1 | { isWSL, inputs, ... }: 2 | 3 | { config, lib, pkgs, ... }: 4 | 5 | let 6 | sources = import ../../nix/sources.nix; 7 | isDarwin = pkgs.stdenv.isDarwin; 8 | isLinux = pkgs.stdenv.isLinux; 9 | 10 | shellAliases = { 11 | ga = "git add"; 12 | gc = "git commit"; 13 | gco = "git checkout"; 14 | gcp = "git cherry-pick"; 15 | gdiff = "git diff"; 16 | gl = "git prettylog"; 17 | gp = "git push"; 18 | gs = "git status"; 19 | gt = "git tag"; 20 | 21 | jd = "jj desc"; 22 | jf = "jj git fetch"; 23 | jn = "jj new"; 24 | jp = "jj git push"; 25 | js = "jj st"; 26 | } // (if isLinux then { 27 | # Two decades of using a Mac has made this such a strong memory 28 | # that I'm just going to keep it consistent. 29 | pbcopy = "xclip"; 30 | pbpaste = "xclip -o"; 31 | } else {}); 32 | 33 | # For our MANPAGER env var 34 | # https://github.com/sharkdp/bat/issues/1145 35 | manpager = (pkgs.writeShellScriptBin "manpager" (if isDarwin then '' 36 | sh -c 'col -bx | bat -l man -p' 37 | '' else '' 38 | cat "$1" | col -bx | bat --language man --style plain 39 | '')); 40 | in { 41 | # Home-manager 22.11 requires this be set. We never set it so we have 42 | # to use the old state version. 43 | home.stateVersion = "18.09"; 44 | 45 | xdg.enable = true; 46 | 47 | #--------------------------------------------------------------------- 48 | # Packages 49 | #--------------------------------------------------------------------- 50 | 51 | # Packages I always want installed. Most packages I install using 52 | # per-project flakes sourced with direnv and nix-shell, so this is 53 | # not a huge list. 54 | home.packages = [ 55 | pkgs._1password-cli 56 | pkgs.asciinema 57 | pkgs.bat 58 | pkgs.eza 59 | pkgs.fd 60 | pkgs.fzf 61 | pkgs.gh 62 | pkgs.htop 63 | pkgs.jq 64 | pkgs.ripgrep 65 | pkgs.sentry-cli 66 | pkgs.tree 67 | pkgs.watch 68 | 69 | pkgs.gopls 70 | pkgs.zigpkgs."0.14.0" 71 | 72 | pkgs.claude-code 73 | pkgs.codex 74 | 75 | # Node is required for Copilot.vim 76 | pkgs.nodejs 77 | ] ++ (lib.optionals isDarwin [ 78 | # This is automatically setup on Linux 79 | pkgs.cachix 80 | pkgs.tailscale 81 | ]) ++ (lib.optionals (isLinux && !isWSL) [ 82 | pkgs.chromium 83 | pkgs.firefox 84 | pkgs.rofi 85 | pkgs.valgrind 86 | pkgs.zathura 87 | pkgs.xfce.xfce4-terminal 88 | ]); 89 | 90 | #--------------------------------------------------------------------- 91 | # Env vars and dotfiles 92 | #--------------------------------------------------------------------- 93 | 94 | home.sessionVariables = { 95 | LANG = "en_US.UTF-8"; 96 | LC_CTYPE = "en_US.UTF-8"; 97 | LC_ALL = "en_US.UTF-8"; 98 | EDITOR = "nvim"; 99 | PAGER = "less -FirSwX"; 100 | MANPAGER = "${manpager}/bin/manpager"; 101 | 102 | AMP_API_KEY = "op://Private/Amp_API/credential"; 103 | OPENAI_API_KEY = "op://Private/OpenAPI_Personal/credential"; 104 | } // (if isDarwin then { 105 | # See: https://github.com/NixOS/nixpkgs/issues/390751 106 | DISPLAY = "nixpkgs-390751"; 107 | } else {}); 108 | 109 | home.file = { 110 | ".gdbinit".source = ./gdbinit; 111 | ".inputrc".source = ./inputrc; 112 | }; 113 | 114 | xdg.configFile = { 115 | "i3/config".text = builtins.readFile ./i3; 116 | "jj/config.toml".source = ./jujutsu.toml; 117 | "rofi/config.rasi".text = builtins.readFile ./rofi; 118 | 119 | # tree-sitter parsers 120 | "nvim/parser/proto.so".source = "${pkgs.tree-sitter-proto}/parser"; 121 | "nvim/queries/proto/folds.scm".source = 122 | "${sources.tree-sitter-proto}/queries/folds.scm"; 123 | "nvim/queries/proto/highlights.scm".source = 124 | "${sources.tree-sitter-proto}/queries/highlights.scm"; 125 | "nvim/queries/proto/textobjects.scm".source = 126 | ./textobjects.scm; 127 | } // (if isDarwin then { 128 | # Rectangle.app. This has to be imported manually using the app. 129 | "rectangle/RectangleConfig.json".text = builtins.readFile ./RectangleConfig.json; 130 | } else {}) // (if isLinux then { 131 | "ghostty/config".text = builtins.readFile ./ghostty.linux; 132 | } else {}); 133 | 134 | #--------------------------------------------------------------------- 135 | # Programs 136 | #--------------------------------------------------------------------- 137 | 138 | programs.gpg.enable = !isDarwin; 139 | 140 | programs.bash = { 141 | enable = true; 142 | shellOptions = []; 143 | historyControl = [ "ignoredups" "ignorespace" ]; 144 | initExtra = builtins.readFile ./bashrc; 145 | shellAliases = shellAliases; 146 | }; 147 | 148 | programs.direnv= { 149 | enable = true; 150 | 151 | config = { 152 | whitelist = { 153 | prefix= [ 154 | "$HOME/code/go/src/github.com/hashicorp" 155 | "$HOME/code/go/src/github.com/mitchellh" 156 | ]; 157 | 158 | exact = ["$HOME/.envrc"]; 159 | }; 160 | }; 161 | }; 162 | 163 | programs.fish = { 164 | enable = true; 165 | shellAliases = shellAliases; 166 | interactiveShellInit = lib.strings.concatStrings (lib.strings.intersperse "\n" ([ 167 | "source ${sources.theme-bobthefish}/functions/fish_prompt.fish" 168 | "source ${sources.theme-bobthefish}/functions/fish_right_prompt.fish" 169 | "source ${sources.theme-bobthefish}/functions/fish_title.fish" 170 | (builtins.readFile ./config.fish) 171 | "set -g SHELL ${pkgs.fish}/bin/fish" 172 | ])); 173 | 174 | plugins = map (n: { 175 | name = n; 176 | src = sources.${n}; 177 | }) [ 178 | "fish-fzf" 179 | "fish-foreign-env" 180 | "theme-bobthefish" 181 | ]; 182 | }; 183 | 184 | programs.git = { 185 | enable = true; 186 | userName = "Mitchell Hashimoto"; 187 | userEmail = "m@mitchellh.com"; 188 | signing = { 189 | key = "523D5DC389D273BC"; 190 | signByDefault = true; 191 | }; 192 | aliases = { 193 | cleanup = "!git branch --merged | grep -v '\\*\\|master\\|develop' | xargs -n 1 -r git branch -d"; 194 | prettylog = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(r) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"; 195 | root = "rev-parse --show-toplevel"; 196 | }; 197 | extraConfig = { 198 | branch.autosetuprebase = "always"; 199 | color.ui = true; 200 | core.askPass = ""; # needs to be empty to use terminal for ask pass 201 | credential.helper = "store"; # want to make this more secure 202 | github.user = "mitchellh"; 203 | push.default = "tracking"; 204 | init.defaultBranch = "main"; 205 | }; 206 | }; 207 | 208 | programs.go = { 209 | enable = true; 210 | goPath = "code/go"; 211 | goPrivate = [ "github.com/mitchellh" "github.com/hashicorp" "rfc822.mx" ]; 212 | }; 213 | 214 | programs.jujutsu = { 215 | enable = true; 216 | 217 | # I don't use "settings" because the path is wrong on macOS at 218 | # the time of writing this. 219 | }; 220 | 221 | programs.tmux = { 222 | enable = true; 223 | terminal = "xterm-256color"; 224 | shortcut = "l"; 225 | secureSocket = false; 226 | mouse = true; 227 | 228 | extraConfig = '' 229 | set -ga terminal-overrides ",*256col*:Tc" 230 | 231 | set -g @dracula-show-battery false 232 | set -g @dracula-show-network false 233 | set -g @dracula-show-weather false 234 | 235 | bind -n C-k send-keys "clear"\; send-keys "Enter" 236 | 237 | run-shell ${sources.tmux-pain-control}/pain_control.tmux 238 | run-shell ${sources.tmux-dracula}/dracula.tmux 239 | ''; 240 | }; 241 | 242 | programs.alacritty = { 243 | enable = !isWSL; 244 | 245 | settings = { 246 | env.TERM = "xterm-256color"; 247 | 248 | key_bindings = [ 249 | { key = "K"; mods = "Command"; chars = "ClearHistory"; } 250 | { key = "V"; mods = "Command"; action = "Paste"; } 251 | { key = "C"; mods = "Command"; action = "Copy"; } 252 | { key = "Key0"; mods = "Command"; action = "ResetFontSize"; } 253 | { key = "Equals"; mods = "Command"; action = "IncreaseFontSize"; } 254 | { key = "Subtract"; mods = "Command"; action = "DecreaseFontSize"; } 255 | ]; 256 | }; 257 | }; 258 | 259 | programs.kitty = { 260 | enable = !isWSL; 261 | extraConfig = builtins.readFile ./kitty; 262 | }; 263 | 264 | programs.i3status = { 265 | enable = isLinux && !isWSL; 266 | 267 | general = { 268 | colors = true; 269 | color_good = "#8C9440"; 270 | color_bad = "#A54242"; 271 | color_degraded = "#DE935F"; 272 | }; 273 | 274 | modules = { 275 | ipv6.enable = false; 276 | "wireless _first_".enable = false; 277 | "battery all".enable = false; 278 | }; 279 | }; 280 | 281 | programs.neovim = { 282 | enable = true; 283 | package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.default; 284 | 285 | withPython3 = true; 286 | 287 | plugins = with pkgs; [ 288 | customVim.vim-copilot 289 | customVim.vim-cue 290 | customVim.vim-fish 291 | customVim.vim-glsl 292 | customVim.vim-misc 293 | customVim.vim-pgsql 294 | customVim.vim-tla 295 | customVim.vim-zig 296 | customVim.pigeon 297 | customVim.AfterColors 298 | 299 | customVim.vim-nord 300 | customVim.nvim-codecompanion 301 | customVim.nvim-comment 302 | customVim.nvim-conform 303 | customVim.nvim-dressing 304 | customVim.nvim-gitsigns 305 | customVim.nvim-lualine 306 | customVim.nvim-lspconfig 307 | customVim.nvim-nui 308 | customVim.nvim-plenary # required for telescope 309 | customVim.nvim-render-markdown 310 | customVim.nvim-telescope 311 | customVim.nvim-treesitter-context 312 | 313 | vimPlugins.vim-eunuch 314 | vimPlugins.vim-markdown 315 | vimPlugins.vim-nix 316 | vimPlugins.typescript-vim 317 | vimPlugins.nvim-treesitter-parsers.elixir 318 | vimPlugins.nvim-treesitter 319 | vimPlugins.nvim-treesitter.withAllGrammars 320 | ] ++ (lib.optionals (!isWSL) [ 321 | # This is causing a segfaulting while building our installer 322 | # for WSL so just disable it for now. This is a pretty 323 | # unimportant plugin anyway. 324 | customVim.nvim-web-devicons 325 | ]); 326 | 327 | extraConfig = (import ./vim-config.nix) { inherit sources; }; 328 | }; 329 | 330 | programs.atuin = { 331 | enable = true; 332 | enableFishIntegration = true; 333 | enableNushellIntegration = true; 334 | settings = { 335 | show_tabs = false; 336 | style = "compact"; 337 | }; 338 | }; 339 | 340 | programs.nushell = { 341 | enable = true; 342 | configFile.source = ./config.nu; 343 | shellAliases = shellAliases; 344 | 345 | # This is appended at the end of the config file and we need to do 346 | # this to override OMP's transient prompt command. 347 | extraConfig = '' 348 | $env.TRANSIENT_PROMPT_COMMAND = null 349 | ''; 350 | }; 351 | 352 | programs.oh-my-posh = { 353 | enable = true; 354 | enableNushellIntegration = true; 355 | settings = builtins.fromJSON (builtins.readFile ./omp.json); 356 | }; 357 | 358 | services.gpg-agent = { 359 | enable = isLinux; 360 | pinentry.package = pkgs.pinentry-tty; 361 | 362 | # cache the keys forever so we don't get asked for a password 363 | defaultCacheTtl = 31536000; 364 | maxCacheTtl = 31536000; 365 | }; 366 | 367 | xresources.extraConfig = builtins.readFile ./Xresources; 368 | 369 | # Make cursor not tiny on HiDPI screens 370 | home.pointerCursor = lib.mkIf (isLinux && !isWSL) { 371 | name = "Vanilla-DMZ"; 372 | package = pkgs.vanilla-dmz; 373 | size = 128; 374 | x11.enable = true; 375 | }; 376 | } 377 | -------------------------------------------------------------------------------- /users/mitchellh/i3: -------------------------------------------------------------------------------- 1 | set $mod Mod4 2 | 3 | #---------------------------------------------------------------------- 4 | # Look & Feel 5 | #---------------------------------------------------------------------- 6 | # Font for window titles. Will also be used by the bar unless a different font 7 | # is used in the bar {} block below. 8 | font pango:Fira Code 8 9 | 10 | # Window visuals 11 | new_window pixel 2 12 | new_float pixel 2 13 | floating_minimum_size 400 x 300 14 | floating_maximum_size -1 x -1 15 | focus_follows_mouse no 16 | 17 | # Reading colors from resources 18 | set_from_resource $back i3wm.background #1D1F21 19 | set_from_resource $black i3wm.color0 #282A2E 20 | set_from_resource $grey i3wm.color8 #373B41 21 | set_from_resource $lightgrey i3wm.color7 #707880 22 | set_from_resource $white i3wm.color15 #C5C8C6 23 | set_from_resource $yellow i3wm.color11 #F0C674 24 | set_from_resource $red i3wm.color9 #CC6666 25 | set_from_resource $darkred i3wm.color1 #A54242 26 | set_from_resource $green i3wm.color10 #B5BD56 27 | 28 | #class border backgr. text split 29 | client.focused $green $green $black $red 30 | client.focused_inactive $grey $grey $lightgrey $grey 31 | client.unfocused $grey $grey $lightgrey $grey 32 | client.urgent $red $red $black $red 33 | client.background $back 34 | 35 | #---------------------------------------------------------------------- 36 | # Startup 37 | #---------------------------------------------------------------------- 38 | # xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the 39 | # screen before suspend. Use loginctl lock-session to lock your screen. 40 | exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork 41 | 42 | # No background 43 | exec --no-startup-id xsetroot -solid $back 44 | 45 | # Keyboard layout settings 46 | exec --no-startup-id setxkbmap -layout us -variant intl 47 | 48 | # Input methods 49 | exec --no-startup-id fcitx5 -d 50 | 51 | #---------------------------------------------------------------------- 52 | # Keybindings 53 | #---------------------------------------------------------------------- 54 | # Use Mouse+$mod to drag floating windows to their wanted position 55 | floating_modifier $mod 56 | 57 | bindsym $mod+o exec rofi -show run 58 | 59 | # start a terminal 60 | bindsym $mod+n exec ghostty --gtk-single-instance=true 61 | bindsym $mod+d split h 62 | bindsym $mod+Shift+d split v 63 | 64 | # temp, hacking on a tty 65 | bindsym $mod+Shift+n exec /home/mitchellh/bin/devtty --config-file=/home/mitchellh/.config/devtty/config 66 | 67 | # kill focused window 68 | bindsym $mod+w kill 69 | 70 | # change focus 71 | bindsym $mod+h focus left 72 | bindsym $mod+j focus down 73 | bindsym $mod+k focus up 74 | bindsym $mod+l focus right 75 | 76 | # move focused window 77 | bindsym $mod+Shift+h move left 78 | bindsym $mod+Shift+j move down 79 | bindsym $mod+Shift+k move up 80 | bindsym $mod+Shift+l move right 81 | 82 | # enter fullscreen mode for the focused container 83 | bindsym $mod+Shift+f fullscreen toggle 84 | 85 | # change container layout (stacked, tabbed, toggle split) 86 | bindsym $mod+Shift+s layout stacking 87 | bindsym $mod+Shift+w layout tabbed 88 | bindsym $mod+Shift+e layout toggle split 89 | 90 | # toggle tiling / floating 91 | bindsym $mod+Shift+space floating toggle 92 | 93 | # change focus between tiling / floating windows 94 | bindsym $mod+space focus mode_toggle 95 | 96 | # focus the parent container 97 | bindsym $mod+Shift+a focus parent 98 | 99 | # focus the child container 100 | #bindsym $mod+Shift+d focus child 101 | 102 | # Define names for default workspaces for which we configure key bindings later on. 103 | # We use variables to avoid repeating the names in multiple places. 104 | set $ws1 "1" 105 | set $ws2 "2" 106 | set $ws3 "3" 107 | set $ws4 "4" 108 | set $ws5 "5" 109 | set $ws6 "6" 110 | set $ws7 "7" 111 | set $ws8 "8" 112 | set $ws9 "9" 113 | set $ws10 "10" 114 | 115 | # switch to workspace 116 | bindsym $mod+1 workspace number $ws1 117 | bindsym $mod+2 workspace number $ws2 118 | bindsym $mod+3 workspace number $ws3 119 | bindsym $mod+4 workspace number $ws4 120 | bindsym $mod+5 workspace number $ws5 121 | bindsym $mod+6 workspace number $ws6 122 | bindsym $mod+7 workspace number $ws7 123 | bindsym $mod+8 workspace number $ws8 124 | bindsym $mod+9 workspace number $ws9 125 | bindsym $mod+0 workspace number $ws10 126 | 127 | # move focused container to workspace 128 | bindsym $mod+Shift+1 move container to workspace number $ws1 129 | bindsym $mod+Shift+2 move container to workspace number $ws2 130 | bindsym $mod+Shift+3 move container to workspace number $ws3 131 | bindsym $mod+Shift+4 move container to workspace number $ws4 132 | bindsym $mod+Shift+5 move container to workspace number $ws5 133 | bindsym $mod+Shift+6 move container to workspace number $ws6 134 | bindsym $mod+Shift+7 move container to workspace number $ws7 135 | bindsym $mod+Shift+8 move container to workspace number $ws8 136 | bindsym $mod+Shift+9 move container to workspace number $ws9 137 | bindsym $mod+Shift+0 move container to workspace number $ws10 138 | 139 | # reload the configuration file 140 | bindsym $mod+Shift+c reload 141 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) 142 | bindsym $mod+Shift+r restart 143 | 144 | #---------------------------------------------------------------------- 145 | # Resize Mode 146 | #---------------------------------------------------------------------- 147 | set $mode_resize Resize / Move 148 | 149 | # This mode will make it easier to resize and move workspaces without 150 | # having to bind a bunch of obscure bindings. 151 | mode "$mode_resize" { 152 | # These bindings trigger as soon as you enter the resize mode 153 | 154 | # Focus parent and child 155 | bindsym a focus parent 156 | bindsym $mod+a focus parent 157 | bindsym c focus child 158 | bindsym $mod+c focus child 159 | 160 | # Move containers 161 | bindsym 1 move container to workspace number $ws1; workspace number $ws1 162 | bindsym 2 move container to workspace number $ws2; workspace number $ws2 163 | bindsym 3 move container to workspace number $ws3; workspace number $ws3 164 | bindsym 4 move container to workspace number $ws4; workspace number $ws4 165 | bindsym 5 move container to workspace number $ws5; workspace number $ws5 166 | bindsym 6 move container to workspace number $ws6; workspace number $ws6 167 | bindsym 7 move container to workspace number $ws7; workspace number $ws7 168 | bindsym 8 move container to workspace number $ws8; workspace number $ws8 169 | bindsym 9 move container to workspace number $ws9; workspace number $ws9 170 | bindsym 0 move container to workspace number $ws10; workspace number $ws10 171 | 172 | # Pressing left will shrink the window’s width. 173 | # Pressing right will grow the window’s width. 174 | # Pressing up will shrink the window’s height. 175 | # Pressing down will grow the window’s height. 176 | bindsym h resize shrink width 10 px or 10 ppt 177 | bindsym j resize grow height 10 px or 10 ppt 178 | bindsym k resize shrink height 10 px or 10 ppt 179 | bindsym l resize grow width 10 px or 10 ppt 180 | 181 | # back to normal: Enter or Escape or $mod+r 182 | bindsym Return mode "default" 183 | bindsym Escape mode "default" 184 | bindsym $mod+r mode "default" 185 | } 186 | 187 | bindsym $mod+r mode "$mode_resize" 188 | 189 | #---------------------------------------------------------------------- 190 | # System Mode 191 | #---------------------------------------------------------------------- 192 | # shutdown / restart / suspend... 193 | set $mode_system System (e) logout, (r) reboot, (Ctrl+s) shutdown 194 | 195 | mode "$mode_system" { 196 | bindsym e exec --no-startup-id i3-msg exit, mode "default" 197 | bindsym r exec --no-startup-id systemctl reboot, mode "default" 198 | bindsym Ctrl+s exec --no-startup-id systemctl poweroff -i, mode "default" 199 | 200 | # back to normal: Enter or Escape 201 | bindsym Return mode "default" 202 | bindsym Escape mode "default" 203 | } 204 | 205 | bindsym $mod+BackSpace mode "$mode_system" 206 | 207 | # Start i3bar to display a workspace bar (plus the system information i3status 208 | # finds out, if available) 209 | bar { 210 | status_command i3status 211 | 212 | font pango:Fira Code 8 213 | colors { 214 | background $back 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /users/mitchellh/i3status: -------------------------------------------------------------------------------- 1 | general { 2 | output_format = "dzen2" 3 | interval = 5 4 | colors = true 5 | color_good = "#8C9440" 6 | color_bad = "#A54242" 7 | color_degraded = "#DE935F" 8 | } 9 | 10 | order += "disk /" 11 | order += "run_watch DHCP" 12 | order += "run_watch VPN" 13 | order += "ethernet eth0" 14 | order += "load" 15 | order += "tztime local" 16 | 17 | ethernet eth0 { 18 | # if you use %speed, i3status requires root privileges 19 | format_up = "E: %ip (%speed)" 20 | format_down = "E: down" 21 | } 22 | 23 | run_watch DHCP { 24 | pidfile = "/var/run/dhclient*.pid" 25 | } 26 | 27 | run_watch VPN { 28 | pidfile = "/var/run/vpnc/pid" 29 | } 30 | 31 | tztime local { 32 | format = "%Y-%m-%d %H:%M:%S" 33 | } 34 | 35 | load { 36 | format = "%1min" 37 | } 38 | 39 | disk "/" { 40 | format = "%avail" 41 | } 42 | -------------------------------------------------------------------------------- /users/mitchellh/inputrc: -------------------------------------------------------------------------------- 1 | # Show tab-completion options on first instead of waiting 2 | # for multiple completions. 3 | set show-all-if-ambiguous on 4 | 5 | # Case insensitive tab-completion 6 | set completion-ignore-case on 7 | 8 | $if Bash 9 | # In bash only, enable "magic space" so that typing space 10 | # will show completions. i.e. !!_ (where _ is space) 11 | # will expand !! for you. 12 | Space: magic-space 13 | $endif 14 | -------------------------------------------------------------------------------- /users/mitchellh/jujutsu.toml: -------------------------------------------------------------------------------- 1 | [user] 2 | email = "m@mitchellh.com" 3 | name = "Mitchell Hashimoto" 4 | 5 | [signing] 6 | backend = "gpg" 7 | behavior = "own" 8 | 9 | [aliases] 10 | b = ["branch"] 11 | n = ["new"] 12 | 13 | # Move the closest bookmark to the current commit. This is useful when 14 | # working on a named branch, creating a bunch of commits, and then needing 15 | # to update the bookmark before pushing. 16 | tug = ["bookmark", "move", "--from", "closest_bookmark(@-)", "--to", "@-"] 17 | 18 | # Rebase the current branch onto the trunk. 19 | retrunk = ["rebase", "-d", "trunk()"] 20 | 21 | [revset-aliases] 22 | "closest_bookmark(to)" = "heads(::to & bookmarks())" 23 | "fork_history(to, from)" = "fork_point(to | from)..@" 24 | 25 | [template-aliases] 26 | "format_timestamp(timestamp)" = "timestamp.ago()" 27 | 28 | [ui] 29 | default-command = "log" 30 | -------------------------------------------------------------------------------- /users/mitchellh/kitty: -------------------------------------------------------------------------------- 1 | font_family Fira Code 2 | font_size 12.0 3 | 4 | #-------------------------------------------------------------------- 5 | # Key bindings 6 | #-------------------------------------------------------------------- 7 | # Clipboard 8 | map super+v paste_from_clipboard 9 | map super+c copy_or_interrupt 10 | 11 | # Screen 12 | map super+k combine : clear_terminal scroll active : send_text normal,application \x0c 13 | 14 | # Miscellaneous 15 | map super+equal increase_font_size 16 | map super+minus decrease_font_size 17 | map super+0 restore_font_size 18 | 19 | # Scrolling 20 | map super+shift+g show_last_command_output 21 | map super+ctrl+p scroll_to_prompt -1 22 | map super+ctrl+n scroll_to_prompt 1 23 | 24 | #-------------------------------------------------------------------- 25 | # Theme 26 | #-------------------------------------------------------------------- 27 | # Based on https://github.com/sonph/onehalf 28 | # By https://github.com/dbinary 29 | 30 | foreground #dcdfe4 31 | background #282c34 32 | selection_foreground #000000 33 | selection_background #FFFACD 34 | url_color #0087BD 35 | 36 | # black 37 | color0 #282c34 38 | color8 #5d677a 39 | 40 | # red 41 | color1 #e06c75 42 | color9 #e06c75 43 | 44 | # green 45 | color2 #98c379 46 | color10 #98c379 47 | 48 | # yellow 49 | color3 #e5c07b 50 | color11 #e5c07b 51 | 52 | # blue 53 | color4 #61afef 54 | color12 #61afef 55 | 56 | # magenta 57 | color5 #c678dd 58 | color13 #c678dd 59 | 60 | # cyan 61 | color6 #56b6c2 62 | color14 #56b6c2 63 | 64 | # white 65 | color7 #dcdfe4 66 | color15 #dcdfe4 67 | -------------------------------------------------------------------------------- /users/mitchellh/nixos.nix: -------------------------------------------------------------------------------- 1 | { pkgs, inputs, ... }: 2 | 3 | { 4 | # https://github.com/nix-community/home-manager/pull/2408 5 | environment.pathsToLink = [ "/share/fish" ]; 6 | 7 | # Add ~/.local/bin to PATH 8 | environment.localBinInPath = true; 9 | 10 | # Since we're using fish as our shell 11 | programs.fish.enable = true; 12 | 13 | users.users.mitchellh = { 14 | isNormalUser = true; 15 | home = "/home/mitchellh"; 16 | extraGroups = [ "docker" "lxd" "wheel" ]; 17 | shell = pkgs.fish; 18 | hashedPassword = "$6$p5nPhz3G6k$6yCK0m3Oglcj4ZkUXwbjrG403LBZkfNwlhgrQAqOospGJXJZ27dI84CbIYBNsTgsoH650C1EBsbCKesSVPSpB1"; 19 | openssh.authorizedKeys.keys = [ 20 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGbTIKIPtrymhvtTvqbU07/e7gyFJqNS4S0xlfrZLOaY mitchellh" 21 | ]; 22 | }; 23 | 24 | nixpkgs.overlays = import ../../lib/overlays.nix ++ [ 25 | (import ./vim.nix { inherit inputs; }) 26 | ]; 27 | } 28 | -------------------------------------------------------------------------------- /users/mitchellh/omp.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", 3 | "upgrade": { 4 | "notice": false 5 | }, 6 | "terminal_background": "p:grey", 7 | "palette": { 8 | "grey": "#454758", 9 | "lavender": "#AE8FE7", 10 | "white": "#FFFFFF", 11 | "text": "#494D64" 12 | }, 13 | "blocks": [ 14 | { 15 | "alignment": "left", 16 | "segments": [ 17 | { 18 | "foreground": "#FFEE58", 19 | "style": "plain", 20 | "template": " \uf0e7 ", 21 | "type": "root" 22 | }, 23 | { 24 | "background": "p:grey", 25 | "foreground": "p:white", 26 | "powerline_symbol": "\ue0b0", 27 | "properties": { 28 | "style": "unique" 29 | }, 30 | "style": "powerline", 31 | "template": " {{ .Path }} ", 32 | "type": "path" 33 | }, 34 | { 35 | "background": "p:lavender", 36 | "foreground": "p:text", 37 | "powerline_symbol": "\ue0b0", 38 | "style": "powerline", 39 | "template": " {{ .HEAD }} ", 40 | "properties": { 41 | "branch_icon": "\ue725 ", 42 | "cherry_pick_icon": "\ue29b ", 43 | "commit_icon": "\uf417 ", 44 | "fetch_status": false, 45 | "fetch_upstream_icon": false, 46 | "merge_icon": "\ue727 ", 47 | "no_commits_icon": "\uf0c3 ", 48 | "rebase_icon": "\ue728 ", 49 | "revert_icon": "\uf0e2 ", 50 | "tag_icon": "\uf412 " 51 | }, 52 | "type": "git" 53 | }, 54 | { 55 | "background": "#ff8080", 56 | "foreground": "#ffffff", 57 | "powerline_symbol": "\ue0b0", 58 | "style": "powerline", 59 | "template": " \ue20f ", 60 | "type": "status" 61 | } 62 | ], 63 | "type": "prompt" 64 | }, 65 | { 66 | "type": "rprompt", 67 | "alignment": "right", 68 | "segments": [ 69 | { 70 | "type": "time", 71 | "style": "plain", 72 | "foreground": "p:lavender", 73 | "properties": { 74 | "time_format": "Mon Jan _2 15:04:05 MST" 75 | } 76 | } 77 | ] 78 | } 79 | ], 80 | "final_space": true, 81 | "version": 3 82 | } 83 | -------------------------------------------------------------------------------- /users/mitchellh/rofi: -------------------------------------------------------------------------------- 1 | configuration { 2 | dpi: 220; 3 | font: "Monaco for Powerline 12"; 4 | } 5 | 6 | * { 7 | foreground: #f8f8f2; 8 | background-color: #282a36; 9 | active-background: #6272a4; 10 | urgent-background: #ff5555; 11 | selected-background: @active-background; 12 | selected-urgent-background: @urgent-background; 13 | selected-active-background: @active-background; 14 | separatorcolor: @active-background; 15 | bordercolor: @active-background; 16 | } 17 | 18 | #window { 19 | background-color: @background; 20 | border: 1; 21 | border-radius: 6; 22 | border-color: @bordercolor; 23 | padding: 5; 24 | } 25 | #mainbox { 26 | border: 0; 27 | padding: 0; 28 | } 29 | #message { 30 | border: 1px dash 0px 0px ; 31 | border-color: @separatorcolor; 32 | padding: 1px ; 33 | } 34 | #textbox { 35 | text-color: @foreground; 36 | } 37 | #listview { 38 | fixed-height: 0; 39 | border: 2px dash 0px 0px ; 40 | border-color: @bordercolor; 41 | spacing: 2px ; 42 | scrollbar: false; 43 | padding: 2px 0px 0px ; 44 | } 45 | #element { 46 | border: 0; 47 | padding: 1px ; 48 | } 49 | #element.normal.normal { 50 | background-color: @background; 51 | text-color: @foreground; 52 | } 53 | #element.normal.urgent { 54 | background-color: @urgent-background; 55 | text-color: @urgent-foreground; 56 | } 57 | #element.normal.active { 58 | background-color: @active-background; 59 | text-color: @foreground; 60 | } 61 | #element.selected.normal { 62 | background-color: @selected-background; 63 | text-color: @foreground; 64 | } 65 | #element.selected.urgent { 66 | background-color: @selected-urgent-background; 67 | text-color: @foreground; 68 | } 69 | #element.selected.active { 70 | background-color: @selected-active-background; 71 | text-color: @foreground; 72 | } 73 | #element.alternate.normal { 74 | background-color: @background; 75 | text-color: @foreground; 76 | } 77 | #element.alternate.urgent { 78 | background-color: @urgent-background; 79 | text-color: @foreground; 80 | } 81 | #element.alternate.active { 82 | background-color: @active-background; 83 | text-color: @foreground; 84 | } 85 | #scrollbar { 86 | width: 2px ; 87 | border: 0; 88 | handle-width: 8px ; 89 | padding: 0; 90 | } 91 | #sidebar { 92 | border: 2px dash 0px 0px ; 93 | border-color: @separatorcolor; 94 | } 95 | #button.selected { 96 | background-color: @selected-background; 97 | text-color: @foreground; 98 | } 99 | #inputbar { 100 | spacing: 0; 101 | text-color: @foreground; 102 | padding: 1px ; 103 | } 104 | #case-indicator { 105 | spacing: 0; 106 | text-color: @foreground; 107 | } 108 | #entry { 109 | spacing: 0; 110 | text-color: @foreground; 111 | } 112 | #prompt { 113 | spacing: 0; 114 | text-color: @foreground; 115 | } 116 | #inputbar { 117 | children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; 118 | } 119 | #textbox-prompt-colon { 120 | expand: false; 121 | str: ":"; 122 | margin: 0px 0.3em 0em 0em ; 123 | text-color: @foreground; 124 | } 125 | -------------------------------------------------------------------------------- /users/mitchellh/textobjects.scm: -------------------------------------------------------------------------------- 1 | [ 2 | (enum) 3 | (message) 4 | (service) 5 | (oneof) 6 | ] @class.outer 7 | 8 | (field) @statement.outer 9 | 10 | (message (message_body)? @class.inner) 11 | 12 | (rpc 13 | (message_or_enum_type) @parameter.inner) 14 | -------------------------------------------------------------------------------- /users/mitchellh/vim-config.nix: -------------------------------------------------------------------------------- 1 | { sources }: 2 | '' 3 | "-------------------------------------------------------------------- 4 | " Fix vim paths so we load the vim-misc directory 5 | let g:vim_home_path = "~/.vim" 6 | 7 | " This works on NixOS 21.05 8 | let vim_misc_path = split(&packpath, ",")[0] . "/pack/home-manager/start/vim-misc/vimrc.vim" 9 | if filereadable(vim_misc_path) 10 | execute "source " . vim_misc_path 11 | endif 12 | 13 | " This works on NixOS 21.11 14 | let vim_misc_path = split(&packpath, ",")[0] . "/pack/home-manager/start/vimplugin-vim-misc/vimrc.vim" 15 | if filereadable(vim_misc_path) 16 | execute "source " . vim_misc_path 17 | endif 18 | 19 | " This works on NixOS 22.11 20 | let vim_misc_path = split(&packpath, ",")[0] . "/pack/myNeovimPackages/start/vimplugin-vim-misc/vimrc.vim" 21 | if filereadable(vim_misc_path) 22 | execute "source " . vim_misc_path 23 | endif 24 | 25 | lua <", 165 | "CodeCompanionActions", 166 | { noremap = true, silent = true } 167 | ) 168 | vim.keymap.set( 169 | { "n" }, 170 | "", 171 | "CodeCompanionChat Toggle", 172 | { noremap = true, silent = true } 173 | ) 174 | vim.keymap.set( 175 | { "v" }, 176 | "", 177 | "CodeCompanionChat Add", 178 | { noremap = true, silent = true } 179 | ) 180 | 181 | --------------------------------------------------------------------- 182 | -- Render Markdown 183 | 184 | vim.keymap.set( 185 | { "n" }, 186 | "md", 187 | "RenderMarkdown toggle", 188 | { noremap = true, silent = true } 189 | ) 190 | 191 | EOF 192 | '' 193 | -------------------------------------------------------------------------------- /users/mitchellh/vim.nix: -------------------------------------------------------------------------------- 1 | { inputs }: 2 | 3 | self: super: 4 | 5 | let sources = import ../../nix/sources.nix; in rec { 6 | # My vim config 7 | customVim = with self; { 8 | vim-copilot = vimUtils.buildVimPlugin { 9 | name = "vim-copilot"; 10 | src = inputs.vim-copilot; 11 | }; 12 | 13 | vim-cue = vimUtils.buildVimPlugin { 14 | name = "vim-cue"; 15 | src = sources.vim-cue; 16 | }; 17 | 18 | vim-fish = vimUtils.buildVimPlugin { 19 | name = "vim-fish"; 20 | src = sources.vim-fish; 21 | }; 22 | 23 | vim-glsl = vimUtils.buildVimPlugin { 24 | name = "vim-glsl"; 25 | src = sources.vim-glsl; 26 | }; 27 | 28 | vim-misc = vimUtils.buildVimPlugin { 29 | name = "vim-misc"; 30 | src = inputs.vim-misc; 31 | doCheck = false; 32 | }; 33 | 34 | vim-pgsql = vimUtils.buildVimPlugin { 35 | name = "vim-pgsql"; 36 | src = sources.vim-pgsql; 37 | }; 38 | 39 | vim-tla = vimUtils.buildVimPlugin { 40 | name = "tla.vim"; 41 | src = sources.vim-tla; 42 | }; 43 | 44 | vim-zig = vimUtils.buildVimPlugin { 45 | name = "zig.vim"; 46 | src = sources.vim-zig; 47 | }; 48 | 49 | dracula = vimUtils.buildVimPlugin { 50 | name = "dracula"; 51 | src = sources.vim-dracula; 52 | }; 53 | 54 | pigeon = vimUtils.buildVimPlugin { 55 | name = "pigeon.vim"; 56 | src = sources.vim-pigeon; 57 | }; 58 | 59 | AfterColors = vimUtils.buildVimPlugin { 60 | name = "AfterColors"; 61 | src = pkgs.fetchFromGitHub { 62 | owner = "vim-scripts"; 63 | repo = "AfterColors.vim"; 64 | rev = "9936c26afbc35e6f92275e3f314a735b54ba1aaf"; 65 | sha256 = "0j76g83zlxyikc41gn1gaj7pszr37m7xzl8i9wkfk6ylhcmjp2xi"; 66 | }; 67 | }; 68 | 69 | vim-nord = vimUtils.buildVimPlugin { 70 | name = "vim-nord"; 71 | src = sources.vim-nord; 72 | }; 73 | 74 | nvim-comment = vimUtils.buildVimPlugin { 75 | name = "nvim-comment"; 76 | src = sources.nvim-comment; 77 | buildPhase = ":"; 78 | }; 79 | 80 | nvim-codecompanion = vimUtils.buildVimPlugin { 81 | name = "nvim-codecompanion"; 82 | src = inputs.nvim-codecompanion; 83 | doCheck = false; 84 | }; 85 | 86 | nvim-conform = vimUtils.buildVimPlugin { 87 | name = "nvim-conform"; 88 | src = inputs.nvim-conform; 89 | }; 90 | 91 | nvim-dressing = vimUtils.buildVimPlugin { 92 | name = "nvim-dressing"; 93 | src = inputs.nvim-dressing; 94 | }; 95 | 96 | nvim-gitsigns = vimUtils.buildVimPlugin { 97 | name = "nvim-gitsigns"; 98 | src = inputs.nvim-gitsigns; 99 | }; 100 | 101 | nvim-lualine = vimUtils.buildVimPlugin { 102 | name = "nvim-lualine"; 103 | src = inputs.nvim-lualine; 104 | }; 105 | 106 | nvim-nui = vimUtils.buildVimPlugin { 107 | name = "nvim-nui"; 108 | src = inputs.nvim-nui; 109 | }; 110 | 111 | nvim-plenary = vimUtils.buildVimPlugin { 112 | name = "nvim-plenary"; 113 | src = inputs.nvim-plenary; 114 | buildPhase = ":"; 115 | doCheck = false; 116 | }; 117 | 118 | nvim-render-markdown = vimUtils.buildVimPlugin { 119 | name = "nvim-render-markdown"; 120 | src = inputs.nvim-render-markdown; 121 | }; 122 | 123 | nvim-telescope = vimUtils.buildVimPlugin { 124 | name = "nvim-telescope"; 125 | src = inputs.nvim-telescope; 126 | buildPhase = ":"; 127 | doCheck = false; 128 | }; 129 | 130 | nvim-treesitter-context = vimUtils.buildVimPlugin { 131 | name = "nvim-treesitter-context"; 132 | src = inputs.nvim-treesitter-context; 133 | doCheck = false; 134 | }; 135 | 136 | nvim-lspconfig = vimUtils.buildVimPlugin { 137 | name = "nvim-lspconfig"; 138 | src = inputs.nvim-lspconfig; 139 | doCheck = false; 140 | 141 | # We have to do this because the build phase runs tests which require 142 | # git and I don't know how to get git into here. 143 | buildPhase = ":"; 144 | }; 145 | 146 | nvim-treesitter-textobjects = vimUtils.buildVimPlugin { 147 | name = "nvim-treesitter-textobjects"; 148 | src = sources.nvim-treesitter-textobjects; 149 | }; 150 | 151 | nvim-web-devicons = vimUtils.buildVimPlugin { 152 | name = "nvim-web-devicons"; 153 | src = inputs.nvim-web-devicons; 154 | }; 155 | }; 156 | 157 | tree-sitter-proto = self.callPackage 158 | (sources.nixpkgs + /pkgs/development/tools/parsing/tree-sitter/grammar.nix) { } { 159 | language = "proto"; 160 | version = "0.1.0"; 161 | source = sources.tree-sitter-proto; 162 | }; 163 | 164 | tree-sitter-hcl = self.callPackage 165 | (sources.nixpkgs + /pkgs/development/tools/parsing/tree-sitter/grammar.nix) { } { 166 | language = "hcl"; 167 | version = "0.1.0"; 168 | source = sources.tree-sitter-hcl; 169 | }; 170 | } 171 | --------------------------------------------------------------------------------