Commit graph

247 commits

Author SHA1 Message Date
931678140b grafana: another attempt to fix anonymous auth 2023-06-05 03:51:42 +05:30
b92dfe4f30 radicale: replace xandikos with radicale 2023-06-05 03:38:15 +05:30
87f9692664 xandikos: fix port 2023-06-05 03:25:12 +05:30
a67c72579c xandikos: Add and enable 2023-06-05 03:23:26 +05:30
0ae5726697 grafana: another attempt at anonymous login 2023-06-05 03:10:47 +05:30
511da815a3 Revert "grafana: Allow anonymous auth"
This reverts commit 2faa1f0c7a.
2023-06-05 03:04:09 +05:30
66341a4fda Revert "grafana: allow anonymous viewer"
This reverts commit bf7142cf37.
2023-06-05 03:04:07 +05:30
bf7142cf37 grafana: allow anonymous viewer 2023-06-05 03:03:06 +05:30
2faa1f0c7a grafana: Allow anonymous auth 2023-06-05 02:53:23 +05:30
6534bb35fb paperless: fix admin 2023-06-05 02:49:57 +05:30
714147e190 paperless: trust localhost 2023-06-05 02:39:37 +05:30
07c7fd4ca9 paperless: Fix CSRF origin 2023-06-05 02:36:20 +05:30
12332f3977 fix paperless 2023-06-05 02:30:25 +05:30
bbddedd05d dex: fix issuer address 2023-06-05 02:20:54 +05:30
a9896167b3 outline: correct port and public URL 2023-06-05 02:14:36 +05:30
2a04d3330c wiki: Enable paperless, outline and dex with nginx 2023-06-05 02:07:20 +05:30
e1da4d958a nginx: different virtualHosts for different services 2023-06-05 01:55:41 +05:30
46340648b4 nginx: add priorities to paths
Hopefully this will fix single service issue
2023-06-05 01:24:43 +05:30
0f31b131e1 nginx: make root point to nginx 2023-06-05 01:09:10 +05:30
054dc49066 nginx: reset root to grafana
Turns out root is needed, and it MUST point to the same host somewhere.

Man this is tricky.
2023-06-05 01:01:33 +05:30
336d7ba735 nginx: remove root 2023-06-05 00:58:30 +05:30
ab62e65332 Revert "nginx: point root to grafana for now"
This reverts commit ba567ddbb9.
2023-06-05 00:53:41 +05:30
ba567ddbb9 nginx: point root to grafana for now 2023-06-05 00:52:56 +05:30
7779b33cc9 nginx: redirect root instead of proxying 2023-06-05 00:49:50 +05:30
7d948ce2ad nginx: add grafana, move navidrome and set root to blog 2023-06-05 00:39:17 +05:30
1f44073a5d wiki: remove dnsProvider 2023-06-05 00:08:19 +05:30
1e1aa22770 nginx: remove forceSSL 2023-06-05 00:07:13 +05:30
a943491fad wiki: correct typo 2023-06-05 00:06:28 +05:30
e0983c5690 wiki: remove certbot
It is no longer present in NixOS modules
2023-06-05 00:04:54 +05:30
27a6445dee wiki: Multiple changes
- Enable acme
- Enable certbot with bare settings
- add and force SSL for bebop subdomain
- enable acme for subdomain
- move music to root for now (to make sure it works)
2023-06-05 00:02:50 +05:30
739e8e504d wiki: Enable nginx proxy for navidrome and minio 2023-06-04 23:00:10 +05:30
4e4b6add85 wiki: disable paperless, dex and outline 2023-06-04 22:41:48 +05:30
17fd11a6a9 Add rhea to hosts and fish abbreviations 2023-06-03 12:28:06 +05:30
6673436bf3 Add hosts entries and fish abbrev for titan and lapetus
titan and lapetus are first of two new Raspberry Pi Zero Ws.

While quite anemic and decidedly incapable of running modern NixOS, they
still run Debian well enough, and are still full computers in their own
right.

