Skip to content

Latest commit

Β 

History

History
218 lines (173 loc) Β· 7.13 KB

File metadata and controls

218 lines (173 loc) Β· 7.13 KB

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,