Compare commits

...

No commits in common. "work" and "main" have entirely different histories.
work ... main

315 changed files with 14114 additions and 4735 deletions

View file

@ -0,0 +1,8 @@
#!/usr/bin/env bash
dir="$(realpath $(dirname ${BASH_SOURCE[0]})/../..)"
_nix_direnv_force_reload=1 direnv exec "$dir" true
direnv reload
# direnv reload updates the mtime of .envrc. Also update the timestamp of the
# profile_rc file to keep track that we actually are up to date.
touch $dir/.direnv/{nix,flake}-profile-*.rc

File diff suppressed because it is too large Load diff

3
.envrc
View file

@ -1 +1,2 @@
use nix export HE_PASSWORD=SuperDuper
use flake

2
.gitignore vendored
View file

@ -1,3 +1 @@
.direnv/ .direnv/
result/
result

View file

@ -1,114 +0,0 @@
# Changelog
## [v0.10.0](https://github.com/divnix/devos/tree/v0.10.0) (2021-05-24)
**Implemented enhancements:**
- Providing an interface to nixpkgs.config [\#237](https://github.com/divnix/devos/issues/237)
- Making the user available in profiles [\#230](https://github.com/divnix/devos/issues/230)
- copy evaluation store paths to iso [\#195](https://github.com/divnix/devos/issues/195)
- Extract custom system builds from devosSystem out of lib [\#170](https://github.com/divnix/devos/issues/170)
- Allow setting of channel host-wide [\#117](https://github.com/divnix/devos/issues/117)
- alacritty: CSIu support [\#51](https://github.com/divnix/devos/issues/51)
**Fixed bugs:**
- Cachix timeouts + how to disable nrdxp cachix \(if needed\) [\#294](https://github.com/divnix/devos/issues/294)
- default.nix flake-compat is broken [\#285](https://github.com/divnix/devos/issues/285)
- All suites return "attribute missing" [\#282](https://github.com/divnix/devos/issues/282)
- nix is built two times [\#203](https://github.com/divnix/devos/issues/203)
- fix lib docs [\#166](https://github.com/divnix/devos/issues/166)
**Closed issues:**
- eliminate userFlakeNixOS [\#257](https://github.com/divnix/devos/issues/257)
- devos-as-library [\#214](https://github.com/divnix/devos/issues/214)
**Merged pull requests:**
- Update evalArgs to match the new planned API [\#239](https://github.com/divnix/devos/pull/239)
## [v0.9.0](https://github.com/divnix/devos/tree/v0.9.0) (2021-04-19)
**Implemented enhancements:**
- pin inputs into iso live registry [\#190](https://github.com/divnix/devos/issues/190)
- Pass 'self' to lib [\#169](https://github.com/divnix/devos/issues/169)
- doc: quickstart "ISO. What next?" [\#167](https://github.com/divnix/devos/issues/167)
- Integrate Android AOSP putting mobile under control [\#149](https://github.com/divnix/devos/issues/149)
- Inoculate host identity on first use [\#132](https://github.com/divnix/devos/issues/132)
- kubenix support [\#130](https://github.com/divnix/devos/issues/130)
- Improve Home Manager support: profiles/suites, modules, extern, flake outputs [\#119](https://github.com/divnix/devos/issues/119)
- Local CA \(between hosts\) [\#104](https://github.com/divnix/devos/issues/104)
- Q5: git annex for machine state [\#68](https://github.com/divnix/devos/issues/68)
- name space ./pkgs overlays [\#60](https://github.com/divnix/devos/issues/60)
- remap global keys easily [\#57](https://github.com/divnix/devos/issues/57)
- make pass state part of this repo's structure [\#56](https://github.com/divnix/devos/issues/56)
- Incorporate ./shells [\#38](https://github.com/divnix/devos/issues/38)
- Encrypt with \(r\)age [\#37](https://github.com/divnix/devos/issues/37)
**Fixed bugs:**
- `pathsToImportedAttrs` does not accept directories [\#221](https://github.com/divnix/devos/issues/221)
- Cachix caches aren't added to the configuration [\#208](https://github.com/divnix/devos/issues/208)
- Issues with current changelog workflow [\#205](https://github.com/divnix/devos/issues/205)
- iso: systemd service startup [\#194](https://github.com/divnix/devos/issues/194)
- Help adding easy-hls-nix to devos [\#174](https://github.com/divnix/devos/issues/174)
- `flk update` fails because of obsolete flag [\#159](https://github.com/divnix/devos/issues/159)
- Expected that not all packages are exported? [\#151](https://github.com/divnix/devos/issues/151)
- Segmentation fault when generating iso [\#150](https://github.com/divnix/devos/issues/150)
**Documentation:**
- doc: split iso [\#193](https://github.com/divnix/devos/issues/193)
- lib: can depend on pkgs \(a la nixpkgs\#pkgs/pkgs-lib\) [\#147](https://github.com/divnix/devos/pull/147)
**Closed issues:**
- FRRouting router implementation [\#154](https://github.com/divnix/devos/issues/154)
- ARM aarch64 Support [\#72](https://github.com/divnix/devos/issues/72)
## [v0.8.0](https://github.com/divnix/devos/tree/v0.8.0) (2021-03-02)
**Implemented enhancements:**
- semi automatic update for /pkgs [\#118](https://github.com/divnix/devos/issues/118)
- Home-manager external modules from flakes [\#106](https://github.com/divnix/devos/issues/106)
**Fixed bugs:**
- My emacsGcc overlay is not working [\#146](https://github.com/divnix/devos/issues/146)
- local flake registry freezes branches [\#142](https://github.com/divnix/devos/issues/142)
- nixos-option no longer works after collect garbage [\#138](https://github.com/divnix/devos/issues/138)
- Profiles imports are brittle, causing failure if imported twice [\#136](https://github.com/divnix/devos/issues/136)
## [0.7.0](https://github.com/divnix/devos/tree/0.7.0) (2021-02-20)
**Implemented enhancements:**
- add zoxide [\#53](https://github.com/divnix/devos/issues/53)
- Multiarch support? [\#17](https://github.com/divnix/devos/issues/17)
- initial multiArch support [\#18](https://github.com/divnix/devos/pull/18)
**Fixed bugs:**
- Missing shebang from flk.sh [\#131](https://github.com/divnix/devos/issues/131)
- Rename Meta Issue [\#128](https://github.com/divnix/devos/issues/128)
- specialisations break the `system` argument [\#46](https://github.com/divnix/devos/issues/46)
- Revert "Add extraArgs to lib.nixosSystem call to add system args." [\#47](https://github.com/divnix/devos/pull/47)
**Documentation:**
- update home-manager urls [\#62](https://github.com/divnix/devos/pull/62)
**Closed issues:**
- add github action for cachix build ci [\#59](https://github.com/divnix/devos/issues/59)
## [12052020](https://github.com/divnix/devos/tree/12052020) (2020-12-06)
## [07092020](https://github.com/divnix/devos/tree/07092020) (2020-07-09)
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

18
COPYING
View file

@ -1,18 +0,0 @@
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -3,61 +3,77 @@
> #### ⚠ Advisory ⚠ > #### ⚠ Advisory ⚠
> Do you remember how you got here? Where were you going? What were you leaving behind? > Do you remember how you got here? Where were you going? What were you leaving behind?
> Even if you cant't remember, I hope you remember what you were looking for. > Are you sure you want to go down this rabbit hole, Alice?
> I hope you find it here.
## Getting Started ## Getting Started
You can clone this directory to `/etc/nixos/` on a NixOS machine, with flakes installed. This is my personal deployment hub. I configure all my personal servers from this repo. Good luck if you're looking to graft this.
Then you can summon a machine with `sudo nixos-rebuild test --flakes '/etc/nixos/#<machine>'` You'll probably want to run some `install.sh` that will configure the base NixOS system. Some of them aren't in a good state.
For a list of machines inscribed in this spellbook look [here][here] From there you can either install the host you want with `sudo nixos-rebuild switch --flake .#<host>` or enter the cockpit with `nix develop` and deploy servers remotely through `deploy`
The rest is left as an exercise to the reader.
### Status: Alpha
The volcanic rock still shifts below this structure. It has not solidified and cannot yet be considered `home` ## Personal dotfiles
You should not expect landmarks here. <img src="./screenshots/fakebusy.png" width="100%" />
Learn to adopt Chaos.
<p align="center">
<span><img src="./screenshots/desktop.png" height="178" /></span>
<span><img src="./screenshots/rofi.png" height="178" /></span>
<span><img src="./screenshots/firefox.png" height="178" /></span>
</p>
------
| | |
|----------------|----------------------------------------------------------|
| **Shell:** | bash / zsh |
| **DM:** | lightdm + lightdm-mini-greeter |
| **WM:** | bspwm + polybar |
| **Editor:** | nvim |
| **Terminal:** | kitty |
| **Launcher:** | rofi |
| **Browser:** | firefox |
| **GTK Theme:** | [Ant Dracula](https://github.com/EliverLara/Ant-Dracula) |
-----
### Status: Tectonic
The planet is cooling down, and approaching stability. It is well understood, and the continents are not expected to change much more. One should expect some more localized changes, and further development.
## Shoulders ## Shoulders
Summoning is powerful magic, and cannot be created in isolation. It stands on the [shoulders of the Summoning is powerful magic, and cannot be created in isolation. It stands on the [shoulders of the
following giants][giants]: following giants][giants]:
### :onion: &mdash; like the layers of an onion ### :onion: &mdash; like the layers of an onion
- [`devos/devos`][devos]
- [`divnix/digga`][digga]
- [`gytis-ivaskevicius/flake-utils-plus`][fup]
- [`numtide/flake-utils`][fu]
- [`numtide/devshell`][devshell]
- [`serokell/deploy-rs`][deploy] - [`serokell/deploy-rs`][deploy]
- [`berberman/nvfetcher`][nvfetcher]
- [`NixOS/nixpkgs`][nixpkgs] - [`NixOS/nixpkgs`][nixpkgs]
- [`ryantm/agenix`][agenix]
- [`direnv/direnv`][direnv]
:heart: :heart:
### But Why? ### But Why?
The future is more uncertain than ever. Make dependable what you can, in whatever way you know how. The future is more uncertain than ever. Make dependable what you can, in whatever way you know how.
Stop doing it by yourself, unless we learn to work with one another will we be able to grow long term solutions. Perhaps together we can stop collapse. Stop doing it by yourself, unless we learn to work with one another will we be able to grow long term solutions.
Managing servers by hand sucks, k8s doesn't allow me to transitively deploy all my configuration to multiple personal machines, and ansible wasn't good enough.
You probably don't want to use nixOS, I'm a masocist
### Grafts
https://github.com/hlissner/dotfiles
# License # License
DevOS is licensed under the [MIT License][mit]. DevOS is licensed under the [MIT License][mit].
[community]: https://github.com/divnix/devos/tree/community [community]: https://github.com/divnix/devos/tree/community
[core]: https://github.com/divnix/devos
[deploy]: https://github.com/serokell/deploy-rs [deploy]: https://github.com/serokell/deploy-rs
[devshell]: https://github.com/numtide/devshell
[digga]: https://github.com/divnix/digga
[dotfiles]: https://github.com/hlissner/dotfiles [dotfiles]: https://github.com/hlissner/dotfiles
[flake-doc]: https://github.com/NixOS/nix/blob/master/src/nix/flake.md [flake-doc]: https://github.com/NixOS/nix/blob/master/src/nix/flake.md
[flakes]: https://nixos.wiki/wiki/Flakes [flakes]: https://nixos.wiki/wiki/Flakes
[fu]: https://github.com/numtide/flake-utils
[fup]: https://github.com/gytis-ivaskevicius/flake-utils-plus
[giants]: https://en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants [giants]: https://en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants
[home-manager]: https://nix-community.github.io/home-manager [home-manager]: https://nix-community.github.io/home-manager
[mit]: https://mit-license.org [mit]: https://mit-license.org
[mk-flake]: https://github.com/divnix/digga/tree/master/src/mkFlake
[nix]: https://nixos.org/manual/nix/stable [nix]: https://nixos.org/manual/nix/stable
[nixos]: https://nixos.org/manual/nixos/stable [nixos]: https://nixos.org/manual/nixos/stable
[nixpkgs]: https://github.com/NixOS/nixpkgs [nixpkgs]: https://github.com/NixOS/nixpkgs
[nvfetcher]: https://github.com/berberman/nvfetcher
[please]: https://github.com/nrdxp/devos/tree/nrd
[here]: https://anish.lakhwara.com/ops/machines

View file

@ -1,5 +0,0 @@
status = [ "check" ]
required_approvals = 1
up_to_date_approvals = true

View file

@ -1,10 +0,0 @@
{ pkgs, lib, budUtils, ... }: {
bud.cmds = with pkgs; {
get = {
writer = budUtils.writeBashWithPaths [ nixUnstable git coreutils ];
synopsis = "get [DEST]";
help = "Copy the desired template to DEST";
script = ./get.bash;
};
};
}

View file

@ -1 +0,0 @@
nix flake new -t "github:divnix/devos/core" "${2:-devos}"

View file

@ -1,31 +0,0 @@
let
inherit (default.inputs.nixos) lib;
default = (import ./lib/compat).defaultNix;
ciSystems = [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
];
filterSystems = lib.filterAttrs
(system: _: lib.elem system ciSystems);
recurseIntoAttrsRecursive = lib.mapAttrs (_: v:
if lib.isAttrs v
then recurseIntoAttrsRecursive (lib.recurseIntoAttrs v)
else v
);
systemOutputs = lib.filterAttrs
(name: set: lib.isAttrs set
&& lib.any
(system: set ? ${system} && name != "legacyPackages")
ciSystems
)
default.outputs;
ciDrvs = lib.mapAttrs (_: system: filterSystems system) systemOutputs;
in
(recurseIntoAttrsRecursive ciDrvs) // { shell = import ./shell.nix; }

7
dns/creds.json Normal file
View file

@ -0,0 +1,7 @@
{
"hedns": {
"TYPE": "HEDNS",
"username": "iamanish",
"password": "$HE_PASSWORD"
}
}

59
dns/dnsconfig.js Normal file
View file

@ -0,0 +1,59 @@
// Providers:
var REG_NONE = NewRegistrar('none'); // No registrar.
var DNS_BIND = NewDnsProvider('bind'); // ISC BIND.
var DNS_HEDNS = NewDnsProvider('hedns');
D("lakhwara.com", REG_NONE,
DnsProvider(DNS_HEDNS),
DefaultTTL(300),
//SOA('@', 'ns1.he.net.', 'hostmaster.he.net.', 2022041702, 86400, 7200, 3600000, 86400, TTL(172800)),
A('anish', '69.61.2.203'),
A('@', '69.61.2.203'),
//A('coaching', '103.16.130.98'),
TXT('anish', 'datkey=dat://1a240a14fab2bae9c85ebad29bddc04505aaba24e5fb809c2ccb4cdf71e3a7d5'),
CNAME('fm1._domainkey', 'fm1.lakhwara.com.dkim.fmhosted.com.'),
CNAME('fm2._domainkey', 'fm2.lakhwara.com.dkim.fmhosted.com.'),
CNAME('fm3._domainkey', 'fm3.lakhwara.com.dkim.fmhosted.com.'),
MX('@', 10, 'in1-smtp.messagingengine.com.'),
MX('@', 20, 'in2-smtp.messagingengine.com.'),
//NAMESERVER('ns1.he.net.'),
//NAMESERVER('ns2.he.net.'),
//NAMESERVER('ns3.he.net.'),
//NAMESERVER('ns4.he.net.'),
//NAMESERVER('ns5.he.net.'),
TXT('@', 'v=spf1 include:spf.messagingengine.com ?all')
)
D('sealight.xyz', REG_NONE, DnsProvider(DNS_HEDNS),
DefaultTTL(86400),
//SOA('@', 'ns1.he.net.', 'hostmaster.he.net.', 2022121008, 86400, 7200, 3600000, 172800, TTL(172800)),
//NAMESERVER('ns1.he.net.'),
//NAMESERVER('ns2.he.net.'),
//NAMESERVER('ns3.he.net.'),
//NAMESERVER('ns4.he.net.'),
//NAMESERVER('ns5.he.net.'),
// capsul: helix
A('bridge', '69.61.2.203', TTL(300)),
A('rss', '69.61.2.203', TTL(300)),
A('git', '69.61.2.203', TTL(300)),
A('bin', '69.61.2.203', TTL(300)),
A('ci', '69.61.2.203', TTL(300)),
A('write', '69.61.2.203', TTL(300)),
// vultr -> nulled: lituus
A('@', '45.77.48.108', TTL(300)),
A('jitsi', '45.77.48.108', TTL(300)),
A('chat', '45.77.48.108', TTL(300)),
A('element', '45.77.48.108', TTL(300)),
A('turn', '45.77.48.108', TTL(300)),
//nullhex free email real estate
CNAME('key1._domainkey', 'key1.nullhex.com.'),
CNAME('autoconfig', 'autoconfig.nullhex.com.'),
MX('@', 10, 'smtp-in-1.nullhex.com.'),
MX('@', 20, 'smtp-in-2.nullhex.com.'),
TXT('@', 'v=spf1 a mx ~all'),
SRV('_autodiscover._tcp', 0, 1, 443, 'autodiscover.nullhex.com.'),
TXT('_dmarc', 'v=DMARC1; p=quarantine;'),
SRV('_imaps._tcp', 0, 1, 993, 'imap.nullhex.com.'),
SRV('_submissions._tcp', 0, 1, 465, 'smtp.nullhex.com.')
);

26
dns/test_nullhex.sh Normal file
View file

@ -0,0 +1,26 @@
#!/bin/sh
if [ -z "$1" ]; then
echo "error: domain missing (sealight.xyz)"
exit 1
fi
domain="$1"
errors=""
dig +short MX "$domain" | grep -q 'smtp-in-1.nullhex.com' || errors="smtp-in-1.nullhex.com record not found"
dig +short MX "$domain" | grep -q 'smtp-in-2.nullhex.com' || errors="$errors\nsmtp-in-2.nullhex.com record not found"
dig +short TXT "$domain" | grep -q '^"v=spf1 a mx ~all"$' || errors="$errors\nspf record not found"
dig +short CNAME "key1._domainkey.$domain" | grep -q 'key1.nullhex.com' || errors="$errors\nkey1._domainkey.$domain record not found"
dig +short TXT "_dmarc.$domain" | grep -q '^"v=DMARC1; p=quarantine;"$' || errors="$errors\ndmarc TXT record is missing"
dig +short SRV "_autodiscover._tcp.$domain" | grep -q '443 autodiscover.nullhex.com.' || errors="$errors\nautodiscover SRV record is missing"
dig +short SRV "_imaps._tcp.$domain" | grep -q '993 imap.nullhex.com.' || errors="$errors\nimap SRV record is missing"
dig +short SRV "_submissions._tcp.$domain" | grep -q '465 smtp.nullhex.com.' || errors="$errors\nsmtp SRV record is missing"
dig +short CNAME "autoconfig.$domain" | grep -q 'autoconfig.nullhex.com.' || errors="$errors\nautoconfig CNAME record is missing"
if [ ! -z "$errors" ]; then
echo "$errors"
exit 1
else
echo "success! u are redy"
fi

View file

@ -0,0 +1,22 @@
; lakhwara.com Dumped Sun May 28 22:30:02 2023
;
lakhwara.com. 172800 IN SOA ns1.he.net. hostmaster.he.net. (
2022041702 ;serial
86400 ;refresh
7200 ;retry
3600000 ;expire
86400 ) ;minimum
anish.lakhwara.com. 86400 IN A 103.16.130.98
anish.lakhwara.com. 86400 IN TXT datkey=dat://1a240a14fab2bae9c85ebad29bddc04505aaba24e5fb809c2ccb4cdf71e3a7d5
fm1._domainkey.lakhwara.com. 86400 IN CNAME fm1.lakhwara.com.dkim.fmhosted.com.
fm2._domainkey.lakhwara.com. 86400 IN CNAME fm2.lakhwara.com.dkim.fmhosted.com.
fm3._domainkey.lakhwara.com. 86400 IN CNAME fm3.lakhwara.com.dkim.fmhosted.com.
lakhwara.com. 86400 IN A 103.16.130.98
lakhwara.com. 86400 IN MX 10 in1-smtp.messagingengine.com.
lakhwara.com. 86400 IN MX 20 in2-smtp.messagingengine.com.
lakhwara.com. 86400 IN NS ns1.he.net.
lakhwara.com. 86400 IN NS ns2.he.net.
lakhwara.com. 86400 IN NS ns3.he.net.
lakhwara.com. 86400 IN NS ns4.he.net.
lakhwara.com. 86400 IN NS ns5.he.net.
lakhwara.com. 86400 IN TXT "v=spf1 include:spf.messagingengine.com ?all"

View file

@ -0,0 +1,30 @@
; sealight.xyz Dumped Sat Dec 10 03:57:51 2022
;
sealight.xyz. 172800 IN SOA ns1.he.net. hostmaster.he.net. (
2022121008 ;serial
86400 ;refresh
7200 ;retry
3600000 ;expire
172800 ) ;minimum
autoconfig.sealight.xyz. 86400 IN CNAME autoconfig.nullhex.com.
bridge.sealight.xyz. 300 IN A 69.61.38.225
chat.sealight.xyz. 300 IN A 45.77.48.108
element.sealight.xyz. 300 IN A 45.77.48.108
git.sealight.xyz. 300 IN A 69.61.38.225
jitsi.sealight.xyz. 300 IN A 69.61.38.225
key1._domainkey.sealight.xyz. 86400 IN CNAME key1.nullhex.com.
rss.sealight.xyz. 300 IN A 69.61.38.225
sealight.xyz. 300 IN A 45.77.48.108
sealight.xyz. 86400 IN MX 10 smtp-in-1.nullhex.com.
sealight.xyz. 86400 IN MX 20 smtp-in-2.nullhex.com.
sealight.xyz. 172800 IN NS ns1.he.net.
sealight.xyz. 172800 IN NS ns2.he.net.
sealight.xyz. 172800 IN NS ns3.he.net.
sealight.xyz. 172800 IN NS ns4.he.net.
sealight.xyz. 172800 IN NS ns5.he.net.
sealight.xyz. 86400 IN TXT "v=spf1 a mx ~all"
turn.sealight.xyz. 300 IN A 69.61.38.225
_autodiscover._tcp.sealight.xyz. 86400 IN SRV 0 1 443 autodiscover.nullhex.com.
_dmarc.sealight.xyz. 86400 IN TXT "v=DMARC1; p=quarantine;"
_imaps._tcp.sealight.xyz. 86400 IN SRV 0 1 993 imap.nullhex.com.
_submissions._tcp.sealight.xyz. 86400 IN SRV 0 1 465 smtp.nullhex.com.

1
doc/.gitignore vendored
View file

@ -1 +0,0 @@
book

View file

@ -1,18 +0,0 @@
# Pull Requests
## TL;DR;
- **Target Branch**: `main`
- **Merge Policy**: [`bors`][bors] is alwyas right (&rarr; `bors try`)
- **Docs**: every changeset is expected to contain doc updates
- **Commit Msg**: be a poet! Comprehensive and explanatory commit messages
should cover the motivation and use case in an easily understandable manner
even when read after a few months.
- **Test Driven Development**: please default to test driven development where possible.
### Within the Devshell (`nix develop`)
- **Hooks**: please `git commit` within the devshell
- **Fail Early**: please run from within the devshell on your local machine:
- `nix flake check`
[bors]: https://bors.tech

View file

@ -1,28 +0,0 @@
# Summary
- [Introduction](../README.md)
- [Quick Start](./start/index.md)
- [ISO](./start/iso.md)
- [Bootstrapping](./start/bootstrapping.md)
- [From NixOS](./start/from-nixos.md)
- [Key Concepts](./concepts/index.md)
- [Hosts](./concepts/hosts.md)
- [Overrides](./concepts/overrides.md)
- [Profiles](./concepts/profiles.md)
- [Suites](./concepts/suites.md)
- [Users](./concepts/users.md)
- [Outputs](./outputs/index.md)
- [Modules](./outputs/modules.md)
- [Overlays](./outputs/overlays.md)
- [Packages](./outputs/pkgs.md)
- [Concerns]()
- [Secrets](./secrets.md)
- [Tests](./tests.md)
- [Helper Script `bud`](./bud/index.md)
- [get](./bud/get.md)
- [Integrations](./integrations/index.md)
- [Cachix](./integrations/cachix.md)
- [Deploy RS](./integrations/deploy.md)
- [NvFetcher](./integrations/nvfetcher.md)
- [Hercules CI](./integrations/hercules.md)
- [Contributing](./CONTRIBUTING.md)

View file

@ -1,6 +0,0 @@
[book]
authors = ["Timothy DeHerrera"]
language = "en"
multilingual = false
src = "."
title = "devos docs"

View file

@ -1,10 +0,0 @@
# get
The `get` subcommand is useful for getting a bare copy of devos without the
git history.
## Usage
```sh
bud get DEST-DIR
```
If DEST-DIR is ommitted, it defaults to _./devos_.

View file

@ -1,24 +0,0 @@
# [`bud`][bud] command
The template incudes a convenient script for managing your system called [`bud`][bud].
It is a portable and highly composable system control tool that work anywhere on your host
or in the flake's devshell.
Although it comes with some predefined standard helpers,
it is very extensible and you are encouraged to write your own script snippets
to ease your workflows. An example is the bud module for a `get` command that
comes included with `devos`.
While writing scripts you can convenientely access smart environment variables
that can tell the current architecture, user or host name, among others, regardless
wether you invoke `bud` within the devshell or as the system-wide installed `bud`.
For details, please review the [bud repo][bud].
## Usage
```sh
bud help
```
[bud]: https://github.com/divnix/bud

View file

@ -1,62 +0,0 @@
# Hosts
Nix flakes contain an output called `nixosConfigurations` declaring an
attribute set of valid NixOS systems. To simplify the management and creation
of these hosts, devos automatically imports every _.nix_ file inside this
directory to the mentioned attribute set, applying the projects defaults to
each. The only hard requirement is that the file contain a valid NixOS module.
As an example, a file `hosts/system.nix` or `hosts/system/default.nix` will
be available via the flake output `nixosConfigurations.system`. You can have
as many hosts as you want and all of them will be automatically imported based
on their name.
For each host, the configuration automatically sets the `networking.hostName`
attribute to the folder name or name of the file minus the _.nix_ extension. This
is for convenience, since `nixos-rebuild` automatically searches for a configuration
matching the current systems hostname if one is not specified explicitly.
You can set channels, systems, and add extra modules to each host by editing the
`nixos.hosts` argument in flake.nix. This is the perfect place to import
host specific modules from external sources, such as the
[nixos-hardware][nixos-hardware] repository.
It is recommended that the host modules only contain configuration information
specific to a particular piece of hardware. Anything reusable across machines
is best saved for [profile modules](./profiles.md).
This is a good place to import sets of profiles, called [suites](./suites.md),
that you intend to use on your machine.
## Example
flake.nix:
```nix
{
nixos = {
imports = [ (devos.lib.importHosts ./hosts) ];
hosts = {
librem = {
channelName = "latest";
modules = [ nixos-hardware.nixosModules.purism-librem-13v3 ];
};
};
};
}
```
hosts/librem.nix:
```nix
{ suites, ... }:
{
imports = suites.laptop;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
fileSystems."/" = { device = "/dev/disk/by-label/nixos"; };
}
```
[nixos-hardware]: https://github.com/NixOS/nixos-hardware

View file

@ -1,10 +0,0 @@
# Key Concepts
Key concepts are derived from [digga][digga]. Please refer to its
[docs][digga-docs] for more details.
This section is dedicated to helping you develop a more hands on
understanding of them them.
[digga-docs]: https://digga.divnix.com
[digga]: https://github.com/divnix/digga

View file

@ -1,42 +0,0 @@
# Overrides
Each NixOS host follows one channel. But many times it is useful to get packages
or modules from different channels.
## Packages
You can make use of `overlays/overrides.nix` to override specific packages in the
default channel to be pulled from other channels. That file is simply an example
of how any overlay can get `channels` as their first argument.
You can add overlays to any channel to override packages from other channels.
Pulling the manix package from the `latest` channel:
```nix
channels: final: prev: {
__dontExport = true;
inherit (pkgs.latest) manix;
}
```
It is recommended to set the `__dontExport` property for override specific
overlays. `overlays/overrides.nix` is the best place to consolidate all package
overrides and the property is already set for you.
## Modules
You can also pull modules from other channels. All modules have access to the
`modulesPath` for each channel as `<channelName>ModulesPath`. And you can use
`disabledModules` to remove modules from the current channel.
To pull zsh module from the `latest` channel this code can be placed in any module, whether its your host file, a profile, or a module in ./modules etc:
```nix
{ latestModulesPath }:
{
imports = [ "${latestModulesPath}/programs/zsh/zsh.nix" ];
disabledModules = [ "programs/zsh/zsh.nix" ];
}
```
> ##### _Note:_
> Sometimes a modules name will change from one branch to another.
[nixpkgs-modules]: https://github.com/NixOS/nixpkgs/tree/master/nixos/modules

View file

@ -1,67 +0,0 @@
# Profiles
Profiles are a convenient shorthand for the [_definition_][definition] of
[options][options] in contrast to their [_declaration_][declaration]. They're
built into the NixOS module system for a reason: to elegantly provide a clear
separation of concerns.
## Creation
Profiles are created with the `rakeLeaves` function which recursively collects
`.nix` files from within a folder. The recursion stops at folders with a `default.nix`
in them. You end up with an attribute set with leaves(paths to profiles) or
nodes(attrsets leading to more nodes or leaves).
A profile is used for quick modularization of [interelated bits](./profiles.md#subprofiles).
> ##### _Notes:_
> * For _declaring_ module options, there's the [modules](../outputs/modules.md) directory.
> * This directory takes inspiration from
> [upstream](https://github.com/NixOS/nixpkgs/tree/master/nixos/modules/profiles)
> .
### Nested profiles
Profiles can be nested in attribute sets due to the recursive nature of `rakeLeaves`.
This can be useful to have a set of profiles created for a specific purpose. It is
sometimes useful to have a `common` profile that has high level concerns related
to all its sister profiles.
### Example
profiles/develop/common.nix:
```nix
{
imports = [ ./zsh ];
# some generic development concerns ...
}
```
profiles/develop/zsh.nix:
```nix
{ ... }:
{
programs.zsh.enable = true;
# zsh specific options ...
}
```
The examples above will end up with a profiles set like this:
```nix
{
develop = {
common = ./profiles/develop/common.nix;
zsh = ./profiles/develop/zsh.nix;
};
}
```
## Conclusion
Profiles are the most important concept in DevOS. They allow us to keep our
Nix expressions self contained and modular. This way we can maximize reuse
across hosts while minimizing boilerplate. Remember, anything machine
specific belongs in your [host](hosts.md) files instead.
[definition]: https://nixos.org/manual/nixos/stable/index.html#sec-option-definitions
[declaration]: https://nixos.org/manual/nixos/stable/index.html#sec-option-declarations
[options]: https://nixos.org/manual/nixos/stable/index.html#sec-writing-modules
[spec]: https://github.com/divnix/devos/tree/core/lib/devos/mkProfileAttrs.nix
[config]: https://nixos.wiki/wiki/Module#structure

View file

@ -1,25 +0,0 @@
# Suites
Suites provide a mechanism for users to easily combine and name collecitons of
profiles.
`suites` are defined in the `importables` argument in either the `home` or `nixos`
namespace. They are a special case of an `importable` which get passed as a special
argument (one that can be use in an `imports` line) to your hosts. All lists defined
in `suites` are flattened and type-checked as paths.
## Definition
```nix
rec {
workstation = [ profiles.develop profiles.graphical users.nixos ];
mobileWS = workstation ++ [ profiles.laptop ];
}
```
## Usage
`hosts/my-laptop.nix`:
```nix
{ suites, ... }:
{
imports = suites.mobileWS;
}
```

View file

@ -1,77 +0,0 @@
> ##### _Note:_
> This section and its semantics need a conceptiual rework.
> Since recently [portable home configurations][portableuser]
> that are not bound to any specific host are a thing.
# Users
Users are a special case of [profiles](profiles.md) that define system
users and [home-manager][home-manager] configurations. For your convenience,
home manager is wired in by default so all you have to worry about is declaring
your users. For a fully fleshed out example, check out the developers personal
[branch](https://github.com/divnix/devos/tree/nrd/users/nrd/default.nix).
## Basic Usage
`users/myuser/default.nix`:
```nix
{ ... }:
{
users.users.myuser = {
isNormalUser = true;
};
home-manager.users.myuser = {
programs.mpv.enable = true;
};
}
```
## Home Manager
Home Manager support follows the same principles as regular nixos configurations,
it even gets its own namespace in your `flake.nix` as `home`.
All modules defined in [user modules][modules-list] will be imported to
Home Manager.
User profiles can be collected in a similar fashion as system ones into a `suites`
argument that gets passed to your home-manager users.
### Example
```nix
{
home-manager.users.nixos = { suites, ... }: {
imports = suites.base;
};
}
```
## External Usage
You can easily use the defined home-manager configurations outside of NixOS
using the `homeConfigurations` flake output. The [flk](../flk/index.md) helper
script makes this even easier.
This is great for keeping your environment consistent across Unix systems,
including OSX.
### From within the projects devshell:
```sh
# builds the nixos user defined in the NixOS host
flk home NixOS nixos
# build and activate
flk home NixOS nixos switch
```
### Manually from outside the project:
```sh
# build
nix build "github:divnix/devos#homeConfigurations.nixos@NixOS.home.activationPackage"
# activate
./result/activate && unlink result
```
[home-manager]: https://nix-community.github.io/home-manager
[modules-list]: https://github.com/divnix/devos/tree/core/users/modules/module-list.nix
[portableuser]: https://digga.divnix.com/api-reference-home.html#homeusers

View file

@ -1,17 +0,0 @@
# Cachix
The system will automatically pull a cachix.nix at the root if one exists.
This is usually created automatically by a `sudo cachix use`. If you're more
inclined to keep the root clean, you can drop any generated files in the
`cachix` directory into the `profiles/cachix` directory without further
modification.
For example, to add your own cache, assuming the template lives in /etc/nixos,
by simply running `sudo cachix use yourcache`. Then, optionally, move
`cachix/yourcache.nix` to `profiles/cachix/yourcache.nix`
These caches are only added to the system after a `nixos-rebuild switch`, so it
is recommended to call `cachix use nrdxp` before the initial deployment, as it
will save a lot of build time.
In the future, users will be able to skip this step once the ability to define
the nix.conf within the flake is fully fleshed out upstream.

View file

@ -1,49 +0,0 @@
# deploy-rs
[Deploy-rs][d-rs] is a tool for managing NixOS remote machines. It was
chosen for devos after the author experienced some frustrations with the
stateful nature of nixops' db. It was also designed from scratch to support
flake based deployments, and so is an excellent tool for the job.
By default, all the [hosts](../concepts/hosts.md) are also available as deploy-rs nodes,
configured with the hostname set to `networking.hostName`; overridable via
the command line.
## Usage
Just add your ssh key to the host:
```nix
{ ... }:
{
users.users.${sshUser}.openssh.authorizedKeys.keyFiles = [
../secrets/path/to/key.pub
];
}
```
And the private key to your user:
```nix
{ ... }:
{
home-manager.users.${sshUser}.programs.ssh = {
enable = true;
matchBlocks = {
${host} = {
host = hostName;
identityFile = ../secrets/path/to/key;
extraOptions = { AddKeysToAgent = "yes"; };
};
};
}
}
```
And run the deployment:
```sh
deploy "flk#hostName" --hostname host.example.com
```
> ##### _Note:_
> Your user will need **passwordless** sudo access
[d-rs]: https://github.com/serokell/deploy-rs

View file

@ -1,36 +0,0 @@
# Hercules CI
If you start adding your own packages and configurations, you'll probably have
at least a few binary artifacts. With hercules we can build every package in
our configuration automatically, on every commit. Additionally, we can have it
upload all our build artifacts to a binary cache like [cachix][cachix].
This will work whether your copy is a fork, or a bare template, as long as your
repo is hosted on GitHub.
## Setup
Just head over to [hercules-ci.com](https://hercules-ci.com) to make an account.
Then follow the docs to set up an [agent][agent], if you want to deploy to a
binary cache (and of course you do), be sure _not_ to skip the
[binary-caches.json][cache].
## Ready to Use
The repo is already set up with the proper _default.nix_ file, building all
declared packages, checks, profiles and shells. So you can see if something
breaks, and never build the same package twice!
If you want to get fancy, you could even have hercules
[deploy your configuration](https://docs.hercules-ci.com/hercules-ci-effects/guide/deploy-a-nixos-machine/)!
> ##### _Note:_
> Hercules doesn't have access to anything encrypted in the
> [secrets folder](../../secrets), so none of your secrets will accidentally get
> pushed to a cache by mistake.
>
> You could pull all your secrets via your user, and then exclude it from
> [allUsers](https://github.com/nrdxp/devos/blob/nrd/suites/default.nix#L17)
> to keep checks passing.
[agent]: https://docs.hercules-ci.com/hercules-ci/getting-started/#github
[cache]: https://docs.hercules-ci.com/hercules-ci/getting-started/deploy/nixos/#_3_configure_a_binary_cache
[cachix]: https://cachix.org

View file

@ -1,5 +0,0 @@
# Integrations
This section explores some of the optional tools included with devos to provide
a solution to common concerns such as ci and remote deployment. An effort is
made to choose tools that treat nix, and where possible flakes, as first class
citizens.

View file

@ -1,43 +0,0 @@
# nvfetcher
[NvFetcher][nvf] is a workflow companion for updating nix sources.
You can specify an origin source and an update configuration, and
nvfetcher can for example track updates to a specific branch and
automatically update your nix sources configuration on each run
to the tip of that branch.
All package source declaration is done in [sources.toml][sources.toml].
From within the devshell of this repo, run `nvfetcher`, a wrapped
version of `nvfetcher` that knows where to find and place its files
and commit the results.
## Usage
Statically fetching (not tracking) a particular tag from a github repo:
```toml
[manix]
src.manual = "v0.6.3"
fetch.github = "mlvzk/manix"
```
Tracking the latest github _release_ from a github repo:
```toml
[manix]
src.github = "mlvzk/manix" # responsible for tracking
fetch.github = "mlvzk/manix" # responsible for fetching
```
Tracking the latest commit of a git repository and fetch from a git repo:
```toml
[manix]
src.git = "https://github.com/mlvzk/manix.git" # responsible for tracking
fetch.git = "https://github.com/mlvzk/manix.git" # responsible for fetching
```
> ##### _Note:_
> Please refer to the [NvFetcher Readme][nvf-readme] for more options.
[nvf]: https://github.com/berberman/nvfetcher
[nvf-readme]: https://github.com/berberman/nvfetcher#readme
[sources.toml]: https://github.com/divnix/devos/tree/core/pkgs/sources.toml

View file

@ -1,3 +0,0 @@
# Layout
Each of the following sections is a directory whose contents are output to the
outside world via the flake's outputs. Check each chapter for details.

View file

@ -1,79 +0,0 @@
# Modules
The modules directory is a replica of nixpkg's NixOS [modules][nixpkgs-modules]
, and follows the same semantics. This allows for trivial upstreaming into
nixpkgs proper once your module is sufficiently stable.
All modules linked in _module-list.nix_ are automatically exported via
`nixosModules.<file-basename>`, and imported into all [hosts](../concepts/hosts.md).
> ##### _Note:_
> This is reserved for declaring brand new module options. If you just want to
> declare a coherent configuration of already existing and related NixOS options
> , use [profiles](../concepts/profiles.md) instead.
## Semantics
In case you've never written a module for nixpkgs before, here is a brief
outline of the process.
### Declaration
modules/services/service-category/my-service.nix:
```nix
{ config, lib, ... }:
let
cfg = config.services.myService;
in
{
options.services.myService = {
enable = lib.mkEnableOption "Description of my new service.";
# additional options ...
};
config = lib.mkIf cfg.enable {
# implementation ...
};
}
```
### Import
modules/module-list.nix:
```nix
[
./services/service-category/my-service.nix
]
```
## Usage
### Internal
profiles/profile-category/my-profile.nix:
```nix
{ ... }:
{
services.MyService.enable = true;
}
```
### External
flake.nix:
```nix
{
# inputs omitted
outputs = { self, devos, nixpkgs, ... }: {
nixosConfigurations.myConfig = nixpkgs.lib.nixosSystem {
system = "...";
modules = [
devos.nixosModules.my-service
({ ... }: {
services.MyService.enable = true;
})
];
};
};
}
```
[nixpkgs-modules]: https://github.com/NixOS/nixpkgs/tree/master/nixos/modules

View file

@ -1,25 +0,0 @@
# Overlays
Writing overlays is a common occurence when using a NixOS system. Therefore,
we want to keep the process as simple and straightforward as possible.
Any _.nix_ files declared in this directory will be assumed to be a valid
overlay, and will be automatically imported into all [hosts](../concepts/hosts.md), and
exported via `overlays.<channel>/<pkgName>` _as well as_
`packages.<system>.<pkgName>` (for valid systems), so all you have to do is
write it.
## Example
overlays/kakoune.nix:
```nix
final: prev: {
kakoune = prev.kakoune.override {
configure.plugins = with final.kakounePlugins; [
(kak-fzf.override { fzf = final.skim; })
kak-auto-pairs
kak-buffers
kak-powerline
kak-vertical-selection
];
};
}
```

View file

@ -1,109 +0,0 @@
# Packages
Similar to [modules](./modules.md), the pkgs directory mirrors the upstream
[nixpkgs/pkgs][pkgs], and for the same reason; if you ever want to upstream
your package, it's as simple as dropping it into the nixpkgs/pkgs directory.
The only minor difference is that, instead of adding the `callPackage` call to
`all-packages.nix`, you just add it the the _default.nix_ in this directory,
which is defined as a simple overlay.
All the packages are exported via `packages.<system>.<pkg-name>`, for all
the supported systems listed in the package's `meta.platforms` attribute.
And, as usual, every package in the overlay is also available to any NixOS
[host](../concepts/hosts.md).
Another convenient difference is that it is possible to use
[nvfetcher](https://github.com/berberman/nvfetcher) to keep packages up to
date.
This is best understood by the simple example below.
## Example
It is possible to specify sources separately to keep them up to date semi
automatically.
The basic rules are specified in pkgs/sources.toml:
```toml
# nvfetcher.toml
[libinih]
src.github = "benhoyt/inih"
fetch.github = "benhoyt/inih"
```
After changes to this file as well as to update the packages specified in there run
nvfetcher (for more details see [nvfetcher](https://github.com/berberman/nvfetcher)).
The pkgs overlay is managed in
pkgs/default.nix:
```nix
final: prev: {
# keep sources first, this makes sources available to the pkgs
sources = prev.callPackage (import ./_sources/generated.nix) { };
# then, call packages with `final.callPackage`
libinih = prev.callPackage ./development/libraries/libinih { };
}
```
Lastly the example package is in
pkgs/development/libraries/libinih/default.nix:
```nix
{ stdenv, meson, ninja, lib, sources, ... }:
stdenv.mkDerivation {
pname = "libinih";
# version will resolve to the latest available on gitub
inherit (sources.libinih) version src;
buildInputs = [ meson ninja ];
# ...
}
```
## Migration from flake based approach
Previous to nvfetcher it was possible to manage sources via a pkgs/flake.nix, the main changes from there are that sources where in the attribute "srcs" (now "sources") and the contents of the sources where slightly different.
In order to switch to the new system, rewrite pkgs/flake.nix to a pkgs/sources.toml file using the documentation of nvfetcher,
add the line that calls the sources at the beginning of pkgs/default.nix, and
accomodate the small changes in the packages as can be seen from the example.
The example package looked like:
pkgs/flake.nix:
```nix
{
description = "Package sources";
inputs = {
libinih.url = "github:benhoyt/inih/r53";
libinih.flake = false;
};
}
```
pkgs/default.nix:
```nix
final: prev: {
# then, call packages with `final.callPackage`
libinih = prev.callPackage ./development/libraries/libinih { };
}
```
pkgs/development/libraries/libinih/default.nix:
```nix
{ stdenv, meson, ninja, lib, srcs, ... }:
let inherit (srcs) libinih; in
stdenv.mkDerivation {
pname = "libinih";
# version will resolve to 53, as specified in the flake.nix file
inherit (libinih) version;
src = libinih;
buildInputs = [ meson ninja ];
# ...
}
```
[pkgs]: https://github.com/NixOS/nixpkgs/tree/master/pkgs

View file

@ -1,110 +0,0 @@
# Secrets
Secrets are managed using [git-crypt][git-crypt] and [agenix][agenix]
so you can keep your flake in a public repository like GitHub without
exposing your password or other sensitive data.
By default, everything in the secrets folder is automatically encrypted. Just
be sure to run `git-crypt init` before putting anything in here.
## Agenix
Currently, there is [no mechanism][secrets-issue] in nix itself to deploy secrets
within the nix store because it is world-readable.
Most NixOS modules have the ability to set options to files in the system, outside
the nix store, that contain sensitive information. You can use [agenix][agenix]
to easily setup those secret files declaratively.
[agenix][agenix] encrypts secrets and stores them as .age files in your repository.
Age files are encrypted with multiple ssh public keys, so any host or user with a
matching ssh private key can read the data. The [age module][age module] will add those
encrypted files to the nix store and decrypt them on activation to `/run/secrets`.
### Setup
All hosts must have openssh enabled, this is done by default in the core profile.
You need to populate your `secrets/secrets.nix` with the proper ssh public keys.
Be extra careful to make sure you only add public keys, you should never share a
private key!!
secrets/secrets.nix:
```nix
let
system = "<system ssh key>";
user = "<user ssh key>";
allKeys = [ system user ];
in
```
On most systems, you can get your systems ssh public key from `/etc/ssh/ssh_host_ed25519_key.pub`. If
this file doesn't exist you likely need to enable openssh and rebuild your system.
Your users ssh public key is probably stored in `~/.ssh/id_ed25519.pub` or
`~/.ssh/id_rsa.pub`. If you haven't generated a ssh key yet, be sure do so:
```sh
ssh-keygen -t ed25519
```
> ##### _Note:_
> The underlying tool used by agenix, rage, doesn't work well with password protected
> ssh keys. So if you have lots of secrets you might have to type in your password many
> times.
### Secrets
You will need the `agenix` command to create secrets. DevOS conveniently provides that
in the devShell, so just run `nix develop` whenever you want to edit secrets. Make sure
to always run `agenix` while in the `secrets/` folder, so it can pick up your `secrets.nix`.
To create secrets, simply add lines to your `secrets/secrets.nix`:
```
let
...
allKeys = [ system user ];
in
{
"secret.age".publicKeys = allKeys;
}
```
That would tell agenix to create a `secret.age` file that is encrypted with the `system`
and `user` ssh public key.
Then go into the `secrets` folder and run:
```sh
agenix -e secret.age
```
This will create the `secret.age`, if it doesn't already exist, and allow you to edit it.
If you ever change the `publicKeys` entry of any secret make sure to rekey the secrets:
```sh
agenix --rekey
```
### Usage
Once you have your secret file encrypted and ready to use, you can utilize the [age module][age module]
to ensure that your secrets end up in `/run/secrets`.
In any profile that uses a NixOS module that requires a secret you can enable a particular secret like so:
```nix
{ self, ... }:
{
age.secrets.mysecret.file = "${self}/secrets/mysecret.age";
}
```
Then you can just pass the path `/run/secrets/mysecret` to the module.
You can make use of the many options provided by the age module to customize where and how
secrets get decrypted. You can learn about them by looking at the
[age module][age module].
> ##### _Note:_
> You can take a look at the [agenix repository][agenix] for more information
> about the tool.
[git-crypt]: https://github.com/AGWA/git-crypt
[agenix]: https://github.com/ryantm/agenix
[age module]: https://github.com/ryantm/agenix/blob/master/modules/age.nix
[secrets-issue]: https://github.com/NixOS/nix/issues/8

View file

@ -1,102 +0,0 @@
# Bootstrapping
This will help you boostrap a bare host with the help of the
[bespoke iso](./iso.md) live installer.
_Note: nothing prevents you from remotely executing the boostrapping
process. See below._
Once your target host has booted into the live iso, you need to partion
and format your disk according to the [official manual][manual].
## Mount partitions
Then properly mount the formatted partitions at `/mnt`, so that you can
install your system to those new partitions.
Mount `nixos` partition to `/mnt` and &mdash; for UEFI &mdash; `boot`
partition to `/mnt/boot`:
```console
$ mount /dev/disk/by-label/nixos /mnt
$ mkdir -p /mnt/boot && mount /dev/disk/by-label/boot /mnt/boot # UEFI only
$ swapon /dev/disk/by-label/swap
```
Add some extra space to the store. In the iso, it's running on a tmpfs
off your RAM:
```console
$ mkdir -p /mnt/tmpstore/{work,store}
$ mount -t overlay overlay -olowerdir=/nix/store,upperdir=/mnt/tmpstore/store,workdir=/mnt/tmpstore/work /nix/store
```
## Install
Install off of a copy of devos from the time the iso was built:
```console
$ cd /iso/devos
$ nixos-install --flake .#NixOS
```
## Notes of interest
### Remote access to the live installer
The iso live installer comes preconfigured with a network configuration
which announces it's hostname via [MulticastDNS][mDNS] as `hostname.local`,
that is `bootstrap.local` in the [iso example](./iso).
In the rare case that [MulticastDNS][mDNS] is not availabe or turned off
in your network, there is a static link-local IPv6 address configured to
`fe80::47`(mnemonic from the letter's position in the english alphabet:
`n=14 i=9 x=24; 47 = n+i+x`).
Provided that you have added your public key to the authorized keys of the
`root` user _(hint: [`deploy-rs`](../integrations/deploy.md) needs passwordless
sudo access)_:
```nix
{ ... }:
{
users.users.root.openssh.authorizedKeys.keyFiles = [
../secrets/path/to/key.pub
];
}
```
You can then ssh into the live installer through one of the
following options:
```console
ssh root@bootstrap.local
ssh root@fe80::47%eno1 # where eno1 is your network interface on which you are linked to the target
```
_Note: the [static link-local IPv6 address][staticLLA] and [MulticastDNS][mDNS] is only
configured on the live installer. If you wish to enable [MulticastDNS][mDNS]
for your environment, you ought to configure that in a regular [profile](../concepts/profiles.md)._
### EUI-64 LLA & Host Identity
The iso's IPv6 Link Local Address (LLA) is configured with a static 64-bit Extended
Unique Identifiers (EUI-64) that is derived from the host interface's Message
Authentication Code (MAC) address.
After a little while (a few seconds), you can remotely discover this unique and host
specific address over [NDP][NDP] for example with:
```console
ip -6 neigh show # also shows fe80::47
```
***This LLA is stable for the host, unless you need to swap that particular network card.***
Under this reservation, though, you may use this EUI-64 to wire up a specific
(cryptographic) host identity.
[manual]: https://nixos.org/manual/nixos/stable/index.html#sec-installation-partitioning
[mDNS]: https://en.wikipedia.org/wiki/Multicast_DNS
[NDP]: https://en.wikipedia.org/wiki/Neighbor_Discovery_Protocol
[staticLLA]: https://tools.ietf.org/html/rfc7404

View file

@ -1,54 +0,0 @@
# From NixOS
## Generate Configuration
Assuming you're happy with your existing partition layout, you can generate a
basic NixOS configuration for your system using:
```sh
flk up
```
This will make a new file `hosts/up-$(hostname).nix`, which you can edit to
your liking.
You must then add a host to `nixos.hosts` in flake.nix:
```nix
{
nixos.hosts = {
modules = hosts/NixOS.nix;
};
}
```
Make sure your `i18n.defaultLocale` and `time.timeZone` are set properly for
your region. Keep in mind that `networking.hostName` will be automatically
set to the name of your host;
Now might be a good time to read the docs on [suites](../concepts/suites.md) and
[profiles](../concepts/profiles.md) and add or create any that you need.
> ##### _Note:_
> While the `up` sub-command is provided as a convenience to quickly set up and
> install a "fresh" NixOS system on current hardware, committing these files is
> discouraged.
>
> They are placed in the git staging area automatically because they would be
> invisible to the flake otherwise, but it is best to move what you need from
> them directly into a host module of your own making, and commit that instead.
# Installation
Once you're ready to deploy `hosts/my-host.nix`:
```sh
flk my-host switch
```
This calls `nixos-rebuild` with sudo to build and install your configuration.
> ##### _Notes:_
> - Instead of `switch`, you can pass `build`, `test`, `boot`, etc just as with
> `nixos-rebuild`.
>
> - It is convenient to have the template living at `/etc/nixos` so you can
> simply `sudo nixos-rebuild switch` from anywhere on the system, but it is
> not required.

View file

@ -1,41 +0,0 @@
# Quick Start
The only dependency is nix, so make sure you have it [installed][install-nix].
## Get the Template
Here is a snippet that will get you the template without the git history:
```sh
nix-shell -p cachix --run "cachix use nrdxp"
nix-shell https://github.com/divnix/devos/archive/core.tar.gz -A shell \
--run "flk get core"
cd flk
nix-shell
git init
git add .
git commit -m init
```
This will place you in a new folder named `flk` with git initialized, and a
nix-shell that provides all the dependencies, including the unstable nix
version required.
In addition, the [binary cache](../integrations/cachix.md) is added for faster deployment.
> ##### _Notes:_
> - Flakes ignore files that have not been added to git, so be sure to stage new
> files before building the system.
> - You can choose to simply clone the repo with git if you want to follow
> upstream changes.
> - If the `nix-shell -p cachix --run "cachix use nrdxp"` line doesn't work
> you can try with sudo: `sudo nix-shell -p cachix --run "cachix use nrdxp"`
## Next Steps:
- [Make installable ISO](./iso.md)
- [Bootstrap Host](./bootstrapping.md)
- [Already on NixOS](./from-nixos.md)
[install-nix]: https://nixos.org/manual/nix/stable/#sect-multi-user-installation

View file

@ -1,22 +0,0 @@
# ISO
Making and writing an installable iso for `hosts/bootstrap.nix` is as simple as:
```sh
bud build bootstrap bootstrapIso
sudo -E $(which bud) burn
```
This works for any host.
## ISO image nix store & cache
The iso image holds the store to the live environment and _also_ acts as a binary cache
to the installer. To considerably speed up things, the image already includes all flake
`inputs` as well as the `devshell` closures.
While you _could_ provision any machine with a single stick, a custom-made iso for
the host you want to install DevOS to, maximises those local cache hits.
For hosts that don't differ too much, a single usb stick might be ok, whereas when
there are bigger differences, a custom-made usb stick will be considerably faster.

View file

@ -1,33 +0,0 @@
# Testing
Testing is always an important aspect of any software development project, and
NixOS offers some incredibly powerful tools to write tests for your
configuration, and, optionally, run them in
[CI](./integrations/hercules.md).
## Unit Tests
Unit tests can be created from regular derivations, and they can do
almost anything you can imagine. By convention, it is best to test your
packages during their [check phase][check]. All packages and their tests will
be built during CI.
## Integration Tests
All your profiles defined in suites will be tested in a NixOS VM.
You can write integration tests for one or more NixOS VMs that can,
optionally, be networked together, and yes, it's as awesome as it sounds!
Be sure to use the `mkTest` function from digga, `digga.lib.pkgs-lib.mkTest`
which wraps the official [testing-python][testing-python] function to ensure
that the system is setup exactly as it is for a bare DevOS system. There are
already great resources for learning how to use these tests effectively,
including the official [docs][test-doc], a fantastic [blog post][test-blog],
and the examples in [nixpkgs][nixos-tests].
[test-doc]: https://nixos.org/manual/nixos/stable/index.html#sec-nixos-tests
[test-blog]: https://www.haskellforall.com/2020/11/how-to-use-nixos-for-lightweight.html
[default]: https://github.com/divnix/devos/tree/core/tests/default.nix
[run-test]: https://github.com/NixOS/nixpkgs/blob/6571462647d7316aff8b8597ecdf5922547bf365/lib/debug.nix#L154-L166
[nixos-tests]: https://github.com/NixOS/nixpkgs/tree/master/nixos/tests
[testing-python]: https://github.com/NixOS/nixpkgs/tree/master/nixos/lib/testing-python.nix
[check]: https://nixos.org/manual/nixpkgs/stable/#ssec-check-phase

File diff suppressed because one or more lines are too long

View file

@ -2,16 +2,19 @@
"nodes": { "nodes": {
"agenix": { "agenix": {
"inputs": { "inputs": {
"darwin": "darwin",
"home-manager": "home-manager",
"nixpkgs": [ "nixpkgs": [
"nixos" "nixpkgs"
] ],
"systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1643841757, "lastModified": 1723293904,
"narHash": "sha256-9tKhu4JzoZvustC9IEWK6wKcDhPLuK/ICbLgm8QnLnk=", "narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=",
"owner": "ryantm", "owner": "ryantm",
"repo": "agenix", "repo": "agenix",
"rev": "a17d1f30550260f8b45764ddbd0391f4b1ed714a", "rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -20,55 +23,67 @@
"type": "github" "type": "github"
} }
}, },
"blank": { "basant": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
],
"poonam": [
"poonam"
]
},
"locked": { "locked": {
"lastModified": 1625557891, "lastModified": 1682226636,
"narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=", "narHash": "sha256-fmETHfUtQ5zOVr/4MT5wE7eNALCSQCnEUYZYmV3UEwg=",
"owner": "divnix", "ref": "main",
"repo": "blank", "rev": "095d14ff2469c8f3de7cbf45d229c0f46a733aae",
"rev": "5a5d2684073d9f563072ed07c871d577a6c614a8", "revCount": 77,
"type": "github" "type": "git",
"url": "ssh://gitea@git.sealight.xyz/aynish/basant"
}, },
"original": { "original": {
"owner": "divnix", "ref": "main",
"repo": "blank", "type": "git",
"type": "github" "url": "ssh://gitea@git.sealight.xyz/aynish/basant"
} }
}, },
"darwin": { "darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixos" "agenix",
"nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1645007752, "lastModified": 1700795494,
"narHash": "sha256-FQZMiVP/1vgR7x+TWonMf0NZczrZ4ZjhSTj3rM+kglY=", "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=",
"owner": "LnL7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "c944b5ee82a829ddf7fa6bd9300bc2fe3d005fa1", "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "LnL7", "owner": "lnl7",
"ref": "master",
"repo": "nix-darwin", "repo": "nix-darwin",
"type": "github" "type": "github"
} }
}, },
"deploy": { "deploy-rs": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"nixpkgs": [ "nixpkgs": [
"nixos" "nixpkgs"
], ],
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1643787431, "lastModified": 1718194053,
"narHash": "sha256-8IwuVgXulRE3ZWq6z8mytarawC32pKPKR20EyDtSH+w=", "narHash": "sha256-FaGrf7qwZ99ehPJCAwgvNY5sLCqQ3GDiE/6uLhxxwSY=",
"owner": "serokell", "owner": "serokell",
"repo": "deploy-rs", "repo": "deploy-rs",
"rev": "4154ba1aaaf7333a916384c348d867d03b6f1409", "rev": "3867348fa92bc892eba5d9ddb2d7a97b9e127a8a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -79,11 +94,11 @@
}, },
"devshell": { "devshell": {
"locked": { "locked": {
"lastModified": 1637575296, "lastModified": 1642188268,
"narHash": "sha256-ZY8YR5u8aglZPe27+AJMnPTG6645WuavB+w0xmhTarw=", "narHash": "sha256-DNz4xScpXIn7rSDohdayBpPR9H9OWCMDOgTYegX081k=",
"owner": "numtide", "owner": "numtide",
"repo": "devshell", "repo": "devshell",
"rev": "0e56ef21ba1a717169953122c7415fa6a8cd2618", "rev": "696acc29668b644df1740b69e1601119bf6da83b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -92,48 +107,50 @@
"type": "github" "type": "github"
} }
}, },
"digga": { "dirt-samples-src": {
"inputs": { "flake": false,
"blank": "blank",
"deploy": [
"deploy"
],
"devshell": "devshell",
"flake-utils-plus": "flake-utils-plus",
"home-manager": [
"home"
],
"latest": "latest",
"nixlib": [
"nixos"
],
"nixos-generators": "nixos-generators",
"nixpkgs": [
"nixos"
]
},
"locked": { "locked": {
"lastModified": 1643510242, "lastModified": 1698439458,
"narHash": "sha256-9C9DyJhQ5bevk0CEEjGct+U9EqUgHg8T70nxz47zjMI=", "narHash": "sha256-Mp8qBpsOvW9Zguv95Kv7EU6S3ICaF2aO02Wz6xGURtE=",
"owner": "divnix", "owner": "tidalcycles",
"repo": "digga", "repo": "dirt-samples",
"rev": "33bfb05b8a148d8ad6a842de74e22209bf9fe5d7", "rev": "9a6dff8f9ec3cd55b287290cf04e01afa6b8f532",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "divnix", "owner": "tidalcycles",
"repo": "digga", "repo": "dirt-samples",
"type": "github"
}
},
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1724031427,
"narHash": "sha256-o1HdAf+7IGv9M13R3c+zc/sJ0QgeEnhsvHBcodI4UpM=",
"owner": "nix-community",
"repo": "disko",
"rev": "4e719b38fa7c85f4f65d0308ca7084c91e7bdd6d",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github" "type": "github"
} }
}, },
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1627913399, "lastModified": 1696426674,
"narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra", "owner": "edolstra",
"repo": "flake-compat", "repo": "flake-compat",
"rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -145,11 +162,11 @@
"flake-compat_2": { "flake-compat_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1627913399, "lastModified": 1641205782,
"narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=",
"owner": "edolstra", "owner": "edolstra",
"repo": "flake-compat", "repo": "flake-compat",
"rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -173,31 +190,13 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils-plus": {
"inputs": {
"flake-utils": "flake-utils"
},
"locked": {
"lastModified": 1639385028,
"narHash": "sha256-oqorKz3mwf7UuDJwlbCEYCB2LfcWLL0DkeCWhRIL820=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "be1be083af014720c14f3b574f57b6173b4915d0",
"type": "github"
},
"original": {
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"type": "github"
}
},
"flake-utils_2": { "flake-utils_2": {
"locked": { "locked": {
"lastModified": 1638122382, "lastModified": 1667395993,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b", "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -206,217 +205,359 @@
"type": "github" "type": "github"
} }
}, },
"home": { "grasp": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": [
"nixos" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1643933536, "lastModified": 1682644301,
"narHash": "sha256-yRmsWAG4DnLxLIUtlaZsl0kH7rN5xSoyNRlf0YZrcH4=", "narHash": "sha256-gMBFZLf41s3+cnhxgZVRvj2JSAFYv4jn2xBKwEESthE=",
"ref": "main",
"rev": "a2d85675b930ffc26f6891b2e14491795907be4e",
"revCount": 137,
"type": "git",
"url": "ssh://gitea@git.sealight.xyz/aynish/grasp.git"
},
"original": {
"ref": "main",
"type": "git",
"url": "ssh://gitea@git.sealight.xyz/aynish/grasp.git"
}
},
"hardware": {
"locked": {
"lastModified": 1723310128,
"narHash": "sha256-IiH8jG6PpR4h9TxSGMYh+2/gQiJW9MwehFvheSb5rPc=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "c54cf53e022b0b3c1d3b8207aa0f9b194c24f0cf",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixos-hardware",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"agenix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1703113217,
"narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "2860d7e3bb350f18f7477858f3513f9798896831", "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-21.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
}, },
"latest": { "home-manager_2": {
"locked": {
"lastModified": 1638198142,
"narHash": "sha256-plU9b8r4St6q4U7VHtG9V7oF8k9fIpfXl/KDaZLuY9k=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8a308775674e178495767df90c419425474582a1",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"latest_2": {
"locked": {
"lastModified": 1644525281,
"narHash": "sha256-D3VuWLdnLmAXIkooWAtbTGSQI9Fc1lkvAr94wTxhnTU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "48d63e924a2666baf37f4f14a18f19347fbd54a2",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"naersk": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixos" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1639947939, "lastModified": 1720042825,
"narHash": "sha256-pGsM8haJadVP80GFq4xhnSpNitYNQpaXk4cnA796Cso=", "narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
"owner": "nmattia",
"repo": "naersk",
"rev": "2fc8ce9d3c025d59fee349c1f80be9785049d653",
"type": "github"
},
"original": {
"owner": "nmattia",
"repo": "naersk",
"type": "github"
}
},
"nixlib": {
"locked": {
"lastModified": 1641688481,
"narHash": "sha256-6L+EU12xLDHby7y8elgFtRKVBxix+7qV8DhVgXqrKZo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs.lib", "repo": "home-manager",
"rev": "f697717b3d3a074ffc16c8c8227504f0db292886", "rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs.lib", "ref": "release-24.05",
"repo": "home-manager",
"type": "github" "type": "github"
} }
}, },
"nixos": { "nix-matrix-appservices": {
"locked": {
"lastModified": 1645043747,
"narHash": "sha256-HjepP5RqpkPR5N1k1GnYmekYjZKqhVjYec1G6W/ZLz4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "62a2a1be29f6a3356e72d87970da4c396ac8d08f",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "release-21.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixos-generators": {
"inputs": { "inputs": {
"devshell": "devshell",
"flake-compat": "flake-compat_2",
"nixlib": "nixlib", "nixlib": "nixlib",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1637655461, "lastModified": 1683490239,
"narHash": "sha256-kXZPbclN3gKwjhp2/RYFDFpAsSBwzX1iLF4EcnHZsPQ=", "narHash": "sha256-QKzpvl2XrqbobWq/I/smDa9hEniwctjJybXPVILHP0w=",
"owner": "nix-community", "owner": "coffeetables",
"repo": "nixos-generators", "repo": "nix-matrix-appservices",
"rev": "05a3eb158a9c7746a5d463726d7f7cccf07500e4", "rev": "e795d2fbc61da45d49802bb3e8f8d0c70ddc1e68",
"type": "gitlab"
},
"original": {
"owner": "coffeetables",
"repo": "nix-matrix-appservices",
"type": "gitlab"
}
},
"nixlib": {
"locked": {
"lastModified": 1643502816,
"narHash": "sha256-Wrbt6Gs+hjXD3HUICPBJHKnHEUqiyx8rzHCgvqC1Bok=",
"owner": "divnix",
"repo": "nixpkgs.lib",
"rev": "ebed7ec5bcb5d01e298535989c6c321df18b631a",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "divnix",
"repo": "nixos-generators", "repo": "nixpkgs.lib",
"type": "github" "type": "github"
} }
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1644870092, "lastModified": 1723310128,
"narHash": "sha256-RLPD92lqXW98LDIbbwYqwAbt3R4iD1V1PiylfgBq5cU=", "narHash": "sha256-IiH8jG6PpR4h9TxSGMYh+2/gQiJW9MwehFvheSb5rPc=",
"owner": "nixos", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "10eab1c4cd8e715c0b41d32c28af2b89fc67bed0", "rev": "c54cf53e022b0b3c1d3b8207aa0f9b194c24f0cf",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "NixOS",
"ref": "master",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1644972330, "lastModified": 1662099760,
"narHash": "sha256-6V2JFpTUzB9G+KcqtUR1yl7f6rd9495YrFECslEmbGw=", "narHash": "sha256-MdZLCTJPeHi/9fg6R9fiunyDwP3XHJqDd51zWWz9px0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "19574af0af3ffaf7c9e359744ed32556f34536bd", "rev": "67e45078141102f45eff1589a831aeaa3182b41e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixpkgs-unstable", "ref": "nixos-22.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1723938990,
"narHash": "sha256-9tUadhnZQbWIiYVXH8ncfGXGvkNq3Hag4RCBEMUk7MI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c42fcfbdfeae23e68fc520f9182dde9f38ad1890",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1626378135, "lastModified": 1724040334,
"narHash": "sha256-koC6DBYmLCrgXA+AMHVaODf1uHYPmvcFygHfy3eg6vI=", "narHash": "sha256-Ia4gRRmhFn4oJ4SJKJPDNPomsRRFWU+bqCK7yuiLW4E=",
"path": "/nix/store/6mfkswqi67m35qwv0vh7kpk8rypbl2rq-source", "owner": "nix-community",
"rev": "00c2ec8f0bbdf0cfb2135bde55fbae5d6b64aa6d", "repo": "NUR",
"type": "path" "rev": "24471a48600e18669d13d24c9640b9859357d2cf",
"type": "github"
}, },
"original": { "original": {
"id": "nur", "owner": "nix-community",
"type": "indirect" "repo": "NUR",
"type": "github"
} }
}, },
"nvfetcher": { "poonam": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": [
"nixos" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1644123018, "lastModified": 1731920409,
"narHash": "sha256-xEhhLmuy4FnT4Zdkf3epPX9T3xqn59yERCsicG4IEyM=", "narHash": "sha256-bMjdNGoWJXaWIGtfxcODmmrNoONnwN3hS73cDTRC1Pk=",
"owner": "berberman", "ref": "main",
"repo": "nvfetcher", "rev": "a87e348a46fd04dbe35ee9accf710eeec42ecbb6",
"rev": "9f2cb15c4668859312b6a854d79ad753d5b98b03", "revCount": 1530,
"type": "github" "type": "git",
"url": "ssh://gitea@git.sealight.xyz/aynish/kitaab"
}, },
"original": { "original": {
"owner": "berberman", "ref": "main",
"repo": "nvfetcher", "type": "git",
"type": "github" "url": "ssh://gitea@git.sealight.xyz/aynish/kitaab"
} }
}, },
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"darwin": "darwin", "basant": "basant",
"deploy": "deploy", "deploy-rs": "deploy-rs",
"digga": "digga", "disko": "disko",
"home": "home", "grasp": "grasp",
"latest": "latest_2", "hardware": "hardware",
"naersk": "naersk", "home-manager": "home-manager_2",
"nixos": "nixos", "nix-matrix-appservices": "nix-matrix-appservices",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2",
"nur": "nur", "nur": "nur",
"nvfetcher": "nvfetcher" "poonam": "poonam",
"rust-overlay": "rust-overlay",
"tidalcycles": "tidalcycles",
"unstable": "unstable",
"vimwikicli": "vimwikicli"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1724034091,
"narHash": "sha256-b1g7w0sw+MDAhUAeCoX1vlTghsqcDZkxr+k9OZmxPa8=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "c7d36e0947826e0751a5214ffe82533fbc909bc0",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"superdirt-src": {
"flake": false,
"locked": {
"lastModified": 1697377840,
"narHash": "sha256-9qU9CHYAXbN1IE3xXDqGipuroifVaSVXj3c/cDfwM80=",
"owner": "musikinformatik",
"repo": "superdirt",
"rev": "c7f32998572984705d340e7c1b9ed9ad998a39b6",
"type": "github"
},
"original": {
"owner": "musikinformatik",
"repo": "superdirt",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tidal-src": {
"flake": false,
"locked": {
"lastModified": 1712519522,
"narHash": "sha256-LbvxQmVxHElidCgvt+w0g1k+QQbNLebK46vtRCgsLeQ=",
"owner": "tidalcycles",
"repo": "tidal",
"rev": "88f09edf6bef2228d5f530dea872b08a9d803066",
"type": "github"
},
"original": {
"owner": "tidalcycles",
"ref": "v1.9.5",
"repo": "tidal",
"type": "github"
}
},
"tidalcycles": {
"inputs": {
"dirt-samples-src": "dirt-samples-src",
"nixpkgs": [
"unstable"
],
"superdirt-src": "superdirt-src",
"tidal-src": "tidal-src",
"vim-tidal-src": "vim-tidal-src",
"vowel-src": "vowel-src"
},
"locked": {
"lastModified": 1723223284,
"narHash": "sha256-NAT+g5nsaJZkpR0sCZjerd1xx233ZUdRH3ZWwZhzq/c=",
"owner": "mitchmindtree",
"repo": "tidalcycles.nix",
"rev": "82f3e8e8d02eb9f0c9dfe9ab3773b825c6bc1982",
"type": "github"
},
"original": {
"owner": "mitchmindtree",
"repo": "tidalcycles.nix",
"type": "github"
}
},
"unstable": {
"locked": {
"lastModified": 1723637854,
"narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
} }
}, },
"utils": { "utils": {
"inputs": {
"systems": "systems_2"
},
"locked": { "locked": {
"lastModified": 1637014545, "lastModified": 1701680307,
"narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=", "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4", "rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -424,6 +565,59 @@
"repo": "flake-utils", "repo": "flake-utils",
"type": "github" "type": "github"
} }
},
"vim-tidal-src": {
"flake": false,
"locked": {
"lastModified": 1685703852,
"narHash": "sha256-8gyk17YLeKpLpz3LRtxiwbpsIbZka9bb63nK5/9IUoA=",
"owner": "tidalcycles",
"repo": "vim-tidal",
"rev": "e440fe5bdfe07f805e21e6872099685d38e8b761",
"type": "github"
},
"original": {
"owner": "tidalcycles",
"repo": "vim-tidal",
"type": "github"
}
},
"vimwikicli": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1662448409,
"narHash": "sha256-Xd8CuFcEpEQK/TjNBXcp1HqPJCc7LwkMqKa1WiAP1Zc=",
"ref": "main",
"rev": "a73c4695cf116c2e8194a5caa837c2f9e1a7e2fb",
"revCount": 7,
"type": "git",
"url": "ssh://gitea@git.sealight.xyz/aynish/vimwiki-cli"
},
"original": {
"ref": "main",
"type": "git",
"url": "ssh://gitea@git.sealight.xyz/aynish/vimwiki-cli"
}
},
"vowel-src": {
"flake": false,
"locked": {
"lastModified": 1641306144,
"narHash": "sha256-zfF6cvAGDNYWYsE8dOIo38b+dIymd17Pexg0HiPFbxM=",
"owner": "supercollider-quarks",
"repo": "vowel",
"rev": "ab59caa870201ecf2604b3efdd2196e21a8b5446",
"type": "github"
},
"original": {
"owner": "supercollider-quarks",
"repo": "vowel",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

389
flake.nix
View file

@ -1,160 +1,275 @@
{ {
description = "A highly structured configuration database."; description = "Sealight NixOS Config";
nixConfig.extra-experimental-features = "nix-command flakes"; inputs = {
nixConfig.extra-substituters = "https://nrdxp.cachix.org https://nix-community.cachix.org"; # Nixpkgs
nixConfig.extra-trusted-public-keys = "nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="; nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
inputs = # ngipkgs.url = "github:Chickensoupwithrice/ngipkgs?ref=aynish/atomic-server-module";
{ # ngipkgs-local.url = "path:/home/anish/usr/ngipkgs";
nixos.url = "github:nixos/nixpkgs/release-21.11";
latest.url = "github:nixos/nixpkgs/nixos-unstable";
digga.url = "github:divnix/digga"; # Home manager
digga.inputs.nixpkgs.follows = "nixos"; home-manager.url = "github:nix-community/home-manager/release-24.05";
digga.inputs.nixlib.follows = "nixos"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
digga.inputs.home-manager.follows = "home"; hardware.url = "github:nixos/nixos-hardware";
digga.inputs.deploy.follows = "deploy";
home.url = "github:nix-community/home-manager/release-21.11"; # Tools
home.inputs.nixpkgs.follows = "nixos"; agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
deploy-rs.url = "github:serokell/deploy-rs";
deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
darwin.url = "github:LnL7/nix-darwin"; # My Packages
darwin.inputs.nixpkgs.follows = "nixos"; poonam.url = "git+ssh://gitea@git.sealight.xyz/aynish/kitaab?ref=main";
poonam.inputs.nixpkgs.follows = "nixpkgs";
basant.url = "git+ssh://gitea@git.sealight.xyz/aynish/basant?ref=main";
vimwikicli.url =
"git+ssh://gitea@git.sealight.xyz/aynish/vimwiki-cli?ref=main";
basant.inputs.nixpkgs.follows = "nixpkgs";
basant.inputs.poonam.follows = "poonam";
vimwikicli.inputs.nixpkgs.follows = "nixpkgs";
grasp.url = "git+ssh://gitea@git.sealight.xyz/aynish/grasp.git?ref=main";
grasp.inputs.nixpkgs.follows = "nixpkgs";
deploy.url = "github:serokell/deploy-rs"; # Matrix
deploy.inputs.nixpkgs.follows = "nixos"; nix-matrix-appservices.url = "gitlab:coffeetables/nix-matrix-appservices";
agenix.url = "github:ryantm/agenix"; # Others
agenix.inputs.nixpkgs.follows = "nixos"; nur.url = "github:nix-community/NUR";
rust-overlay = {
nvfetcher.url = "github:berberman/nvfetcher"; url = "github:oxalica/rust-overlay";
nvfetcher.inputs.nixpkgs.follows = "nixos"; inputs.nixpkgs.follows = "nixpkgs";
naersk.url = "github:nmattia/naersk";
naersk.inputs.nixpkgs.follows = "nixos";
nixos-hardware.url = "github:nixos/nixos-hardware";
}; };
tidalcycles.url = "github:mitchmindtree/tidalcycles.nix";
tidalcycles.inputs.nixpkgs.follows = "unstable";
# TODO hundred rabbits software
# TODO needs secrets
# dhyan.url = "git+ssh://gitea@git.sealight.xyz/aynish/dhyan?ref=main";
# dhyan.inputs.nixpkgs.follows = "nixpkgs";
# TODO needs secrets
# muneem.url = "git+ssh://gitea@git.sealight.xyz/aynish/muneem?ref=main";
# muneem.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = outputs = { self, nixpkgs, unstable, nixos-hardware, home-manager, deploy-rs
{ self , agenix, disko, basant, grasp, nix-matrix-appservices, nur, tidalcycles
, digga , rust-overlay, vimwikicli, ... }@inputs:
, nixos let
, home forAllSystems = nixpkgs.lib.genAttrs [
, nixos-hardware "aarch64-linux"
, nur "i686-linux"
, agenix "x86_64-linux"
, nvfetcher "aarch64-darwin"
, deploy "x86_64-darwin"
, ... ];
} @ inputs: unstableOverlay = final: prev: {
digga.lib.mkFlake # We already have these in scope
{ unstable = unstable.legacyPackages.${prev.system};
inherit self inputs; deploy = deploy-rs.packages.${prev.system}.deploy-rs;
};
vimwikiOverlay = final: prev: {
vimwiki-cli = vimwikicli.packages.${prev.system}.vimwiki-cli;
};
channelsConfig = { allowUnfree = true; }; nixpkgsFor = forAllSystems (system:
import nixpkgs {
channels = { inherit system;
nixos = { config.allowUnfreePredicate = pkg:
imports = [ (digga.lib.importOverlays ./overlays) ]; builtins.elem (nixpkgs.lib.getName pkg) [
overlays = [ "ripcord"
nur.overlay "vcv-rack"
agenix.overlay "SunVox"
nvfetcher.overlay "renoise"
deploy.overlay
./pkgs/default.nix
]; ];
}; # config.permittedInsecurePackages = [
latest = { }; # "python3.10-django-3.1.14" # Needed for archivebox deployments on curve
# # Check when archive box updates it's dependeny
# ];
overlays = [
rust-overlay.overlays.default
tidalcycles.overlays.default
agenix.overlays.default
nur.overlay
nix-matrix-appservices.overlay
unstableOverlay
vimwikiOverlay
self.overlays.additions
self.overlays.modifications
];
});
# for when space matters
litePkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
# config.permittedInsecurePackages = [
# "forgejo-1.19.4-0" # Needed for archivebox deployments on curve
# # Check when archive box updates it's dependeny
# ];
overlays = [
agenix.overlays.default
self.overlays.additions
self.overlays.modifications
tidalcycles.overlays.default # needed for nvim which comes pre-installed lol
];
});
in {
# Your custom packages
# Acessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in import ./pkgs { pkgs = pkgs; });
# Devshell for bootstrapping
# Acessible through 'nix develop' or 'nix-shell' (legacy)
devShells = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in import ./shell.nix { pkgs = pkgs; });
# Your custom packages and modifications, exported as overlays
overlays = import ./overlays;
# Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs
nixosModules = import ./modules/nixos;
# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
homeManagerModules = import ./modules/home-manager;
# NixOS configuration entrypoint
nixosConfigurations = {
curve = nixpkgs.lib.nixosSystem rec {
specialArgs = { inherit inputs self; };
system = "x86_64-linux";
pkgs = nixpkgsFor.${system};
modules = [
./hosts/curve
agenix.nixosModules.age
self.nixosModules.backup
self.nixosModules.wireguard
self.nixosModules.wallabag
nixos-hardware.nixosModules.lenovo-thinkpad-x270
home-manager.nixosModules.home-manager
{
nix.registry.nixpkgs.flake = nixpkgs;
nix.registry.unstable.flake = unstable;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.anish = import ./home/gui;
}
];
}; };
lib = import ./lib { lib = digga.lib // nixos.lib; }; helix = nixpkgs.lib.nixosSystem rec {
specialArgs = { inherit inputs self; };
sharedOverlays = [ system = "x86_64-linux";
(final: prev: { pkgs = litePkgsFor.${system};
__dontExport = true; modules = [
lib = prev.lib.extend (lfinal: lprev: { ./hosts/helix
our = self.lib; agenix.nixosModules.age
}); self.nixosModules.backup
}) self.nixosModules.wireguard
]; basant.nixosModule
# self.nixosModules.microbin
nixos = { disko.nixosModules.disko
hostDefaults = { {
system = "x86_64-linux"; nixpkgs.flake.setNixPath = false;
channelName = "nixos"; nixpkgs.flake.setFlakeRegistry = false;
imports = [ (digga.lib.importExportableModules ./modules) ]; }
exportedModules = [ ];
{ lib.our = self.lib; }
digga.nixosModules.bootstrapIso
digga.nixosModules.nixConfig
home.nixosModules.home-manager
agenix.nixosModules.age
];
};
imports = [ (digga.lib.importHosts ./hosts) ];
hosts = {
/* set host specific properties here */
NixOS = { };
curve = {
channelName = "nixos";
#modules = [ ]; # nixos-hardware.nixosModules.lenovo-thinkpad
# Yubikey
};
box = { };
hypercube = { };
work = { };
};
importables = rec {
profiles = digga.lib.rakeLeaves ./profiles // {
users = digga.lib.rakeLeaves ./users;
};
suites = with profiles; rec {
base = [ core users.root nvim users.anish ]; # TODO make anish non gui
sealight = [ base ]; # matrix rsshub backup wireguard website
mossnet = [ base ]; # shaarli wallabag nextcloud taskwarrior headphones
home-manager = [ users.profiles.firefox users.profiles.desktop ];
graphical = [ base home-manager bluetooth music sync wireguard wifi ];
curve = [ graphical users.profiles.email users.profiles.cal ];
work = [ base home-manager ];
};
};
}; };
home = { lituus = nixpkgs.lib.nixosSystem rec {
imports = [ (digga.lib.importExportableModules ./users/modules) ]; specialArgs = { inherit inputs self; };
exportedModules = [ ]; system = "x86_64-linux";
importables = rec { pkgs = nixpkgsFor.${system};
profiles = digga.lib.rakeLeaves ./users/profiles; modules = [
suites = with profiles; rec { ./hosts/lituus
hmBase = [ direnv git ]; agenix.nixosModules.age
#gui = [ base profiles.firefox profiles.desktop ]; self.nixosModules.backup
}; self.nixosModules.hesienbridge
}; nix-matrix-appservices.nixosModule
users = { home-manager.nixosModules.home-manager
nixos = { suites, ... }: { imports = suites.base; }; {
curve = { suites, ... }: { imports = suites.gui; }; home-manager.useGlobalPkgs = true;
}; # digga.lib.importers.rakeLeaves ./users/hm; home-manager.useUserPackages = true;
home-manager.users.anish = import ./home/core;
}
];
}; };
devshell = ./shell; box = nixpkgs.lib.nixosSystem rec {
specialArgs = { inherit inputs self; };
system = "x86_64-linux";
pkgs = nixpkgsFor.${system};
modules = [
./hosts/box
agenix.nixosModules.age
self.nixosModules.backup
self.nixosModules.wireguard
self.nixosModules.gonic
self.nixosModules.gpodder2go
self.nixosModules.wallabag
self.nixosModules.ulogger-server
grasp.nixosModule
home-manager.nixosModules.home-manager
{
nix.registry.nixpkgs.flake = nixpkgs;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.anish = import ./home/dev;
}
];
};
};
homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations; # Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"anish@work" = home-manager.lib.homeManagerConfiguration {
pkgs =
nixpkgsFor."x86_64-linux"; # Home-manager requires 'pkgs' instance
extraSpecialArgs = { inherit inputs; };
modules = [ ./home/core.nix ./home/profiles/firefox ];
};
};
deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations deploy.nodes = {
{ box = {
curve = { hostname = "mossnet.lan";
profilesOrder = [ "system" "curve" ]; autoRollback = false;
profiles.anish = { magicRollback = false;
user = "anish"; remoteBuild = true;
path = deploy.lib.x86_64-linux.activate.home-manager self.homeConfigurationsPortable.x86_64-linux.anish; profiles.system = {
}; user = "root";
}; path = deploy-rs.lib.x86_64-linux.activate.nixos
self.nixosConfigurations.box;
}; };
};
lituus = {
hostname = "sealight.xyz";
# autoRollback = false;
profiles.system = {
user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos
self.nixosConfigurations.lituus;
};
};
helix = {
hostname = "git.sealight.xyz";
autoRollback = false;
magicRollback = false;
profiles.system = {
user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos
self.nixosConfigurations.helix;
};
};
};
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy.lib; checks = builtins.mapAttrs
} (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
; };
} }

9
home/core/default.nix Normal file
View file

@ -0,0 +1,9 @@
{ self, pkgs, ... }:
{
imports = [
../profiles/cli
../profiles/direnv
../profiles/git
];
home.stateVersion = "22.05";
}

5
home/dev/default.nix Normal file
View file

@ -0,0 +1,5 @@
{ self, pkgs, ... }: {
imports =
[ ../profiles/cli ../profiles/nvim ../profiles/direnv ../profiles/git ];
home.stateVersion = "22.05";
}

14
home/gui/default.nix Normal file
View file

@ -0,0 +1,14 @@
{ pkgs, ... }:
{
imports = [
../core
../profiles/nvim
../profiles/firefox
../profiles/desktop
../profiles/email
../profiles/cal
../profiles/sync/kitaab
../profiles/ssh
../profiles/task
];
}

62
home/home.nix Normal file
View file

@ -0,0 +1,62 @@
# This is your home-manager configuration file
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
{ inputs, outputs, lib, config, pkgs, ... }: {
# You can import other home-manager modules here
imports = [
# If you want to use modules your own flake exports (from modules/home-manager):
# outputs.homeManagerModules.example
# Or modules exported from other flakes (such as nix-colors):
# inputs.nix-colors.homeManagerModules.default
# You can also split up your configuration and import pieces of it here:
# ./nvim.nix
];
nixpkgs = {
# You can add overlays here
overlays = [
# If you want to use overlays your own flake exports (from overlays dir):
# outputs.overlays.modifications
# outputs.overlays.additions
# Or overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
# Workaround for https://github.com/nix-community/home-manager/issues/2942
allowUnfreePredicate = (_: true);
};
};
# TODO: Set your username
home = {
username = "anish";
homeDirectory = "/home/anish/";
};
# Add stuff for your user as you see fit:
# programs.neovim.enable = true;
# home.packages = with pkgs; [ steam ];
# Enable home-manager and git
programs.home-manager.enable = true;
# programs.git.enable = true;
# Nicely reload system units when changing configs
# systemd.user.startServices = "sd-switch";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
home.stateVersion = "22.05";
}

View file

@ -0,0 +1,98 @@
{ pkgs, config, age, ... }:
{
home.packages = with pkgs; [
khal
khard
vdirsyncer
];
xdg.configFile = {
"vdirsyncer/config".text = ''
[general]
status_path = "/home/anish/.config/vdirsyncer/status/"
[pair contacts]
a = "contacts_local"
b = "contacts_remote"
collections = ["from b"]
metadata = ["displayname"]
[storage contacts_local]
type = "filesystem"
path = "~/.contacts/"
fileext = ".vcf"
[storage contacts_remote]
type = "carddav"
url = "http://mossnet.lan:5252/anish"
username = "anish"
password.fetch = ["command", "echo", "acceptsanypassword"]
[pair calendar]
a = "calendar_local"
b = "calendar_remote"
collections = ["from b"]
metadata = ["displayname"]
[storage calendar_local]
type = "filesystem"
path = "~/.calendar/"
fileext = ".ics"
[storage calendar_remote]
type = "caldav"
url = "http://mossnet.lan:5252/anish"
username = "anish"
password.fetch = ["command", "echo", "allpasswordsaccepted"]
'';
"khal/config".text = ''
[calendars]
[[calendar_local]]
path = ~/.calendar/*
type = discover
[[contacts_local]]
path = ~/.contacts/*
type = birthdays
[locale]
timeformat = %H:%M
dateformat = %Y-%m-%d
longdateformat = %Y-%m-%d
datetimeformat = %Y-%m-%d %H:%M
longdatetimeformat = %Y-%m-%d %H:%M
'';
"khard/khard.conf".text = ''
[addressbooks]
[[personal]]
path = ~/.contacts/*
[general]
debug = no
default_action = list
editor = nvim, -i, NONE
merge_editor = nvim, -d
[contact table]
display = first_name
group_by_addressbook = no
reverse = no
show_nicknames = yes
show_uids = no
sort = last_name
localize_dates = yes
preferred_phone_number_type = pref, cell, home
preferred_email_address_type = pref, home, work
[vcard]
private_objects = Jabber,
preferred_version = 3.0
search_in_source_files = no
skip_unparsable = no
'';
};
}

View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
working_directory=$(pwd)
vim_directory="${working_directory//\//%}.vim"
trash "$HOME/.local/share/nvim/sessions/${vim_directory}"

View file

@ -0,0 +1,19 @@
`dasht-docsets-intstall`
Bash
Clojure
Docker
Elixir
HTML
JavaScript
Jinja
Lua_5.4
Nginx
OpenGL_4
PostgreSQL
Processing
Python_3
React
Rust
TypeScript
Vim

View file

@ -0,0 +1,315 @@
{ lib, pkgs, config, ... }:
{
home.packages = with pkgs; [
binutils
coreutils
dnsutils
dasht
dosfstools
#git
git-machete
bottom
gptfdisk
starship
iputils
jq
manix
moreutils
nix-index
cached-nix-shell
nmap
ripgrep
skim
tealdeer
usbutils
utillinux
whois
iftop
wget
curl
eza
bat
fd
ncdu
du-dust
# dia-cli
duf
trash-cli
nix-index
silver-searcher
tcpdump
mtr
file
lsof
atool
strace
zip
unzip
rsync
tmux
pwgen
glow
pass
less
gdb
xxd
taskwarrior
gnupg
syncthing
dijo
#ssb-patchwork
fontconfig
pandoc
taskwarrior-tui
python3Packages.howdoi
vimwiki-cli
(pkgs.writeScriptBin "jq-repl" ''
#!/usr/bin/env bash
if [[ -z $1 ]] || [[ $1 == "-" ]]; then
input=$(mktemp)
trap "rm -f $input" EXIT
cat /dev/stdin > $input
else
input=$1
fi
echo "" \ | fzf --phony --preview-window="up:90%" --print-query --preview "jq --color-output -r {q} $input"
'')
(pkgs.writeScriptBin "clear-vim-trash" (builtins.readFile ./bin/clear-vim-trash.sh))
(pkgs.writeScriptBin "flakify" ''
#!/usr/bin/env zsh
if [ ! -e flake.nix ]; then
nix flake new -t github:nix-community/nix-direnv .
elif [ ! -e .envrc ]; then
echo "use flake" > .envrc
direnv allow
fi
vim flake.nix
'')
(pkgs.writeScriptBin "mx" ''
#!/usr/bin/env bash
manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview="manix '{}'" | xargs manix
'')
(pkgs.writeScriptBin "monitor" ''
# hotplug
connect() {
# Turn it on if it was off
xrandr --output HDMI-2 --auto
xrandr --output HDMI-2 --same-as eDP-1
}
disconnect() {
xrandr --output HDMI-2 --off
}
xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect
'')
(pkgs.writeScriptBin "disconnect-keyboard" ''
# keyboard on curve is busted
get_keyboard_id() {
xinput list | grep 'AT Translated Set' | cut -f2 | cut -d'=' -f2 | xinput float
}
disconnect_keyboard() {
id=$(get_keyboard_id)
xinput float $id
unset id
}
attach_keyboard() {
id=$(get_keyboard_id)
xinput reattach $id 3
unset id
}
disconnect_keyboard
'')
];
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = false;
initExtra = ''
bindkey -v
autopair-init
'';
sessionVariables = {
EDITOR = "nvim";
TERMINFO_DIRS = "${pkgs.kitty.terminfo.outPath}/share/terminfo"; # Needed to run home-manager switch on non-nixOS
};
plugins = [
{
name = "zsh-autopair";
src = pkgs.fetchFromGitHub {
owner = "hlissner";
repo = "zsh-autopair";
rev = "34a8bca0c18fcf3ab1561caef9790abffc1d3d49";
sha256 = "1h0vm2dgrmb8i2pvsgis3lshc5b0ad846836m62y8h3rdb3zmpy1";
};
file = "autopair.zsh";
}
{
name = "zsh-syntax-highlighting";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-syntax-highlighting";
rev = "0.6.0";
sha256 = "0zmq66dzasmr5pwribyh4kbkk23jxbpdw4rjxx0i7dx8jjp2lzl4";
};
file = "zsh-syntax-highlighting.zsh";
}
{
name = "zsh-autoquoter";
src = pkgs.fetchFromGitHub {
owner = "ianthehenry";
repo = "zsh-autoquoter";
rev = "819a615fbfd2ad25c5d311080e3a325696b45de7";
sha256 = "r0jdo+YFTOejvNMTqzXi5ftcLzDpuKejX0wMFwqKdJY=";
};
file = "zsh-autoquoter.zsh";
}
# {
# name = "zsh-nix-shell";
# file = "nix-shell.plugin.zsh";
# src = pkgs.fetchFromGitHub {
# owner = "chisui";
# repo = "zsh-nix-shell";
# rev = "v0.5.0";
# sha256 = "0za4aiwwrlawnia4f29msk822rj9bgcygw6a8a6iikiwzjjz0g91";
# };
# }
];
};
programs.starship = {
enable = true;
enableZshIntegration = true;
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
services.kdeconnect.enable = true;
home.shellAliases = {
# quick cd
".." = "cd ..";
"..." = "cd ../..";
"...." = "cd ../../..";
"....." = "cd ../../../..";
icat = "kitty +kitten icat";
yt = "ytfzf -T kitty -t ";
gen-secret = "< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c\${1:-32};echo;";
# modern cli tools
ls = "eza --icons";
l = "esa -l --icons";
la = "eza -la --icons";
tree = "ls --tree --icons";
cat = "bat";
unzip = "aunpack";
copy = "xclip -selection clipboard";
paste = "xclip -selection clipboard -o";
rm = "echo USE TRASH, FOOL: trash ";
trash = "trash-put";
make-secret = "< /dev/urandom \\tr -dc _A-Za-z0-9 | head -c \${1:-32};echo;";
# task warrior
t = "task -BLOCKED -idea -backlog";
tw = "t rc.context:work";
# TODO find a reasonable way to manage this from a non-nix managed file in ~/.task/context or something
# we can do something like task rc.context:$(cat ~/.task/context) to read context
# and write a little script make-context = cat $@ > ~/.task/context or something
tt = "taskwarrior-tui -r list";
ti = "task +idea";
tb = "task +backlog list";
ttb = "taskwarrior-tui -r backlog";
tr = "task newest limit:page";
twait = "task +wait";
ta = "task add";
tai = "task add +idea";
tn = "task-note";
ts = "task sync";
# taskwarrior task lists
twt = "task tags +PENDING | tail -n +4 | cut -d ' ' -f1 | fzf --preview 'task +{}'";
# task warrior projects list
tp = "task projects +PENDING | tail -n +4 | head -n -2 | cut -d ' ' -f1 | fzf --preview 'task pro:{}'";
# keeping for posterity but now sxhkbd handles screenshot with <Super+O>
# scrot = "flameshot screen -c -p ~/screenshots/";
# scrotgui = "flameshot gui -p ~/screenshots/";
# git
g = "git";
# grep
grep = "rg";
gi = "grep -i";
# internet ip
myip = "dig +short myip.opendns.com @208.67.222.222 2>&1";
# nix
n = "nix";
np = "n profile";
ni = "np install";
nr = "np remove";
ns = "n search --no-update-lock-file";
nf = "n flake";
nfl = "nf lock";
nepl = "n repl '<nixpkgs>'";
srch = "ns nixpkgs";
orch = "ns override";
nrb = "cd /tmp; sudo nixos-rebuild switch --flake '/home/anish/usr/helm#curve'; cd $OLDPWD";
nrt = "cd /tmp; sudo nixos-rebuild test --flake '/home/anish/usr/helm#curve'; cd $OLDPWD";
ned = "cd /home/anish/usr/helm; vim; cd $OLDPWD";
ncd = "cd /home/anish/usr/helm";
mn = ''
manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | sk --preview="manix '{}'" | xargs manix
'';
# sudo
s = "sudo -E ";
pls = "s";
si = "sudo -i";
se = "sudoedit";
# top
top = "btm";
# systemd
ctl = "systemctl";
stl = "s systemctl";
utl = "systemctl --user";
ut = "systemctl --user start";
un = "systemctl --user stop";
up = "s systemctl start";
dn = "s systemctl stop";
jtl = "journalctl";
# quick ssh
kssh = "kitty +kitten ssh";
smm = "ssh 10.0.69.4"; # box over wireguard
sm = "ssh mossnet.lan"; # box regular
sl = "ssh sealight.xyz"; # lituus
sh = "ssh git.sealight.xyz"; # helix
sb = "ssh cyberian@69.61.38.246"; # bonfire for allwell
};
}

View file

View file

Before

Width:  |  Height:  |  Size: 2.8 MiB

After

Width:  |  Height:  |  Size: 2.8 MiB

View file

@ -0,0 +1,317 @@
#!/usr/bin/env bash
# __ _ _ _ _ _ _
# _ __ ___ / _(_) | |__ | |_ _ ___| |_ ___ ___ | |_| |__
# | '__/ _ \| |_| |_____| '_ \| | | | |/ _ \ __/ _ \ / _ \| __| '_ \
# | | | (_) | _| |_____| |_) | | |_| | __/ || (_) | (_) | |_| | | |
# |_| \___/|_| |_| |_.__/|_|\__,_|\___|\__\___/ \___/ \__|_| |_|
#
# Author: Nick Clyde (clydedroid)
#
# A script that generates a rofi menu that uses bluetoothctl to
# connect to bluetooth devices and display status info.
#
# Inspired by networkmanager-dmenu (https://github.com/firecat53/networkmanager-dmenu)
# Thanks to x70b1 (https://github.com/polybar/polybar-scripts/tree/master/polybar-scripts/system-bluetooth-bluetoothctl)
#
# Depends on:
# Arch repositories: rofi, bluez-utils (contains bluetoothctl)
# Constants
divider="---------"
goback="Back"
# Checks if bluetooth controller is powered on
power_on() {
if bluetoothctl show | grep -q "Powered: yes"; then
return 0
else
return 1
fi
}
# Toggles power state
toggle_power() {
if power_on; then
bluetoothctl power off
show_menu
else
if rfkill list bluetooth | grep -q 'blocked: yes'; then
rfkill unblock bluetooth && sleep 3
fi
bluetoothctl power on
show_menu
fi
}
# Checks if controller is scanning for new devices
scan_on() {
if bluetoothctl show | grep -q "Discovering: yes"; then
echo "Scan: on"
return 0
else
echo "Scan: off"
return 1
fi
}
# Toggles scanning state
toggle_scan() {
if scan_on; then
kill $(pgrep -f "bluetoothctl scan on")
bluetoothctl scan off
show_menu
else
bluetoothctl scan on &
echo "Scanning..."
sleep 5
show_menu
fi
}
# Checks if controller is able to pair to devices
pairable_on() {
if bluetoothctl show | grep -q "Pairable: yes"; then
echo "Pairable: on"
return 0
else
echo "Pairable: off"
return 1
fi
}
# Toggles pairable state
toggle_pairable() {
if pairable_on; then
bluetoothctl pairable off
show_menu
else
bluetoothctl pairable on
show_menu
fi
}
# Checks if controller is discoverable by other devices
discoverable_on() {
if bluetoothctl show | grep -q "Discoverable: yes"; then
echo "Discoverable: on"
return 0
else
echo "Discoverable: off"
return 1
fi
}
# Toggles discoverable state
toggle_discoverable() {
if discoverable_on; then
bluetoothctl discoverable off
show_menu
else
bluetoothctl discoverable on
show_menu
fi
}
# Checks if a device is connected
device_connected() {
device_info=$(bluetoothctl info "$1")
if echo "$device_info" | grep -q "Connected: yes"; then
return 0
else
return 1
fi
}
# Toggles device connection
toggle_connection() {
if device_connected $1; then
bluetoothctl disconnect $1
device_menu "$device"
else
bluetoothctl connect $1
device_menu "$device"
fi
}
# Checks if a device is paired
device_paired() {
device_info=$(bluetoothctl info "$1")
if echo "$device_info" | grep -q "Paired: yes"; then
echo "Paired: yes"
return 0
else
echo "Paired: no"
return 1
fi
}
# Toggles device paired state
toggle_paired() {
if device_paired $1; then
bluetoothctl remove $1
device_menu "$device"
else
bluetoothctl pair $1
device_menu "$device"
fi
}
# Checks if a device is trusted
device_trusted() {
device_info=$(bluetoothctl info "$1")
if echo "$device_info" | grep -q "Trusted: yes"; then
echo "Trusted: yes"
return 0
else
echo "Trusted: no"
return 1
fi
}
# Toggles device connection
toggle_trust() {
if device_trusted $1; then
bluetoothctl untrust $1
device_menu "$device"
else
bluetoothctl trust $1
device_menu "$device"
fi
}
# Prints a short string with the current bluetooth status
# Useful for status bars like polybar, etc.
print_status() {
if power_on; then
printf ''
paired_devices_cmd="devices Paired"
# Check if an outdated version of bluetoothctl is used to preserve backwards compatibility
if (( $(echo "$(bluetoothctl version | cut -d ' ' -f 2) < 5.65" | bc -l) )); then
paired_devices_cmd="paired-devices"
fi
mapfile -t paired_devices < <(bluetoothctl $paired_devices_cmd | grep Device | cut -d ' ' -f 2)
counter=0
for device in "${paired_devices[@]}"; do
if device_connected $device; then
device_alias=$(bluetoothctl info $device | grep "Alias" | cut -d ' ' -f 2-)
if [ $counter -gt 0 ]; then
printf ", %s" "$device_alias"
else
printf " %s" "$device_alias"
fi
((counter++))
fi
done
printf "\n"
else
echo ""
fi
}
# A submenu for a specific device that allows connecting, pairing, and trusting
device_menu() {
device=$1
# Get device name and mac address
device_name=$(echo $device | cut -d ' ' -f 3-)
mac=$(echo $device | cut -d ' ' -f 2)
# Build options
if device_connected $mac; then
connected="Connected: yes"
else
connected="Connected: no"
fi
paired=$(device_paired $mac)
trusted=$(device_trusted $mac)
options="$connected\n$paired\n$trusted\n$divider\n$goback\nExit"
# Open rofi menu, read chosen option
chosen="$(echo -e "$options" | $rofi_command "$device_name")"
# Match chosen option to command
case $chosen in
"" | $divider)
echo "No option chosen."
;;
$connected)
toggle_connection $mac
;;
$paired)
toggle_paired $mac
;;
$trusted)
toggle_trust $mac
;;
$goback)
show_menu
;;
esac
}
# Opens a rofi menu with current bluetooth status and options to connect
show_menu() {
# Get menu options
if power_on; then
power="Power: on"
# Human-readable names of devices, one per line
# If scan is off, will only list paired devices
devices=$(bluetoothctl devices | grep Device | cut -d ' ' -f 3-)
# Get controller flags
scan=$(scan_on)
pairable=$(pairable_on)
discoverable=$(discoverable_on)
# Options passed to rofi
options="$devices\n$divider\n$power\n$scan\n$pairable\n$discoverable\nExit"
else
power="Power: off"
options="$power\nExit"
fi
# Open rofi menu, read chosen option
chosen="$(echo -e "$options" | $rofi_command "Bluetooth")"
# Match chosen option to command
case $chosen in
"" | $divider)
echo "No option chosen."
;;
$power)
toggle_power
;;
$scan)
toggle_scan
;;
$discoverable)
toggle_discoverable
;;
$pairable)
toggle_pairable
;;
*)
device=$(bluetoothctl devices | grep "$chosen")
# Open a submenu if a device is selected
if [[ $device ]]; then device_menu "$device"; fi
;;
esac
}
# Rofi command to pipe into, can add any options here
rofi_command="rofi -theme theme/passmenu.rasi -dmenu -no-fixed-num-lines -yoffset -100 -i -p"
case "$1" in
--status)
print_status
;;
*)
show_menu
;;
esac

View file

@ -0,0 +1,71 @@
#!/bin/sh
# Get class of a wid
get_class() {
id=$1
if [ -z "$id" ]; then
echo ""
else
xprop -id "$id" | sed -n \
-e '/WM_CLASS/s/\( "\)/\n/g; s/[^\n]*\n\([^"]*\)[^\n]*/\1\n/g' \
-e '/WM_COMMAND/s/[^"]*/\n\n/1; s/\n"//1; s/\n\([^"]*\)".*/\n\1/; /\n/p' | sed '/^$/d' | head -n1
fi
}
get_pid() {
xprop _NET_WM_PID -id "$1" | awk '/[0-9]+/ {print $3}'
}
get_ppid() {
ps -o ppid= -p $1
}
check_swallowing_process() {
pid=$(get_pid $1)
[ -z $pid ] && return 0
gppid=$(get_ppid $(get_ppid $pid))
grep -i "^$(ps -o cmd= -p $gppid | awk '{print $1}' | sed 's_^.*/__')$" ~/.config/bspwm/terminals && return 0
[ "$(get_ppid "$(get_ppid "$(get_pid "$1")")")" = "$(get_pid "$2")" ] && return 0 || return 1
}
swallow() {
addedtodesktop=$2
lasttermdesktop=$(bspc query -D -n last)
swallowerid=$1
swallowingid=$(bspc query -N -n last)
if [ "$addedtodesktop" = "$lasttermdesktop" ] && check_swallowing_process "$swallowerid" "$swallowingid"; then
grep -q "^$(get_class "$swallowerid")$" ~/.config/bspwm/{noswallow, terminals} && return
grep -i "^$(get_class "$swallowingid")$" ~/.config/bspwm/terminals || return
echo "$swallowerid $swallowingid" >> /tmp/swallowids
bspc node "$swallowingid" --flag hidden=on
fi
}
spit() {
spitterid=$1
spitterdesktop=$2
grep "^$spitterid" /tmp/swallowids || return
spittingid=$(grep "^$spitterid" /tmp/swallowids | head -n1 | awk '{print $2}')
bspc node "$spittingid" --flag hidden=off
termdesktop=$(bspc query -D -n "$spittingid")
[ "$termdesktop" = "$spitterdesktop" ] || bspc node "$spittingid" -d "$spitterdesktop"
bspc node "$spittingid" -f
sed -i "/^$spitterid/d" /tmp/swallowids
}
bspc subscribe node_add node_remove | while read -r event
do
case $(echo "$event" | awk '{ print $1 }') in
node_add)
swallow $(echo "$event" | awk '{print $5 " " $3}')
;;
node_remove)
spit $(echo "$event" | awk '{print $4 " " $3}')
;;
esac
done

View file

@ -0,0 +1,11 @@
#! /usr/bin/env bash
connect() {
xrandr --output HDMI-2 --same-as eDP-1
}
disconnect() {
xrandr --output HDMI-2 --off
}
xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect

15
home/profiles/desktop/bin/ku Executable file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env bash
# get into a shell that has poonam
cd ~/kitaab || exit;
nix develop;
# Use fzf to select a file and capture the output
selected_file=$(${pkgs.poonam}/main report --titles=false | head -n -2 | fzf --preview 'bat --color=always --terminal-width -1 ./vimwiki/{}')
echo $selected_file
# Add additional details to the file path
# file_path="./vimwiki/${selected_file}"
#
# # Open the file in vim for editing
# vim "${file_path}"
#

View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
URL="$(xclip -selection clipboard -o)"
mpv $URL

View file

@ -0,0 +1 @@
curl -F "content=$(xclip -o)" -X POST https://bin.sealight.xyz/upload

View file

@ -5,27 +5,27 @@ rofi_command="rofi -theme theme/powermenu.rasi"
### Options ### ### Options ###
power_off="\tShutdown" power_off="\tShutdown"
reboot="\tReboot" reboot="\tReboot"
lock="\tLock" lock="\tLock"
suspend="\tSleep" suspend="󰤄\tSleep"
log_out="\tLogout" log_out="󰍃\tLogout"
# Variable passed to rofi # Variable passed to rofi
options="$power_off\n$reboot\n$lock\n$suspend\n$log_out" options="$power_off\n$reboot\n$lock\n$suspend\n$log_out"
case "$(echo -e "$options" | $rofi_command -dmenu -selected-row 2)" in case "$(echo -e "$options" | $rofi_command -dmenu)" in
" Shutdown") " Shutdown")
systemctl poweroff systemctl poweroff
;; ;;
" Reboot") " Reboot")
systemctl reboot systemctl reboot
;; ;;
" Lock") " Lock")
zzz # TODO doesn't do anything dm-tool lock
;; ;;
" Sleep") "󰤄 Sleep")
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause
systemctl suspend systemctl suspend
;; ;;
" Logout") "󰍃 Logout")
bspc quit bspc quit
;; ;;
esac esac

View file

@ -0,0 +1,56 @@
#!/usr/bin/env bash
timer=5
# Options
select="󰩭 "
window=" "
screen=" "
record=" "
delay="󱑃 "
cancel="󰜺 "
# Variable passed to rofi
options="$select\n$window\n$screen\n$delay\n$cancel"
rofi_command="rofi -theme theme/screenshotmenu.rasi"
setFilename() {
directory="/tmp/"
filename="IMG_$(date +%Y%m%d_%H%M%S).jpg"
filepath=$directory$filename
}
notify() {
dunstify "Screenshot saved and copied to clipboard" -i accessories-screenshot
}
chosen="$(echo -e "$options" | $rofi_command -dmenu)"
case $chosen in
$select)
setFilename
maim -Buosd 0.25 \
| tee $filepath | xclip -selection c -t image/png
notify
;;
$window)
setFilename
maim -Buod 0.25 -i $(xdotool getactivewindow) \
| tee $filepath | xclip -selection c -t image/png
notify
;;
$screen)
setFilename
maim -Buod 0.25 \
| tee $filepath | xclip -selection c -t image/png
notify
;;
$delay)
setFilename
maim -Buod $timer \
| tee $filepath | xclip -selection c -t image/png
notify
;;
$record)
kooha
esac

View file

@ -0,0 +1,115 @@
#!/usr/bin/env bash
# rofi config without entry so to make select from available options only
rofiprompt=theme/passmenu.rasi
# normal rofi menu
rofidmenu=theme/passmenu.rasi
# rofi config for password
rofipass=theme/passmenu.rasi
# Power Status
flag=$(cat /sys/class/net/wl*/flags)
if [ "$flag" = "0x1003" ]; then
power="On"
else
power="Off"
fi
# Connection Status
state=$(cat /sys/class/net/wl*/operstate)
if [ "$state" = "up" ]; then
status=$(nmcli | grep "^wlp" | sed 's/\ connected\ to/Connected to/' | cut -d ':' -f2)
else
status="Disconnected"
fi
# ┌─┐┌─┐┬ ┬┌─┐┬─┐
# ├─┘│ ││││├┤ ├┬┘
# ┴ └─┘└┴┘└─┘┴└─
powertoggle=$( [ "$flag" = "0x1003" ] && echo "Power Off" || echo "Power On" )
powerswitch() {
if [ "$powertoggle" = "Power Off" ]; then
nmcli radio wifi off
elif [ "$powertoggle" = "Power On" ]; then
nmcli radio wifi on
fi
}
# ┌─┐┌─┐┌┐┌┌┐┌┌─┐┌─┐┌┬┐
# │ │ │││││││├┤ │ │
# └─┘└─┘┘└┘┘└┘└─┘└─┘ ┴
connections() {
list=$(nmcli --fields "SECURITY,SSID" device wifi list | tail -n +2 | sed "s/ */ /g" | sed -E "s/WPA*.?//g" | sed "s/^--//g" | sed "s/ //g")
networks=$(printf "$list" | rofi -theme $rofiprompt -dmenu -i -hover-select -p "Select Wifi Network
$status")
wifi=$( echo "$networks" | sed "s/ //g" | sed "s/ //g" | xargs)
[ -z "$networks" ] && exit
nopass="No Password"
pass=$(printf "$nopass\nCancel" | rofi -theme $rofipass -dmenu -i -hover-select -password -p "Wifi Password")
if [ "$pass" = "" ]; then
exit
elif [ "$pass" = "$nopass" ]; then
nmcli dev wifi con "$wifi" && printf "exit" | rofi -theme $rofiprompt -dmenu -only-match -i -p "Successfully Connected to $wifi" && exit
elif [ "$pass" = "Cancel" ]; then
exit
else
nmcli dev wifi con "$wifi" password "$pass" && printf "exit" | rofi -theme $rofiprompt -dmenu -i -only-match -p "Successfully Connected to $wifi" && exit
fi
printf "exit" | rofi -theme $rofiprompt -dmenu -i -p -only-match "Failed to Connect $wifi" && exit
}
# ┌┬┐┌─┐┌┐┌┬ ┬┌─┐┬
# │││├─┤││││ │├─┤│
# ┴ ┴┴ ┴┘└┘└─┘┴ ┴┴─┘
manual() {
wifi=$(rofi -theme $rofidmenu -dmenu -i -p "Enter Wifi Name")
[ -z "$wifi" ] && exit
nopass="Run Without Password"
pass=$(printf "$nopass\nCancel" | rofi -theme $rofipass -dmenu -i -password -p "Wifi Password")
if [ "$pass" = "" ]; then
exit
elif [ "$pass" = "$nopass" ]; then
nmcli dev wifi con "$wifi" && printf "exit" | rofi -theme $rofiprompt -dmenu -i -only-match -p "Successfully Connected to $wifi" && exit
elif [ "$pass" = "Cancel" ]; then
exit
else
nmcli dev wifi con "$wifi" password "$pass" && printf "exit" | rofi -theme $rofiprompt -dmenu -i -only-match -p "Successfully Connected to $wifi" && exit
fi
printf "exit" | rofi -theme $rofiprompt -dmenu -only-match -i -p "Failed to Connect $wifi" && exit
}
# ┌─┐┌─┐┌┬┐┬┌─┐┌┐┌┌─┐
# │ │├─┘ │ ││ ││││└─┐
# └─┘┴ ┴ ┴└─┘┘└┘└─┘
options="$powertoggle\nConnections\nConnect Manually"
rofiwifi=$(printf "$options" | rofi -theme $rofiprompt -dmenu -i -hover-select -p "Wifi
Powered: $power
Status: $status")
case $rofiwifi in
$powertoggle)
powerswitch
;;
Connections)
notify-send "Scanning"
connections
;;
"Connect Manually")
manual
esac 2>/dev/null

View file

@ -26,6 +26,8 @@ bspc config active_border_color "#181a23"
bspc config focused_border_color "#bd93f9" bspc config focused_border_color "#bd93f9"
bspc config presel_feedback_color "#bd93f9" bspc config presel_feedback_color "#bd93f9"
bspc config split_ratio 0.71
# Extra padding for polybar # Extra padding for polybar
bspc config -m primary top_padding 34 bspc config -m primary top_padding 34
bspc config -m primary bottom_padding 0 bspc config -m primary bottom_padding 0
@ -34,15 +36,13 @@ bspc config -m primary bottom_padding 0
bspc rule -r '*' bspc rule -r '*'
bspc rule -a Pinentry state=floating center=on bspc rule -a Pinentry state=floating center=on
bspc rule -a Emacs split_ratio=0.28 state=tiled bspc rule -a Firefox state=fullscreen
bspc rule -a Firefox split_ratio=0.32
bspc rule -a feh state=fullscreen bspc rule -a feh state=fullscreen
bspc rule -a 'Emacs:org*' state=floating
bspc rule -a 'Emacs:scratch' state=floating # bspswallow
bspc rule -a 'Emacs:emacs-everywhere' state=floating sticky=on pgrep bspswallow || bspswallow &
bspc rule -a '*:scratch' state=floating sticky=on center=on border=off rectangle=1000x800+0+0
# polybar # polybar
for file in $XDG_CONFIG_HOME/bspwm/rc.d/*; do for file in "$XDG_CONFIG_HOME"/bspwm/rc.d/*; do
source "$file" source "$file"
done done

View file

@ -0,0 +1,191 @@
{ pkgs, config, lib, ... }:
let
dracula-gtk = pkgs.fetchFromGitHub {
owner = "dracula";
repo = "gtk";
rev = "502f212d83bc67e8f0499574546b99ec6c8e16f9";
sha256 = "1wx9nzq7cqyvpaq4j60bs8g7gh4jk8qg4016yi4c331l4iw1ymsa";
};
in
{
home.pointerCursor = {
x11.enable = true;
x11.defaultCursor = "left_ptr";
package = pkgs.capitaine-cursors;
name = "capitaine-cursors";
};
# Install themes
home.packages = with pkgs; [
ayu-theme-gtk
dracula-theme
capitaine-cursors
paper-icon-theme
papirus-icon-theme
libsForQt5.qtstyleplugin-kvantum
qt5ct
gtk-engine-murrine
gtk_engines
maim
kitty
libreoffice
inotify-tools
offpunk
termpdfpy
libsForQt5.kontact
thunderbird
];
# GTK4 color scheme?
dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
};
# Move required config files around
xdg.enable = true; # This doesn't seem to do anything so we have below
xdg.configHome = "/home/anish/.config"; # TODO bad hardcode
xdg.configFile = {
"Kvantum/Dracula/Dracula.kvconfig".source = "${dracula-gtk}/kde/kvantum/Dracula-purple-solid/Dracula-purple-solid.kvconfig";
"Kvantum/Dracula/Dracula.svg".source = "${dracula-gtk}/kde/kvantum/Dracula-purple-solid/Dracula-purple-solid.svg";
"Kvantum/kvantum.kvconfig".text = "[General]\ntheme=Dracula";
};
xdg.mimeApps.defaultApplications = {
};
home.file = {
".config/bspwm/rc.d/polybar".source = ./run.sh;
".config/bspwm/bspwmrc".source = ./bspwmrc;
".config/sxhkdrc".source = ./sxhkdrc;
".config/rofi/theme" = {
source = ./rofi;
recursive = true;
};
".config/polybar" = {
source = ./polybar;
recursive = true;
};
".config/dunst/dunstrc".source = ./dunstrc;
".config/kitty/kitty.conf".source = ./kitty.conf;
".config/kitty/ayu.conf".source = ./ayu-kitty.conf;
".config/zathura/zathurarc".source = ./zathurarc;
".background-image".source = ./background.jpg;
#gtk4 theme
".config/gtk-4.0/settings.ini".text = ''
[Settings]
gtk-application-prefer-dark-theme=1
'';
# gtk3 theme
".config/gtk-3.0/settings.ini".text = ''
[Settings]
gtk-theme-name=Dracula
gtk-icon-theme-name=Paper
gtk-cursor-theme-name=Capitaine Cursors - White
gtk-fallback-icon-theme=gnome
gtk-application-prefer-dark-theme=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintfull
gtk-xft-rgba=none
'';
# GTK2 global theme (widget and icon theme)
".config/gtk-2.0/gtkrc".text = ''
gtk-theme-name=Ayu-Mirage
gtk-icon-theme-name=Capitaine Cursors - White
gtk-font-name="Sans 10"
'';
".local/bin/passmenu".source = ./bin/passmenu;
".local/bin/paste".source = ./bin/paste;
".local/bin/bluetoothmenu".source = ./bin/bluetoothmenu;
".local/bin/wifimenu".source = ./bin/wifimenu;
".local/bin/powermenu".source = ./bin/powermenu;
".local/bin/screenshot".source = ./bin/screenshot;
".local/bin/mpv-ify".source = ./bin/mpv-ify;
".local/bin/bspswallow".source = ./bin/bspswallow;
".config/bspwm/terminals".text = "Kitty";
# ".local/bin/hotplug-monitor.sh".source = ./bin/hotplug-monitor.sh;
};
xdg.desktopEntries = {
ocr = {
name = "OCR image";
exec = "${pkgs.writeScript "ocr" ''
${pkgs.xfce.xfce4-screenshooter}/bin/xfce4-screenshooter -r --save /tmp/ocr-tmp.png
${pkgs.tesseract}/bin/tesseract /tmp/ocr-tmp.png | ${pkgs.xclip}/bin/xclip -sel clip
rm /tmp/ocr-tmp.png
''}";
};
screenshot = {
name = "Screenshot";
exec = "screenshot";
};
};
qt = {
enable = true;
platformTheme.name = "gtk";
style = { name = "qt5ct-style"; };
};
# set up env
xsession.enable = true;
xresources.properties = {
"*.foreground" = "#95E6CB";
"*.background" = "#1F2430";
"*.cursorColor" = "#BAE67E";
# Black
"*.color0" = "#1F2430";
"*.color8" = "#F28779";
# Red
"*.color1" = "#A6CC70";
"*.color9" = "#FFCC66";
# Green
"*.color2" = "#5CCFE6";
"*.color10" = "#F29E74";
# Yellow
"*.color3" = "#77A8D9";
"*.color11" = "#5C6773";
# Blue
"*.color4" = "#707A8C";
"*.color12" = "#F27983";
# Magenta
"*.color5" = "#BAE67E";
"*.color13" = "#FFD580";
# Cyan
"*.color6" = "#73D0FF";
"*.color14" = "#FFA759";
# White
"*.color7" = "#95E6CB";
"*.color15" = "#CBCCC6";
# Bold, Italic, Underline
"*.colorBD" = "#e6e1cf";
};
programs.autorandr.enable = true;
services.udiskie.automount = true;
services.mpris-proxy.enable = true; # bluetooth media control
# Compositor
# services.picom = {
# enable = true;
# fade = true;
# fadeDelta = 1;
# fadeSteps = [ "0.01" "0.022" ];
# shadow = true;
# shadowOffsets = [ (-10) (-10) ];
# shadowOpacity = "0.22";
# # activeOpacity = "1.00";
# # inactiveOpacity = "0.92";
# extraOptions = ''
# shadow-radius = 12;
# # blur-background = true;
# # blur-background-frame = true;
# # blur-background-fixed = true;
# blur-kern = "7x7box";
# blur-strength = 320;
# corner-radius = 3
# '';
# };
}

View file

@ -0,0 +1,443 @@
# vim: ft=cfg
# See dunst(5) for all configuration options
[global]
### Display ###
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a window manager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern window managers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = none
### Geometry ###
# dynamic width from 0 to 300
# width = (0, 300)
# constant width of 300
width = (160, 320)
# The maximum height of a single notification, excluding the frame.
height = 400
# Position the notification in the top right corner
origin = top-right
# Offset from the origin
offset = 12x36
# Scale factor. It is auto-detected if value is 0.
scale = 0
# Maximum number of notification (0 means no limit)
notification_limit = 5
### Progress bar ###
# Turn on the progess bar. It appears when a progress hint is passed with
# for example dunstify -h int:value:12
progress_bar = true
# Set the progress bar height. This includes the frame, so make sure
# it's at least twice as big as the frame width.
progress_bar_height = 2
# Set the frame width of the progress bar
progress_bar_frame_width = 0
# Set the minimum width for the progress bar
progress_bar_min_width = 160
# Set the maximum width for the progress bar
progress_bar_max_width = 320
# Show how many messages are currently hidden (because of
# notification_limit).
indicate_hidden = yes
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing window manager is
# present (e.g. xcompmgr, compiz, etc.). (X11 only)
transparency = 0
# Draw a line of "separator_height" pixel height between two
# notifications.
# Set to 0 to disable.
separator_height = 1
# Padding between text and separator.
padding = 8
# Horizontal padding.
horizontal_padding = 8
# Padding between text and icon.
text_icon_padding = 8
# Defines width in pixels of frame around the notification window.
# Set to 0 to disable.
frame_width = 1
# Defines color of the frame around the notification window.
frame_color = "#414868"
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = frame
# Sort messages by urgency.
sort = yes
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
# A client can set the 'transient' hint to bypass this. See the rules
# section for how to disable this if necessary
# idle_threshold = 120
### Text ###
font = Iosevka Nerd Font 10
# The spacing between lines. If the height is smaller than the
# font height, it will get raised to the font height.
line_height = 0
# Possible values are:
# full: Allow a small subset of html markup in notifications:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <https://docs.gtk.org/Pango/pango_markup.html>.
#
# strip: This setting is provided for compatibility with some broken
# clients that send markup even though it's not enabled on the
# server. Dunst will try to strip the markup but the parsing is
# simplistic so using this option outside of matching rules for
# specific applications *IS GREATLY DISCOURAGED*.
#
# no: Disable markup parsing, incoming notifications will be treated as
# plain text. Dunst will not advertise that it has the body-markup
# capability if this is set as a global setting.
#
# It's important to note that markup inside the format option will be parsed
# regardless of what this is set to.
markup = full
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# %n progress value if set without any extra characters
# %% Literal %
# Markup is allowed
format = "<b>%s</b>\n%b"
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left
# Vertical alignment of message text and icon.
# Possible values are "top", "center" and "bottom".
vertical_alignment = top
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = -1
# Specify where to make an ellipsis in long lines.
# Possible values are "start", "middle" and "end".
ellipsize = end
# Ignore newlines '\n' in notifications.
ignore_newline = no
# Stack together notifications with the same content
stack_duplicates = true
# Hide the count of stacked notifications with the same content
hide_duplicate_count = true
# Display indicators for URLs (U) and actions (A).
show_indicators = no
### Icons ###
# Align icons left/right/off
icon_position = left
# Scale small icons up to this size, set to 0 to disable. Helpful
# for e.g. small files or high-dpi screens. In case of conflict,
# max_icon_size takes precedence over this.
min_icon_size = 0
# Scale larger icons down to this size, set to 0 to disable
max_icon_size = 160
# Paths to default icons.
icon_path = /usr/share/icons/kora/status/symbolic/:/usr/share/icons/kora/status/scalable/:/usr/share/icons/kora/apps/scalable/:/usr/share/icons/kora/mimes/scalable/:/usr/share/icons/kora/devices/scalable:/usr/share/icons/kora/places/scalable
### History ###
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = no
# Maximum amount of notifications kept in history
history_length = 8
### Misc/Advanced ###
# dmenu path.
dmenu = /usr/bin/dmenu -p dunst
# Browser for opening urls in context menu.
browser = /usr/bin/xdg-open
# Always run rule-defined scripts, even if the notification is suppressed
always_run_script = true
# Define the title of the windows spawned by dunst
title = dunst
# Define the class of the windows spawned by dunst
class = dunst
# Define the corner radius of the notification window
# in pixel size. If the radius is 0, you have no rounded
# corners.
# The radius will be automatically lowered if it exceeds half of the
# notification height to avoid clipping text and/or icons.
corner_radius = 0
# Ignore the dbus closeNotification message.
# Useful to enforce the timeout set by dunst configuration. Without this
# parameter, an application may close the notification sent before the
# user defined timeout.
ignore_dbusclose = false
### Wayland ###
# These settings are Wayland-specific. They have no effect when using X11
# Uncomment this if you want to let notications appear under fullscreen
# applications (default: overlay)
# layer = top
# Set this to true to use X11 output on Wayland.
force_xwayland = false
### Legacy
# Use the Xinerama extension instead of RandR for multi-monitor support.
# This setting is provided for compatibility with older nVidia drivers that
# do not support RandR and using it on systems that support RandR is highly
# discouraged.
#
# By enabling this setting dunst will not be able to detect when a monitor
# is connected or disconnected which might break follow mode if the screen
# layout changes.
force_xinerama = false
### mouse
# Defines list of actions for each mouse event
# Possible values are:
# * none: Don't do anything.
# * do_action: Invoke the action determined by the action_name rule. If there is no
# such action, open the context menu.
# * open_url: If the notification has exactly one url, open it. If there are multiple
# ones, open the context menu.
# * close_current: Close current notification.
# * close_all: Close all notifications.
# * context: Open context menu for the notification.
# * context_all: Open context menu for all notifications.
# These values can be strung together for each mouse event, and
# will be executed in sequence.
mouse_left_click = do_action
mouse_middle_click = close_current
mouse_right_click = context
# Experimental features that may or may not work correctly. Do not expect them
# to have a consistent behaviour across releases.
[experimental]
# Calculate the dpi to use on a per-monitor basis.
# If this setting is enabled the Xft.dpi value will be ignored and instead
# dunst will attempt to calculate an appropriate dpi value for each monitor
# using the resolution and physical size. This might be useful in setups
# where there are multiple screens with very different dpi values.
per_monitor_dpi = false
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#24283b"
foreground = "#c0caf5"
highlight = "#bb9af7"
timeout = 3
# Icon for notifications with low urgency, uncomment to enable
icon = /dev/null
[urgency_normal]
background = "#24283b"
foreground = "#a9b1d6"
highlight = "#bb9af7"
timeout = 5
# Icon for notifications with normal urgency, uncomment to enable
icon = /dev/null
[urgency_critical]
background = "#24283b"
foreground = "#c0caf5"
frame_color = "#e9af68"
highlight = "#bb9af7"
timeout = 5
# Icon for notifications with critical urgency, uncomment to enable
#icon = /path/to/icon
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
#
# Messages can be matched by
# appname (discouraged, see desktop_entry)
# body
# category
# desktop_entry
# icon
# match_transient
# msg_urgency
# stack_tag
# summary
#
# and you can override the
# background
# foreground
# format
# frame_color
# fullscreen
# new_icon
# set_stack_tag
# set_transient
# set_category
# timeout
# urgency
# skip_display
# history_ignore
# action_name
# word_wrap
# ellipsize
# alignment
#
# Shell-like globbing will get expanded.
#
# Instead of the appname filter, it's recommended to use the desktop_entry filter.
# GLib based applications export their desktop-entry name. In comparison to the appname,
# the desktop-entry won't get localized.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
# Disable the transient hint so that idle_threshold cannot be bypassed from the
# client
#[transient_disable]
# match_transient = yes
# set_transient = no
#
# Make the handling of transient notifications more strict by making them not
# be placed in history.
#[transient_history_ignore]
# match_transient = yes
# history_ignore = yes
# fullscreen values
# show: show the notifications, regardless if there is a fullscreen window opened
# delay: displays the new notification, if there is no fullscreen window active
# If the notification is already drawn, it won't get undrawn.
# pushback: same as delay, but when switching into fullscreen, the notification will get
# withdrawn from screen again and will get delayed like a new notification
#[fullscreen_delay_everything]
# fullscreen = delay
#[fullscreen_show_critical]
# msg_urgency = critical
# fullscreen = show
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# skip_display = true
#[history-ignore]
# # This notification will not be saved in history
# summary = "foobar"
# history_ignore = yes
#[skip-display]
# # This notification will not be displayed, but will be included in the history
# summary = "foobar"
# skip_display = yes
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
#[stack-volumes]
# appname = "some_volume_notifiers"
# set_stack_tag = "volume"
#
#[play_sound]
# summary = "*"
# script = ~/.local/share/sounds/notify_sound

View file

@ -0,0 +1,50 @@
* {
all: unset;
color: #cdd6f4;
}
/* Calendar */
.cal-box {
background-color: #181825;
border-radius: 8px;
font-family: JetBrainsMono Nerd Font;
font-size: 1.2em;
.cal-inner-box {
padding: 1rem 1rem .3rem 1rem;
.cal {
&.highlight {
padding: 10rem;
}
padding: .8rem .25rem 0rem;
margin-left: 10px;
}
}
}
calendar:selected {
color: #9ece6a;
}
calendar.header {
color: #ad8ee6;
font-weight: bold;
}
calendar.button {
color: #449dab;
}
calendar.highlight {
color: #7aa2f7;
font-weight: bold;
}
calendar:indeterminate {
color: #8C8C8C;
}

View file

@ -0,0 +1,13 @@
; includes:
;widgets
(include "widgets.yuck")
;; Calendar Windows ;;
(defwindow calendar
:geometry (geometry :x "-19px"
:y "50px"
:width "270px"
:height "60px"
:anchor "top right")
(cal))

View file

@ -0,0 +1,20 @@
; widgets
(defpoll time0 :interval "10s" "date '+%H':%M")
(defpoll date :interval "10s" "date '+%b %d'")
;; Calendar Widgets ;;
(defwidget cal []
(box :class "cal-box"
:orientation "v"
(box :class "cal-inner-box"
(calendar :class "cal"
:day calendar_day
:month calendar_month
:year calendar_year))))
(defpoll calendar_day :interval "10h"
"date '+%d'")
(defpoll calendar_month :interval "10h"
"calendar")
(defpoll calendar_year :interval "10h"
"date '+%Y'")

View file

@ -1,7 +1,13 @@
include ayu.conf include ayu.conf
font_family Hermit font_family Hermit
font_size 13
bold_font auto bold_font auto
italic_font auto italic_font auto
bold_italic_font auto bold_italic_font auto
open_url_with default open_url_with default
mouse_map left click ungrabbed mouse_click_url_or_select mouse_map left click ungrabbed mouse_click_url_or_select
confirm_os_window_close 0
enable_audio_bell no
-- Allows zen-mode.nvim to increase font size
-- allow_remote_control socket-only
-- listen_on unix:/tmp/kitty

View file

@ -330,7 +330,7 @@ ramp-volume-2 = 
[module/battery] [module/battery]
type = internal/battery type = internal/battery
battery = BAT0 battery = BAT2
adapter = ADP1 adapter = ADP1
full-at = 98 full-at = 98

View file

@ -0,0 +1,379 @@
[colors]
yellow = #ffd580
orange = #fe8019
blue = #73d0ff
green = #bae67e
red = #ff3333
bg = #1f2430
fg = #bfbab0
icons = #bae67e
cyan = #95e6cb
text = ${xrdb:color2}
unfocus = ${xrdb:color1}
accent = #604c7e
sky = #73d0ff
mauve = #bae67e
alert = ${colors.yellow}
bg-alt = #1E2029
fg-alt = #373844
bg-dark = #181a23
[bar/mybar]
; monitor = VGA-1
override-redirect = false
; Put the bar at the bottom of the screen
bottom = false
; Prefer fixed center position for the `modules-center` block
fixed-center = true
width = 100%
height = 34
; Background ARGB color (e.g. #f00, #ff992a, #ddff1023)
background = ${colors.bg}
; Foreground ARGB color (e.g. #f00, #ff992a, #ddff1023)
foreground = ${colors.fg}
line-size = 0
line-color = #fff
; Number of spaces to add at the beginning/end of the bar
; Individual side values can be defined using:
; padding-{left,right}
padding-right = 1
padding-left = 0
; Number of spaces to add before/after each module
; Individual side values can be defined using:
; module-margin-{left,right}
module-margin = 0
margin-bottom = 34
font-0 = "Iosevka Nerd Font,Iosevka NF:pixelsize=10;1" ; Icon Size
font-1 = "Iosevka Nerd Font,Iosevka NF:pixelsize=12;4" ; Large Text font
font-2 = "FiraCode Nerd Font:pixelsize=12;2"
font-3 = "Siji:pixelsize=10;2"
font-4 = "Iosevka Nerd Font,Iosevka NF:pixelsize=8;1" ; Small Icon Size
; Add module mpd for artist - title info
modules-left = bspwm sps volume
; modules-center = title
modules-right = wireless-network sps battery sps memory sps cpu sps date
; The separator will be inserted between the output of each module
separator =
; This value is used to add extra spacing between elements
; @deprecated: This parameter will be removed in an upcoming version
spacing = 0
; Opacity value between 0.0 and 1.0 used on fade in/out
dim-value = 1.0
wm-name = bspwm
tray-position = right
; If true, the bar will not shift its
; contents when the tray changes
tray-detached = false
; Tray icon max size
tray-maxsize = 16
tray-background = ${colors.bg}
;offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
tray-offset-x = 0
tray-offset-y = 0
; Pad the sides of each tray icon
tray-padding = 0
; Scale factor for tray clients
tray-scale = 1.0
wm-restack = bspwm
dpi-x = 133
dpi-y = 133
enable-ipc = false
; Fallback click handlers that will be called if
; there's no matching module handler found.
[module/bspwm]
type = internal/bspwm
pin-workspaces = true
enable-click = true
ws-icon-0 = 1;%{T2} %{T-}
ws-icon-1 = 2;%{T2} %{T-}
ws-icon-2 = 3;%{T2}󰺻 %{T-}
ws-icon-3 = 4;%{T2} %{T-}
ws-icon-4 = 5;%{T2} %{T-}
ws-icon-default = 
; fuzzy-match = true
format = <label-state> <label-mode>
label-padding = 1
label-foreground = ${colors.green}
label-focused = %icon%
label-focused-background = ${colors.yellow}
label-focused-foreground = ${colors.bg}
# label-focused-underline = ${colors.magenta}
; label-focused-foreground = ${xrdb:color2}
label-focused-padding = 1
label-occupied = %icon%
label-occupied-foreground = ${colors.accent}
label-occupied-padding = 1
label-urgent = %icon%
label-urgent-foreground = ${colors.alert}
; label-urgent-background = ${colors.alert}
label-urgent-padding = 1
; label-urgent-font = 3
label-empty = %icon%
label-empty-foreground = ${colors.fg-alt}
label-empty-padding = 1
[module/date]
type = internal/date
; Seconds to sleep between updates
interval = 1.0
; See "http://en.cppreference.com/w/cpp/io/manip/put_time" for details on how to format the date string
; NOTE: if you want to use syntax tags here you need to use %%{...}
date = %{T2} %{T-}%{T1} %d/%a%{T-}
; Optional time format
time = %{T2} %H:%M%{T-}
; if `date-alt` or `time-alt` is defined, clicking
; the module will toggle between formats
date-alt = %{T2} %{T-} %{T1} %a, %d %b %y%{T-}
time-alt = %{T2} %H:%M:%S%{T-}
label = %date%%time%
label-font = 0
label-foreground = ${colors.green}
[module/wireless-network]
type = internal/network
interface = wlp3s0
label-connected = %essid%
label-connected-font = 2
format-connected = <ramp-signal> <label-connected>
label-connected-foreground = #82b414
format-disconnected = <label-disconnected>
label-disconnected = "󰖪"
label-disconnected-foreground = #f92672
ramp-signal-foreground = #82b414
ramp-signal-0 = " "
ramp-signal-1 = " "
ramp-signal-2 = " "
ramp-signal-3 = " "
ramp-signal-4 = " "
ramp-signal-5 = " "
[module/cpu]
type = internal/cpu
; Seconds to sleep between updates
; Default: 1
interval = 0.5
label = %{T2} %{T-}%{T1} %percentage:2%%%{T-}
label-foreground = ${colors.cyan}
[module/memory]
type = internal/memory
; Seconds to sleep between updates
; Default: 1
interval = 0.5
format = <label>
; Available tokens:
; %percentage_used% (default)
; %percentage_free%
; %gb_used%
; %gb_free%
; %gb_total%
; %mb_used%
; %mb_free%
; %mb_total%
; %percentage_swap_used%
; %percentage_swap_free%
; %mb_swap_total%
; %mb_swap_free%
; %mb_swap_used%
; %gb_swap_total%
; %gb_swap_free%
; %gb_swap_used%
label = %{T2}󰍛 %{T-}%{T1} %gb_used%%{T-}
label-foreground = ${colors.cyan}
[module/mpd]
type = internal/mpd
host = 0.0.0.0
port = 6600
interval = 2
format-online = <label-song>
format-online-background = ${colors.bg}
format-online-foreground = ${colors.yellow}
#format-online-padding = 20
label-song = %{T2}%artist% - %title%%{T-}
label-song-maxlen = 55
label-song-ellipsis = true
label-offline = "MPD is offline"
[module/mpd_i]
type = internal/mpd
interval = 2
format-online = <icon-prev> <toggle> <icon-next>
format-online-background = ${colors.bg}
format-online-foreground = ${colors.yellow}
#format-online-padding = 2
label-offline = "MPD is offline"
; Only applies if <icon-X> is used
icon-play = %{T1}奈%{T-}
icon-pause = %{T1}%{T-}
icon-stop = %{T1}%{T-}
icon-prev = %{T1}ﭣ%{T-}
icon-next = %{T1}ﭡ%{T-}
;An empty module used to add 1 unit spacings whenever needed
[module/sps]
type = custom/text
content = " "
content-padding = 0
[module/volume]
type = internal/pulseaudio
use-ui-max = false
interval = 5
format-volume = <ramp-volume> <bar-volume>
format-muted = <label-muted>
format-muted-prefix = "  "
format-muted-prefix-font = 2
format-muted-prefix-foreground = ${colors.mauve}
label-volume = "%percentage%% "
label-muted = "Mute"
label-volume-foreground = ${colors.mauve}
label-muted-foreground = ${colors.mauve}
bar-volume-width = 8
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 6
bar-volume-indicator-foreground = ${colors.mauve}
bar-volume-fill = ─
bar-volume-fill-font = 6
bar-volume-fill-foreground = ${colors.mauve}
bar-volume-empty = ─
bar-volume-empty-font = 6
bar-volume-empty-foreground = ${colors.fg-alt}
ramp-volume-0 = "  "
ramp-volume-1 = "  "
ramp-volume-2 = "  "
ramp-volume-3 = "  "
ramp-volume-4 = "  "
ramp-volume-5 = "  "
ramp-volume-6 = "  "
ramp-volume-7 = "  "
ramp-volume-8 = "  "
ramp-volume-9 = "  "
ramp-volume-font = 1
ramp-volume-foreground = ${colors.mauve}
ramp-headphones-0 = 
ramp-headphones-1 = 
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
[module/battery]
type = internal/battery
full-at = 99
adapter = ACAD
battery = BAT0
poll-interval = 2
time-format = %H:%M
format-charging = <animation-charging> <label-charging>
format-charging-prefix =
format-discharging = <ramp-capacity> <label-discharging>
format-full = <label-full>
format-full-prefix = " "
format-full-prefix-font = 2
format-full-prefix-foreground = ${colors.sky}
label-charging = "%percentage%% "
label-discharging = "%percentage%% "
label-full = "%percentage%%"
label-charging-foreground = ${colors.sky}
label-discharging-foreground = ${colors.sky}
label-charging-font = 2
label-discharging-font = 2
label-full-foreground = ${colors.sky}
label-full-font = 2
ramp-capacity-0 = " "
ramp-capacity-1 = " "
ramp-capacity-2 = " "
ramp-capacity-3 = " "
ramp-capacity-4 = " "
ramp-capacity-font = 1
ramp-capacity-foreground = ${colors.sky}
animation-charging-0 = " "
animation-charging-1 = " "
animation-charging-2 = " "
animation-charging-3 = " "
animation-charging-4 = " "
animation-charging-font = 1
animation-charging-foreground = ${colors.sky}
animation-charging-framerate = 750
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

View file

@ -62,8 +62,8 @@ padding-right = 2
module-margin-left = 0 module-margin-left = 0
module-margin-right = 0 module-margin-right = 0
font-0 = "Fira Code:pixelsize=9;2" font-0 = "Fira Code:pixelsize=13;2"
font-1 = "Wuncon Siji:pixelsize=12;2" font-1 = "Wuncon Siji:pixelsize=16;2"
font-2 = "Siji:pixelsize=10;2" font-2 = "Siji:pixelsize=10;2"
; modules-left = volume pad cpu memory pad pkg mail ; modules-left = volume pad cpu memory pad pkg mail
@ -88,6 +88,7 @@ enable-click = true
# ws-icon-4 = 5; # ws-icon-4 = 5;
# ws-icon-5 = 6; # ws-icon-5 = 6;
ws-icon-default =  ws-icon-default = 
fuzzy-match = true
format = <label-state> <label-mode> format = <label-state> <label-mode>
label-padding = 1 label-padding = 1
@ -130,8 +131,8 @@ format-prefix-foreground = ${colors.accent}
[module/fs] [module/fs]
type = internal/fs type = internal/fs
mount-0 = / mount-0 = /
mount-1 = /mnt/projects ; for desktops # mount-1 = /mnt/projects ; for desktops
mount-2 = /home ; for laptop mount-2 = /home/anish
interval = 30 interval = 30
; Available tags: ; Available tags:
@ -254,17 +255,18 @@ format-disconnected-foreground =
; label-disconnected = ! ; label-disconnected = !
; label-disconnected-foreground = ${colors.red} ; label-disconnected-foreground = ${colors.red}
ramp-signal-0 = ramp-signal-0 =
ramp-signal-0-foreground = ${colors.yellow} ramp-signal-0-foreground = ${colors.yellow}
ramp-signal-1 = ramp-signal-1 =
ramp-signal-1-foreground = ${colors.yellow} ramp-signal-1-foreground = ${colors.yellow}
ramp-signal-2 = ramp-signal-2 =
ramp-signal-2-foreground = ${colors.yellow} ramp-signal-2-foreground = ${colors.yellow}
ramp-signal-3 = ramp-signal-3 =
ramp-signal-3-foreground = ${colors.accent} ramp-signal-3-foreground = ${colors.accent}
ramp-signal-4 = ramp-signal-4 =
ramp-signal-4-foreground = ${colors.fg} ramp-signal-4-foreground = ${colors.fg}
[module/network-up] [module/network-up]
type = internal/network type = internal/network
interface = ${env:LAN:eno1} interface = ${env:LAN:eno1}

View file

@ -2,7 +2,7 @@
@import "config.rasi" @import "config.rasi"
textbox-icon { textbox-icon {
str: " "; str: "󱎂 ";
} }
prompt { prompt {

View file

@ -46,7 +46,7 @@ configuration {
/**** Layout ****/ /**** Layout ****/
window { window {
width: 1000px; width: 1000px;
y-offset: -50px; y-offset: -150px;
anchor: north; anchor: north;
location: center; location: center;
border: 1px; border: 1px;

View file

@ -0,0 +1,15 @@
/* -*- mode: css; -*- */
@import "config.rasi"
listview {
columns: 4;
}
textbox-icon {
str: "🎑";
}
prompt {
enabled: false;
}

View file

@ -0,0 +1,43 @@
@import "config.rasi"
* {
icon-font : "Iosevka Nerd Font Mono 24";
text-color : @fg;
background-color : @bg;
margin : 0px;
padding : 0px;
spacing : 0px;
}
window {
location : north;
children : [mainbox];
}
mainbox {
children : [listview];
}
listview {
columns : 8;
lines : 1;
}
element {
children : [element-text];
}
element-text {
font : @icon-font;
cursor : pointer;
padding : 4px;
vertical-align : 0.5;
horizontal-align : 0.5;
}
element-text selected {
text-color : @bg;
background-color : @accent;
}

View file

@ -0,0 +1,22 @@
@import "appmenu.rasi"
window {
children: [ listview ];
width: 264px;
y-offset: -540px;
border-radius: 5px 5px 5px 5px;
}
listview {
scrollbar: false;
lines: 1;
columns: 6;
}
element {
background-color: @bg;
}
element.selected {
background-color: @off;
text-color: @bg;
}

9
home/profiles/desktop/run.sh Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Cheap hack to get pointerCursor working because for some reason it doesn't...
xsetroot -xcf /etc/profiles/per-user/anish/share/icons/capitaine-cursors/cursors/left_ptr 32
pkill -u $UID -x polybar
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
polybar mybar >$XDG_DATA_HOME/polybar.log 2>&1 &

View file

@ -18,35 +18,35 @@ super + Return
ctrl + super + Return ctrl + super + Return
xst -e bash -c "(tmux ls | grep -qEv 'attached|scratch' && tmux at) || tmux" xst -e bash -c "(tmux ls | grep -qEv 'attached|scratch' && tmux at) || tmux"
# Open a disposable, floating terminal window, for quick shell commands.
super + grave
scratch
# Open a disposable scratch buffer in a floating Emacs window, to run arbitrary
# code or quickly note something down.
super + shift + grave
emacsclient --eval "(open-scratch-frame)"
super + space super + space
rofi -show drun -modi drun,run -show-icons -theme theme/appmenu.rasi rofi -show drun -modi drun,run -show-icons -theme theme/appmenu.rasi
super + Tab super + Tab
rofi -show window -show-icons -theme theme/windowmenu.rasi rofi -show window -show-icons -theme theme/windowmenu.rasi
super + e
rofimoji --selector-args "-theme theme/emojimenu.rasi" --skin-tone moderate --action copy
super + a
paste
super + p super + p
passmenu passmenu
super + slash
filemenu -x
super + s super + s
powermenu powermenu
super + o super + o
screenshot screenshot
super + Escape super + w
pkill -USR1 -x sxhkd wifimenu
super + b
bluetoothmenu
# super + Escape
# pkill -USR1 -x sxhkd
super + n super + n
xkblayout-state set +1 xkblayout-state set +1
@ -95,6 +95,8 @@ super + shift + {Left,Down,Up,Right}
# #
## Media keys ## Media keys
super + u
mpv-ify
# screenshot region # screenshot region
Print Print

View file

@ -3,7 +3,7 @@
enable = true; enable = true;
nix-direnv = { nix-direnv = {
enable = true; enable = true;
enableFlakes = true; # enableFlakes = true;
}; };
}; };
} }

View file

@ -0,0 +1,302 @@
{ pkgs, ... }:
{
#age.secrets.fastmail.file = "/etc/nixos/secrets/fastmail.age";
#age.secrets.fastmail.owner = "anish";
home.packages = with pkgs; [
neomutt
himalaya
imapfilter
browsh
# icat
];
services.mbsync = {
enable = true;
frequency = "*:0/30";
postExec = "${pkgs.notmuch}/bin/notmuch new";
};
services.imapnotify.enable = true;
programs.mbsync.enable = true;
programs.msmtp.enable = true;
programs.notmuch.enable = true;
home.file.".mailcap".text = ''
text/html; firefox %s
application/pdf; zathura %s
image/png; feh %s
image/jpeg; feh %s
'';
programs.neomutt = {
enable = true;
extraConfig = ''
# Shamelessly Stolen from https://gideonwolfe.com/posts/workflow/neomutt/intro/
# set editor to neovim
set editor = "nvim +':set textwidth=0'"
#set virtual_spoolfile=yes
set folder="~/Maildir/anish"
set mbox_type = Maildir
mailboxes `find ~/Maildir/anish/* -maxdepth 0 -type d | grep -v "Trash\|Spam\|tmp\|new\|cur" | sed 's|/home/anish/Maildir/anish|=\"|g' | sed 's|$|\"|g' | tr '\n' ' '`
## Folder with emails
#set folder = "~/Mail/anish"
# Type of mailbox
# Directory to poll for new mail
#set spoolfile = +Inbox
# Directory to save sent messages into
#set record = +Sent
# Sets the drafts folder
set postponed = ~/Mail/anish/Drafts
# File that headers will be cached
# set header_cache = ~/.cache/mutt
set my_name = "Anish"
set imap_check_subscribed
# Set preffered view modes
auto_view text/html text/calendar application/ics # view html automatically
alternative_order text/plain text/enriched text/html text/*
# main options
set use_from
set from="anish@lakhwara.com"
set sendmail="msmtpq" # send from default account using msmtp
set sendmail_wait=-1
set edit_headers # show headers when composing
set fast_reply # skip to compose when replying
#set askcc # ask for CC:
set fcc_attach # save attachments with the body
set forward_format = "Fwd: %s" # format of subject when forwarding
set forward_decode # decode when forwarding
set attribution = "On %d, %n wrote:" # format of quoting header
set reply_to # reply to Reply to: field
set reverse_name # reply as whomever it was to
set include # include message in replies
set forward_quote # include message in forwards
set text_flowed
set ssl_force_tls
set fast_reply
#unset sig_dashes # no dashes before sig
#unset mime_forward # forward attachments as part of body
#unset help # No help bar at the top of index
set status_on_top # Status bar on top of index
#set tmpdir = ~/Programs/neomutt/temp # where to keep temp files
unset confirmappend # don't ask, just do!
set quit # don't ask, just do!!
unset mark_old # read/new is good enough for me
set pipe_decode # strip headers and eval mimes when piping
set thorough_search # strip headers and eval mimes before searching
set timeout = 0
# status bar, date format, finding stuff etc.
set status_chars = " *%A"
set status_format = "[ Folder: %f ] [%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]%>%?p?( %p postponed )?"
set date_format = "%d.%m.%Y %H:%M"
set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*"
set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"
set send_charset = "utf-8:iso-8859-1:us-ascii"
set charset = "utf-8"
set arrow_cursor = "no" # Change `color indicator` depending
# notmuch shortcuts
# Points to the notmuch directory
set nm_default_url = "notmuch://$HOME/Mail/anish"
# Makes notmuch return threads rather than messages
set nm_query_type = "threads"
# Binding for notmuch search
macro index,pager S "<vfolder-from-query>" "Search mailbox"
# Pager View Options
set pager_index_lines = 10 # Shows 10 lines of index when pager is active
set pager_context = 3
set pager_stop
set menu_scroll
set tilde
set mail_check_stats
unset markers
#set header_cache = "~/.cache/mutt"
#set message_cachedir = "~/.cache/mutt"
set query_command = "khard email --parsable --search-in-source-files '%s'"
### Mappings Settings
# General rebindings
bind attach <return> view-mailcap
bind attach l view-mailcap
bind editor <space> noop
bind pager c imap-fetch-mail
bind index G last-entry
bind index g noop
bind index gg first-entry
bind pager,attach h exit
bind pager j next-line
bind pager k previous-line
bind pager l view-attachments
bind index D delete-message
bind index U undelete-message
bind index L limit
bind index h noop
bind index l display-message
bind browser h goto-parent
bind browser l select-entry
bind pager,browser gg top-page
bind pager,browser G bottom-page
bind index,pager,browser d half-down
bind index,pager,browser u half-up
# bind index,pager R group-reply
bind index \031 previous-undeleted # Mouse wheel
bind index \005 next-undeleted # Mouse wheel
bind pager \031 previous-line # Mouse wheel
bind pager \005 next-line # Mouse wheel
bind editor <Tab> complete-query
# sidebar mappings
set sidebar_short_path=yes
set sidebar_delim_chars='/'
bind index,pager \Ck sidebar-prev
bind index,pager \Cj sidebar-next
bind index,pager \Co sidebar-open
bind index,pager \Cp sidebar-prev-new
bind index,pager \Cn sidebar-next-new
bind index,pager B sidebar-toggle-visible
# global index and pager shortcuts
bind index,pager @ compose-to-sender
bind index,pager D purge-message
bind index <tab> sync-mailbox
bind index <space> collapse-thread
# Email completion bindings
bind editor <Tab> complete-query
bind editor ^T complete
# Press A to archive
macro index,pager A "<clear-flag><save-message>=/Archive" "mark message as Archived"
# Press C to add contact to Khard address book
macro index,pager C \
"<pipe-message>khard add-email<return>" \
"add the sender email address to khard"
### Color Settings
# Header colors:
color header blue default ".*"
color header brightmagenta default "^(From)"
color header brightcyan default "^(Subject)"
color header brightwhite default "^(CC|BCC)"
mono bold bold
mono underline underline
mono indicator reverse
mono error bold
color normal default default
color indicator brightyellow default # currently selected message. default makes bar clear, disabled arrow to save space.
color sidebar_highlight red default
color sidebar_divider brightblack black
color sidebar_flagged red black
color sidebar_new green black
color normal brightyellow default
color error red default
color tilde black default
color message cyan default
color markers red white
color attachment white default
color search brightmagenta default
color status brightyellow black
color hdrdefault brightgreen default
color quoted green default
color quoted1 blue default
color quoted2 cyan default
color quoted3 yellow default
color quoted4 red default
color quoted5 brightred default
color signature brightgreen default
color bold black default
color underline black default
color normal default default
color body brightred default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" # Email addresses
color body brightblue default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" # URL
color body green default "\`[^\`]*\`" # Green text between ` and `
color body brightblue default "^# \.*" # Headings as bold blue
color body brightcyan default "^## \.*" # Subheadings as bold cyan
color body brightgreen default "^### \.*" # Subsubheadings as bold green
color body yellow default "^(\t| )*(-|\\*) \.*" # List items as yellow
color body brightcyan default "[;:][-o][)/(|]" # emoticons
color body brightcyan default "[;:][)(|]" # emoticons
color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon?
color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon?
color body red default "(BAD signature)"
color body cyan default "(Good signature)"
color body brightblack default "^gpg: Good signature .*"
color body brightyellow default "^gpg: "
color body brightyellow red "^gpg: BAD signature from.*"
mono body bold "^gpg: Good signature"
mono body bold "^gpg: BAD signature from.*"
color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]"
# Default index colors:
color index yellow default '.*'
color index_author red default '.*'
color index_number blue default
color index_subject cyan default '.*'
# For new mail:
color index brightyellow black "~N"
color index_author brightred black "~N"
color index_subject brightcyan black "~N"
color progress black cyan
'';
};
accounts.email = {
accounts.anish = {
primary = true;
address = "anish@lakhwara.com";
#alias = [ "*@lakhwara.com" ];
#gpg = {
# key = "";
# signByDefault = true;
#};
imap.host = "imap.fastmail.com";
mbsync = {
enable = true;
create = "both";
expunge = "both";
remove = "both";
extraConfig.local.subFolders = "Verbatim";
};
imapnotify = {
enable = true;
boxes = [ "Inbox" ];
onNotify = "${pkgs.isync}/bin/mbsync anish && ${pkgs.notmuch}/bin/notmuch new";
onNotifyPost = "${pkgs.libnotify}/bin/notify-send 'New Email 📩'";
};
msmtp.enable = true;
msmtp.extraConfig = {
"port" = "465";
};
notmuch.enable = true;
realName = "Anish Lakhwara";
signature = {
text = ''
Thanks,
Anish
'';
showSignature = "append";
};
passwordCommand = "${pkgs.coreutils}/bin/cat /run/agenix/fastmail";
smtp = {
host = "smtp.fastmail.com";
};
userName = "anish@lakhwara.com";
neomutt.enable = true;
himalaya.enable = true;
};
};
}

View file

@ -0,0 +1 @@
{"boxes":["Inbox"],"host":"imap.fastmail.com","onNewMail":"/nix/store/pmvvqwrsyv6ah0x8c82hgkddas5f9ajb-isync-1.4.4/bin/mbsync anish && /nix/store/wyi8a02kk3vh5y7qhdkfzyibb1yl0xc1-notmuch-0.37/bin/notmuch index","onNewMailPost":{"mail":"/nix/store/q360zpybna4djr4kjhjg6hmkk3vj7pjf-libnotify-0.8.1/bin/notify-send -a mail 'email: new in %s'"},"passwordCmd":"'/nix/store/a7gvj343m05j2s32xcnwr35v31ynlypr-coreutils-9.1/bin/cat' '/run/agenix/fastmail'","port":993,"tls":true,"username":"anish@lakhwara.com"}

Some files were not shown because too many files have changed in this diff Show more