So they get hostnames, the first of two moons in solar system, starting
from Saturn (should last a while :p), by ascending order of their year
of discovery. After Saturn, it'll be Jupyter, Uranus, Neptune, and then
back inwards starting from Mars. Luna will be last (if we ever manage to
get that far :p)
2023-06-02 01:24:55 +05:30
c716951f29 Syncthing: update for upstream option change 2023-05-28 16:20:10 +05:30
872bd8710b home: remove helix 2023-05-28 16:19:06 +05:30
c499caaec5 wiki: more outline 2023-05-27 19:57:07 +05:30
d2c731ae7f wiki: More change for outline 2023-05-27 19:49:29 +05:30
754e3133f9 wiki: Give outline correct url for dex 2023-05-27 19:42:15 +05:30
ec56ca4d28 wiki: More changes for outline 2023-05-27 19:36:58 +05:30
e03b09eb2a wiki: Enable outline to use Dex 2023-05-27 19:27:11 +05:30
1d1b259866 wiki: More changes 2023-05-27 19:05:36 +05:30
3ae0554efb wiki/outline: Attempt #2 2023-05-27 18:15:10 +05:30
986588255f wiki: Enable minio and add a new secret key for the same 2023-05-27 18:03:13 +05:30
8d36c91bff common: Add fsh alias to enable FHS with all currently installed libs 2023-05-27 15:17:49 +05:30
657db2ce17 wiki: Disable minio 2023-05-27 12:53:24 +05:30
dbfd58bef3 wiki: open ports for minio 2023-05-26 00:32:42 +05:30
5b9864a639 wiki: Disable outline, Add minio 2023-05-25 18:02:53 +05:30
386427b7ee wiki: Initial implementation
Ideally this should be split into separate packages, but we'll see. This
commit enables two services for bebop:

- outline (getoutline.com)
  A personal notion.so - like note-taking and knowledge base.
  I do like and prefer org-mode, but this is nicer looking and useful
  for gen-pop.
- paperless
  To store all documents in PDF format plus automatically OCR them and
  query the OCR'ed text.
2023-05-24 01:37:41 +05:30
06d1be47a7 monitoring: Add extra collectors to prometheus node
Does NOT work
2023-05-21 11:19:42 +05:30
f7a53e19e7 monitoring: Add new job for every target
Doesn NOT work
2023-05-21 11:19:23 +05:30
6541afb931 monitoring: Add job to scrape metrics from OpenWRT 2023-05-21 11:10:05 +05:30
7e1e1eb17d monitoring: remove zabbix 2023-05-21 11:09:45 +05:30
37bec4cb64 Calibre: Add module and enable for both hermes and bebop 2023-05-18 22:36:14 +05:30
8cf2aec09f monitoring: Add new exporters and their scraping for Prometheus
- Systemd
- influxdb
- pihole
2023-05-18 22:15:03 +05:30
7b254da83d syncthing: More api updated 2023-05-18 22:14:42 +05:30
c3ca54be60 grafana: Disable analytics
I'm surprised at Nixpkgs keeping them enabled by default :(
2023-05-17 00:15:26 +05:30
4b2b429052 common: Enable Atuin integration
shell history backed by sqlite database and spruced up with colorful
interface.

It is a direct replacement for fzf in that regard, and seems to work
quite well, albeit does not interact with fzf satisfactorily. So this is
an experiment to see how it goes.

It also provides syncing of shell history, with end-to-end encryption,
so that's something I'm looking forward to. Let's see how it goes.
2023-05-16 13:03:08 +05:30
f6a099b239 deploy-rs: Fully working deployments from hermes to bebop
I'm not sure whether the passwordless sudo is required, but I'm too
tired to test right now. Anyway, this works.

Also unsure on the statelessness of deploy-rs, but again, its simple
enough, didn't require changing anything else much and it works.

