Skip to content

sonofhypnos/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotfiles

Welcome to my dotfiles đź‘‹! I use dotbot to manage the files.

I'd discourage just forking this repo, because lots of things here are specific to my workflow. Don't shoot yourself in the foot! Feel free to copy what you like though.

Overview

  • config/espanso/default.yml - text expansions for espanso
  • config/home-manager/ - my home-manager config (I am slowly trying to move more and more of my package-management and other config into home-manager)
  • /nix - contains files that are managed by home-manager
  • config/regolith - configuration for regolith ≅ Ubuntu + i3
  • nvim - neovim configuration and plugins
  • gitconfig - git configuration

My Doom-Emacs files are in a separate repo.

Miscellaneous/Obscure

Setting up Machines (intended for myself)

Setting Up Remote Machine

In case we want to push stuff to GitHub:

sudo apt update
sudo apt install git python3 curl neovim 

Install nix with:

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install # See https://github.com/DeterminateSystems/nix-installer

Install the repo:

git clone --depth 1 --recurse-submodules -j8 git@github.com:sonofhypnos/dotfiles.git ~/.dotfiles

Then run ./install.sh (make sure you have emacs and neovim installed).

./install.sh will also ask you if you want to recompile your home-manager config.

Put the following at the top of the bashrc (if you are using the local one):

if [[ $TERM = "tramp" ]]; then
        unset RPROMPT
        unset RPS1
        PS1="$ "
        unsetopt zle
        unsetopt rcs  # Inhibit loading of further config files
        return
fi

Setting Up Desktop

Suspend

