Commit graph

315 commits

Author SHA1 Message Date
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
3caf58ca63 flake.lock: 2022_02_20 2022-02-20 17:19:32 +05:30
6e2eeea390 Backups: Keep some more snapshots
Restic is quite good at this and snapshots don't seem to take a lot of space (at
least now). So I can increase the number of snapshots.

This will likely only be important in case of significant fuckup on my part, or
some hacker encrypting my data leaving me dead in the water.
2022-02-20 17:18:01 +05:30
a3486e318d Backups: Setup backup for maildir for main Gmail account
- This also uses restic + rclone + NixOS as org/syncthing backups
         - Also setup desktop notifications and basic alert for if/when this
         - backup fails
2022-02-20 17:13:51 +05:30
cd9cd9aae7 Backups: Create new restic services to backup to onedrive
- This is second backup of data, on OneDrive
         Benefit being this data lives in a paid OneDrive subscription on DT
         and MP's family pack, and uses a shared directory on their OneDrive.
         - This removes dependency on Google, as even if GMail is blocked, I can
         retrieve the data as well as maildir via DT/MP's login.
         - This also means I don't have to pay for this storage :)
         (I should still find a way to pay them back, even though my use is
         tiny, like 2.5 G/1T or so).
2022-02-20 17:10:05 +05:30
5d27e57a05 (Try to) fix alerts and notifications for failed backup
- Multiple ExecStart statements
     - Type = oneshot, because that is the only way to have multiple ExecStarts
     - Delete unnecessary variables as it was making things more confusing than
       helpful. There was also much less duplication after removing Success
     - notification services
2022-02-20 17:07:12 +05:30
4adf354bf2 Backup: Formatted comment 2022-02-19 17:01:37 +05:30
c7652b388e Backup: Remove notification on successful backup
Over few days it is established that the configuration works in delivering
useful desktop notifications.

However, due to hourly backups, it is too much of a spam and endangers the
possibility of missing a rather important notification in case of a failed
backup.

So, it is wise to disable notifications on successful backups. Either way, I
have learned systemd service config and can always just 'git log' to get back at it.
2022-02-19 16:58:56 +05:30
46c694a4b1 flake.lock: 2022_02_18 2022-02-19 16:52:33 +05:30
76bfb711d1 Further enhance failure alerts for backups
I noticed that actual file was being created, but my semicolon was wrongly
escaped.
So this is attemt #2 to get it fixed.
2022-02-16 23:22:42 +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
bbe5634370 flake.lock: 2022_02_14 2022-02-14 15:05:33 +05:30
edc33d55d0 Disable virt-manager for now
One of its dependencies is failing to build and that is stopping entire system
from updating.
2022-02-14 15:04:54 +05:30
af83aaa20b Disable Skype
It brought in lot of gnome-related dependencies and I jsut don't seem to use
skype for much any more.
2022-02-14 15:04:17 +05:30
6196136513 Refine backup notifications
Now working for successful backups. Failure *should* work the same.

Notifications are preserved in notification history for now, because I couldn't
get error file creation to work, but that can be resolved in later iteration.
2022-02-14 15:02:53 +05:30
c930b6ec51 Minor format change 2022-02-14 14:15:51 +05:30
e76bd608f2 Initial attempt at email notifications (Needs testing)
imapnotify is supposed to keep the connection open and sync maildir whenever new
email is received.

Home-manager provides convenient way to enable this, so I'm trying it out.

Links:
config example:
b44af46bee/modules/workspace/email.nix

notification command:
https://teddit.net/r/kde/comments/j4vm37/plasma5_is_there_a_way_to_send_a_notification/

exact string for emacs' .desktop file was found by looking into emacs location
in /nix/store/*-emacspgtk../share/applications (and by looking at similar
example in Konsole dir). This needed to be done like this because NixOS does not
keep all desktop files in one location, but in thei respective packge's build in
/nix/store and then tells systemd to find them (not sure how, yet).
2022-02-13 13:24:56 +05:30
a1831bb6cf Begin setting up proper backup-monitoring
Add a rudimentary service that:

    1. is invoked when backup service indicates failure (systemd unit OnFailure
    config)
    This one needs to be tested properly

    2. when inoked, creates an empty file in user home directory with filename
    indicating which backup service failed
    This also needs to be tested, is very rudimentary, prone to failure and does
    not really work well.
    But, it is a good way to get feet wet. In future this can be automatically
    handed over to msmtp for an email, probably after generating some report on
    reason and conflict

I tried reading the restic service code in nixpkgs for adding the 'OnFailure'
option, but it does not look like an easy one. However, NixOS already provides
an easy way to modify any systemd service in a generic way, which is I am using
now.

I should regardless try to upstream a restic-service specific option for
OnFailure, but for now, I think this will work.

Issue link:
      GitHub: https://github.com/NixOS/nixpkgs/issues/126096
      IA: https://archive.is/4fwV4
      Wayback: https://web.archive.org/web/*/https://github.com/NixOS/nixpkgs/issues/126096
