/system-configurations

Configurations for my machines

Primary LanguageLuaGNU General Public License v3.0GPL-3.0

System Configurations

built with nix

This repository holds the Home Manager and nix-darwin configurations for my machines. I don't expect anyone else to use this, but I figured I'd leave the repo public as a resource for people who want to manage their systems similarly.

Table of Contents

Applying a Configuration

  1. Install Nix by running:

    NOTE: Please confirm that everything in the command provided above, besides the --extra-conf flags, is up-to-date with what is currently listed on the Installer Website.

    # The first `--extra-conf` adds your user to `trusted-users` so you can do things
    # like accepting a binary cache.
    #
    # The second one enables the feature `auto-allocate-uids`. I'm enabling it because
    # of one instance where I was running a flake output I got an error because this
    # feature wasn't enabled. I'm assuming the flake, or one of its dependencies, set
    # `auto-allocate-uids = true` in the `nixConfig` section of its `flake.nix`.
    curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install \
      --extra-conf "extra-trusted-users = $(whoami)" \
      --extra-conf 'extra-experimental-features = auto-allocate-uids'
  2. Start a Nix shell with the other required programs and clone the repository by running:

    nix shell --impure nixpkgs#fish nixpkgs#direnv nixpkgs#git \
      --command fish --init-command '
        direnv hook fish | source
        and git clone https://github.com/bigolu/system-configurations.git ~/code/system-configurations
        and cd ~/code/system-configurations
        and direnv allow
        and direnv exec "$PWD" nix-direnv-reload
      '

The next steps depend on the operating system you're using:

Linux

  1. Apply the Home Manager configuration by running just init-home-manager <host_name> where <host_name> is one of the hosts defined in the Home Manager flake module.

  2. Install and start keyd

  3. Apply the Firefox about:config changes in dotfiles/firefox-developer-edition/about-config-changes.txt

macOS

  1. Apply the nix-darwin configuration by running just init-nix-darwin <host_name> where <host_name> is one of the hosts defined in the nix-darwin flake module.

  2. Keyboard:

    • Set the keyboard input source to 'Others → (No Accent Keys)'.
    • Shortcuts:

      • Disable: "Select the previous input source" ctrl+space, "Application windows" ctrl+↓

      • Change: "Mission Control → Move left/right a space" to cmd+[ and cmd+] respectively, "Mission Control" to cmd+d, "Mission Control → Switch to Desktop 1-9" cmd+[1-9]

  3. Open Hammerspoon, Finicky, MonitorControl, UnnaturalScrollWheels, Nightfall, and "Mac Mouse Fix" to configure them.

Running the Home Configuration

You can also run a shell or terminal with the home configuration already loaded in it. This is helpful when you only need to use the configuration temporarily and not apply it, like when you're in a remote host. The executable is a self-extracting archive (SEA) that contains all the command-line programs I use, as well as my config files for them. Just run one of these commands, depending on whether you have wget or curl:

curl -fsSL https://raw.githubusercontent.com/bigolu/system-configurations/master/.github/run.sh \
  | sh -s -- <type>
wget -qO- https://raw.githubusercontent.com/bigolu/system-configurations/master/.github/run.sh \
  | sh -s -- <type>

Where <type> can be shell or terminal.

NOTE: While the SEA doesn't depend on any programs on your computer, it does require that you have a /tmp directory. You can read this GitHub issue comment regarding a "rootless Nix" to see why this is needed, as well as learn more about how this works.