Make sure you have more swap disk space than RAM, so you can use the swap partition for sleep with disk. (If you forget this, it's fine you can make a swap file)

Get UUID:

blkid | grep swap

Add swap to grub:

sudo vim /etc/default/grub

Append resume= at the end of already existing "quiet splash" or similar:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash
resume=UUID=2763225c-d330-4d26-82a3-76ef82dfc3f0"

Regenerate grub config: On Debian/Ubuntu/Mint:

sudo update-grupb

Regenerate initramfs (on Debian/Ubuntu/Mint) (this is needed to make sure the resume hook is in the initramfs (an os thingy in your RAM loaded at boot time)):

sudo update-initramfs -u

restart. Afterwards, sudo systemctl hibernate, should work.

Applications

sudo apt update
sudo apt install git python3 curl neovim 

Install nix with:

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install # See https://github.com/DeterminateSystems/nix-installer

Setup Neo Keyboard

System-wide (didn't work on ubuntu last time I tried):

sudo localectl --no-convert set-x11-keymap de pc105 neo_qwertz

Enable with (if it doesn't work go to next step):

setxkbmap de neo_qwertz

Enable neo keyboard with GNOME (not required on ubuntu last time I checked):

gsettings set org.gnome.desktop.input-sources show-all-sources true

Setup .dotfiles

Download your dotfiles:

git clone --depth 1 --recurse-submodules -j8 git@github.com:sonofhypnos/dotfiles.git ~/.dotfiles
nix-shell -p home-manager
cd ~/.dotfiles/config/home-manager/
home-manager switch -b backup --flake .#tassilo

After running the above we want to add home-manager independent of home-manager:

nix profile add home-manager

finally we run the dotfiles install script:

cd ~/.dotfiles
./install

Setup Regolith

  • Check the latest way of installing regolith here

Remove the keybindings config from regolith (since you configure it manually):

Add your favorite look:

sudo apt install regolith-look-*

The above doesn't literally work sadly:

sudo apt install regolith-look-blackhole 

Install Applications Manually That Otherwise Won't Work

sudo snap install steam
sudo snap install aws-cli --classic #Amazon website mentions snap version is maintained, so up to date.

Important applications to install via apt:

sudo apt install npm
sudo apt install pulseaudio-utils # Useful for audio via commandline
sudo apt install kazam #Not working via nix

# Needed for copilot with emacs

Download the latest Chrome version and run:

sudo apt install ./google-chrome-stable_current_amd64.deb
sudo apt install ./code_1.101.1-1750254731_amd64.deb

Same for 1password and run (you cannot install 1password via snap since it will be sandboxed and can't do everything you want):

sudo apt install ./1password-latest.deb 
  • go to 1password and enable developer setings

  • disable default keybinds in 1password, because they conflict with Ctrl+a on neoqwertz layout

  • Download the most recent version of anki (don't try APT (too old), nix or snap (too sandboxed)) and install it manually.

Ubuntu 24.04 User Namespace Fix

Fixes Nix apps (dropbox, signal, chrome) getting bwrap: Permission denied:

echo 'kernel.apparmor_restrict_unprivileged_userns = 0' | sudo tee /etc/sysctl.d/20-apparmor-donotrestrict.conf
sudo sysctl --system

Test the fix:

unshare --user --map-root-user echo "success"

References

Firefox

Set .dotfiles/bin/pdf.sh as the default application for PDFs.

Also enable org-protocol (refer to your notes for how to setup or debug org-protocol).

Dropbox

Install Dropbox by downloading the latest .deb file and use apt install ./dropbox-file.deb to install it.

Run Dropbox once on the command line with:

dropbox start -i

It will ask you to connect Dropbox with this laptop by opening a URL for login.

Zotero

  • Fix my entire backup setup (In my new setup, I will only backup user-owned things.)
  • First you need to manually install two addons below. Download their files (use wget, since Firefox will try to install them by default) and then go to "Tools > Plugins" in Zotero to install them.
  • Make sure that the versions of the addons are compatible with your Zotero version.
  • Configure auto-export for your Zotero library entries. Go to "File > Export Library...". Check the box for "Keep updated". This option will not exist if you have not added the Better BibTeX addon! We are currently storing them under ~/repos/bibliography/My Library.bib. You have to manually set the auto-export folder.

Device-Specific Information and Considerations Regarding Backup

So far, we always backed up all our files including files under / like /var/. Turns out our backup is getting really complicated though, because doing it like this requires us to run our backup as root, which messes with us being able to get prompted through a GUI by our backup. I could write a nicer backup that takes care of this. What seems like a more pleasant solution is to decide that everything under root will have to be configured manually, and while the idea of having logs of what happened after my laptop crashes is pleasant, who in practice is going to investigate this for my desktop laptop anyway. I don't have the time for that either.

This also makes another thing more uncomplicated. I think it probably makes a lot of sense to separate out our home directory to be on a different disk than the root directory. Last time I put ~/repos on a separate disk, because it was so large, but that was then inconvenient when we were jumping out of repos in Emacs.

Set Dark Mode

Set GNOME's dark theme preference explicitly:

gsettings set org.gnome.desktop.interface gtk-theme 'Yaru-dark'
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'

Enable Sync + OOM Killer Only (Secure)

We enable:

16 =  0x10 - enable sync command (s)
32 =  0x20 - enable remount read-only (u)
64 =  0x40 - enable signalling of processes (term, kill, oom-kill) (f)
128 =  0x80 - allow reboot/poweroff (b)

Check if /etc/sysctl.d/99-sysrq.conf exists.

Check the current value of the commands via:

cat /proc/sys/kernel/sysrq

s, u, b is probably enabled, so the value is 176 on Ubuntu. If the value is something else, perhaps you have other keys enabled and you would want to change the command below.

echo 'kernel.sysrq = 240' | sudo tee /etc/sysctl.d/99-sysrq.conf
sudo sysctl -p

Test if killing memory is working via:

python3 -c "x=[0]*10**8; input('Press Enter to exit or Ctrl+C to kill: ')"

Setup Backup

  • Forget the things below on setting up your backup for root! We are going to only backup things owned by the user in the future. Fewer problems with permissions. We just manually edit the configuration for root and document it well.
  • You will have to remove the ~/.config/systemd directory created by home-manager once, so that we can first write the files from dotbot there, before we proceed to add the ones from home-manager.

Checking Timers

To check when your timers are running next, you can run:

systemctl --user list-timers

for your user-level timers.

Setup fingerprint software

NOTE: We are trying without fingerprint for a while now, because we suspect it is the culprit that broke login with chrome not working anymore (chrome needs access to the keyring to decrypt its profile and so it looses things if we loose the keyring (or so the theory). I think it is easier to just not use the fingerprint feature probably.)

sudo apt update
sudo apt install fprintd libpam-fprintd

Scan your fingerprint (NOTE: it is important that we add our user here, otherwise the fingerprint will be used for root, but that is not the correct fingerprint if you want to log into root, which requires the fingerprint from a user with root access):

sudo fprintd-enroll tassilo

After add

sudo pam-auth-update

And select fingerprint from the menu

Setup org-roam

Your org-roam notes are backed up with github. We do not use git-dropbox anymore, since it is confusing to set up and it is slower than regular git. We thought it might be a good idea to use to allow us to store more data (like images), but it doesn't actually work well for that purpose. If we have too much data, downloading your repository becomes so slow as to be impossible. Instead, we just store images outside of our notes, which makes way more sense in the first place. Clone your repository:

git clone git@github.com:sonofhypnos/org-roam.git org-roam

Install Other Great Applications That You Can't Install via Nix

(Possibly because they need root access)

sudo apt install logwatch

Anki

You might have to install anki addons again. Anki addons you usually like to use: Image Occlusion Enhanced Review Heatmap Flexible Cloze 2 Batch Note editing Search and replace tags

(use Flexible Cloze 2 min note type)

Doom

Compile your config (last time you compiled your config on 30.2 it took just 2 minutes). Install further dependencies inside doom (depends on node 20+ which you can install with nix):

Run:

M-x: copilot-install-server

Secrets

So far we don't have a proper solution to secrets.

Trash-cli

To use trashcli in root, use:

sudo mkdir /.Trash-1001
sudo chown $(whoami):$(whoami) /.Trash-1001

(Trash-cli needs there to be a trash directory)

Magic SysRq Keys

On the ThinkPad T460, the magic key just requires you to press Fn. Just Fn+F is going to kill the application with the most memory etc.

More documentation on the magic key bitmap.

Fix backup:

If lock on your backup and there aren't two processes currently accessing at the same time:

borg break-lock borgbase:./repo

TODOs

  • we could change our bios such that we power on our device at midnight and then allow our backup to run.
  • Add secrets for backup
  • Add secrets for SSH (check which ones you want on desktop or other machines etc.)
  • Note: there is a problem, because we need the home-manager setup thing, but to get that zshrc and bashrc need to be set up if we want to add things under ~/bin to the path, but this is done by home-manager:
    • Insight: we do not need to properly install home-manager: we can use nix-shell -p home-manager and then install home-manager with home-manager! (This worked for me on a new install flawlessly)
  • Fix your version control setup with Dropbox? Using a remote to backup your stuff doesn't work, because your repository is too big. Probably the easiest solution is to just give up on having a remote and to just use ... instead.
  • Find a fix for the fact that home-manager wants to sandbox my applications when I do not want that
  • Try bash with starship, fzf and bash-completion and see if you can get rid of zsh as something you need to install extra.
  • Remove or fix the script where we are automatically trying to install home-manager and nix. They don't work in their current form, because they already expect scripts we added to our /bin to be in the path.
  • Create better action logging tools/lifelogging tools for LLMs to process:
    • Archive URLs with all of the text I read
    • Enable eye-tracking and use that to extract what text on a page I am reading
  • Make sure that things are still working without needing to install home-manager? (Or do we want that?)
  • Make sure install does not do weird things when we haven't installed Emacs
  • By now I know instead of copying and modifying things under /etc/share/regolith/conf.d/ I can just overwrite them in ~/config/regolith2/Xresources. That is what the set_from_xresource keybinds are for. Undoing that would be nice to do before or after we move to regolith 3.0
  • Same for neovim (for committing with git for example)
  • Move all dotbot stuff that I only need for my home to nix already (optional)
  • Create a bootstrap script to install nix and setup home-manager (for now I gave up on this, because nix doesn't like to work with root as docker does.)
  • Create better paths for shell (use $HOME instead of /home/tassilo)
  • Move more configuration to home-manager and make it declarative.

About

Configuration files for my linux desktop.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published