Perhaps some day, I'll see about trying out colmena for deploying
secrets, but until then, agenix is good enough for my needs.
2023-04-30 22:23:55 +05:30
bc8062f330 deploy-rs: More configuration
Right now this fails, because what I assume is a failure with emulation
in WSL, but otherwise I'm linking the overall approach of reusing the
preconfigured nixOSConfigurations in the same flake, as well as
lightweight burden of configuration. Doesn't hurt that it is written in
Rust rather than Python.
2023-04-30 16:59:46 +05:30
34cadf5c84 monitoring: Initial config for zabbix 2023-04-29 13:14:29 +05:30
8fb55cfa17 bebop: Update to changed options 2023-04-23 18:26:03 +05:30
e47ff31885 home: Enable exa, a replacement for 'ls'
Although aliases are enabled, I could not figure out a way to get them
to work with my current shell. I think this is because while
home-manager is trying to set aliases, they are set and controlled by
NixOS config, which doesn't have such option for fzf. I'll need to find
a way to set Fish as default shell via home-manager, but right now that
way does not work because home-manager cannot set fish plugins by using
nixpkgs derivation for it directly. :(
2023-04-20 14:32:51 +05:30
ee6f0461c3 hermes: Minor modification to fzf config 2023-04-20 14:32:32 +05:30
9b08f7b64c fish: switch emacs dir to new default freedesktop dir 2023-04-16 19:15:37 +05:30
1622f2b89a fonts: Add IBM Plex Mono 2023-04-05 01:56:27 +05:30
4ebf9bff80 home: Add nix-output-manager 2023-03-25 17:43:32 +05:30
22fd2e203a htop: Do not show full path
On NixOS the full path of binaries is long, obscures the flags/options given,
and is not very useful, since the nix store and hash are quite meaningless.

As such, it makes sense on NixOS to hide the full path of the program.

As for how to find the actual variable names for htop config, this file is
useful:

40104588f3/Settings.c
2022-12-12 14:12:06 +05:30
43acb193ac common-home: Add Helix editor
As an experiment at better Vim-style terminal editor.
2022-12-07 12:53:18 +05:30
c701f5a4d1 fish: Add another abbrev to update flake with sudo 2022-11-08 01:46:35 +05:30
9a7f817fdd hermes/WSL: Change generate resolv.conf due to NixOS-WSL update
Without this the build fails, so this is kinda unavoidable.
2022-11-07 13:05:41 +05:30
d46117ffb5 WSL: Disable nativeSystemd
Its support is very experimental upstream and things break. For e.g. user-level
services just don't work, and have no way to know/fix it. NixOS-WSL maintainer
is not very keen on working around that because of complexity and because
upstream is better place to fix it. As such, and on his advice, its better to
stick to the original state of affairs.
2022-11-04 21:36:10 +05:30
b83346874a WSL: Use native systemd support
Now that WSL comes with native systemd support of its own, NixOS-WSL can use it.
2022-11-04 13:21:29 +05:30
2f6bf35afc hermes: Fix gtk build failures
By removing minimal.nix config.noXlib is not set, and includes some other
packages per matrix answer.

But it will allow gtk to build and the rest of the system can now be updated.
2022-11-04 13:20:26 +05:30
ef339bf13b Elixir: Remove Elixir module
also remove commented import for elixir module from Hermes
2022-11-01 12:22:12 +05:30
a5549d831d Elixir: Remove elixir-LS path hack
emacs/eglot is now configured to use correct executable defined by the Emacs
package itself, so this hack is not required anymore
2022-10-21 23:02:56 +05:30
86bff1ef68 Revert "Common/Home: Temporarily disable manpages"
This reverts commit 2192fd0a60.

Upstream home-manager is now fixed and this is not required any more.
2022-10-21 13:45:59 +05:30
31d778b7ad Elixir: Switch to 1.14 2022-10-19 14:10:19 +05:30
2192fd0a60 Common/Home: Temporarily disable manpages
As a workaround for upstrean Nixpkgs issue
2022-10-19 13:31:27 +05:30
830ee784d2 WSL: Attempt to fix mount path 2022-10-17 11:00:53 +05:30
a4b46acf5e Fish: Add alias for 'mu index' 2022-09-23 11:28:13 +05:30
866b555cc6 Emacs+Fonts: Fix all-the-icons flag icons in mu4e
After bit of investigation across doom and package wiki and source code, bit
more googling to see why the flags were missing, turns out the font package was
missing from NixOS.

all-the-icons package in emacs closure is not strictly necessary, as doom is
expected to download it automatically, but I'll probably always have it, so its
a safe bet to keep both in sync.
2022-09-08 20:59:32 +05:30
c713048484 Hermes/Elixir: Add gnumake
Because for some reason exqlite compilation fails without some version of make.
2022-09-01 21:08:42 +05:30
5feda0f1f5 Hermes: Setup Elixir + Phoenix liveView packages
The LSP setup was bit more involved than expected, but it works.

- Create environment variable with ls package path.
- Do this globally because Fish is not yet managed by home-manager
- Use the variable to get package path in Emacs (configured in Doom Emacs
 config)

Currently the Elixir stuff is installed globally but this can work as far as I
can see. I might have to synchronise between project and system flake
occasionally, but I think it will be manageable for a while.
2022-08-28 11:07:16 +05:30
97fcac9e89 Fonts: Remove Julia Mono and IBM Plex fonts
I have not used these in a while. I also switched back to Fira Code today, and
it looks a lot better on HiDPI display with larger size compared to 1080p
display.

Julia Mono also wasn't being very helpful with the emojis, so its intended
purpose was not being served anyway.
2022-08-26 12:36:02 +05:30
551908cb7f hermes: disable hosts and resolve.conf generation
Inherit from Windows directly and make do with that. Once cache issues are
resolved-ish, I will think about re-enabling.
2022-07-05 21:34:56 +05:30
2ae292ebac WSL: Fix for NixOS-WSL update
Enable hosts and resolve config
2022-07-02 11:59:39 +05:30
e736becf78 Fix stateVersion for home-manager 2022-06-21 19:08:19 +05:30
8cc24511e0 Hermes: Let WSL handle networking
While I can setup dhcp with bridged networking on WSL, it won't be as friction
free. I'll have to setup a bridged adapter with same name in Hyper-V and then
the imperative state starts accumulating again.

Not fun.

I might have hardcoded hotsts file, which would have had been alright with my
threat model, but I realised only reason I want my DNS is privacy and
ad-blocking. But since neither browser nor any nefarious applications (at least
I hope not) run from within the VM, oit doesn't make sense.

Now the only thing remaining about this is that broken scrobbling in navidrome.
In that case, oh well.. not like all the client applications are fun,  so might
as well live with it.
2022-06-13 16:49:31 +05:30
4040d067f8 Hermes: Make NixOS generate hosts file
By default WSL generates the hosts file, but since NixOS can do its job, its
better to let it. Previous hosts file must be deleted first for this to take
effect.

resolv.conf generation via NixOS is currently disabled, but I might just do it.
DHCP is disabled so I'm not sure what else needs to be applied, but we'll see.
2022-06-13 16:41:28 +05:30
da8ad7a3a3 Revert dbc2a39e: DNS fix attempt 2022-06-13 10:29:33 +05:30
927cad466d Hermes: Move WSL config to separate module 2022-06-13 10:27:56 +05:30
57908c2b81 Navidrome: Move datafolder under homdir root
Navidrome config cannot be shared, it makes no sense to keep it synced under
org.
2022-06-12 15:47:03 +05:30
7f338deb98 navidrome: Make data folders independent of hosts
Turns out sharing navidrome data isn't possible. They don't really work
together.

So next best thing is to separate them out.
2022-06-12 14:53:55 +05:30
ddc5a663a7 whitespace cleanup 2022-06-12 13:53:37 +05:30
fcae51e38a Navidrome: Fix Music and Data Directories
THe systemd Unit for navidrome in nixpkgs is too overzealous in permission
denials.

It blocks homedir access by default (which I believe is dumb), so if MusicFolder
and DataFolder are anywhere inside homedir, they are not available to service at
runtime.

MusicFolder can be read-only, but DataFolder must be write-able.

This change also force sets user and group. I'm not sure that is necessary, but
since DynamicUser is true, I might just get it over with.
2022-06-12 13:18:38 +05:30
67dad94e7d navidrome: Explicitly enable Listenbrainz integration
Not that it is working.. I suspect it is another victim of overzealous systemd
unit configuration in Nixpkgs. Anyway I opened a bug report for it on navidrome
repo, probably have some response in next few weeks.
2022-06-12 12:28:51 +05:30
8dbb2e85f0 Navidrome: More customization 2022-06-12 01:55:01 +05:30
1e494aa605 Hermes,Bebop: Add and enable Navidrome audio server
Because WSL is ridden with bugs, I'm going to try running my Music over a
server.

This also provides opportunity to finally unify and start making proper
playlists that will stick.
2022-06-11 22:08:35 +05:30
5d009b6e5e Hermes/htop: Make Htop interface cleaner
by removing few columns:

1. Priority
2. Nice
3. M_SIZE
4. M_RESIDENT
5. M_SHARE
6. STATE
2022-06-08 17:38:10 +05:30
a3de5058f3 Hermes: Attempt to fix nixos-rebuild issue due to git
git fixed a CVE that makes directories not owned by the user to appear as not
git repo. Since my /etc/nixos is owned by my user, but nixos-rebuild is
performed by root, this is an issue. Simplest and best workaround is to add this
repo as safe directory.

This commit fixes this by way of setting default config for root user.

I also decided to go all in and setup full home-manager config identical to my
user here. I'll probably remove the FIsh config, but will see how it goes.
2022-06-08 17:35:26 +05:30
3c1666f9b1 Hermes: remove small unhelpful comments 2022-06-05 08:18:36 +05:30
a72f11864f Fish: Disable greeting text 2022-06-04 23:40:21 +05:30
586f56baa5 Hermes: Moved agenix module to host-specific dir
For now, thats all I need. Beside, it was weird before to have the top module
and keys in separate sections
2022-06-04 01:27:18 +05:30
d1945d2338 Agenix: Finally fix the breaking key decryption
The issue was generated NixOS system closure did not depend on the agenix
secrets being present in the NixOS repo. So, whenever garbage got collected, the
secrets dir got removed from the store, and on subsequent boots the secret
decryption failed as encrypted secrets were absent from NixOS store.

This fix means entire agenix secrets get copied over to the store instead of the
selective keys, but given how my current number of machines is fairly small and
I need pretty much all the keys on them, I think it is fine to keep it as is. In
future I can try something like Syncthing module where definition and
use happens in different location.
2022-06-04 01:16:32 +05:30
0003e82f75 Syncthing: Remove Enterprise 2022-06-04 01:16:09 +05:30
232fe744b7 Syncthing: Update id for Hermes 2022-06-04 01:15:47 +05:30
9ff1246638 Hermes: Enable secrets module
Now the agenix secrets are automatically decryped using the age secret key.
2022-06-02 18:57:10 +05:30
2de9aac5fb Users: Set up default usergroup for payas 2022-06-02 09:29:07 +00:00
ec43c4544e Hermes/Fonts: Enable Fonts module and add cascadia-code
Since I've been using WSL2 for past few days, I have been using Windows
Terminal.

While it doesn't really hold a candle to Konsole, it is alright and comes with
Cascadia Code font by default. Over few days, I've come to like this font and
decided to try it out for Emacs within WSL.
2022-06-02 09:17:57 +00:00
95a868f981 Syncthing/Bebop/Hermes: Replace Enterprise with Hermes
And enable Syncthing module for Hermes
2022-06-02 08:50:44 +00:00
0700205e2d Hermes: Initial bringup
This is minimal config for Hermes on WSL2.

Emacs is untested yet and needs ~/org/ to be imperatively copied still.

Email, Syncthing and Backup modules are yet to be set up and might need
some imperative actions.

However, the system is working and automatically logs into correct
default user.
2022-06-02 07:19:59 +00:00
33a8a7e501 Enterprise: Further modularization
- Plasma desktop
- Fonts
- Users

These are top-level modules in anticipation of new machine, but I expect them to
remain same regardless of particular host.
2022-05-26 23:17:15 +05:30
720c2e0bae Fish: Add alias to new bkp script in emacs-lisp
Emacs-lisp is proving to be decent scripting language.

This is a small script I wrote to unlock restic repos in case they get locked
based on few input params.
2022-05-19 23:12:07 +05:30
2f33493a92 Home: Manage Htop config using NixOS 2022-05-14 20:32:32 +05:30
3d13f90f08 Fish: Manage Fish plugins via NixOS
There is home-manager for more fine-grained plugin management, but I only use
single plugin used by Fish shell, and it is already present in nixpkgs.

Also setup (commented) code to add config.fish via home-manager. Should come in
handy in future.
2022-05-14 11:56:43 +05:30
c17557c7e5 Enterprise: Move Emacs config to home-manager
In sync with my general attempt to move as much as possible into user config
rather than system config.

It also makes Emacs config "slightly" cleaner and better understandable.
2022-05-14 11:54:37 +05:30
2ca8cbc9ad Home: Move broot and bat config to home-manager
This also allows removing this config from homedir
2022-05-14 11:47:47 +05:30
7f107d0947 Syncthing/everywhere: Remove Rocinante
In pursuit of trying out NixOS on Rocinante, the device was formatted and in my
basic assumptions, I did not back up userdata.

So, the device is lost and I no longer have the original Syncthing keys for this
device. Being an android phone, it would be unwise to backup and restore the
keys anyway.

So, For now, I am simply removing Rocinante from my backp roster. Oh so much for
extra machine backing up my stuff..
2022-05-08 20:43:03 +05:30
8752f3dc60 Fish: Add abbreviation: mkbook
This will download the whole HTML and its linked docs, recursively 5-levels
deep,  with random delays inbetween so as to not get throttled and convert links
to point to local files.

In short, this will copy a whole website on local, in a completely useable from
local format.

I tested on the Rust Book and it works fantastically!

I have a hunch I'll be using this multiple times going forward, so adding
abreviation.
2022-05-03 22:38:05 +05:30
71c0362ea5 Syncthing: Remove music_shared
Now only the full fat FLAC dir is shared between enterprise, bebop and Childish
Tycoon. I realised that the overhead of maintaining 2 sets was eventually going
to be too much. The two dirs were already out of sync, and as I was cleaning up
unwanted files from one device, the other dir was falling further behind in
sync.

So, now only FLACs will be shared. This means Rocinante has to be left out of
Music sync. This means there is one less backup, but I hope it will be fine.
Roci originally served the purpose of always-on node, but that role has been
taken over by bebopin much better fashion, so at least for now, I can survive
with one less backup of the music.
2022-05-01 20:15:53 +05:30
b105fe7add Syncthing: Add music_flac folder
This way I'll have at least one backup (albeit on-site only) of the flac
collection.

It took  me significant time to build it, and I'd rather not have to build all
of that again
2022-04-24 17:31:29 +05:30
1992e23f6b Fish: Add a function to compare two NixOS revisions on system
This function is a fish wrapper around a 'nix store' command to make it less
annoying to type every time.
2022-04-24 16:20:42 +05:30
648d39487f Git: Enable rerere: record merge conflict resolution 2022-04-22 00:36:05 +05:30
f398774bf3 Bebop: Switch back to pihole and remove adguardhome 2022-04-21 23:31:32 +05:30
d83ec9b498 Adguardhome: Add adguardhome module
It is easier to configure and has a NixOS module, it is well maintained, does
not need docker or non-deterministic container and
generally seems allright.

But, it *appears* to have less bells and whistles compared to PiHole. Generally
PiHole has a lot of mindshare, and as crappy as their development practices are,
it is taking a lead.. Its default list alsu has more than twice the number of
entries, so I'm inclined to return to it.
2022-04-21 23:02:35 +05:30
3d4a2ba8b2 Monitoring: Disable Nginx reverse proxy
It is not needed to display grafana afterall. If I need it to show things in
future from a (truly) remote host, I'll think about it.
2022-04-21 22:39:39 +05:30
047c890fbb Syncthing: Add Pictures folder to bring enterprise into declarative fold 2022-04-20 21:56:07 +05:30
016bfe7c50 Fish/Nix: Add abbr to delete all unued gc roots 2022-04-20 19:13:47 +05:30
2aaf27998e Monitoring: Add telegraf+influxdb data source
Still needs to be added to grafana imperatively, but that is something that will
take a lot of time, and need to understand my own pattern.

The board that I have copied over is not very useful, has too much info that I
don't need, and needs to have some more inputs from telegraf configured. So this
is a long term proejct, and can be safely ignored as *done* for now.
2022-04-20 00:01:03 +05:30
008e831bff Monitoring: Enable monitoring using Prometheus+grafana+systemd
TODO: Add Loki for logs

resource:
https://christine.website/blog/prometheus-grafana-loki-nixos-2020-11-20
2022-04-18 23:16:29 +05:30
3a56cf4ad1 Fish: Add simple abbr to check space left in all useful partitions 2022-04-18 19:12:26 +05:30
b39ff3e66f Syncthing: Add all existing devices and foldes
But don't enable them for bebop yet. Its measly storage is not yet there to hold
the music :p
2022-04-18 19:11:10 +05:30
ed2e919840 Bebop: Initial setup of Syncthing using declarative NixOS service
This is really good, because all the folders and devices and all their sharing
matrix is now declarative and part of same config as everything else. This
should remove a lot of headache going forward.

Only question is, the secrets management for Syncthing cert and key.

cert is public info encoded into the device ID, so that is mostly taken care of,
kinda.

But, these are still imperatively generated by Syncthing on the first run. I can
generate my own using openssh, but that isn't strictly better because it adds
more imperative overhead.

Lastly, the cert+key+ID combo is unique and every time a new device comes
in/current device needs to be reinstalled (highly unlikely since the dawn on
NixOS, but never say never), then this needs to be adjusted manually. For now,
I'm gonna leave it be, and deal with it when the need arises.

Declaratively deploying key via agenix is currently shelved, because unlike
other uses, this one directly exposes my network and machine to wide internet,
hedging on single SSH key, that cannot be password protected due to limitation
in agenix.
2022-04-18 18:43:25 +05:30
b74eda979b Fish: simplify abbreviations for bebop interaction 2022-04-17 22:03:44 +05:30
73be53cdb5 Bebop: Enable home-menager as NixOS module
This allows easy config of few applications/services

- git
- htop
- fzf
- neovim

* syncthing is not enabled yet. During previous experimentation it did not work,
so need to look more into it
2022-04-17 22:00:28 +05:30
b7a3e0c394 meta: Move nix.nix from top-level to modules directory
It makes sense
2022-04-16 21:31:56 +05:30
ce5b5ada3a Fish: Add couple of aliases for nix-env system rollback/switch-generation
NOT tested
2022-04-16 20:20:30 +05:30
026b412e23 Fish: Add couple of aliases to interact with bebop remotely 2022-04-16 20:20:08 +05:30
67ba724418 New module to hold config and packages common to all
While setting up Raspberry Pi, I realised there are some packages I consider
bare minimum, even for headless servers (that I own)

- NeoVim
- git
- ripgrep
- fd
- htop
- jq
- wget
- fzf
2022-04-15 12:25:40 +05:30
3e11013c7b Make Fish a common module instead of host specific module 2022-04-15 11:58:17 +05:30
1cd3d8c379 Secrets: Disable debug logging for agenix
Now that I have found the reason, there is no need IMO to keep this going.

It also makes it hard to grok whether decryption actually worked or not.
2022-03-07 23:12:30 +05:30
efe9b4de03 Revert "Secrets: Remove debug logging for agenix"
This reverts commit a6f719ce54.
2022-03-05 11:16:14 +05:30
a6f719ce54 Secrets: Remove debug logging for agenix 2022-03-04 23:55:24 +05:30
56a81aa87b Secrets: Fix agenix decryption during reboot
Force identityPaths value from config instead of merging it with one from agenix
derivation (it uses empty array if openssh is disabled, and openssh key paths if
enabled).

Ultimately this should not be necessary, but there is a chance my config was in
bad state and mkForce fixed it.

Since the whole point of NixOS is to not have such 'bad states', this is a bit
puzzling. After all everything is built by mortals so bugs are understandable.
but it will be better to keep in mind that all abstractions are leaky, even the
fully functional and strongly declarative ones like Nix :)
2022-03-04 23:52:19 +05:30
82779f2a54 Secrets: Enable debug logging for agenix
For some reason agenix failed to decrypt secrets during reboots and only worked
during `nixos-rebuild switch`.

This was @ryantm's suggestion to test things out while he helped out on Matrix
room.

Ultimately the conclusion was that probably openssh daemon was
starting (unlikely, but can be fixed by having system SSH keys and adding them
to agenix config) or that config was in some bad state (in which case it can
be fixed in a different manner).

Fix by simply asserting identityPaths value is included in next commit.
2022-03-04 23:46:26 +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