Skip to content

Commit

Permalink
i use nixos btw
Browse files Browse the repository at this point in the history
Switch over to NixOS. This has been a long time coming, and I've added
another machine and a lot of extra tooling and changes to Neovim,
Hyprland, and so on.

Time to merge this now, I think.
  • Loading branch information
Mange committed Oct 29, 2023
1 parent 5ee93f1 commit fb1fda3
Show file tree
Hide file tree
Showing 452 changed files with 2,696 additions and 23,352 deletions.
7 changes: 0 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +0,0 @@
[submodule "config/awesome/vendor/bling"]
path = config/awesome/vendor/bling
url = https://github.com/BlingCorp/bling.git
[submodule "config/awesome/vendor/nice"]
path = config/awesome/vendor/nice
url = https://github.com/Mange/awesome-wm-nice.git
branch = master
81 changes: 8 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,86 +4,22 @@ This is a repo of my settings and computer customization preferences.

Quick summary of my stack:

- **OS:** [Arch Linux][arch]
- **Window manager:** [Awesome WM][awesome] + [picom] (compositor)
- **OS:** [NixOS]
- **Window manager:** [Hyprland] (Wayland)
- **Editor:** [Neovim]
- **Shell:** [ZSH]
- **Terminal emulator:** [Wezterm]
- **Web browser:** [Brave]
- **Colors:** [Catppuccin]

## Structure
## Nix

This repo uses Ansible to setup new machines. Usage of roles makes it possible
to quickly pick what I want to include or not include on a new machine.

You can see all roles under `roles/` and the initial setup in `environment.yml`.

Ansible also copies the dotfiles and installs them for the user in question.

### Dotfiles

Dotfiles are mainly placed in accordance with the XDG directory specification.
This simplifies things a whole lot. You can find files for the configuration
directory inside the `config` directory, data files inside the `data` directory
and executables inside the `bin` directory.

Some software does not follow XDG specifications and might require custom
locations. Those files are inside the `snowflakes` directory.

## Dotfiles CLI

After installing the dotfiles there is a CLI you can use.

```bash
dotfiles --help

# Update and install
dotfiles update

# Update symlinks
dotfiles update -t dotfiles
# …or without checking out new changes
dotfiles setup -t dotfiles

# If you want to edit a file
dotfiles edit
```
A lot of my config is very very old and I have not moved everything over to Nix
yet. This will take its own sweet time.

## How to bootstrap

As root, run the install script:

```bash
# For Arch:
pacman -Sy --noconfirm curl

curl -o - https://github.com/Mange/dotfiles/raw/master/bootstrap/bootstrap.sh | bash -
```

This script will run the bootstrap playbook (see `bootstrap/bootstrap.yml`),
which should create my user account. Follow the prompts to get running.

After you've set up the account, log in as the user and go to the dotfiles
checkout. Run the `setup.sh` script.

```bash
sudo su - mange
cd Projects/dotfiles
./setup.sh
```

## Tests

If you want to test the dotfiles and/or setup, you can use the test script
under `test/test.sh`. It will boot up a Docker container for the given platform
and bootstrap it. Then you are free to use the shell to test out the dotfiles.

```
host-machine$ dotfiles test --rebuild arch
docker-container$ cd Projects/dotfiles
docker-container$ ./setup.sh
```
Install NixOS on a machine, clone out the repo and apply it.

## Copyright

Expand All @@ -97,9 +33,8 @@ to be honored.
No warranty or guarantees are provided in case you run any code from this
repository.

[arch]: https://www.archlinux.org/
[awesome]: https://awesomewm.org/
[picom]: https://github.com/yshui/picom
[NixOS]: https://www.nixos.org
[Hyprland]: https://hyprland.org/
[Neovim]: https://neovim.io/
[ZSH]: http://zsh.sourceforge.net/
[Wezterm]: https://wezfurlong.org/wezterm/
Expand Down
7 changes: 0 additions & 7 deletions ansible.cfg

This file was deleted.

12 changes: 12 additions & 0 deletions apply-system.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env sh

mode=switch

case "$1" in
switch | boot | test)
mode="$1"
shift
;;
esac

exec sudo nixos-rebuild "$mode" --flake ".#$(uname -n)" "$@"
3 changes: 3 additions & 0 deletions apply-user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh

exec home-manager switch --flake ".#${USER}@$(uname -n)" "$@"
31 changes: 0 additions & 31 deletions bin/aur-gc

This file was deleted.

4 changes: 0 additions & 4 deletions bin/aurlist

This file was deleted.

18 changes: 0 additions & 18 deletions bin/awesome-repl

This file was deleted.

2 changes: 0 additions & 2 deletions bin/banner

This file was deleted.

14 changes: 0 additions & 14 deletions bin/banners

This file was deleted.

6 changes: 5 additions & 1 deletion bin/brb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ msg="$*"

s=0

# go to alternative screen, and back again on exit.
tput smcup
trap 'tput rmcup' EXIT

while true; do
s=$((s + 6))
clear
tput cup 0 0
banner "$msg" | dotacat -S "$s"
sleep 1
done
2 changes: 0 additions & 2 deletions bin/bwmenu-clear-session

This file was deleted.

10 changes: 0 additions & 10 deletions bin/delta-wrapper

This file was deleted.

6 changes: 0 additions & 6 deletions bin/elm-make

This file was deleted.

4 changes: 2 additions & 2 deletions bin/find-icon-file
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
shopt -s extglob
set -e

Expand All @@ -18,7 +18,7 @@ usage() {
Show debug output on STDERR.
Example:
$0 -t Tela spotify
$0 -t Papirus-Dark spotify
EOF
}

Expand Down
2 changes: 1 addition & 1 deletion bin/finder
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

#
# Use Rofi or fzf for dmenu-like prompts, depending on if it is running on a
Expand Down
2 changes: 1 addition & 1 deletion bin/git-fshow
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/usr/bin/env zsh
# git-fshow - git commit browser
#
# https://gist.github.com/akatrevorjay/9fc061e8371529c4007689a696d33c62
Expand Down
2 changes: 1 addition & 1 deletion bin/github
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash


if ! fetch_url=$(LC_LANG=C LANG=C git config --get remote.origin.url); then
Expand Down
2 changes: 1 addition & 1 deletion bin/hyprjump
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

usage() {
cat <<EOF
Expand Down
2 changes: 1 addition & 1 deletion bin/hyprscreenshot
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

usage() {
Expand Down
27 changes: 0 additions & 27 deletions bin/i3resize

This file was deleted.

2 changes: 1 addition & 1 deletion bin/imgcat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# http://blog.z3bra.org/2014/01/images-in-terminal.html
# z3bra -- 2014-01-21
Expand Down
2 changes: 1 addition & 1 deletion bin/inotify-consumers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Get the procs sorted by the number of inotify watches
# @author Carl-Erik Kopseng
Expand Down
9 changes: 0 additions & 9 deletions bin/is-inside-container

This file was deleted.

2 changes: 1 addition & 1 deletion bin/lock-screen
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Lock screen, executing some things before and some things after unlocking
# again. Using i3lock-color.

Expand Down
2 changes: 1 addition & 1 deletion bin/preview
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

usage() {
Expand Down
12 changes: 0 additions & 12 deletions bin/redshift-toggle

This file was deleted.

30 changes: 0 additions & 30 deletions bin/remove-old-screenshots

This file was deleted.

Loading

0 comments on commit fb1fda3

Please sign in to comment.