2022-02-13 13:23:13 +05:30
6873252e8e Minor refactor
Replace string "payas" with variable
2022-02-12 21:39:31 +05:30
ddf6fe498c Update Nix config options to match upstream
1. nix.binaryCaches -> nix.settings.substituters
  2. nix.maxJobs -> nix.settings.max-jobs
2022-02-12 19:31:42 +05:30
b7130e72e1 flake.lock: 2022_02_10 2022-02-11 16:44:03 +05:30
b04b3c6af9 flake.lock: 2022_02_08 2022-02-08 23:35:54 +05:30
0ea987c4d6 Remove Roboto fonts
I haven't used them in months and it is unlikely I will be using them in future.
2022-02-08 23:35:22 +05:30
6310acb6b8 flake.lock: 2022_02_03
This fixes the unlock issue and is a mass rebuild.
2022-02-03 19:55:02 +05:30
9865dd0e74 Update Nix config options for latest version 2022-02-03 19:54:39 +05:30
e8f2a3f283 NeoVim: Disable Ruby plugins
My only use of NeoVim is quick edits, and what minimal config I have works
without any plugins. As such, I can safely disable ruby plugins and hopefully
get rid of extra overhead and surface area in the system.
2022-02-03 09:47:19 +05:30
87f9ac0cad Replaace hledger with beancount
Further details in dotfiles repo
2022-02-03 08:39:46 +05:30
7b82a4091d Update config option for new nix version 2022-02-03 08:39:17 +05:30
ccf49dfd76 flake.lock: 2022_01_24 2022-01-24 17:34:34 +05:30
3249702c8c flake.lock: 2022_01_23 2022-01-23 15:37:23 +05:30
399056a56c flake.lock: 2022_01_18 2022-01-18 21:36:19 +05:30
5a87c9ca7a flake.lock: 2022_01_15 2022-01-16 12:05:05 +05:30
a437c65512 Configure NeoVim as default editor for git
Default editor for entire OS is configured to be kwrite, to aid with
occasional txt file opening from GUI. But it is not very convenient for
git.

Thankfully, git provides option to set defult editor for its own
operation and hom-manager provides option to configure it via home.nix.
2022-01-16 12:02:45 +05:30
7f069fc4b6 flake.lock: 2022_01_13 2022-01-13 19:46:21 +05:30
53ed08a399 flake.lock: 2022_01_09 2022-01-09 12:54:52 +05:30
831d9ee0f3 Include restic in PATH
This is useful for when a repository needs to be unlocked manually due to
occasional conflict or failure.
2022-01-09 12:49:43 +05:30
150fe9eb2f flake.lock: 2022_01_08 2022-01-08 14:37:27 +05:30
de47d37566 Add ghostscript
For modifying/compressing/munging PDFs conveniently and reliably via command line.
2022-01-08 14:36:34 +05:30
0320afc724 Remove unused packages
- shellcheck
- godot
2022-01-02 18:13:23 +05:30
d24c9087b2 Minor cleanup and refactor for restic service 2022-01-02 18:13:18 +05:30
f4dfde1560 flake.lock: 2022_01_01 2022-01-01 13:02:16 +05:30
a7a6efa97f Remove unused config for opening TCP ports for snapcast and mopidy
I am no longer using mopidy nor snapcast, and they are both removed from config.
It makes sense to remove this relic as well.
2021-12-31 22:50:27 +05:30
3c629724dc flake.lock: 2021_12_31 2021-12-31 17:37:12 +05:30
e2f2a0963a Move Syncthing config to home-manager
NixOS module for Syncthing already provides extensive configuration options, but
last time I attempted that, it did not work. So for a while now, I've installed
syncthing binary from NixOS, but handrolled the configuration and directory
setup and used syncthing-tray to keep an eye on it via nice GUI in tray icon.
Only annoyance being syncthing-tray did not start autmatically with the system.

Home-manager does not provide any/much config options. But, it provides a single
option to enable and auto-start syncthing + syncthing-tray, and it actuall
works. Needed to do a bit of fiddling about, but as is the case with NixOS, this
is now documented and enshrined within my config, so I don't have to think about
it again. Very nice indeed.
2021-12-31 17:33:07 +05:30
dee40cf1a5 Remove commented link for email config via Nix+home-manager
I think my config is at this pooint a good reference point to come back to for
this topic, so this comment is unnecessary
2021-12-30 23:58:14 +05:30
a894c82c1d Couple of plasma changes
- Enable Num Lock by default on startup
- Use "plasmawayland" as default session in SDDM
2021-12-30 23:56:36 +05:30
9af9d6428d Move htop, fzf and Neovim configs to home-manager
home-manager modules for these packages are quite nice and extensive and working
well in my testing so far. So, I might just use that.
2021-12-30 23:55:10 +05:30
3b7e7ebaa0 Install and configure git via home-manager 2021-12-30 22:34:47 +05:30
ac478a77e3 flake.lock: 2021_12_30 2021-12-30 22:34:28 +05:30
a9c0b78431 mu: Change mail retrieval/update time to align to 2nd minute of hour
Originally the service would schedule itself every hour starting from 00:00.

Right now, there is no good reason for it, but there could be other services
that might be waking up during the same time. So I shifted the window by 2 min
to make it little easier on the machine.
2021-12-29 21:04:37 +05:30