Skip to content

Animeshz/linux-desktop

Repository files navigation

My Linux Desktop

Preface

I prefer maximizing control over my system whenever possible. The top priorities for my Linux Desktop include Accessibility, Ease of Use, Reproducibility, and Stability.

And speaking of control, I’ve realized I should start documenting my processes. I mean, who knows, my wisdom might just go six feet under with me, and I’ve got a boatload of know-how tucked away up in this brain of mine. Plus, you know what they say about active externalism — it’s all about making sure your knowledge doesn’t end with you.

I’ve experimented with different tools over time ranging from shell scripts, makefiles, ansible/puppet/chef (check out the git tags) in order to enforce and sync configuration. But as the system evolves, things tend to deteriorate and everything becomes a giant mess.

Nix appears to tackle these issues, albeit in an extreme manner - less convenient and sensible, but quite effective - prioritizing correctness over flexibility. Most importantly it guarentees reproducibility, which means I can sit back and relax; if something worked, it’ll keep working unless changed.

Before anything, you can view my configuration at:

Additionally, I’ve described nix extensively in my notes over here.

My configuration

This is root repository to my linux system configuration, managed by nix flake.

I’ve primarily used home-manager with snowfall-lib for installation & configuration of most packages. For native stuffs (display drivers / virtualization that requires dkms kernel integrations / service management) I’ve used Puppet RAL.

So in most cases this config should be applicable to fit wide variety of distros, including various service managers (systemd/runit/openrc/etc).

Applying config

Justfile has following recipes set up.

just --list --unsorted
Available recipes:
    build
    dry-run
    switch
    list-generations
    treeview arg='.' # Shows treeview of given folder (also used in generation of README)
    nvfetcher        # Update all dependencies in nvfetcher.toml
    bundix           # Update all gems in packages/**

Main command you should remember is,

just switch && stow -t $HOME stow/

TODO: Document stow folder

Repository Structure

Autogenerated by running C-c C-v b in emacs. Be sure to load the shell module if you haven’t.

Home configs

homes
└── x86_64-linux
    └── animesh@framework
        └── default.nix

My primary config is at homes/x86_64-linux/animesh@framework/default.nix.

Modules

modules
└── home
    ├── apps
    │   └── brave
    │       └── default.nix
    ├── cli
    │   ├── bat
    │   │   └── default.nix
    │   ├── fish
    │   │   ├── default.nix
    │   │   └── functions.nix
    │   ├── git
    │   │   └── default.nix
    │   ├── inxi
    │   │   └── default.nix
    │   ├── just
    │   │   └── default.nix
    │   ├── kitty
    │   │   └── default.nix
    │   ├── nix
    │   │   ├── default.nix
    │   │   ├── pin-inputs.nix
    │   │   └── setup-comma.nix
    │   ├── ranger
    │   │   └── default.nix
    │   └── starship
    │       └── default.nix
    ├── desktop
    │   ├── eww
    │   │   └── default.nix
    │   ├── fonts
    │   │   └── default.nix
    │   ├── gtk
    │   │   └── default.nix
    │   ├── herbstluftwm
    │   │   └── default.nix
    │   └── xorg
    │       └── default.nix
    ├── editors
    │   ├── emacs
    │   │   └── default.nix
    │   └── nvim
    │       └── default.nix
    ├── languages
    │   ├── android
    │   │   └── default.nix
    │   ├── go
    │   │   └── default.nix
    │   └── ruby
    │       └── default.nix
    ├── modules
    │   └── puppet
    │       ├── default.nix
    │       └── etc.nix
    └── system
        ├── acpi-handler
        │   └── default.nix
        ├── auto-cpufreq
        │   └── default.nix
        ├── fstrim
        │   └── default.nix
        └── sysctl
            └── default.nix

Bundled packages

packages
├── emacs-chdir
│   └── default.nix
├── emacs-pcre
│   └── default.nix
├── phosphor-icons
│   └── default.nix
└── puppet
    ├── default.nix
    └── gemset.nix

Overlays

overlays
└── nvfetcher
    └── default.nix

Notes

To cleanup older generations:

pushd ~/.local/state/nix/profiles && ls | awk "!/$(readlink home-manager)/ && /home-manager-/" | xargs rm && popd
nix-collect-garbage --delete-old
nix store gc --debug

Sometimes mmap files prevent gc, reboot + same thing may clear even more!

UNLICENSE

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

For more information, please refer to <http://unlicense.org/>

References

Special thanks to these as my configuration have been extremely inspired by them,