Commit graph

119 commits

Author SHA1 Message Date
3e11013c7b Make Fish a common module instead of host specific module 2022-04-15 11:58:17 +05:30
bad999e00b bebop: Initial config
bebop is the Raspberry Pi hanging around my table utterly unused for close to a
year now. About time it saw some use as tiny home server.
2022-04-14 23:35:54 +05:30
8ae17f5bad Clean up, rearrange and add comments in flake.nix
I could in theory just import all flake files from particular host, but so far
there aren't a lot of files in there, and I like the explicitness, and central
point of entry in flake.nix

Not sure what went wrong the last time I tried it. This seems to be working, so
I'll keep it and keep an eye for a while
2022-04-05 18:55:28 +05:30
51a851767f EXPERIMENT: Set up nixpkgs-unfree as root input as well as cachix
nixpkgs-unfree supposedly provides builds for non-free, but redistributable
packages that cache.nixos.org does not build.

Along with cuda-maintainers, it should reduce the burden for using heavy
packages for machine learning quite a bit. So, lets see how this one goes.

I should also start checking how the machine learning story is with NixOS at
all, it is rife with Python and Python has absolutely horrible ecosystem for
managing dependencies.
2022-03-29 22:11:51 +05:30
bf2761e10c doom-emacs: Disable building doom-emacs config via Nix 2022-03-28 22:18:22 +05:30
9167849010 doom-emacs: Get nix-doom-emacs to build and work
It is not perfect, it does not load private files and it generally feels a set
and forget, not-updated-often situation like every other Nix derivation.

It is promising, but the edges are sharp, and not something I'd like to invest
time in right now.
2022-03-28 22:14:28 +05:30
0553add7fc doom-emacs: Initial commit (BROKEN)
Build Doom-emacs config via Nix itself, and comine all in single monolithic,
declarative system mwahahahahaha

Except, its not working yet. It keeps complaining about missing 'beancount' :/

So, this commit will most likely be promptly reverted.
2022-03-28 21:04:24 +05:30
04dfe98ba2 Fish: Move Fish shell config to separate file
Also add new alias to `nixos-rebuild switch -v --offline`

Because offline build takes under a minute on cold-boot while without can take
multiple minutes, often wasting time and bandwidth on useless stuff like
fetching and parsing all inputs to system flake.

Lower time also makes it a as good temporary workaround for the agenix bug.
2022-03-28 00:10:28 +05:30
28322523c8 Enable nvidia and move nvidia config to separate file
- Enable nvidia GPU in sync-mode
   At least one game did not work well enough on Intel
 - Move nvidia config to separate file (nvidia.nix)
 - Refactor and simplify nvidia config
   enabling/mode-changing of nvidia can be done via two simple
   top-level variables instead of changing interdependent booleans
   independently.
   select GPU driver based on top level variable
   Add `nvidia-offload' environment variable shell to env based on top-level variable
2022-03-27 22:41:51 +05:30
629846a1f9 Setup secrets management using agenix
agenix uses age (a utility + standard) that encrypts secrets using ssh key.
This simplifies secrets management quite a bit compared to GPG (my attempts for
which have failed so far).

Changes included:
        - Encrypt all current keys (mail, backups) using age, configured via
        agenix
        - All encrypted keys are committed to git repo and decrypted during boot
        - None of the keys are used anywhere just yet. They will replace file
        paths in future commit after testing
        - Decrypted keys are available after boot under user name with read-only
        permissions at default agenix location (as of this commit)
        - The Nix variable path is provided by agenix and can be used instead of
        having to recreate
        - multiple keys can be specified for single key, but for now I am only
        using one

For now, the code is dirty and can definitely use improvements. It is just at a
place where it is all working right now.

TODO: Get age + agenix in environment packages available at runtime in NixOS

Links:
    - https://github.com/ryantm/agenix
    - https://github.com/hlissner/dotfiles
2022-02-22 03:09:20 +05:30
0d0b6c7d2c Refactor some parts into separate files
Move some logically independent and consisitent parts into separate
modules (files):

        1. Nix config :
           Package, experimental options, automatic garbage-collection config
        2. Backups :
           Restic + rclone + systemd services for backup notifications

This has reduced main configuration.nix by 100+ lines. These parts are also
unlikely to be touched in tandem with other configuration and hence can be
separated out.
2022-02-14 16:15:27 +05:30
cfe9e785a4 Revert "Temporarily pin emacs-overlay"
This reverts commit 4fa3d1f70a.
2021-11-24 13:51:35 +05:30
4fa3d1f70a Temporarily pin emacs-overlay
A change in Emacs 29 changed signature of define-key that broke doom.

Until the issue is fixed, pin emacs-overlay to commit before that.

Doom issue link: https://github.com/hlissner/doom-emacs/issues/5785
2021-11-24 13:46:17 +05:30
dfb3d3f7ee Enable binary cache for nix-community
Finally fully enable binary cache for nix-community and emacs-overlay.
No I don't have to build emacs from scratch for every master update :)

This was done by means of cachix, which is a means to upload built derivations
for others to share with. Nix-community has their own, and it makes using
overlays provided by nix-community that much better. This should shave off 20-25
min per system rebuild.

I am not sure if this will work as is after moving this config to new system,
so here are the steps to follow:

1. nix shell nixpkgs#cachix
2. sudo cachix use nix-community
3. stage/commit cachix.nix and cachix/ from /etc/nixos
4. done

Hopefully this will be enough in the future system move. If not, all the best to
future me.
2021-11-13 12:15:53 +05:30
a6ee16e8dc Use EmacsGcc package from emacs-overlay
Use Emacs master branch with native compilation flag enabled.

I tried Pgtk branch, but it is not always kept up to date with master (currently
3+ months behind) and could have some issues that aren't always tested. It does
mean Wayland integration is imperfect, but right now it is good enough (with few
minor annoyances).

Emacs + Gcc (native-comp)

native-comp is currently in upcoming release branch (28.0.50), while pgtk branch
is yet to be merged. Using both above features is easily available with
emacs-overlay provided by nix-community.

I still haven't been able to get cachix build cache to work, so currrently this
config builds full Emacs on machine. This extends system rebuild by 30+ minutes
and reduces system useability for the same duration.

Updating system frequently is not currently on my radar anyway, and I can
probably stomach keeping the machine humming for 60+ minutes of system
rebuild (compiling Emacs itself takes 25-30 min),
as long as I do it less than once per week. Will see how it goes.
2021-10-31 12:01:55 +05:30
338b82dd4a Switch Sound to PipeWire and move to separate module
PipeWire is new Linux audio and video streams.
Previously I used PulseAudio, and while it worked, it was less than
perfect. Pulse used bit much processing, and in general had few bugs.

Pipewire is supposed to be lighter, more stable, and it can use high
quality codec for bluetooth.

I took this opportunity to move sound-related config to its separate
module (sound.nix). This is a beginning to nicely move inpendent config
sections to their own modules. Sound config has pretty much zero
relations with rest of the config, so it made sense to move it in
separate file. Perhaps I can do the same with other stuff, maybe some services.
2021-09-13 08:08:58 +05:30
4cffebb34c mbsync + msmtp + mu setup via home-manager
Initial setup to email from within emacs.
That required setting up above stuff, detailed below:

mbsync : sync maildir with email host/provider (gmail)
mu : index and search maildir
msmtp : send mail

All of the above have good module under home-manager, making it *relatively*
straightforward to set the whole thing up.
2021-07-20 16:55:19 +05:30
42e7c9c728 Minor re-arrangement 2020-11-03 16:27:55 +05:30
8afac13daa Initial flake implementation
For now, simply copied current configuration.nix and hardware-configuration.nix
to hostname specific directory.
Made minor modifications to remove input impurity from
hardware-configuration.nix (<nixpkgs> to 4{modulesPath}).
Created flake.nix to import the configuration.nix and just build it.

Referred to this guy : https://github.com/MatthewCroughan/nixcfg
2020-11-03 16:10:59 +05:30