Compare commits

...

145 Commits

Author SHA1 Message Date
b86cc94d23 hosts/suwako: prevent spam on gitea
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-11-11 22:40:48 +05:30
95825c6ff1 hosts/suwako: use 2 filehost services :wowo:
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-11-11 22:35:36 +05:30
3e7e404d4c home: emacs:use lsp-deferred on progmode 2025-10-26 02:54:40 +05:30
bb4c77208d even more changes
add isearch count support to evil
add highlight-indent-guides-mode

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-10-22 13:30:05 +05:30
1f53cd2efb home: emacs: delete unused conf
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-10-22 13:29:09 +05:30
d9f8c16011 home: emacs: add olivetti and nyan-mode
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-10-18 22:34:35 +05:30
4335805701 home: emacs some more changes
- Fix benchmark-deactivate on init
- defer loading aidermacs and gptel
- also set evil-want-keybinding to nil: https://github.com/emacs-evil/evil-collection/issues/6
2025-10-18 18:08:07 +05:30
Amneesh Singh
4a18ae77fc home: emacs: update config
remove auto flexpair and use electric mode instead
add gptel
add aidermacs

Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-10-17 17:41:56 +05:30
Amneesh Singh
5ebf3c9c5e home: amneesh: pkgs: add libreoffice and git-repo
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-10-17 11:55:12 +05:30
Amneesh Singh
f4e5628238 home: amneesh: use overlay for standalone home-manager
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-10-17 11:54:45 +05:30
Amneesh Singh
bf00621b02 home: amneesh: add screen config
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-10-17 11:53:28 +05:30
Amneesh Singh
ec8d9fafdd home: common: fix zsh GREP_COLORS
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-10-17 11:52:29 +05:30
539b46393e home/natto: emacs: some changes
add savehist
add blamer
tweak lsp to not format at RET

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-16 02:27:44 +05:30
Amneesh Singh
e686aef94e home: amneesh: wrap hypridle with nixGL
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-09-11 12:22:57 +05:30
54c45411fe home/natto: hyprlock: use pixels instead of percentages
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-10 18:58:50 +05:30
Amneesh Singh
23d6f855ee home: amneesh: update home.packages
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-09-10 18:57:54 +05:30
Amneesh Singh
346c304427 home: amneesh: add hypridle, hyprlock and hyprpaper
override pam for unix_chkpwd

Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-09-10 18:54:55 +05:30
0bab44bf04 home/natto: add hyprlock,hypridle and hyprpaper
also move hyprland.conf -> hyprland.nix

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-10 16:40:42 +05:30
5579bf49c3 hosts/okina: cleanup
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-04 17:42:34 +05:30
11a8dfebff hosts/suwako: move gitea from marisa to suwako
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-04 16:35:31 +05:30
c2a1654be8 hosts/suwako: move filehost from marisa to suwako
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-04 15:32:44 +05:30
6d431bdf9d hosts/remilia: networking: add suwako public wg key
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-04 13:12:39 +05:30
5dc4e6d3c0 hosts/remilia: mailserver: dovecot2 directory migration
changed stateVersion to 3

More: https://nixos-mailserver.readthedocs.io/en/latest/migrations.html#dovecot-mail-directory-migration

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-04 13:11:46 +05:30
5c1c326baf hosts/suwako: mailserver: dovecot2 directory migration
changed stateVersion to 3

More: https://nixos-mailserver.readthedocs.io/en/latest/migrations.html#dovecot-mail-directory-migration

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-04 12:16:55 +05:30
4e5b555498 hosts/security: fix cert path
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-04 11:48:32 +05:30
895a495b3f hosts/suwako: split service files
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-04 11:48:29 +05:30
7e4a6ac8fe hosts: housekeeping
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-08-31 19:34:44 +05:30
cd52be2620 home: natto: add me@amneesh.com to neomutt
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-08-30 20:05:25 +05:30
34b2c4d015 hosts/suwako: add mailserver for amneesh.com
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-08-30 16:46:44 +05:30
Amneesh Singh
943956f119 home: amneesh: add wayvnc and more pkgs
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-08-29 13:20:00 +05:30
Amneesh Singh
27f3b76ab7 home: natto: restart ags 10s after failure
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-08-28 18:49:02 +05:30
Amneesh Singh
4decf54e13 home: amneesh: wrap hyprland in nixGL
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-08-25 18:16:18 +05:30
Amneesh Singh
abd567a8a5 home: amneesh: move ubuntu->arch and use existing config
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-08-25 18:04:40 +05:30
5785832cbe home: emacs: use vertico+consult instead of selectrum
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-07-02 22:31:00 +05:30
0eacdcdc27 home: emacs: move config files
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-07-02 21:42:25 +05:30
0890c49887 hosts/remilia: mailserver: change certificateScheme
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-07-02 00:37:22 +05:30
fb94547fa2 hosts/hina: change rootfs disk path to by-label
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-07-02 00:31:54 +05:30
c10e121604 hosts/remilia: change rootfs disk path to by-label
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-07-02 00:31:09 +05:30
8a87dc6c93 hosts/remilia: add stateVersion in mailserver
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-07-02 00:30:57 +05:30
5db9d23792 hosts/suwako: add pufferpanel (minecraft paper)
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 20:49:40 +05:30
1651bb9356 home: move amneesh to its own directory
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 19:51:33 +05:30
a9d4f6de5a treewide: format files
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 19:49:39 +05:30
404f35c0b9 home/natto: delete unused
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 19:44:41 +05:30
9baf54ef33 home/natto: split wayland.nix
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 19:40:28 +05:30
5a9ff77a29 home/natto: split programs.nix
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 19:34:12 +05:30
87a6c1a862 home: refactor common files
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 19:23:07 +05:30
43660ff173 home: ags: use v1
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 18:57:27 +05:30
fe6d79edb5 pkgs: remove tlauncher
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 18:56:41 +05:30
da4309e2e0 hosts: make security settings common
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 18:49:58 +05:30
e1e72965f9 hosts: move pipewire to services/
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 18:31:53 +05:30
0979956f16 hosts: enable dconf on desktop
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 18:27:59 +05:30
28c9799f60 hosts: move wayland portal to home
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 18:18:27 +05:30
f9e29ce77f hosts: move xserver to services/
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 18:05:23 +05:30
f4a8493dce hosts: delete minimal.nix
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:55:35 +05:30
e097c9d25f hosts: move neovim to programs/
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:54:17 +05:30
58ab2f07a7 hosts: move nix settings to its own file
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:50:50 +05:30
e1faa10e24 hosts: move doas to its own module
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:45:10 +05:30
f9ed56123d hosts: move git to its own module
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:45:08 +05:30
30934f006c hosts: rename modules -> programs
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:33:24 +05:30
31bec468c8 hosts: move gnupg into a module
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:31:33 +05:30
6c1400e295 hosts: move adb into a module
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:28:47 +05:30
8d3bbe9d75 hosts: move fonts to home-manager
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:28:04 +05:30
4f96bcda1d hosts: split zsh into a module
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:27:55 +05:30
0ecd267fa8 home: zsh: fix prezto config
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-14 17:24:32 +05:30
c590fb01dc home: natto: rename deprecated stuff
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-14 17:24:32 +05:30
d9a9d110de home: natto: edit hyprland config
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-14 17:24:32 +05:30
09f2e19683 hosts: satori: rename opengl -> graphics
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-14 17:24:32 +05:30
8b12178bfc hosts: okina: update disk configuration
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-14 17:24:32 +05:30
4f0f6021e5 hosts: rename font
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-14 17:24:32 +05:30
00ead02ff1 flake: update
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-14 17:24:32 +05:30
5e54dfded8 hosts/suwako: init
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-10-20 15:59:58 +05:30
Amneesh Singh
eac8c77797 home/amneesh: update
Signed-off-by: Amneesh Singh <a-singh21@ti.com>
2024-07-12 09:51:21 +05:30
Amneesh Singh
3aab004b55 home/amneesh: init 2024-07-08 17:49:02 +05:30
270d7c2fe4 hosts/okina: add wireguard config
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-28 20:22:50 +05:30
4c87e635ab hosts/remilia: update wireguard keys
Signed-off-by: natto1784 <natto@weirdnatto.in>
2024-06-28 20:22:21 +05:30
129fa4973f conf: add okina
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-28 18:49:19 +05:30
075ee51920 hosts: minor change
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-28 18:29:26 +05:30
aeb370f299 satori: im taking this HDD with me for some time
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-28 18:29:04 +05:30
edf8d639b3 emacs: minor fix
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-28 17:41:48 +05:30
090c069a11 hosts/okina: add onevpl
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-12 00:13:48 +05:30
f230a60a73 home/natto/ags: add margin to the right of settings
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-04 19:50:37 +05:30
ca1ea8f701 hosts/okina: add avahi daemon for printer discovery (for now)
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-04 19:30:16 +05:30
570bafce6a home/natto/emacs: remove treemacs magit
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-04 17:11:44 +05:30
8fd337d099 home/natto/emacs: just use defaultInitFile
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-04 16:58:29 +05:30
7737bc5137 home/natto/emacs: tangle when deploying
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-04 16:31:12 +05:30
f44ddb256b flake: update inputs.stable
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-02 16:06:58 +05:30
3d2befc555 home: fix pkgs generation for other users
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-02 16:05:08 +05:30
194f03c578 home/natto/emacs: minor changes
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-02 16:04:14 +05:30
d0a53ea9a3 home/natto/ags: add systemd to deps
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-01 21:14:46 +05:30
c1134662a9 home/natto/ags: update settings css
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-01 18:43:16 +05:30
afbfff8e96 home/natto/ags: i have 3 iq
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-01 18:40:52 +05:30
87fcf277f5 home/natto/ags: update readme
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-01 18:18:14 +05:30
5af717ac53 home/natto/ags: fix weather
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-01 18:12:13 +05:30
f6f228f990 conf: fix globalArgs
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-01 18:10:31 +05:30
c86fb8b6d3 home/natto/ags: init
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-01 18:10:31 +05:30
00ea23f65c home/natto/hyprland: update config
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-01 17:10:35 +05:30
a882cc48b4 home/natto/secrets: dont symlink
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-01 17:10:24 +05:30
684b9a41cc home: move around things a bit
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-01 16:57:00 +05:30
48e46b465f home: add a way to differentiate bw laptop and desktop
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-05-28 06:54:29 +05:30
510cc18de3 hosts/default.nix: remove unnecessary recs
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-05-28 06:22:29 +05:30
51281913ac home: use agenix modules via flake
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-05-28 06:21:56 +05:30
2831c62ee2 expose packages
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-05-28 05:54:50 +05:30
111920a63f hosts: update x86builder from satori to okina (who uses this)
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-05-28 05:15:57 +05:30
faedfb51ae neovim: update neovim config after a long time (i still use emacs
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-05-28 05:14:28 +05:30
f748daba0f neovim: move from hosts/ to pkgs/
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-05-28 05:14:11 +05:30
c1c4714fa2 flake-parts: rename lib' to conf
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-05-27 23:00:24 +05:30
29acfc513e hosts/xorg: get rid of rename warning
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-05-27 23:00:24 +05:30
15f03999d3 hosts/okina: init
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-05-27 23:00:24 +05:30
ded1e9c202 satori: get rid of rename warning
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-05-27 23:00:24 +05:30
856d49ee10 hosts: rearrange modules a bit
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-05-27 23:00:24 +05:30
ed71d6459c fmt
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-02-25 17:16:10 +05:30
e0a9283d2e home/natto: yearly update
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-02-25 17:15:17 +05:30
855dd5d445 satori: yearly visit
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-02-25 17:08:12 +05:30
d4554d43ae hosts/hina: init
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-08-16 13:44:42 +05:30
e281e912d8 hosts/marisa: fix gitea mailer
Signed-off-by: natto1784 <natto@weirdnatto.in>
2023-08-07 04:59:53 +05:30
1fc6e8cd96 migrate services from nomad to systemd
Signed-off-by: natto1784 <natto@weirdnatto.in>
2023-07-26 22:42:58 +05:30
ff831dc3e0 hosts/marisa: remove hashistack
Signed-off-by: natto1784 <natto@weirdnatto.in>
2023-07-26 22:42:58 +05:30
e06bc88784 hosts/remilia: bring back the git subdomain atleast
Signed-off-by: natto1784 <natto@weirdnatto.in>
2023-07-26 22:40:30 +05:30
4682d7814b hosts/remilia: remove most subdomains :(
Signed-off-by: natto1784 <natto@weirdnatto.in>
2023-07-26 18:03:20 +05:30
78f440f69c pkgs: update tlauncher
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-07-26 16:43:11 +05:30
cfa5a8d1b8 hosts/satori: changes to udev rules
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-07-26 16:42:59 +05:30
c33a30be60 home/natto: misc changes
enable sioyek
fix gtk theme
add environment variables
change zathura config
change hyprland config

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-07-26 16:41:04 +05:30
8f7781f293 hosts/modules: put builder back in a separate file
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-06-24 16:25:48 +05:30
f88702525b hosts/satori: random changes + debloating sound
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-06-24 15:46:52 +05:30
149dbe2e33 home/natto: misc config changes
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-06-24 15:46:42 +05:30
be59cc0e8a hosts/remilia: random nginx changes
Signed-off-by: natto1784 <natto@weirdnatto.in>
2023-04-27 15:01:33 +05:30
0e4ac5dfe5 home: random configuration changes across apps
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-04-27 14:58:59 +05:30
04dc801925 hosts/satori: disable iwd
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-04-27 14:58:10 +05:30
bfe8ae35b8 satori: enable docker
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-03-23 18:25:48 +05:30
8e3a3aca2b lib: rename
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-03-08 11:22:04 +05:30
f31eb4c876 arrange users marisa:spark and satori:bat
Signed-off-by: natto1784 <natto@weirdnatto.in>
2023-03-08 10:08:50 +05:30
5652340dae marisa: add user bat
Signed-off-by: natto1784 <singh.amneesh1784@gmail.com>
2023-03-08 07:57:01 +05:30
a739d6de6d rearrange hosts a bit
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-03-08 06:50:15 +05:30
c8d74d3af8 nvim,emacs: remove stupid colemak binds
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-03-08 06:32:30 +05:30
ab43a24e08 hosts/satori: random changes
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-03-08 06:15:08 +05:30
8c32c34bc7 home: update emacs and some other configs
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-03-08 06:14:50 +05:30
1626936630 random eww changes
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-01-27 22:49:05 +05:30
e732d5514d change playerctl shortcuts 2023-01-27 21:50:16 +05:30
8899dbdaee home/natto/eww: init
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-01-27 21:39:36 +05:30
c87410b1aa enable iwd
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-01-27 07:02:30 +05:30
a4173c855e home/natto: misc changes
add mpdris
change emacs package
hyprland keybind changes
random changes to home.packages

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-01-27 07:01:54 +05:30
5e4c51a4ed home/natto: added tofi config, changed hyprland config + webcord
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-01-24 20:40:38 +05:30
df34f1fffc hosts/satori: enable rtkit and systemwide zsh
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-01-24 20:39:34 +05:30
67a7c8ea27 add catppuccin themes for emacs and nvim
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-01-24 15:10:52 +05:30
ec6533a782 wayland: add initial config for hyprland and XDPH and implement new colors
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-01-24 11:38:38 +05:30
179 changed files with 6860 additions and 2322 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

2
.gitattributes vendored
View File

@@ -1 +1,3 @@
flake.lock linguist-generated
*.yuck linguist-language=lisp
**/emacs/config.org linguist-language=elisp

1
.gitignore vendored
View File

@@ -5,3 +5,4 @@
*~
*.html
result
.sass-cache

View File

@@ -1,6 +1,6 @@
#Catpuccin Mocha
let
colors = rec{
colors = rec {
rosewater = "#F5E0DC";
flamingo = "#F2CDCD";
pink = "#F5C2E7";
@@ -30,12 +30,16 @@ let
mantle = "#181825";
crust = "#11111B";
background = crust;
background = base;
foreground = text;
};
in
rec {
default = with builtins; mapAttrs (_: color: substring 1 6 color) colors; # hex without hash
hex = colors; # hex with hash
argb = { a ? "ff" }: builtins.mapAttrs (_:color: a + color) default; # ARGB
argb =
{
a ? "ff",
}:
builtins.mapAttrs (_: color: a + color) default; # ARGB
}

11
conf/default.nix Normal file
View File

@@ -0,0 +1,11 @@
{ inputs, self, ... }:
{
config._module.args.globalArgs = {
inherit inputs self;
flake = self;
conf = {
colors = import ./colors.nix;
network = import ./network.nix;
};
};
}

31
conf/network.nix Normal file
View File

@@ -0,0 +1,31 @@
{
addresses = rec {
wireguard = rec {
ipPrefix = "10.55.0";
prefixLength = 24;
ipsWithPrefixLength = "10.55.0.0/24";
ips = {
remilia = "${ipPrefix}.1";
marisa = "${ipPrefix}.2";
satori = "${ipPrefix}.3";
hina = "${ipPrefix}.4";
okina = "${ipPrefix}.5";
suwako = "${ipPrefix}.6";
};
};
domain = {
natto = "weirdnatto.in";
amneesh = "amneesh.com";
chutiya = "chutiya.online";
};
};
commonSSHKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJHingN2Aho+KGgEvBMjtoez+W1svl9uVoa4vG0d646j"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPX1HDzWpoaOcU8GDEGuDzXgxkCpyeqxRR6gLs/8JgHw"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOSQnDNrNP69tIK7U2D7qaMjycfIjpgx0at4U2D5Ufib"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK5V/hdkTTQSkDLXaEwY8xb/T8+sWtw5c6UjYOPaTrO8"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKFyKi0HYfkgvEDvjzmDRGwAq2z2KOkfv7scTVSnonBh"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIICEow6+G9F0JjvVwnyrFoObFAKKBQQ2wwScST0Xzs1l"
];
}

1145
flake.lock generated

File diff suppressed because it is too large Load Diff

118
flake.nix
View File

@@ -1,63 +1,85 @@
{
description = "dotfiles";
inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixpkgs-unstable;
flake-parts.url = github:hercules-ci/flake-parts;
home-manager = {
url = github:nix-community/home-manager;
inputs.nixpkgs.follows = "nixpkgs";
};
mailserver = {
url = gitlab:simple-nixos-mailserver/nixos-mailserver;
inputs.nixpkgs.follows = "nixpkgs";
};
rust-overlay = {
url = github:oxalica/rust-overlay;
inputs.nixpkgs.follows = "nixpkgs";
};
nix-gaming = {
url = github:fufexan/nix-gaming;
inputs.nixpkgs.follows = "nixpkgs";
};
nbfc = {
url = github:nbfc-linux/nbfc-linux;
inputs.nixpkgs.follows = "nixpkgs";
};
emacs-overlay.url = github:nix-community/emacs-overlay;
nvim-overlay = {
url = github:nix-community/neovim-nightly-overlay;
inputs.nixpkgs.url = github:nixos/nixpkgs?rev=fad51abd42ca17a60fc1d4cb9382e2d79ae31836;
};
hyprland.url = github:hyprwm/Hyprland;
};
outputs = inputs@{ self, ... }:
outputs =
inputs@{ self, ... }:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" ];
systems = [
"x86_64-linux"
"aarch64-linux"
];
imports = [
./hosts
./home
./pkgs
./lib
./conf
];
perSystem = { pkgs, system, ... }: rec {
legacyPackages = import inputs.nixpkgs {
inherit system;
config = {
allowUnfree = true;
allowBroken = true;
perSystem =
{ system, pkgs, ... }:
rec {
formatter = pkgs.nixfmt-tree;
devShells.default =
with pkgs;
mkShell {
packages = [
nixd
formatter
];
};
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
};
overlays = [
inputs.nvim-overlay.overlay
inputs.emacs-overlay.overlay
inputs.rust-overlay.overlays.default
];
};
formatter = pkgs.nixpkgs-fmt;
};
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
stable.url = "github:nixos/nixpkgs/release-24.05";
flake-parts.url = "github:hercules-ci/flake-parts";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
mailserver = {
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
inputs.nixpkgs.follows = "nixpkgs";
};
filehost = {
url = "github:natto1784/yamaf";
};
nix-gaming.url = "github:fufexan/nix-gaming";
nbfc = {
url = "github:nbfc-linux/nbfc-linux";
inputs.nixpkgs.follows = "nixpkgs";
};
emacs-overlay.url = "github:nix-community/emacs-overlay";
nvim-overlay.url = "github:nix-community/neovim-nightly-overlay";
hyprland = {
type = "git";
url = "https://github.com/hyprwm/Hyprland";
submodules = true;
};
hyprland-contrib = {
url = "github:hyprwm/contrib";
};
agenix.url = "github:ryantm/agenix";
ags.url = "github:Aylur/ags/v1";
nixgl.url = "github:nix-community/nixGL";
};
}

8
home/README Normal file
View File

@@ -0,0 +1,8 @@
natto : default user for okina (desktop - NixOS Unstable)
natto-laptop : default user for satori (laptop - NixOS Unstable)
bat : default user for remilia (Oracle VM - NixOS Unstable)
spin : default user for hina (Oracle VM - NixOS Unstable)
spark : default user for marisa (RPi4 - NixOS Unstable)
kero : default user for suwako (ARM OracleVM - NixOS Unstable)
amneesh : default user for nightbug (Workplace PC - Arch Linux)

37
home/amneesh/default.nix Normal file
View File

@@ -0,0 +1,37 @@
{
config,
pkgs,
inputs,
...
}:
{
home = {
homeDirectory = "/home/amneesh";
username = "amneesh";
stateVersion = "24.05";
};
targets.genericLinux.enable = true;
imports = [
./pkgs.nix
./nixgl.nix
./screen.nix
./wayvnc.nix
# From personal
../natto/ags
../natto/emacs.nix
../natto/browser.nix
../natto/dunst.nix
../natto/gtk.nix
../natto/cursor.nix
../natto/wayland.nix
../natto/hypridle.nix
../natto/hyprlock.nix
../natto/hyprpaper.nix
../natto/hyprland.nix
../natto/tofi.nix
../natto/foot.nix
];
}

29
home/amneesh/nixgl.nix Normal file
View File

@@ -0,0 +1,29 @@
{
config,
lib,
pkgs,
inputs,
...
}:
let
inherit (inputs) nixgl;
inherit (inputs.hyprland.packages.${pkgs.system}) hyprland;
inherit (config.lib.nixGL) wrap;
in
{
nixGL = {
packages = nixgl.packages;
defaultWrapper = "mesa";
offloadWrapper = "nvidiaPrime";
installScripts = [
"mesa"
"nvidiaPrime"
];
};
# hyprland
wayland.windowManager.hyprland.package = lib.mkForce (wrap hyprland);
# hypridle
services.hypridle.package = lib.mkForce (wrap pkgs.hypridle);
}

29
home/amneesh/pkgs.nix Normal file
View File

@@ -0,0 +1,29 @@
{
pkgs,
inputs,
...
}:
{
xdg.mime.enable = true;
programs = {
bash.enable = true;
};
home.packages = with pkgs; [
cmake
corkscrew
dtc
file
htop
llvmPackages.clang
(nattovim.override { nvimPackage = inputs.nvim-overlay.packages.${pkgs.system}.neovim; })
meson
ninja
thunderbird
wget
xfce.thunar
libreoffice
git-repo
];
}

12
home/amneesh/screen.nix Normal file
View File

@@ -0,0 +1,12 @@
{ pkgs, ... }:
{
home = {
packages = [ pkgs.screen ];
file = {
".screenrc".text = ''
defscrollback 10000
'';
};
};
}

13
home/amneesh/wayvnc.nix Normal file
View File

@@ -0,0 +1,13 @@
{
...
}:
{
services.wayvnc = rec {
enable = true;
autoStart = enable;
settings = {
address = "0.0.0.0";
port = 5900;
};
};
}

View File

@@ -0,0 +1,4 @@
{ ... }:
{
programs.direnv.enable = true;
}

View File

@@ -0,0 +1,20 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
fira-code
fira-mono
monoid
font-awesome
material-icons
material-design-icons
lohit-fonts.devanagari
lohit-fonts.gurmukhi
office-code-pro
eb-garamond
noto-fonts-cjk-sans
takao
liberation_ttf
];
fonts.fontconfig.enable = true;
}

9
home/common/laptop.nix Normal file
View File

@@ -0,0 +1,9 @@
{ lib, ... }:
{
options.isLaptop = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether this device is a laptop or not";
};
}

View File

@@ -0,0 +1,28 @@
{ lib, ... }:
{
programs.zsh = {
enable = true;
autocd = true;
history = rec {
expireDuplicatesFirst = true;
size = 30000;
save = size;
};
autosuggestion.enable = true;
enableCompletion = true;
syntaxHighlighting.enable = true;
prezto = {
enable = true;
prompt.theme = "pure";
autosuggestions.color = "fg=yellow,bold";
utility.safeOps = false;
extraConfig = lib.mkBefore ''
export GREP_COLORS="mt=01;31"
'';
};
initContent = lib.mkAfter ''
unsetopt extendedGlob
[[ -f ~/.zsh_custom ]] && source ~/.zsh_custom
'';
};
}

View File

@@ -1,14 +1,122 @@
{ self, inputs, globalArgs, ... }:
{
self,
inputs,
globalArgs,
...
}:
let
common = [
{ programs.home-manager.enable = true; }
./common/zsh
./common/direnv
./common/laptop.nix
inputs.agenix.homeManagerModules.default
];
mkPkgs =
system: overlays:
import inputs.nixpkgs {
inherit system;
config = {
allowUnfree = true;
allowBroken = true;
allowInsecure = true;
};
overlays = overlays ++ [ self.overlays.default ];
};
extraSpecialArgs = globalArgs;
in
{
flake.homeConfigurations = {
natto = inputs.home-manager.lib.homeManagerConfiguration {
natto-laptop = inputs.home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs;
modules = [
./natto
./modules/secret.nix
inputs.hyprland.homeManagerModules.default
globalArgs
];
pkgs = self.legacyPackages.x86_64-linux;
./common/fonts
{ isLaptop = true; }
]
++ common;
pkgs = mkPkgs "x86_64-linux" [ ];
};
natto = inputs.home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs;
modules = [
./natto
./common/fonts
]
++ common;
pkgs = mkPkgs "x86_64-linux" [ ];
};
spark = inputs.home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs;
modules = [
{
home = {
homeDirectory = "/home/spark";
username = "spark";
stateVersion = "23.05";
};
}
]
++ common;
pkgs = mkPkgs "aarch64-linux" [ ];
};
bat = inputs.home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs;
modules = [
{
home = {
homeDirectory = "/home/bat";
username = "bat";
stateVersion = "23.05";
};
}
]
++ common;
pkgs = mkPkgs "x86_64-linux" [ ];
};
spin = inputs.home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs;
modules = [
{
home = {
homeDirectory = "/home/spin";
username = "spin";
stateVersion = "23.05";
};
}
]
++ common;
pkgs = mkPkgs "x86_64-linux" [ ];
};
kero = inputs.home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs;
modules = [
{
home = {
homeDirectory = "/home/kero";
username = "kero";
stateVersion = "24.05";
};
}
]
++ common;
pkgs = mkPkgs "aarch64-linux" [ ];
};
amneesh = inputs.home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs;
modules = [
./amneesh
]
++ common;
pkgs = mkPkgs "x86_64-linux" [ (import ./overlays/standalone.nix) ];
};
};
}

View File

@@ -1,93 +0,0 @@
/* Module by @ryantm in github:ryantm/agenix */
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.age;
ageBin = "${pkgs.rage}/bin/rage";
users = config.users.users;
home_ = config.home.homeDirectory;
username_ = config.home.username;
identities = builtins.concatStringsSep " " (map (path: "-i ${path}") cfg.sshKeyPaths);
installSecret = secretType: ''
echo "decrypting ${secretType.file} to ${secretType.path}..."
TMP_FILE="${secretType.path}.tmp"
mkdir -p $(dirname ${secretType.path})
(umask 0400; ${ageBin} --decrypt ${identities} -o "$TMP_FILE" "${secretType.file}")
chmod ${secretType.mode} "$TMP_FILE"
chown ${secretType.owner} "$TMP_FILE"
mv -f "$TMP_FILE" '${secretType.path}'
'';
secretType = types.submodule ({ config, ... }: {
options = {
name = mkOption {
type = types.str;
default = config._module.args.name;
description = ''
Name of the file used in /run/secrets
'';
};
file = mkOption {
type = types.path;
description = ''
Age file the secret is loaded from.
'';
};
path = mkOption {
type = types.str;
default = "${home_}/.secrets/${config.name}";
description = ''
Path where the decrypted secret is installed.
'';
};
mode = mkOption {
type = types.str;
default = "0400";
description = ''
Permissions mode of the in octal.
'';
};
owner = mkOption {
type = types.str;
default = "${username_}";
description = ''
User of the file.
'';
};
};
});
in
{
options.age = {
secrets = mkOption {
type = types.attrsOf secretType;
default = { };
description = ''
Attrset of secrets.
'';
};
sshKeyPaths = mkOption {
type = types.listOf types.path;
default = [ ];
description = ''
Path to SSH keys to be used as identities in age decryption.
'';
};
};
config = mkIf (cfg.secrets != { }) {
assertions = [{
assertion = cfg.sshKeyPaths != [ ];
message = "age.sshKeyPaths must be set.";
}];
home.activation = {
decryptSecrets = lib.hm.dag.entryBefore [ "writeBoundary" ] (concatStrings (map installSecret (builtins.attrValues cfg.secrets)));
};
};
}

11
home/natto/ags/README.md Normal file
View File

@@ -0,0 +1,11 @@
# My AGS configuration
Currently has a bar, a media box, an unstyled calendar and a settings(?) menu.
## Notes
- Works only on 1.8.2 (current)
- audio: requires pipewire-pulse
- mpris: requires gvfs for art
- hyprland: requires hyprland (🤯)
- battery: requires upower
- system-tray: requires libdbusmenu-gtk3
- systemd: for power commands

31
home/natto/ags/config.js Normal file
View File

@@ -0,0 +1,31 @@
import Bar from "./windows/bar/index.js";
import Settings from "./windows/settings/index.js";
import MusicBox from "./windows/music-box/index.js";
import Calendar from "./windows/calendar.js";
const configDir = App.configDir;
const scssStyle = `${configDir}/style.scss`;
const cssStyle = `${configDir}/style.css`;
const compileSass = () => {
Utils.exec(`scss ${scssStyle} ${cssStyle}`);
console.log("sass compiled to css");
};
compileSass();
Utils.monitorFile(`${configDir}/styles`, () => {
console.log("change detected in style");
compileSass();
App.resetCss();
App.applyCss(cssStyle);
console.log("new style applied");
});
App.config({
style: "./style.css",
windows: [Bar(), MusicBox(), Settings(), Calendar()],
});
export {};

View File

@@ -0,0 +1,6 @@
export const WindowNames = {
BAR: "bar",
SETTINGS: "settings",
MUSIC_BOX: "music-box",
CALENDAR: "calendar",
};

View File

@@ -0,0 +1,66 @@
{
pkgs,
lib,
config,
inputs,
...
}:
let
cfg = config.programs.ags;
deps =
with pkgs;
[
sass
gawk
bash
procps
coreutils
imagemagick
systemd
config.wayland.windowManager.hyprland.package
]
++ lib.optional config.isLaptop brightnessctl;
configDir = lib.cleanSourceWith {
src = ./.;
filter =
name: _:
let
baseName = baseNameOf (toString name);
in
!(lib.hasSuffix ".nix" baseName);
};
in
{
imports = [
inputs.ags.homeManagerModules.default
];
programs.ags = {
enable = true;
# package = pkgs.ags_1;
};
xdg.configFile."ags" = {
source = configDir;
recursive = true;
};
systemd.user.services.ags = {
Unit = {
Description = "Aylur's Gtk Shell";
PartOf = [
"tray.target"
"graphical-session.target"
];
};
Service = {
Environment = "PATH=${lib.makeBinPath deps}";
ExecStart = "${cfg.package}/bin/ags";
Restart = "on-failure";
RestartSec = 10;
};
Install.WantedBy = [ "graphical-session.target" ];
};
}

View File

@@ -0,0 +1,5 @@
@import "styles/global.scss";
@import "styles/bar.scss";
@import "styles/music-box.scss";
@import "styles/settings.scss";
@import "styles/calendar.scss";

View File

@@ -0,0 +1,40 @@
.bar {
background: $background;
.hyprland {
background: none;
button.focused {
transition-duration: 0;
color: $mauve;
box-shadow: 0 0 0 9999px rgba($mauve, 0.08) inset;
}
button.unfocused {
background: none;
color: $flamingo;
}
}
.music {
.music-title {
color: $sapphire;
}
.music-controls button {
color: $yellow;
}
}
.network .network-icon {
color: $lavender;
}
.date-wrapper {
color: $text;
}
.tray-button {
color: $flamingo;
}
}

View File

@@ -0,0 +1,8 @@
.calendar {
.calendar-unwrapped {
margin-top: 10px;
border: 2px solid $mauve;
border-radius: 4px;
background: rgba($base, 0.9);
}
}

View File

@@ -0,0 +1,57 @@
$rosewater: #f5e0dc;
$flamingo: #f2cdcd;
$pink: #f5c2e7;
$mauve: #cba6f7;
$red: #f38ba8;
$maroon: #eba0ac;
$peach: #fab387;
$yellow: #f9e2af;
$green: #a6e3a1;
$teal: #94e2d5;
$sky: #89dceb;
$sapphire: #74c7ec;
$blue: #89b4fa;
$lavender: #b4befe;
$text: #cdd6f4;
$subtext1: #bac2de;
$subtext0: #a6adc8;
$overlay2: #9399b2;
$overlay1: #7f849c;
$overlay0: #6c7086;
$surface2: #585b70;
$surface1: #45475a;
$surface0: #313244;
$base: #1e1e2e;
$mantle: #181825;
$crust: #11111b;
$background: $base;
$foreground: $text;
* {
font-weight: bold;
}
button {
background: none;
border-radius: 0px;
}
icon {
font-size: 24px;
}
.bar,
.music-box,
.calendar,
.settings {
font-size: 16px;
font-family: "Fira Mono";
}
.bar {
.hyprland {
font-size: 18px;
font-family: "Lohit Gurmukhi";
}
}

View File

@@ -0,0 +1,79 @@
.music-box {
.music-box-unwrapped {
margin-top: 15px;
.music-player {
background: $base;
border: 2px solid $mauve;
border-radius: 13px;
.cover-art {
margin: 2em;
border-radius: 13px;
background-size: cover;
background-position: center;
}
.music-details {
$shadow: 0px 0px 10px rgba(black, 0.8);
padding: 2em;
.title {
font-size: 30px;
color: $pink;
text-shadow: $shadow;
}
.icon-wrapper {
.icon {
font-size: 24px;
color: $yellow;
}
.artist {
color: $yellow;
text-shadow: $shadow;
}
}
.length-label,
.position-label {
text-shadow: $shadow;
}
.music-controls {
border-radius: 20px 8px 20px 8px;
padding: 5px;
margin: 0px 10px;
background: rgba($base, 0.5);
button {
font-size: 30px;
&:hover {
box-shadow: none;
}
}
}
scale trough {
min-height: 10px;
margin: 0 15px;
highlight {
background-image: linear-gradient(to right, $sapphire, $blue);
}
slider {
border-radius: 4px;
background: $background;
margin: -10px -10px;
transition: 0.1s;
&:hover {
border: 2px $mauve solid;
box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.1);
}
&:active {
box-shadow:
0 0 0 1px inset,
0 0 0 8px rgba(255, 255, 255, 0.1);
}
}
}
}
}
}
}

View File

@@ -0,0 +1,116 @@
.settings {
.settings-unwrapped {
margin-top: 10px;
margin-right: 10px;
border: 2px solid $mauve;
border-radius: 4px;
background: $base;
.metrics {
& > * {
background-color: rgba(255, 255, 255, 0.03);
border-radius: 4px;
margin: 10px;
padding: 10px;
.metric-progress {
min-width: 40px;
min-height: 40px;
font-size: 4px;
margin: 4px;
.metric-icon {
font-size: 15px;
}
}
}
.cpu-metric {
color: $mauve;
}
.memory-metric {
color: $flamingo;
}
.disk-metric {
color: $pink;
}
.battery-metric {
color: $yellow;
}
}
.settings-col {
.sliders {
$icon-size: 15px;
$scale-height: 20px;
margin: 10px;
scale trough {
min-height: $scale-height;
min-width: 160px;
border-radius: 3px;
highlight {
all: unset;
border-radius: 3px;
}
slider {
$slider-height: $scale-height + 5px;
min-width: $slider-height;
min-height: $slider-height;
border-radius: $slider-height;
background: $text;
box-shadow: 0 2px 0 0 rgba(255, 255, 255, 0.1);
}
}
.volume {
.volume-icon {
font-size: $icon-size;
color: $green;
}
scale trough highlight {
background-color: $green;
}
}
.brightness {
.brightness-icon {
font-size: $icon-size;
color: $yellow;
}
scale trough highlight {
background-color: $yellow;
}
}
}
.settings-col-temps {
.temperature {
color: $blue;
}
.temperature-hot {
color: $red;
}
.weather {
color: $rosewater;
}
& > * {
margin: 0px 10px;
}
}
.power-menu {
margin: 20px;
button {
&:hover {
color: $red;
box-shadow: none;
}
font-size: 24px;
}
}
}
}
}

View File

@@ -0,0 +1,18 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"lib": [
"ES2022"
],
"allowJs": true,
"checkJs": false,
"strict": true,
"noImplicitAny": false,
"baseUrl": ".",
"typeRoots": [
"./types"
],
"skipLibCheck": true
}
}

View File

@@ -0,0 +1,42 @@
import GLib from "gi://GLib";
export const lengthStr = (length) => {
if (length < 0) return "0:00";
const min = Math.floor(length / 60);
const sec = Math.floor(length % 60);
const sec0 = sec < 10 ? "0" : "";
return `${min}:${sec0}${sec}`;
};
export const blurBg = (cover) => {
if (!cover) return "";
const cachePath = Utils.CACHE_DIR + "/media";
const blurPath = cachePath + "/blur";
const bgPath = blurPath + cover.substring(cachePath.length);
if (!GLib.file_test(bgPath, GLib.FileTest.EXISTS)) {
Utils.ensureDirectory(blurPath);
Utils.exec(
`convert ${cover} -scale 10% -blur 0x2 -resize 1000% ${bgPath}`,
);
}
return `
background-image: url('${bgPath}');
background-repeat: no-repeat;
background-position: center;
background-size: cover;
`;
};
export const findPlayer = (players) => {
const active = players.find((p) => p.playBackStatus === "Playing");
if (active) return active;
for (const p of players) if (p) return p;
return undefined;
};

View File

@@ -0,0 +1,41 @@
export const Padding = (name, { hexpand = true, vexpand = true } = {}) =>
Widget.EventBox({
hexpand,
vexpand,
can_focus: false,
setup: (w) => w.on("button-press-event", () => App.closeWindow(name)),
});
export const Revealer = ({
name,
child,
transition = "slide_down",
transitionDuration = 200,
}) =>
Widget.Box({
css: "padding: 1px;",
child: Widget.Revealer({
transition,
transitionDuration,
child: Widget.Box({
child,
}),
setup: (self) =>
self.hook(App, (_, window, visible) => {
if (window === name) self.reveal_child = visible;
}),
}),
});
export default ({ name, layout, ...props }) =>
Widget.Window({
name,
setup: (w) => w.keybind("Escape", () => App.closeWindow(name)),
visible: false,
keymode: "on-demand",
exclusivity: "normal",
layer: "top",
anchor: ["top", "bottom", "right", "left"],
child: layout,
...props,
});

View File

@@ -0,0 +1,5 @@
export const shrinkText = (str, n) => {
let newStr = str.substring(0, n);
if (str.length > n) newStr = newStr + "...";
return newStr;
};

View File

@@ -0,0 +1,19 @@
const bluetooth = await Service.import("bluetooth");
export default () =>
Widget.Icon({
setup: (self) =>
self.hook(
bluetooth,
(self) => {
self.tooltipText = bluetooth.connected_devices
.map(({ name }) => name)
.join("\n");
self.visible = bluetooth.connected_devices.length > 0;
},
"notify::connected-devices",
),
icon: bluetooth
.bind("enabled")
.as((on) => `bluetooth-${on ? "active" : "disabled"}-symbolic`),
});

View File

@@ -0,0 +1,38 @@
const hyprland = await Service.import("hyprland");
const gurmukhiNums = {
1: "",
2: "੨",
3: "੩",
4: "",
5: "੫",
6: "੬",
7: "੭",
8: "੮",
9: "੯",
10: "",
};
export default () => {
const activeId = hyprland.active.workspace.bind("id");
const workspaces = hyprland.bind("workspaces").as((ws) =>
ws
.sort((a, b) => a.id - b.id)
.map(({ id }) =>
Widget.Button({
onClicked: () => hyprland.messageAsync(`dispatch workspace ${id}`),
child: Widget.Label(gurmukhiNums[id]),
className: activeId.as(
(i) => `${i === id ? "focused" : "unfocused"}`,
),
cursor: "pointer",
}),
),
);
return Widget.Box({
css: "padding: 1px;",
className: "hyprland",
children: workspaces,
});
};

View File

@@ -0,0 +1,56 @@
import Hyprland from "./hyprland.js";
import Music from "./music.js";
import Tray from "./tray.js";
import Time from "./time.js";
import Network from "./network.js";
import Bluetooth from "./bluetooth.js";
import Settings from "./settings.js";
import { WindowNames } from "../../constants.js";
const { BAR } = WindowNames;
const Left = () => {
return Widget.Box({
className: "bar-left",
spacing: 8,
children: [Hyprland()],
});
};
const Center = (monitor) => {
return Widget.Box({
className: "bar-center",
spacing: 8,
children: [Music(monitor)],
});
};
const Right = (monitor) => {
return Widget.Box({
className: "bar-right",
hpack: "end",
spacing: 10,
children: [
Tray(),
Bluetooth(),
Network(),
Time(monitor),
Settings(monitor),
],
});
};
export default (monitor = 0) =>
Widget.Window({
name: `${BAR}-${monitor}`,
className: BAR,
monitor,
anchor: ["top", "left", "right"],
exclusivity: "exclusive",
child: Widget.CenterBox({
startWidget: Left(),
centerWidget: Center(monitor),
endWidget: Right(monitor),
}),
});

View File

@@ -0,0 +1,65 @@
import Controls from "../music-box/music-controls.js";
import { shrinkText } from "../../utils/text.js";
import { findPlayer } from "../../utils/music.js";
import { WindowNames } from "../../constants.js";
const mpris = await Service.import("mpris");
const players = mpris.bind("players");
/** @param {import('types/service/mpris').MprisPlayer} player */
const Player = (player, monitor) => {
const revealer = Widget.Revealer({
revealChild: false,
transitionDuration: 300,
transition: "slide_left",
child: Controls(player),
});
return Widget.EventBox({
visible: player.bus_name === findPlayer(mpris.players).bus_name,
cursor: "pointer",
setup: (self) => {
self.on("leave-notify-event", () => {
revealer.reveal_child = false;
});
self.on("enter-notify-event", () => {
revealer.reveal_child = true;
});
},
child: Widget.Box({
className: "music",
children: [
Widget.Button({
onClicked: () =>
App.toggleWindow(`${WindowNames.MUSIC_BOX}-${monitor}`),
className: "music-title",
child: Widget.Label().hook(player, (self) => {
self.tooltip_text = player.track_title;
self.label = shrinkText(self.tooltip_text, 50);
}),
}),
revealer,
],
}),
})
.hook(
mpris,
(self, bus_name) => {
self.visible = player.bus_name === bus_name;
},
"player-changed",
)
.hook(
mpris,
(self) => {
self.visible = player === findPlayer(mpris.players);
},
"player-closed",
);
};
export default (monitor) =>
Widget.Box({
visible: players.as((p) => p.length > 0),
children: players.as((ps) => ps.map((p) => Player(p, monitor))),
});

View File

@@ -0,0 +1,40 @@
const network = await Service.import("network");
const WifiIndicator = () =>
Widget.Box({
tooltipText: network.wifi.bind("state").as((s) => `State: ${s}`),
children: [
Widget.Icon({
className: "network-icon",
icon: network.wifi.bind("icon_name"),
}),
Widget.Label({
visible: network.wifi.bind("ssid"),
label: network.wifi.bind("ssid"),
}),
],
});
const WiredIndicator = () =>
Widget.Icon({
className: "network-icon",
tooltipText: network.wired.bind("internet").as((a) => `Internet: ${a}`),
icon: network.wired.bind("icon_name"),
});
export default () =>
Widget.Stack({
className: "network",
children: {
wifi: WifiIndicator(),
wired: WiredIndicator(),
},
shown: Utils.merge(
[network.bind("primary"), network.wired.bind("state")],
(primary, wired) => {
if (primary) return primary;
if (wired == "activated") return "wired";
return "wifi";
},
),
});

View File

@@ -0,0 +1,8 @@
import { WindowNames } from "../../constants.js";
export default (monitor) =>
Widget.Button({
child: Widget.Icon("open-menu-symbolic"),
onPrimaryClick: () =>
App.toggleWindow(`${WindowNames.SETTINGS}-${monitor}`),
});

View File

@@ -0,0 +1,42 @@
const time = Variable("", {
poll: [1000, 'date "+%H:%M:%S"'],
});
const getDate = () => " " + Utils.exec('date "+%a, %b %e"');
const date = Variable(getDate());
export default () => {
const revealer = Widget.Revealer({
revealChild: false,
transitionDuration: 300,
transition: "slide_left",
child: Widget.Label({
label: date.bind(),
}),
});
return Widget.EventBox({
cursor: "pointer",
setup: (self) => {
self.on("leave-notify-event", () => {
revealer.reveal_child = false;
});
self.on("enter-notify-event", () => {
date.value = getDate();
revealer.reveal_child = true;
});
},
child: Widget.Button({
className: "date-wrapper",
onPrimaryClick: () => App.toggleWindow("calendar-0"),
child: Widget.Box({
children: [
Widget.Label({
label: time.bind(),
}),
revealer,
],
}),
}),
});
};

View File

@@ -0,0 +1,17 @@
const systemtray = await Service.import("systemtray");
const SysTrayItem = (item) =>
Widget.Button({
className: "system-tray-item",
child: Widget.Icon().bind("icon", item, "icon"),
tooltipMarkup: item.bind("tooltip_markup"),
onPrimaryClick: (_, event) => item.activate(event),
onSecondaryClick: (_, event) => item.openMenu(event),
cursor: "pointer",
});
export default () =>
Widget.Box({
className: "system-tray-unwrapped",
children: systemtray.bind("items").as((i) => i.map(SysTrayItem)),
});

View File

@@ -0,0 +1,37 @@
import Popup, { Padding, Revealer } from "../utils/popup.js";
import { WindowNames } from "../constants.js";
const Tray = Widget.Calendar({
className: "calendar-unwrapped",
showDayNames: true,
showHeading: true,
});
export default (monitor = 0) => {
const { CALENDAR } = WindowNames;
const name = `${CALENDAR}-${monitor}`;
return Popup({
name,
className: CALENDAR,
monitor,
layout: Widget.Box({
children: [
Padding(name),
Widget.Box({
hexpand: false,
vertical: true,
children: [
Revealer({
name,
child: Tray,
transition: "slide_down",
transitionDuration: 400,
}),
Padding(name),
],
}),
],
}),
});
};

View File

@@ -0,0 +1,183 @@
// Mostly taken from https://github.com/Aylur/ags/blob/11150225e62462bcd431d1e55185e810190a730a/example/media-widget/Media.js
import Popup, { Padding, Revealer } from "../../utils/popup.js";
import { shrinkText } from "../../utils/text.js";
import { lengthStr, blurBg } from "../../utils/music.js";
import { findPlayer } from "../../utils/music.js";
import { WindowNames } from "../../constants.js";
import Controls from "./music-controls.js";
const FALLBACK_ICON = "audio-x-generic-symbolic";
const { MUSIC_BOX } = WindowNames;
const mpris = await Service.import("mpris");
const Player = (player) => {
const img = Widget.Box({
visible: player.bind("cover_path"),
className: "cover-art",
vpack: "start",
css: player
.bind("cover_path")
.as(
(p) =>
(p ? "min-width: 200px; min-height: 200px;" : "") +
`background-image: url('${p}');`,
),
});
const title = Widget.Label({
className: "title",
wrap: true,
hpack: "start",
label: player.bind("track_title").as((t) => shrinkText(t, 40)),
});
const artist = Widget.Label({
className: "artist",
wrap: true,
hpack: "start",
label: player.bind("track_artists").as((a) => shrinkText(a.join(", "), 80)),
});
const positionSlider = Widget.Slider({
className: "position",
drawValue: false,
onChange: ({ value }) => (player.position = value * player.length),
visible: player.bind("length").as((l) => l > 0),
setup: (self) => {
const update = () => {
if (self.dragging) return;
const value = player.position / player.length;
self.value = value > 0 ? value : 0;
};
self
.hook(player, update)
.hook(player, update, "position")
.poll(1000, update);
},
});
const positionLabel = Widget.Label({
ypad: 0,
hpack: "start",
className: "position-label",
setup: (self) => {
const update = (_, time) => {
self.label = lengthStr(time || player.position);
self.visible = player.length > 0;
};
self.hook(player, update, "position");
self.poll(1000, update);
},
});
const lengthLabel = Widget.Label({
ypad: 0,
hpack: "end",
className: "length-label",
visible: player.bind("length").as((l) => l > 0),
label: player.bind("length").as(lengthStr),
});
const icon = Widget.Icon({
className: "icon",
hexpand: true,
hpack: "end",
vpack: "start",
tooltipText: player.identity || "",
icon: player.bind("entry").as((entry) => {
const name = `${entry}-symbolic`;
return Utils.lookUpIcon(name) ? name : FALLBACK_ICON;
}),
});
return Widget.Box(
{
className: "music-player",
visible: player.bus_name === findPlayer(mpris.players).bus_name,
css: player.bind("cover_path").as(blurBg),
},
img,
Widget.CenterBox({
className: "music-details",
vertical: true,
hexpand: true,
spacing: 25,
startWidget: Widget.Box(
{
vertical: true,
spacing: 6,
},
title,
Widget.Box({
className: "icon-wrapper",
spacing: 10,
children: [artist, icon],
}),
),
centerWidget: positionSlider,
endWidget: Widget.CenterBox({
spacing: 6,
startWidget: positionLabel,
centerWidget: Controls(player),
endWidget: lengthLabel,
}),
}),
)
.hook(
mpris,
(self, bus_name) => {
self.visible = player.bus_name === bus_name;
},
"player-changed",
)
.hook(
mpris,
(self) => {
self.visible = player.bus_name === findPlayer(mpris.players).bus_name;
},
"player-closed",
);
};
const PlayerBox = () =>
Widget.Box({
className: `${MUSIC_BOX}-unwrapped`,
vertical: true,
css: "padding: 1px;",
children: mpris.bind("players").as((ps) => ps.map(Player)),
});
export default (monitor = 0) => {
const name = `${MUSIC_BOX}-${monitor}`;
return Popup({
name,
className: MUSIC_BOX,
monitor,
layout: Widget.Box({
children: [
Padding(name), // left
Widget.Box({
hexpand: false,
vexpand: false,
vertical: true,
children: [
Revealer({
name,
child: PlayerBox(),
transition: "slide_down",
transitionDuration: 400,
}),
Padding(name), // down
],
}),
Padding(name), // right
],
}),
});
};

View File

@@ -0,0 +1,47 @@
const PLAY_ICON = "media-playback-start-symbolic";
const PAUSE_ICON = "media-playback-pause-symbolic";
const PREV_ICON = "go-previous-symbolic";
const NEXT_ICON = "go-next-symbolic";
export default (player) => {
const playPause = Widget.Button({
class_name: "play-pause",
on_clicked: () => player.playPause(),
visible: player.bind("can_play"),
cursor: "pointer",
child: Widget.Icon({
icon: player.bind("play_back_status").transform((s) => {
switch (s) {
case "Playing":
return PAUSE_ICON;
case "Paused":
case "Stopped":
return PLAY_ICON;
}
}),
}),
});
const prev = Widget.Button({
yalign: 0.5,
onClicked: () => player.previous(),
visible: player.bind("can_go_prev"),
child: Widget.Icon(PREV_ICON),
cursor: "pointer",
});
const next = Widget.Button({
onClicked: () => player.next(),
visible: player.bind("can_go_next"),
child: Widget.Icon(NEXT_ICON),
cursor: "pointer",
});
return Widget.CenterBox({
vertical: true,
centerWidget: Widget.Box({
className: "music-controls",
children: [prev, playPause, next],
}),
});
};

View File

@@ -0,0 +1,69 @@
const audio = await Service.import("audio");
export default () => {
const isSpeaker = Variable(true);
/** @param {'speaker' | 'microphone'} type */
const VolumeSlider = (type = "speaker") =>
Widget.Slider({
hexpand: true,
drawValue: false,
onChange: ({ value }) => (audio[type].volume = value),
value: audio[type].bind("volume"),
});
const speakerSlider = VolumeSlider("speaker");
const micSlider = VolumeSlider("microphone");
const speakerIndicator = Widget.Button({
on_clicked: () => (audio.speaker.is_muted = !audio.speaker.is_muted),
child: Widget.Icon().hook(audio.speaker, (self) => {
self.className = "volume-icon";
const vol = audio.speaker.volume * 100;
let icon = [
[101, "overamplified"],
[67, "high"],
[34, "medium"],
[1, "low"],
[0, "muted"],
].find(([threshold]) => threshold <= vol)?.[1];
if (audio.speaker.is_muted) icon = "muted";
self.icon = `audio-volume-${icon}-symbolic`;
self.tooltip_text = `Volume ${Math.floor(vol)}%`;
}),
});
const micIndicator = Widget.Button({
on_clicked: () => (audio.microphone.is_muted = !audio.microphone.is_muted),
child: Widget.Icon().hook(audio.microphone, (self) => {
self.className = "volume-icon";
const vol = audio.microphone.volume * 100;
let icon = [
[67, "high"],
[34, "medium"],
[1, "low"],
[0, "muted"],
].find(([threshold]) => threshold <= vol)?.[1];
if (audio.microphone.is_muted) icon = "muted";
self.icon = `microphone-sensitivity-${icon}-symbolic`;
self.tooltip_text = `Volume ${Math.floor(vol)}%`;
}),
});
return Widget.EventBox({
cursor: "pointer",
className: "volume",
onSecondaryClick: () => (isSpeaker.value = !isSpeaker.value),
child: Widget.Stack({
children: {
speaker: Widget.Box({}, speakerSlider, speakerIndicator),
microphone: Widget.Box({}, micSlider, micIndicator),
},
shown: isSpeaker.bind().as((s) => (s ? "speaker" : "microphone")),
}),
});
};

View File

@@ -0,0 +1,48 @@
const hasBacklight = Variable(Utils.exec("ls /sys/class/backlight"));
export default () => {
const getBrightness = () => {
try {
return (
Number(Utils.exec("brightnessctl get")) /
Number(Utils.exec("brightnessctl max"))
);
} catch {
console.log("settings/backlight: failed to get brightness");
}
return 0;
};
const setBrightness = (b) => {
if (b < 0.05) b = 0.05;
else if (b > 1) b = 1;
Utils.exec(`brightnessctl set ${b * 100}%`);
};
const brightness = Variable(getBrightness());
const Slider = Widget.Slider({
hexpand: true,
drawValue: false,
onChange: ({ value }) => setBrightness(value),
value: brightness.bind(),
});
const Indicator = Widget.Button({
on_clicked: brightness.bind().as((b) => () => {
if (b <= 0.5) brightness.value = 1;
else brightness.value = 0.5;
}),
child: Widget.Icon().hook(brightness, (self) => {
self.className = "brightness-icon";
self.icon = `display-brightness-symbolic`;
self.tooltip_text = `Brightness: ${Math.floor(brightness.value * 100)}%`;
}),
});
return Widget.Box({
className: "brightness",
visible: hasBacklight.bind().as((b) => !!b),
children: [Slider, Indicator],
});
};

View File

@@ -0,0 +1,72 @@
import Popup, { Padding, Revealer } from "../../utils/popup.js";
import { WindowNames } from "../../constants.js";
import Audio from "./audio.js";
import Backlight from "./backlight.js";
import {
cpuMetric,
memoryMetric,
diskMetric,
batteryMetric,
} from "./metrics.js";
import Temperature from "./temperature.js";
import Weather from "./weather.js";
import PowerMenu from "./power-menu.js";
const metrics = Widget.Box({
className: "metrics",
vertical: true,
children: [cpuMetric, memoryMetric, diskMetric, batteryMetric],
});
const sliders = Widget.Box({
className: "sliders",
vertical: true,
children: [Audio(), Backlight()],
});
const settingsCol = Widget.CenterBox({
className: "settings-col",
vertical: true,
spacing: 8,
startWidget: sliders,
centerWidget: Widget.CenterBox({
className: "settings-col-temps",
startWidget: Temperature(),
endWidget: Weather(),
}),
endWidget: PowerMenu(),
});
const settings = Widget.Box({
className: "settings-unwrapped",
children: [metrics, settingsCol],
});
export default (monitor = 0) => {
const { SETTINGS } = WindowNames;
const name = `${SETTINGS}-${monitor}`;
return Popup({
name,
className: SETTINGS,
monitor,
layout: Widget.Box({
children: [
Padding(name),
Widget.Box({
hexpand: false,
vertical: true,
children: [
Revealer({
name,
child: settings,
transition: "slide_down",
transitionDuration: 400,
}),
Padding(name),
],
}),
],
}),
});
};

View File

@@ -0,0 +1,104 @@
const battery = await Service.import("battery");
const divide = ([total, free]) => free / total;
const cpuValue = Variable(0, {
poll: [
2000,
"top -b -n 1",
(out) =>
divide([
100,
out
.split("\n")
.find((line) => line.includes("Cpu(s)"))
.split(/\s+/)[1]
.replace(",", "."),
]),
],
});
const memoryValue = Variable([0, 0], {
poll: [
2000,
"free",
(out) => {
const data = out
.split("\n")
.find((line) => line.includes("Mem:"))
.split(/\s+/)
.splice(1, 2);
return [(data[1] / (1024 * 1024)).toFixed(2), divide(data)];
},
],
});
const diskValue = Variable(["0G", "0%"], {
poll: [
120000,
"df -kh /",
(out) => out.split("\n")[1].split(/\s+/).splice(3, 2),
],
});
const mkMetric = ({
className,
tooltipText,
value,
label,
icon,
visible = true,
}) =>
Widget.Box(
{
spacing: 10,
className,
tooltipText,
visible,
},
Widget.CircularProgress({
className: "metric-progress",
child: Widget.Icon({
icon,
className: "metric-icon",
}),
value,
}),
Widget.Label({
wrap: true,
label,
}),
);
export const cpuMetric = mkMetric({
className: "cpu-metric",
tooltipText: cpuValue.bind().as((c) => `CPU: ${(c * 100).toFixed(2)}%`),
value: cpuValue.bind(),
label: cpuValue.bind().as((c) => `${(c * 100).toFixed(2)}%`),
icon: "cpu-symbolic",
});
export const memoryMetric = mkMetric({
className: "memory-metric",
tooltipText: memoryValue.bind().as((m) => `RAM :${m[0]}G`),
value: memoryValue.bind().as((m) => m[1]),
label: memoryValue.bind().as((m) => `${m[0]}G`),
icon: "memory-symbolic",
});
export const diskMetric = mkMetric({
className: "disk-metric",
tooltipText: diskValue.bind().as((d) => `Free Space :${d[0]}`),
value: diskValue.bind().as((d) => Number(d[1]) / 100),
label: diskValue.bind().as((d) => d[1]),
icon: "drive-harddisk-symbolic",
});
export const batteryMetric = mkMetric({
className: "battery-metric",
tooltipText: battery.bind("percent").as((p) => `Battery: ${p}%`),
value: battery.bind("percent").as((p) => (p > 0 ? p / 100 : 0)),
label: battery.bind("percent").as((p) => `${p}%`),
icon: battery.bind("icon_name"),
visible: battery.bind("available"),
});

View File

@@ -0,0 +1,94 @@
export default () => {
const isLocked = Variable(true);
const power = Variable("poweroff");
const suspend = Variable("sleep");
const cursor = "pointer";
const unlockButton = Widget.Button({
onPrimaryClick: () => {
isLocked.value = false;
},
tooltipText: "Unock power menu",
child: Widget.Icon("system-lock-screen-symbolic"),
cursor,
});
const lockButton = Widget.Button({
onPrimaryClick: () => {
isLocked.value = true;
},
tooltipText: "Lock power menu",
child: Widget.Icon("system-lock-screen-symbolic"),
cursor,
});
const poweroffButton = Widget.Button({
onPrimaryClick: () => {
Utils.exec("poweroff");
},
onSecondaryClick: () => (power.value = "reboot"),
tooltipText: "Shutdown",
child: Widget.Icon("system-shutdown-symbolic"),
cursor,
});
const rebootButton = Widget.Button({
onPrimaryClick: () => {
Utils.exec("reboot");
},
onSecondaryClick: () => (power.value = "poweroff"),
tooltipText: "Reboot",
child: Widget.Icon("system-reboot-symbolic"),
cursor,
});
const sleepButton = Widget.Button({
onPrimaryClick: () => {
Utils.exec("systemctl suspend");
},
onSecondaryClick: () => (suspend.value = "hibernate"),
tooltipText: "Sleep",
child: Widget.Icon("weather-clear-night-symbolic"),
cursor,
});
const hibernateButton = Widget.Button({
onPrimaryClick: () => {
Utils.exec("systemctl hibernate");
},
onSecondaryClick: () => (suspend.value = "sleep"),
tooltipText: "Hibernate",
child: Widget.Icon("computer-symbolic"),
cursor,
});
const powerStack = Widget.Stack({
children: {
poweroff: poweroffButton,
reboot: rebootButton,
},
shown: power.bind(),
});
const suspendStack = Widget.Stack({
children: {
sleep: sleepButton,
hibernate: hibernateButton,
},
shown: suspend.bind(),
});
return Widget.Stack({
className: "power-menu",
children: {
locked: Widget.CenterBox({ centerWidget: unlockButton }),
unlocked: Widget.CenterBox({
startWidget: powerStack,
centerWidget: lockButton,
endWidget: suspendStack,
}),
},
shown: isLocked.bind().as((l) => (l ? "locked" : "unlocked")),
});
};

View File

@@ -0,0 +1,62 @@
export default () => {
const getThermalZone = () => {
try {
return Utils.exec([
"bash",
"-c",
`awk '{print FILENAME ":" $0}' /sys/class/thermal/thermal_zone*/type`,
])
.split("\n")
.find((line) => line.includes("x86_pkg_temp"))
.split(":")[0]
.slice(0, -4);
} catch (e) {
console.error(e);
console.log("settings/temperature: cannot get thermal zone");
}
return undefined;
};
const thermalZone = Variable(getThermalZone());
const tempValue = thermalZone.value
? Variable(0, {
poll: [
5000,
() => {
try {
return (
Utils.readFile(`${thermalZone.value}/temp`) / 1000
).toFixed(2);
} catch {
console.log(
"settings/temperature: specified thermal zone does not exist",
);
}
return 0;
},
],
})
: Variable(undefined);
return Widget.CenterBox({
vertical: true,
visible: thermalZone.bind().as((t) => !!t),
centerWidget: Widget.Box(
{
vertical: true,
spacing: 8,
tooltipText: tempValue.bind().as((t) => `CPU Temperature: ${t}°C`),
className: tempValue
.bind()
.as((t) => `temperature${t > 65 ? "-hot" : ""}`),
},
Widget.Icon({
icon: "sensors-temperature-symbolic",
}),
Widget.Label({
label: tempValue.bind().as((t) => `${t}°C`),
}),
),
});
};

View File

@@ -0,0 +1,78 @@
const conditionIcons = {
Clear: "clear",
Sunny: "clear",
"Partly Cloudy": "few-clouds",
Cloudy: "overcast",
Overcast: "overcast",
"Light Rain": "showers-scattered",
Drizzle: "showers-scattered",
Rain: "showers",
"Heavy Rain": "showers",
Showers: "showers",
Thunderstorm: "storm",
Snow: "snow",
"Light Snow": "snow",
"Heavy Snow": "snow",
Mist: "fog",
Fog: "fog",
Haze: "fog",
Dust: "fog",
Smoke: "fog",
Sand: "fog",
Wind: "windy",
Tornado: "tornado",
undefined: "clear",
};
const fetchWeather = async () => {
return await Utils.fetch("http://wttr.in/?format=j1")
.then((res) => res.json())
.then((j) => j["current_condition"][0])
.catch((e) => {
console.error(e);
console.log("settings/weather: error fetching weather data");
});
};
export default () => {
const data = Variable(undefined, {
poll: [600000, async () => await fetchWeather()],
});
return Widget.Box(
{
vertical: true,
visible: data.bind().as((d) => !!d),
className: "weather",
},
Widget.Icon({
icon: data.bind().as((d) => {
const condition = d?.["weatherDesc"]?.[0]?.["value"]?.split(/[\s,]+/)?.[0];
return `weather-${conditionIcons[condition]}-symbolic`;
}),
}),
Widget.Label({
label: data.bind().as((d) => {
const conditions = d?.["weatherDesc"]?.map((w) => w["value"]) || [];
return conditions.join(" ");
}),
}),
Widget.Label({
label: data.bind().as((d) => {
const temperature = d?.["temp_C"];
const feelsLike = d?.["FeelsLikeC"];
return `${temperature}°C (${feelsLike}°C)`;
}),
}),
Widget.Label({
label: data.bind().as((d) => {
const humidity = d?.["humidity"];
const precipitation = d?.["precipMM"];
return `${humidity}%, ${precipitation}mm`;
}),
}),
);
};

18
home/natto/browser.nix Normal file
View File

@@ -0,0 +1,18 @@
{ pkgs, ... }:
{
programs = {
firefox = {
enable = true;
profiles.natto = {
name = "natto";
};
};
chromium = {
enable = true;
package = pkgs.ungoogled-chromium;
};
};
home.sessionVariables = {
BROWSER = "firefox";
};
}

View File

@@ -1,48 +1,29 @@
#+TITLE: My Emacs Configuration
#+AUTHOR: Amneesh Singh
#+PROPERTY: header-args:emacs-lisp :tangle yes
* Color Variables
idk random variables to match my color theme
#+begin_src emacs-lisp
; -*- lexical-binding: t; -*-
( setq
c-bg "#073642"
c-fg "#eee8d5"
c-red "#dc322f"
c-green "#859900"
c-yellow "#b58900"
c-blue "#268bd2"
c-magenta "#d33682"
c-cyan "#2aa198"
c-white "#eee8d5"
c-black "#002b36"
c-red-2 "#cb4b16"
c-green-2 "#586e75"
c-yellow-2 "#657b83"
c-blue-2 "#839496"
c-magenta-2 "#6c71c4"
c-cyan-2 "#93a1a1"
c-white-2 "#fdf6e3")
#+end_src
#+AUTHOR: natto1784
#+PROPERTY: header-args :emacs-lisp :tangle yes
* Settings
** Setting the default face
#+begin_src emacs-lisp
; -*- lexical-binding: t; -*-
(set-frame-font "Fira Code 13" nil t)
(add-to-list 'default-frame-alist '(font . "Fira Code-13"))
#+end_src
** Some mode settings based on personal preferences
#+begin_src emacs-lisp
(global-hl-line-mode 1)
(add-hook 'prog-mode-hook #'hl-line-mode)
(add-hook 'text-mode-hook #'hl-line-mode)
(scroll-bar-mode 0)
(tool-bar-mode 0)
(menu-bar-mode 0)
(fringe-mode 0)
;; (cua-mode 1)
(global-display-line-numbers-mode 1)
(xterm-mouse-mode 1)
(electric-pair-mode)
(setq ring-bell-function 'ignore
gc-cons-threshold most-positive-fixnum
initial-major-mode 'fundamental-mode)
#+end_src
** Setting some variables
@@ -53,8 +34,9 @@ idk random variables to match my color theme
scroll-step 1
display-line-numbers-type 'relative
confirm-kill-processes nil
dark-theme t
inhibit-startup-screen t)
inhibit-startup-screen t
isearch-lazy-count t
lazy-count-prefix-format "[%s/%s] ")
(setq-default tab-width 2
indent-tabs-mode nil)
#+end_src
@@ -74,6 +56,13 @@ idk random variables to match my color theme
(require 'use-package)
#+end_src
*** Profiling
#+begin_src emacs-lisp
(use-package benchmark-init
:config
(add-hook 'after-init-hook 'benchmark-init/deactivate) )
#+end_src
** Visual packages
*** Add solaire mode
#+begin_src emacs-lisp
@@ -84,41 +73,62 @@ idk random variables to match my color theme
*** Set theme
#+begin_src emacs-lisp
(use-package doom-themes
(use-package catppuccin-theme
:config
(setq doom-themes-enable-bold t
doom-themes-enable-italic t
doom-themes-treemacs-theme "doom-colors")
(load-theme 'doom-solarized-dark t)
(doom-themes-treemacs-config)
(doom-themes-org-config))
(load-theme 'catppuccin t)
:custom
(dark-theme t))
#+end_src
** Configure Selectrum
Enable selectrum
*** Indent guides
#+begin_src emacs-lisp
(use-package selectrum
(use-package highlight-indent-guides
:config
(selectrum-mode +1))
(setq highlight-indent-guides-method 'column)
:hook
(prog-mode . highlight-indent-guides-mode))
#+end_src
Add selectrum-prescient
** Minibuffer
Enable vertico
#+begin_src emacs-lisp
(use-package selectrum-prescient
:config
(selectrum-prescient-mode +1)
(prescient-persist-mode +1))
(use-package vertico
:init
(vertico-mode)
:bind (:map vertico-map
("C-j" . vertico-next)
("C-k" . vertico-previous)))
#+end_src
Save history over restarts
#+begin_src emacs-lisp
(use-package savehist
:init
(savehist-mode))
#+end_src
Marginalia for description
#+begin_src emacs-lisp
(use-package marginalia
:after vertico
:config
(marginalia-mode 1))
#+end_src
Orderless
#+begin_src emacs-lisp
(use-package orderless
:after selectrum
:after vertico
:config
(setq completion-styles '(orderless basic))
(savehist-mode)
(setq orderless-skip-highlighting (lambda () selectrum-is-active)
selectrum-highlight-candidates-function #'orderless-highlight-matches))
(setq completion-styles '(orderless basic)))
#+end_src
Consult
#+begin_src emacs-lisp
(use-package consult
:bind (("M-s M-g" . consult-grep)
("M-s M-f" . consult-find)
("M-s M-b" . consult-buffer)))
#+end_src
** Evil
@@ -139,6 +149,7 @@ Add selectrum-prescient
(use-package evil
:init
(setq-default evil-shift-width 2)
(setq evil-want-keybinding nil)
:config
(evil-set-initial-state 'vterm-mode 'insert)
(evil-set-undo-system 'undo-tree)
@@ -147,72 +158,82 @@ Add selectrum-prescient
(evil-mode 1))
#+end_src
*** Evil related packages
#+begin_src emacs-lisp
(use-package evil-collection
:after evil
:ensure t
:config
(evil-collection-init))
(use-package evil-terminal-cursor-changer
:after evil
:if (not (display-graphic-p))
:config
(evil-terminal-cursor-changer-activate))
(use-package evil-anzu :after evil)
#+end_src
*** Configure undo tree
To undo and redo easily like vi
#+begin_src emacs-lisp
(use-package undo-tree
:init
(setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo")))
:config
(global-undo-tree-mode 1))
#+end_src
*** Miscellaneous evil related packages
#+begin_src emacs-lisp
(use-package evil-terminal-cursor-changer)
(use-package evil-anzu
:after evil)
#+end_src
** Treemacs
*** Configure treemacs
#+begin_src emacs-lisp
(use-package treemacs)
#+end_src
(use-package treemacs
:defer t
:config
(treemacs-project-follow-mode))
#+begin_src emacs-lisp
(use-package treemacs-evil)
(use-package treemacs-magit)
(use-package treemacs-projectile)
(use-package treemacs-all-the-icons)
(use-package treemacs-evil :after treemacs)
(use-package treemacs-projectile :after treemacs)
(use-package treemacs-all-the-icons :after treemacs)
#+end_src
** LSP
*** Configure lsp-mode
#+begin_src emacs-lisp
(use-package lsp-mode
:defer 0
:defer t
:commands lsp
:custom
(lsp-rust-analyzer-server-display-inlay-hints t)
(lsp-rust-analyzer-display-chaining-hints t)
(lsp-rust-analyzer-display-closure-return-type-hints t))
:init (setq lsp-enable-on-type-formatting nil)
:hook (prog-mode . lsp-deferred))
#+end_src
*** Configure lsp-ui
#+begin_src emacs-lisp
(use-package lsp-ui
:defer 0
:defer t
:init
(setq lsp-ui-doc-show-with-cursor t)
(setq lsp-ui-doc-delay 1.0
lsp-ui-doc-show-with-mouse t
pgtk-wait-for-event-timeout nil
lsp-ui-doc-show-with-cursor t)
:config
(lsp-ui-peek-enable 1)
(lsp-ui-doc-enable 1))
#+end_src
*** Language specific LSP packages
#+begin_src emacs-lisp
(use-package lsp-haskell)
(use-package lsp-grammarly)
(lsp-ui-doc-enable 1)
:hook (lsp-mode . lsp-ui-mode))
#+end_src
*** Configure flycheck
#+begin_src emacs-lisp
(use-package flycheck)
(use-package flycheck
:defer t)
#+end_src
*** Configure dap-mode
#+begin_src emacs-lisp
(use-package dap-mode)
(use-package dap-mode
:defer t
:hook ((lsp-mode . dap-mode)
(lsp-mode . dap-ui-mode)))
#+end_src
** Company
@@ -220,12 +241,11 @@ To undo and redo easily like vi
For autocomplete
#+begin_src emacs-lisp
(use-package company
:defer 0
:after lsp-mode
:config
(add-to-list 'company-backends 'company-dabbrev)
(setq company-backends (cons 'company-files (remove 'company-files company-backends)))
(company-mode 1))
(setq company-backends (append '(company-files) (remove 'company-files company-backends)))
:hook (after-init . global-company-mode))
#+end_src
*** Configure company-quickhelp
@@ -236,12 +256,13 @@ For autocomplete
** Treesitter
#+begin_src emacs-lisp
(use-package tree-sitter-langs)
(use-package tree-sitter-langs :defer t)
(use-package tree-sitter
:after tree-sitter-langs
:after tree-sitter-langs
:defer t
:config
(global-tree-sitter-mode)
:init
:init
(add-to-list 'tree-sitter-major-mode-language-alist '(fundamental-mode . bash))
(add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode))
#+end_src
@@ -253,41 +274,52 @@ For autocomplete
(direnv-mode))
#+end_src
** Lang support
** Languages
#+begin_src emacs-lisp
(use-package inform7)
(use-package haskell-mode)
(use-package lsp-latex)
(use-package rustic)
(use-package wgsl-mode)
(use-package dts-mode
:mode ("\\.dts\\'" "\\.dtsi\\'" "\\.overlay\\'"))
(use-package lsp-haskell
:mode "\\.hs\\'")
(use-package lsp-latex
:mode "\\.tex\\'")
(use-package rustic
:mode "\\.rs\\'")
(use-package typescript-mode
:mode ("\\.ts\\'" "\\.tsx\\'"))
(use-package wgsl-mode
:mode "\\.wgsl\\'")
(use-package nix-mode
:mode "\\.nix\\'")
(add-to-list 'lsp-language-id-configuration '(nix-mode . "nix"))
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection '("rnix-lsp"))
:major-modes '(nix-mode)
:server-id 'nix))
(use-package hcl-mode
:mode
"\\.hcl\\'"
"\\.nomad\\'")
(use-package go-mode)
(use-package go-mode
:mode "\\.go\\'")
#+end_src
** Magit
** Git
magit for git operations
#+begin_src emacs-lisp
(use-package magit)
(use-package magit :defer t)
#+end_src
* VTerm
** Configure vterm
blamer for git blame
#+begin_src emacs-lisp
(use-package blamer
:defer 20
:custom
(blamer-idle-time 0.3)
(blamer-min-offset 70)
:config
(global-blamer-mode 1)
:init
(setq blamer-show-avatar-p nil
blamer-max-commit-message-length 72))
#+end_src
** VTerm
*** Configure vterm
#+begin_src emacs-lisp
(use-package vterm
:config
@@ -296,6 +328,7 @@ For autocomplete
(setq vterm-timer-delay 0.005))
(use-package vterm-toggle
:after vterm
:config
(setq vterm-toggle-fullscreen-p nil)
(add-to-list 'display-buffer-alist
@@ -311,66 +344,120 @@ For autocomplete
#+end_src
** Centaur Tabs
#+begin_src emacs-lisp
Do not use centaur tabs for now
#+begin_src emacs-lisp :tangle no
(use-package centaur-tabs
:demand
:defer t
:custom
(centaur-tabs-style "rounded")
(centaur-tabs-height 18)
(centaur-tabs-set-modified-marker t)
(centaur-tabs-set-icons t)
:config
(setq centaur-tabs-style "rounded"
centaur-tabs-height 18
centaur-tabs-set-modified-marker t
centaur-tabs-set-icons t)
(centaur-tabs-mode t)
(centaur-tabs-group-by-projectile-project)
(set-face-attribute 'tab-line nil :inherit 'centaur-tabs-unselected)
(centaur-tabs-headline-match)
(centaur-tabs-mode nil)
(set-face-attribute 'tab-line nil :inherit 'centaur-tabs-unselected))
:bind
(:map evil-normal-state-map
("M-," . centaur-tabs-forward)
("M-." . centaur-tabs-backward))
(:map evil-motion-state-map
("M-," . centaur-tabs-forward)
("M-." . centaur-tabs-backward)))
#+end_src
** Misc packages
*** Icons
For installing icons
#+begin_src emacs-lisp
(use-package elcord
:defer 0)
(use-package all-the-icons
:defer t
:if (display-graphic-p))
#+end_src
*** Projectile
For tracking project root
#+begin_src emacs-lisp
(use-package projectile
:defer t
:config
(define-key projectile-mode-map (kbd "C-x p") 'projectile-command-map)
(projectile-mode +1))
(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode))
(use-package flex-autopair)
#+end_src
* Org
*** Rainbow
For highlighting colors
#+begin_src emacs-lisp
(use-package rainbow-mode :defer t)
#+end_src
*** Rainbow delimiters
To make distinguishing parens easier
#+begin_src emacs-lisp
(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode))
#+end_src
*** Olivetti
When you want write prose or something similar
#+begin_src emacs-lisp
(use-package olivetti
:defer t
:diminish olivetti-mode
:custom
(olivetti-body-width 100)
(olivetti-minimum-body-width 50)
(olivetti-style 'fancy)
(olivetti-recall-visual-line-mode-entry-state t)
:config
(defvar-local my/olivetti--saved-line-numbers nil
"Stores the previous value of `display-line-numbers` before enabling Olivetti.")
(defun my/olivetti-toggle-line-numbers ()
"Hide line numbers when entering Olivetti, restore when exiting."
(if olivetti-mode
(progn
(setq my/olivetti--saved-line-numbers display-line-numbers)
(setq display-line-numbers nil))
(setq display-line-numbers my/olivetti--saved-line-numbers)))
(add-hook 'olivetti-mode-hook #'my/olivetti-toggle-line-numbers))
#+end_src
** Org
** Add org-mode
#+begin_src emacs-lisp
(use-package org
:defer t
:after evil
:config
(setq evil-want-C-i-jump nil
org-adapt-indentation t
org-src-fontify-natively t
org-src-strip-leading-and-trailing-blank-lines t
org-src-preserve-indentation t
org-src-tab-acts-natively t)
(define-key org-mode-map (kbd "RET") 'org-return-and-maybe-indent)
(evil-define-key 'normal org-mode-map (kbd "TAB") 'org-cycle))
(evil-define-key 'normal org-mode-map (kbd "TAB") 'org-cycle)
:custom
(evil-want-C-i-jump nil)
(org-adapt-indentation t)
(org-src-fontify-natively t)
(org-src-strip-leading-and-trailing-blank-lines t)
(org-src-preserve-indentation t)
(org-src-tab-acts-natively t))
#+end_src
** Add org-bullets
#+begin_src emacs-lisp
(use-package org-bullets
:config
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))
:defer t
:hook ((org-mode . org-bullets-mode)))
#+end_src
** Babel and exports
#+begin_src emacs-lisp
(use-package htmlize)
(add-to-list 'org-latex-packages-alist '("" "minted"))
(setq org-latex-listings 'minted)
(use-package htmlize :defer t)
(setq org-latex-pdf-process
(setq org-latex-listings 'minted
org-latex-packages-alist '(("" "minted"))
org-latex-pdf-process
'("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
@@ -380,96 +467,36 @@ For autocomplete
(org-babel-do-load-languages
'org-babel-load-languages
'((awk . t)
(python . t)
'((python . t)
(C . t)
(shell . t)
(sql . t)
(latex . t)))
#+end_src
* Mode specific hooks
#+begin_src emacs-lisp
(add-hook 'c-mode-hook 'lsp)
(add-hook 'c++-mode-hook 'lsp)
(add-hook 'haskell-mode-hook #'lsp)
(add-hook 'haskell-literate-mode-hook #'lsp)
#+end_src
* Random eye candy stuff
** Ligature
* Mode line
** Doom modeline
Switched to doom modeline after using my own modeline for a while
#+begin_src emacs-lisp
(use-package ligature
:config
(ligature-set-ligatures 't '("www"))
(ligature-set-ligatures 'prog-mode '("www" "**" "***" "**/" "*>" "*/" "\\\\" "\\\\\\" "{-" "::"
":::" ":=" "!!" "!=" "!==" "-}" "----" "-->" "->" "->>"
"-<" "-<<" "-~" "#{" "#[" "##" "###" "####" "#(" "#?" "#_"
"#_(" ".-" ".=" ".." "..<" "..." "?=" "??" ";;" "/*" "/**"
"/=" "/==" "/>" "//" "///" "&&" "||" "||=" "|=" "|>" "^=" "$>"
"++" "+++" "+>" "=:=" "==" "===" "==>" "=>" "=>>" "<="
"=<<" "=/=" ">-" ">=" ">=>" ">>" ">>-" ">>=" ">>>" "<*"
"<*>" "<|" "<|>" "<$" "<$>" "<!--" "<-" "<--" "<->" "<+"
"<+>" "<=" "<==" "<=>" "<=<" "<>" "<<" "<<-" "<<=" "<<<"
"<~" "<~~" "</" "</>" "~@" "~-" "~>" "~~" "~~>" "%%"))
(global-ligature-mode t))
(use-package doom-modeline
:init (doom-modeline-mode 1))
#+end_src
Also show columns
#+begin_src emacs-lisp
(column-number-mode 1)
#+end_src
* Custom mode line
** Nyan Mode
#+begin_src emacs-lisp
(defface mode-line-buf-name
`((t :foreground ,c-fg
:background ,c-bg
:weight bold
))
"Custom face for buffer name"
:group 'mode-line-faces )
(defface mode-line-maj-mode
`((t :foreground ,c-fg
:background ,c-bg
))
"Custom face for major mode"
:group 'mode-line-faces )
(defface mode-line-vc
`((t :foreground ,c-fg
:background ,c-red-2
:weight bold
))
"Custom face for VC"
:group 'mode-line-faces )
(defface mode-line-info
`((t :foreground ,c-bg
:background ,c-cyan
:weight bold
))
"For showing line and column number"
:group 'mode-line-faces )
(setq-default mode-line-format
'((:propertize " %b " face mode-line-buf-name)
(vc-mode (:propertize ("" vc-mode " " ) face mode-line-vc))
(:propertize (" " mode-name " ") face mode-line-maj-mode)
(:propertize (" [[ %l | %c || %p . %+%@ ]] ") face mode-line-info)))
(setq exclude-ln '(term-mode-hook eshell-mode-hook shell-mode-hook))
(while exclude-ln
(add-hook (car exclude-ln) (lambda () (display-line-numbers-mode 0)))
(setq exclude-ln (cdr exclude-ln)))
(let ((default-color (cons (face-background 'mode-line)
(face-foreground 'mode-line))))
(add-hook 'post-command-hook
(lambda ()
(let ((color (cond ((minibufferp) default-color)
((evil-insert-state-p) (cons c-magenta c-fg))
((evil-visual-state-p) (cons c-cyan c-fg))
((evil-normal-state-p) (cons c-fg c-bg))
((buffer-modified-p) (cons c-blue c-fg))
(t default-color))))
(set-face-background 'mode-line-buf-name (car color))
(set-face-foreground 'mode-line-buf-name (cdr color))
))))
(use-package nyan-mode
:ensure t
:init
(when (display-graphic-p)
(nyan-mode 1))
:custom
(nyan-animate-nyancat t)
:config
(nyan-start-animation))
#+end_src
* Pop-up terminal
@@ -498,36 +525,40 @@ Stolen from [[https://www.reddit.com/r/emacs/comments/ft84xy/run_shell_command_i
(vterm-send-return)))
#+end_src
This returns the command to run in the terminal
* LLMs
** gptel
#+begin_src emacs-lisp
(defun candrun ()
(let ((full buffer-file-name)
(file (file-name-sans-extension buffer-file-name)))
(pcase (file-name-extension full)
("c" (concat "gcc " full " -lm -pthread -o " file " && " file " && rm " file))
("java" (concat "java " full))
("py" (concat "python " full))
("cpp" (concat "g++ " full " -o " file " && " file " && rm " file))
("hs" (concat "runhaskell " full))
("sh" (concat "sh " full))
("js" (concat "node " full))
("ts" (concat "tsc" full " && node " file ".js && rm " file ".js" ))
("rs" (concat "rustc" full " -o " file " && " file " && rm " file)))))
(use-package gptel
:defer t
:config
(setq gptel-model 'claude-sonnet-4-20250514
gptel-backend (gptel-make-anthropic "Claude"
:stream t
:protocol "https"
:key (getenv "ANTHROPIC_API_KEY")
:host (getenv "ANTHROPIC_API_BASE_DOMAIN")))
(setq gptel-default-mode 'org-mode)
:bind (("C-c g" . gptel)))
#+end_src
* Custom Functions
** Aidermacs
#+begin_src emacs-lisp
(defun detach-process ()
"Run processes but detached from the parent"
(interactive)
(let ((command (read-string "Enter command:")))
(call-process-shell-command (concat command " &") nil 0)))
(use-package aidermacs
:defer t
:bind (("C-c a" . aidermacs-transient-menu))
:custom
; See the Configuration section below
(aidermacs-default-chat-mode 'architect)
(aidermacs-default-model "sonnet"))
#+end_src
* Keybinds
** General
*** Colemak translations
#+begin_src emacs-lisp
not using this anymore
#+begin_src emacs-lisp :tangle no
(use-package evil-colemak-basics
:init
(setq evil-colemak-basics-layout-mod 'mod-dh)
@@ -537,75 +568,55 @@ This returns the command to run in the terminal
*** Misc binds
#+begin_src emacs-lisp
(use-package general)
(use-package general
:ensure t)
(setq evil-states
'(visual normal motion))
(with-eval-after-load 'general
(general-define-key
:states evil-states
"M-c" 'comment-line
"C-c M-c" 'comment-box)
(general-define-key
:states evil-states
"M-c" 'comment-line
"C-c M-c" 'comment-box)
(general-define-key
:states '(normal insert)
"M-C-f" 'lsp-format-buffer
"C-S-v" 'yank)
(general-define-key
:states '(normal insert)
"M-C-f" 'lsp-format-buffer
"C-S-v" 'yank)
(general-define-key
:keymaps '(global override vterm-mode-map)
:states evil-states
"M-o" 'treemacs
"M-v" 'split-window-vertically
"M-h" 'split-window-horizontally
"M-m" 'windmove-left
"M-n" 'windmove-down
"M-e" 'windmove-up
"M-i" 'windmove-right
"M-C-m" 'shrink-window-horizontally
"M-C-i" 'enlarge-window-horizontally
"M-C-e" 'shrink-window
"M-C-n" 'enlarge-window
"M-," 'centaur-tabs-backward
"M-." 'centaur-tabs-forward
"C-q" 'delete-window
"M-C-S-q" 'kill-buffer-and-window
"M-w" 'centaur-tabs--kill-this-buffer-dont-ask
"M-S-w" 'kill-window)
(general-define-key
:keymaps '(global override vterm-mode-map)
:states evil-states
"M-o" 'treemacs
"M-s-v" 'split-window-vertically
"M-s-h" 'split-window-horizontally
"M-h" 'windmove-left
"M-j" 'windmove-down
"M-k" 'windmove-up
"M-l" 'windmove-right
"M-C-h" 'shrink-window-horizontally
"M-C-l" 'enlarge-window-horizontally
"M-C-j" 'shrink-window
"M-C-k" 'enlarge-window
"C-q" 'delete-window
"M-C-S-q" 'kill-buffer-and-window
"M-w" (lambda () (interactive) (kill-buffer (current-buffer)))
"M-S-w" 'kill-window)
#+end_src
*** Pop-up terminal specific keybinds
#+begin_src emacs-lisp
(with-eval-after-load 'vterm-toggle
(general-define-key
:keymaps '(global override vterm-mode-map)
:states evil-states
"<f4>" (lambda () (interactive) (vterm t))
"C-<f1>" 'vterm-toggle-cd
"<f1>" 'vterm-toggle
"<f5>" (lambda () (interactive) (run-in-vterm (candrun))))
(general-define-key
:keymaps 'vterm-mode-map
"<f2>" 'vterm-toggle-forward
"<f3>" 'vterm-toggle-backward))
#+end_src
*** Toggle Appearance
#+begin_src emacs-lisp
(defun toggle-theme-shade ()
(if (symbol-value dark-theme)
(progn (disable-theme 'doom-solarized-dark)
(load-theme 'doom-solarized-light t))
(progn (disable-theme 'doom-solarized-light)
(load-theme 'doom-solarized-dark t)))
(setq-local dark-theme (not dark-theme))
(centaur-tabs-display-update)
(centaur-tabs-headline-match)
)
(general-define-key
:states '(normal)
"<f7>" (lambda () (interactive) (toggle-theme-shade)))
)
(with-eval-after-load 'vterm-toggle
(general-define-key
:keymaps '(global override vterm-mode-map)
:states evil-states
"<f4>" (lambda () (interactive) (vterm t))
"C-S-t" 'vterm-toggle-cd
"C-t" 'vterm-toggle
"<f1>" 'vterm-toggle)
(general-define-key
:keymaps 'vterm-mode-map
"<f3>" 'vterm-toggle-forward
"<f2>" 'vterm-toggle-backward)))
#+end_src

View File

@@ -1,2 +1,8 @@
(delete-file (expand-file-name "~/.emacs.d/config.el"))
(org-babel-load-file (expand-file-name "~/.emacs.d/config.org"))
(defconst config-org (expand-file-name "config.org" user-emacs-directory))
(defconst config-el (expand-file-name "config.el" user-emacs-directory))
(unless (file-exists-p config-el)
(require 'org)
(org-babel-tangle-file config-org config-el))
(load-file config-el)

View File

@@ -0,0 +1,26 @@
[colors]
background=11111B
bright0=585B70
bright1=F38BA8
bright2=A6E3A1
bright3=F9E2AF
bright4=89B4FA
bright5=F5C2E7
bright6=94E2D5
bright7=A6ADC8
foreground=CDD6F4
regular0=45475A
regular1=F38BA8
regular2=A6E3A1
regular3=F9E2AF
regular4=89B4FA
regular5=F5C2E7
regular6=94E2D5
regular7=BAC2DE
[main]
font=Fira Mono:style=Regular:pixelsize=12
font-bold=Fira Mono:style=Bold:pixelsize=12
[scrollback]
lines=4000

View File

@@ -9,6 +9,7 @@ pid_file "~/.config/mpd/pid"
bind_to_address "0.0.0.0"
bind_to_address "~/.config/mpd/socket"
restore_paused "yes"
input {
plugin "curl"
}
@@ -19,7 +20,7 @@ audio_output {
audio_output {
type "fifo"
name "Visualizer feed"
path "/tmp/g.fifo"
path "/tmp/mpd.fifo"
format "44100:16:2"
}
audio_output {

View File

@@ -19,17 +19,18 @@ mpd_music_dir=/home/natto/Music
now_playing_prefix=>
playlist_display_mode=columns
playlist_editor_display_mode=classic
progressbar_elapsed_color=magenta
progressbar_color=green
progressbar_look=▃▃▃
regular_expressions=extended
song_columns_list_format=(4)[red]{l} (20)[cyan]{t} (25)[green]{a} (25)[magenta]{b}
song_columns_list_format=(4)[red]{l} (40)[cyan]{t} (15)[green]{a} (25)[magenta]{b}
song_list_format=$(yellow){%a} - $(blue){%t}
song_status_format= $6%a $7⟫⟫ $3%t $7⟫⟫ $4%b
statusbar_visibility=yes
system_encoding=utf-8
titles_visibility=yes
user_interface=alternative
visualizer_data_source=/tmp/g.fifo
visualizer_data_source=/tmp/mpd.fifo
visualizer_fps=144
visualizer_in_stereo=yes
visualizer_look=◆▋

View File

@@ -5,18 +5,16 @@ set sidebar_visible
set mail_check_stats
bind attach,index,pager \CU next-page
bind attach,index,pager \CD previous-page
bind attach,index,pager n next-entry
bind attach,index,pager e previous-entry
bind attach,index,pager 9 group-reply
bind pager g top
bind pager G bottom
bind pager n next-line
bind pager e previous-line
bind pager i view-attachments
bind pager j next-line
bind pager k previous-line
bind pager l view-attachments
bind attach,index g first-entry
bind attach,index G last-entry
bind index,pager \CE sidebar-prev
bind index,pager \CN sidebar-next
bind index,pager \CK sidebar-prev
bind index,pager \CJ sidebar-next
bind index,pager \CI sidebar-open
bind index,pager \CB sidebar-toggle-visible
set sleep_time = 0
@@ -34,3 +32,6 @@ set mail_check=60
auto_view text/html
alternative_order text/enriched text/plain text/html text
macro index,pager U "<shell-escape>mbsync -a<enter>" "run mbsync to sync all emails"
macro index A \
"<tag-pattern>~N<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" \
"mark all new as read"

View File

@@ -50,6 +50,8 @@ myXmobarrc = "~/.xmonad/lib/xmobar.hs"
myWorkspaces = clickable $ ["\xf269", "\xf120", "\xf121", "\xf392", "\xf008", "\xf07b", "\xf11b", "\xf086", "\xf074" ]
where clickable l = ["<action=`xdotool key super+" ++ show (n) ++ "`>" ++ ws ++ "</action>" | (i,ws) <- zip [1..9] l, let n = i ]
playerctl = "playerctl -p 'playerctld,%any'"
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
[ ((modMask, xK_Return),
spawn $ XMonad.terminal conf)
@@ -70,22 +72,22 @@ myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
spawn "flameshot gui -d 10000")
, ((modMask, xK_p),
spawn "mpc toggle")
spawn (playerctl ++ " play-pause"))
, ((0, xF86XK_AudioPlay),
spawn "mpc toggle")
spawn (playerctl ++ " play-pause"))
, ((modMask, xF86XK_AudioNext),
spawn "mpc next")
spawn (playerctl ++ " next"))
, ((modMask, xF86XK_AudioPrev),
spawn "mpc prev")
spawn (playerctl ++ " previous"))
, ((0, xF86XK_AudioPrev),
spawn "mpc seek -00:00:05")
spawn (playerctl ++ " position 5-"))
, ((0, xF86XK_AudioNext),
spawn "mpc seek +00:00:05")
spawn (playerctl ++ " position 5+"))
, ((0, xF86XK_AudioRaiseVolume),
spawn "pamixer --allow-boost -ui 5")

View File

@@ -8,7 +8,4 @@ map S rotate
map f zoom in
map q zoom out
map p follow link
#map m scroll left
#map i scroll right
#map n scroll down
#map e scroll up
set selection-clipboard clipboard

13
home/natto/cursor.nix Normal file
View File

@@ -0,0 +1,13 @@
{ pkgs, ... }:
{
home.pointerCursor = {
package = pkgs.catppuccin-cursors.mochaFlamingo;
name = "catppuccin-mocha-flamingo-cursors";
size = 32;
x11 = {
enable = true;
defaultCursor = "crosshair";
};
gtk.enable = true;
};
}

View File

@@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }:
{ ... }:
{
home = {
homeDirectory = "/home/natto";
@@ -8,15 +8,32 @@
imports = [
./email.nix
./programs.nix
./xsession.nix
./wayland.nix
./pass.nix
./browser.nix
./pdf.nix
./mpv.nix
./pkgs.nix
./stuff.nix
./emacs.nix
./gtk.nix
./dunst.nix
./git.nix
./mpd.nix
./music.nix
./zsh.nix
./games.nix
./cursor.nix
./emacs.nix
# when xserver
# ./xsession.nix
# when wayland
./wayland.nix
./hyprpaper.nix
./hyprlock.nix
./hypridle.nix
./hyprland.nix
./foot.nix
./tofi.nix
./ags
];
}

View File

@@ -1,10 +1,12 @@
{ config, colors, ... }:
{ config, conf, ... }:
{
services = {
dunst = {
enable = true;
iconTheme = with config.gtk.iconTheme; { inherit name package; };
settings = with colors.hex; {
iconTheme = with config.gtk.iconTheme; {
inherit name package;
};
settings = with conf.colors.hex; {
global = {
mouse_left_click = "close_current";
mouse_right_click = "do_action";
@@ -23,7 +25,7 @@
urgency_normal = {
inherit background foreground;
frame_color = green;
frame_color = mauve;
timeout = 5;
};

View File

@@ -1,31 +1,49 @@
{ config, pkgs, inputs, ... }:
{ pkgs, inputs, ... }:
let
mymacs = config: # with inputs.emacs-overlay.packages.${pkgs.system}; already resolved with overlay
with pkgs; emacsWithPackagesFromUsePackage {
inherit config;
package = emacsGit;
alwaysEnsure = true;
alwaysTangle = true;
extraEmacsPackages = epkgs: with epkgs; [
use-package
(epkgs.tree-sitter-langs.withPlugins (_: epkgs.tree-sitter-langs.plugins))
];
};
emacs = pkgs.emacs-git-pgtk;
configFile = ./config/emacs/config.org;
enable = true;
in
{
home.file = with config; {
"config.org" = {
source = ./config/emacs/config.org;
target = "${home.homeDirectory}/.emacs.d/config.org";
};
"init.el" = {
source = ./config/emacs/init.el;
target = "${home.homeDirectory}/.emacs.d/init.el";
nixpkgs.overlays = [ inputs.emacs-overlay.overlays.default ];
home = {
shellAliases = rec {
e = "emacs";
enw = e + " -nw";
ec = "emacsclient";
ecc = ec + " -c";
ecnw = ec + " -nw";
};
};
programs.emacs = {
enable = true;
package = mymacs ./config/emacs/config.org;
inherit enable;
package = pkgs.emacsWithPackagesFromUsePackage {
config = configFile;
package = emacs;
alwaysEnsure = true;
alwaysTangle = true;
defaultInitFile = true;
extraEmacsPackages = epkgs: with epkgs; [
use-package
(tree-sitter-langs.withPlugins (_: tree-sitter-langs.plugins))
];
override = final: prev: {
evil = prev.melpaPackages.evil.overrideAttrs(_: {
src = pkgs.fetchFromGitHub {
owner = "natto1784";
repo = "evil";
rev = "isearch-lazy-count";
sha256 = "sha256-YqXoqPqOWRvszzktb0MYHMe590mzTQxCMgBloy3MHkQ=";
};
});
};
};
};
services.emacs.enable = true;
services.emacs = {
inherit enable;
defaultEditor = true;
};
systemd.user.services.emacs.Service.Environment = "COLORTERM=truecolor";
}

View File

@@ -1,44 +1,94 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
inputs,
conf,
...
}:
let
key = "53EC089EF230E47A83BA8F8195949BD4B853F559";
host = "mail.weirdnatto.in";
realName = "Amneesh Singh";
in
{
accounts.email = {
accounts = {
natto = rec {
realName = "Amneesh Singh";
primary = true;
address = "natto@weirdnatto.in";
userName = address;
gpg = {
inherit key;
signByDefault = true;
natto =
let
domain = conf.network.addresses.domain.natto;
address = "natto@${domain}";
host = "mail.${domain}";
in
{
inherit realName address;
primary = true;
userName = address;
gpg = {
key = "3C4BDBE7BBF45B52C14EA193007257B05FCC86A8";
signByDefault = true;
};
imap = {
inherit host;
tls.enable = true;
};
imapnotify.enable = true;
smtp = {
inherit host;
tls.enable = true;
};
mbsync = {
enable = true;
create = "both";
};
passwordCommand = "pass show email/${address}";
neomutt = {
enable = true;
extraMailboxes = [
"Sent"
"Drafts"
"Trash"
"Junk"
];
};
};
imap = {
inherit host;
tls.enable = true;
amneesh =
let
domain = conf.network.addresses.domain.amneesh;
address = "me@${domain}";
host = "mail.${domain}";
in
{
inherit address realName;
userName = address;
gpg = {
key = "0C2FDA374F2D48D9F9F0F7788EAAB36980C424C2";
signByDefault = true;
};
imap = {
inherit host;
tls.enable = true;
};
imapnotify.enable = true;
smtp = {
inherit host;
tls.enable = true;
};
mbsync = {
enable = true;
create = "both";
};
passwordCommand = "pass show email/${address}";
neomutt = {
enable = true;
extraMailboxes = [
"Sent"
"Drafts"
"Junk"
];
};
};
imapnotify.enable = true;
smtp = {
inherit host;
tls.enable = true;
};
mbsync = {
enable = true;
create = "both";
};
passwordCommand = "pass show email/${address}";
neomutt = {
enable = true;
extraMailboxes = [
"Sent"
"Drafts"
"Trash"
"Junk"
];
};
};
};
};
services = {
@@ -50,18 +100,17 @@ in
enable = true;
package = pkgs.neomutt;
sort = "reverse-date";
extraConfig =
lib.concatMapStringsSep
"\n"
builtins.readFile
[
./config/neomutt/neomuttrc
./config/neomutt/theme
];
extraConfig = lib.concatMapStringsSep "\n" builtins.readFile [
./config/neomutt/neomuttrc
./config/neomutt/theme
];
};
};
home = {
packages = with pkgs; [ mailcap ];
packages = with pkgs; [
mailcap
w3m
];
file = {
mailcap = {
source = ./config/mailcap;

View File

@@ -0,0 +1,4 @@
#+OPTIONS: toc:nil
Inspired by
+ [[https://github.com/saimoomedits/eww-widgets/tree/cfb2523a4e37ed2979e964998d9a4c37232b2975][saimoomedits]]
+ [[https://github.com/fufexan/dotfiles/tree/db777ae5a76db34608dd486ed9238e9129252bbc/home/programs/eww][fufexan]]

242
home/natto/eww/bar/bar.scss Normal file
View File

@@ -0,0 +1,242 @@
* {
all: unset;
}
tooltip {
background: $background;
border: 1px solid $pink;
border-radius: 2px;
label {
padding: 5px;
}
}
@mixin color-shadow($color, $opacity: 0.08, $on-hover: 1) {
color: $color;
@if $on-hover == 0 {
box-shadow: 0 0 0 9999px rgba($color, $opacity) inset;
} @else {
&:hover {
box-shadow: 0 0 0 9999px rgba($color, $opacity) inset;
}
}
}
.bar, .music-large {
font-family: "Fira Mono";
background: $background;
button:hover {
transition: 0.15s;
}
scale trough, circular-progress {
background: $surface1;
}
}
.workspaces {
font-size: 16px;
font-family: "Lohit Devanagari";
button {
background: none;
}
.workspace-active {
@include color-shadow($mauve, $on-hover: 0);
font-size: 20px;
font-weight: bold;
}
.workspace-inactive {
@include color-shadow($flamingo);
}
}
.music {
button {
background: none;
padding: 0 10px;
}
.music-control {
@include color-shadow($mauve);
font-family: "Font Awesome 6 Free";
font-size: 18px;
}
.music-title {
@include color-shadow($sapphire);
font-size: 16px;
}
}
.music-large {
border: solid 3px $sapphire;
color: $mauve;
border-radius: 8px;
.music-large-cover {
background-size: cover;
background-position: center;
border-radius: 5px;
margin: 15px 0 15px 15px;
min-height: 200px;
min-width: 200px;
}
.music-large-controls {
margin: 15px;
scale trough {
min-height: 5px;
margin: 0 15px;
highlight {
background-image: linear-gradient(to right, $sapphire, $teal);
}
slider {
border-radius: 4px;
background: $background;
border: 2px $mauve solid;
margin: -10px -10px;
transition: 0.2s;
&:hover {
box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.1);
}
&:active {
box-shadow: 0 0 0 1px inset, 0 0 0 8px rgba(255, 255, 255, 0.1);
}
}
}
.music-large-artist {
font-size: 18px;
color: $mauve;
}
.music-large-album {
font-size: 16px;
color: $sapphire;
}
}
}
.system {
button {
background: none;
font-size: 20px;
padding: 0 10px;
}
.system-scale {
min-width: 100px;
}
scale trough {
min-height: 20px;
min-width: 120px;
border-radius: 3px;
highlight {
all: unset;
border-radius: 3px;
}
slider {
all:unset;
border: none;
min-width: 0;
min-height: 0;
}
}
.system-sound {
button {
@include color-shadow($green);
padding-right: 5px;
}
scale trough highlight {
background-color: $green;
}
}
.system-bright {
button {
@include color-shadow($yellow);
}
scale trough highlight {
background-color: $yellow;
}
}
.system-temp {
button {
@include color-shadow($red);
}
}
.system-net {
button {
@include color-shadow($mauve);
}
}
.system-separator {
min-width: 5px;
background-color: $sapphire;
}
.system-metrics {
transition: 0.2s;
label {
padding: 0 5px;
font-size: 20px;
}
circular-progress {
margin: 0 5px;
}
.system-metric-cpu {
color: $teal;
}
.system-metric-battery {
color: $yellow;
}
.system-metric-memory {
color: $pink;
}
.system-metric-disk {
color: $blue;
}
}
}
.system-time {
label {
color: $foreground;
padding: 0 5px;
font-weight: bold;
}
.system-time-time {
font-size: 18px;
}
.system-time-date {
font-size: 20px;
}
}

View File

@@ -0,0 +1,20 @@
(include "bar/music.yuck")
(include "bar/hyprworkspaces.yuck")
(include "bar/system.yuck")
(defwidget bar []
(box :class "bar" :orientation "h" :spacing 40
(workspaces)
(music_compact)
(system)))
(defwindow bar
:monitor 0
:geometry (geometry :x "0%"
:y "0%"
:width "100%"
:height "40px"
:anchor "top center")
:stacking "fg"
:exclusive true
(bar))

View File

@@ -0,0 +1,13 @@
pkgs: with pkgs; [
coreutils
bash
jq
less
gawk
socat
playerctl
networkmanager
light
iwgtk
wireplumber
]

View File

@@ -0,0 +1,34 @@
#!/usr/bin/env bash
##########################################
# workspace script to work with hyprland #
##########################################
# i dont really have multiple monitors rn
# active workspace
current=1
list_workspaces() {
workspace_list=$(hyprctl -j workspaces | jq -rc '[.[]|.id]|sort' || "[]")
}
workspaces() {
echo '{"current": '"${current}"',"list": '"${workspace_list}"'}'
}
list_workspaces
workspaces
hyprctl dispatch workspace $current &>/dev/null || true
socat -u UNIX-CONNECT:/tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | while read -r event; do
case ${event%>>*} in
"workspace")
current=${event##*>>}
workspaces
;;
"createworkspace"|"destroyworkspace")
list_workspaces
workspaces
;;
esac
done

View File

@@ -0,0 +1,13 @@
(deflisten workspace :initial "{}" "bar/hyprworkspaces")
(defvar numerals "[\"१\", \"२\", \"३\", \"४\", \"५\", \"६\", \"७\", \"८\", \"९\", \"\"]")
(defwidget workspaces []
(eventbox
:cursor "pointer"
(box
:class "workspaces"
(for ws in {workspace.list}
(button
:class "${ws == workspace.current ? 'workspace-active' : 'workspace-inactive'}"
:onclick "hyprctl dispatch workspace ${ws}"
{ws <= 10 ? numerals[ws - 1] : ws })))))

View File

@@ -0,0 +1,92 @@
(defvar playerctl "playerctl -p 'playerctld,%any'")
; https://github.com/elkowar/eww/issues/518
(deflisten music :initial ""
"playerctl -p 'playerctld,%any' --follow metadata --format '{\"artist\":\"{{artist}}\",\"album\":\"{{album}}\",\"title\":\"{{trunc(title,40)}}\",\"full_title\":\"{{title}}\",\"cover\":\"{{mpris:artUrl}}\", \"status\":\"{{lc(status)}}\",\"duration\":\"{{duration(mpris:length)}}\",\"raw_duration\":\"{{mpris:length}}\",\"position\":\"{{duration(position)}}\",\"raw_position\":\"{{position}}\"}'")
(defwidget music_controls[]
(box
(button :class "music-control" :onclick "${playerctl} previous" "")
(button :class "music-control" :onclick "${playerctl} play-pause" {music.status == "playing" ? "" : "" })
(button :class "music-control" :onclick "${playerctl} next" "")))
(defwidget music_large []
(box
:halign "center"
:class "music-large"
:orientation "h"
(box
:class "music-large-cover"
:visible {music.cover != ""}
:style "background-image: url(\"${music.cover}\");")
(box
:orientation "v"
:class "music-large-controls"
:spacing {music.cover == "" ? 10 : 0}
(label
:visible {music.artist != ""}
:class "music-large-artist"
:text {music.artist})
(label
:visible {music.album != ""}
:class "music-large-album"
:text {music.album})
(eventbox
:cursor "pointer"
(music_controls))
(box
(label
:visible {music.position != ""}
:xalign {music.duration == "" ? 0.5 : 0}
:style {music.duration == "" ? "font-size: 18px;": ""}
:text {music.position})
(label
:visible {music.duration != ""}
:xalign {music.position == "" ? 0.5 : 1}
:style {music.position == "" ? "font-size: 18px;": ""}
:text {music.duration}))
(eventbox
:class "music-large-scale"
:cursor "pointer"
:visible {music.raw_duration != "" && music.raw_position != "" }
(scale
:min 0
:max {music.raw_duration / 1000000}
:onchange "${playerctl} position {}"
:value {music.raw_position / 1000000})))))
(defvar music_control false)
(defwidget music_compact []
(eventbox
:cursor "pointer"
:onhover "${EWW_CMD} update music_control=true"
:onhoverlost "${EWW_CMD} update music_control=false"
:visible {music.title != "" && music.status != "stopped" && music != ""}
:halign "center"
(box
:class "music"
:space-evenly "false"
(button
:class "music-title"
:onclick "${EWW_CMD} open --toggle music"
:tooltip "${music.title} by ${music.artist}"
:onrightclick "wl-copy \"${music.artist} - ${music.full_title}\""
{music.title})
(revealer
:transition "slideright"
:reveal music_control
:duration "200ms"
(music_controls)
))))
(defwindow music
:stacking "overlay"
:monitor 0
:geometry (geometry
:x "0%"
:y "10px"
:width "0%"
:height "0%"
:anchor "top center")
(music_large))

View File

@@ -0,0 +1,183 @@
(defvar system_sound_control false)
(defvar system_sound_mute false)
(defpoll volume :interval "3s"
"wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2 * 100}'")
(defwidget system_sound []
(eventbox
:cursor "pointer"
:onhover "${EWW_CMD} update system_sound_control=true"
:onhoverlost "${EWW_CMD} update system_sound_control=false"
:tooltip "${ system_sound_mute ? 'Muted' : 'Volume: ${volume}%'}"
(box
:space-evenly false
:orientation "h"
:class "system-sound"
(revealer
:transition "slideleft"
:reveal system_sound_control
:duration "250ms"
(scale
:class "system-scale"
:min 0
:max 151
:onchange "wpctl set-volume @DEFAULT_AUDIO_SINK@ {}%"
:value {volume}
))
(button
; since we do not know the initial state, we will just update the variable
:onclick "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && ${EWW_CMD} update system_sound_mute=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $3 ~ /MUTED/ ? \"true\" : \"false\"}')"
{system_sound_mute ? "" : volume > 75 ? "" : "" })
)))
(defvar system_bright_control false)
(defpoll bright :interval "3s" "light")
(defwidget system_bright []
(eventbox
:cursor "pointer"
:onhover "${EWW_CMD} update system_bright_control=true"
:onhoverlost "${EWW_CMD} update system_bright_control=false"
:tooltip "Brightness: ${round(bright,0)}%"
(box
:space-evenly false
:orientation "h"
:class "system-bright"
(revealer
:transition "slideleft"
:reveal system_bright_control
:duration "250ms"
(scale
:class "system-scale"
:min 5
:max 101
:onchange "light -S {}"
:value {bright}
))
(button
:onclick "light -S ${bright < 51 ? 100 : 50}"
""))))
(defwidget system_temp []
(eventbox
:cursor "pointer"
:tooltip {EWW_TEMPS["CORETEMP_PACKAGE_ID_0"] != "" ? "CPU: ${EWW_TEMPS['CORETEMP_PACKAGE_ID_0']} C" : EWW_TEMPS}
:class "system-temp"
(button
"")))
(defpoll system_net_ethernet :interval "4s" :initial ""
"nmcli -f NAME,TYPE con show --active | awk '$NF == \"ethernet\" {NF--; print}'")
(defpoll system_net_wifi :interval "4s" :initial ""
"nmcli -f NAME,TYPE con show --active | awk '$NF == \"wifi\" { NF--; print}'")
(defwidget system_net []
(eventbox
:cursor "pointer"
:class "system-net"
:visible {system_net_ethernet != "" || system_net_wifi != ""}
:tooltip {EWW_NET}
(box
:orientation "h"
(button
:visible {system_net_ethernet != ""}
:tooltip {system_net_ethernet}
"")
(button
:visible {system_net_wifi != ""}
:tooltip {system_net_wifi}
""))))
(defwidget system_info []
(box
:orientation "h"
:space-evenly false
:spacing 5
(system_sound)
(system_bright)
(system_temp)))
(defwidget system_metric [value class tooltip]
(box
:orientation "h"
:space-evenly false
:class "system-metric-${class}"
:tooltip "${tooltip}"
(circular-progress
:value value
:start-at 0
:thickness 4
(label :text ""))))
(defwidget system_metrics []
(eventbox
:cursor "pointer"
:class "system-metrics"
:tooltip "test"
:onclick "${EWW_CMD} open --toggle system"
(box
:space-evenly false
(system_metric
:value {EWW_CPU.avg}
:tooltip "CPU Usage: ${round(EWW_CPU.avg, 2)}%
CPU Freq: ${EWW_CPU.cores[0].freq} MHz}"
:class "cpu")
(system_metric
:value {EWW_RAM.used_mem_perc}
:tooltip "Free Memory: ${round(EWW_RAM.free_mem / 1024 / 1024, 2)} MB
Available Memory: ${round(EWW_RAM.available_mem / 1024 / 1024, 2)} MB
Free %: ${round(100 - EWW_RAM.used_mem_perc, 2)}%"
:class "memory")
(system_metric
:value {EWW_BATTERY.total_avg}
:tooltip "Battery ${round(EWW_BATTERY.total_avg, 0)}%"
:class "battery")
(system_metric
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
:tooltip "Free Disk: ${round(EWW_DISK['/'].free / 1024 / 1024 / 1024, 2)} GB
Free Disk %: ${round(EWW_DISK['/'].free / EWW_DISK['/'].total * 100, 2)}%"
:class "disk"))))
(defvar system_date_reveal false)
(defpoll time :interval "1s"
"date '+%H:%M:%S'")
(defpoll date :interval "10m"
"date '+%b %d'")
(defwidget system_time []
(eventbox
:onhover "${EWW_CMD} update system_date_reveal=true"
:onhoverlost "${EWW_CMD} update system_date_reveal=false"
(box
:space-evenly false
:orientation "h"
:class "system-time"
(label :class "system-time-time" :text {time})
(revealer
:transition "slideright"
:reveal system_date_reveal
:duration "250ms"
(label :class "system-time-date" :text {date})))))
(defwidget system_separator [?visible] (box :class "system-separator" :visible {visible == "false" ? false : true}))
(defwidget system []
(box
:halign "end"
:class "system"
:space-evenly false
:spacing 5
(system_separator)
(system_info)
(system_separator
:visible "${system_net_ethernet != "" || system_net_wifi != ""}")
(system_net)
(system_separator)
(system_metrics)
(system_separator)
(system_time)))

View File

@@ -0,0 +1,55 @@
{
config,
pkgs,
lib,
...
}:
{
programs.eww = {
enable = true;
package = pkgs.eww;
configDir = lib.cleanSourceWith {
src = ./.;
filter =
name: _:
let
baseName = baseNameOf (toString name);
in
!(lib.hasSuffix ".nix" baseName);
};
};
systemd.user.services.eww = {
Unit = {
Description = "EWW Daemon";
PartOf = [ "graphical-session.target" ];
};
Service =
let
deps = [
config.programs.eww.package
]
++ lib.optional config.wayland.windowManager.hyprland.enable config.wayland.windowManager.hyprland.package
++ (with pkgs; [
coreutils
bash
jq
less
gawk
socat
playerctl
networkmanager
iwgtk
wireplumber
])
++ lib.optional config.laptop pkgs.light;
in
{
Type = "simple";
Environment = "PATH=${lib.makeBinPath deps}";
Restart = "on-failure";
ExecStart = "${config.programs.eww.package}/bin/eww daemon --no-daemonize";
};
Install.WantedBy = [ "graphical-session.target" ];
};
}

31
home/natto/eww/eww.scss Normal file
View File

@@ -0,0 +1,31 @@
$rosewater: #F5E0DC;
$flamingo: #F2CDCD;
$pink: #F5C2E7;
$mauve: #CBA6F7;
$red: #F38BA8;
$maroon: #EBA0AC;
$peach: #FAB387;
$yellow: #F9E2AF;
$green: #A6E3A1;
$teal: #94E2D5;
$sky: #89DCEB;
$sapphire: #74C7EC;
$blue: #89B4FA;
$lavender: #B4BEFE;
$text: #CDD6F4;
$subtext1: #BAC2DE;
$subtext0: #A6ADC8;
$overlay2: #9399B2;
$overlay1: #7F849C;
$overlay0: #6C7086;
$surface2: #585B70;
$surface1: #45475A;
$surface0: #313244;
$base: #1E1E2E;
$mantle: #181825;
$crust: #11111B;
$background: $base;
$foreground: $text;
@import "bar/bar.scss"

1
home/natto/eww/eww.yuck Normal file
View File

@@ -0,0 +1 @@
(include "bar/bar.yuck")

34
home/natto/foot.nix Normal file
View File

@@ -0,0 +1,34 @@
{ conf, ... }:
{
programs = {
foot = {
enable = true;
settings = {
main = {
font = "Fira Mono:style=Regular:pixelsize=18";
font-bold = "Fira Mono:style=Bold:pixelsize=18";
};
scrollback.lines = 10000;
colors = with conf.colors.default; {
inherit foreground background;
regular0 = surface1;
regular1 = red;
regular2 = green;
regular3 = yellow;
regular4 = blue;
regular5 = pink;
regular6 = teal;
regular7 = subtext1;
bright0 = surface2;
bright1 = red;
bright2 = green;
bright3 = yellow;
bright4 = blue;
bright5 = pink;
bright6 = teal;
bright7 = subtext0;
};
};
};
};
}

13
home/natto/games.nix Normal file
View File

@@ -0,0 +1,13 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
# Wine and games and stuff
wineWowPackages.stable
steam
winetricks
# lutris
# inputs.nix-gaming.packages.${pkgs.system}.osu-lazer-bin
];
programs.mangohud.enable = true;
}

View File

@@ -10,7 +10,8 @@
};
age.secrets.gitconfig = {
file = ./secrets/.gitconfig.age;
file = ./secrets/gitconfig.age;
path = "${config.home.homeDirectory}/.gitconfig";
symlink = false;
};
}

17
home/natto/gtk.nix Normal file
View File

@@ -0,0 +1,17 @@
{ pkgs, ... }:
{
gtk = {
enable = true;
theme = {
name = "catppuccin-mocha-teal-standard";
package = pkgs.catppuccin-gtk.override {
accents = [ "teal" ];
variant = "mocha";
};
};
iconTheme = {
package = pkgs.papirus-icon-theme;
name = "Papirus-Dark";
};
};
}

29
home/natto/hypridle.nix Normal file
View File

@@ -0,0 +1,29 @@
{
pkgs,
config,
...
}:
let
lock = "${pkgs.systemd}/bin/loginctl lock-session";
timeout = 300;
in
{
# screen idle
services.hypridle = {
enable = true;
settings = {
general = {
before_sleep_cmd = lock;
lock_cmd = "pgrep hyprlock || ${config.programs.hyprlock.package}/bin/hyprlock";
};
listener = [
{
timeout = timeout;
on-timeout = lock;
}
];
};
};
}

207
home/natto/hyprland.nix Normal file
View File

@@ -0,0 +1,207 @@
{
pkgs,
inputs,
config,
lib,
conf,
...
}:
{
wayland = {
windowManager = {
hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland;
xwayland = {
enable = true;
};
settings = {
monitor = ", highrr, auto, 1";
input = {
kb_layout = "us,us";
kb_variant = "colemak_dh";
kb_model = "";
kb_options = "grp:rctrl_toggle";
kb_rules = "";
repeat_delay = 300;
accel_profile = "flat";
follow_mouse = true;
touchpad = {
natural_scroll = true;
scroll_factor = 0.4;
};
};
general = with conf.colors.argb { a = "ee"; }; {
gaps_in = 5;
gaps_out = 10;
border_size = 2;
layout = "dwindle";
"col.active_border" = "0x${mauve} 0x${flamingo} 135deg";
"col.inactive_border" = "0x${surface0}";
};
decoration = {
rounding = 1;
inactive_opacity = 0.8;
shadow = {
enabled = true;
};
blur = {
enabled = true;
size = 8;
new_optimizations = true;
xray = true;
};
};
animations = {
enabled = true;
bezier = [
"overshot,0.01,0.9,0.1,1.05"
"easeoutexpo,0.16,1,0.3,1"
];
animation = [
"windows,1,7,overshot,popin 50%"
"windowsOut,1,7,easeoutexpo,popin 50%"
"border,1,10,default"
"fade,1,7,default"
"workspaces,1,6,overshot"
];
};
cursor = {
no_hardware_cursors = true;
};
dwindle = {
pseudotile = true;
preserve_split = true;
};
misc = {
disable_hyprland_logo = true;
};
"$mod" = "SUPER";
bind =
let
playerctl = "playerctl -p 'playerctld,%any'";
in
[
# Hyprland operations
"$mod ALT, f, exit,"
"$mod SHIFT, t, pseudo,"
"$mod, f, fullscreen,"
"$mod, t, togglefloating,"
"$mod, left, movefocus, l"
"$mod, h, movefocus, l"
"$mod, right, movefocus, r"
"$mod, l, movefocus, r"
"$mod, up, movefocus, u"
"$mod, k, movefocus, u"
"$mod, down, movefocus, d"
"$mod, j, movefocus, d"
"$mod, 1, workspace, 1"
"$mod, 2, workspace, 2"
"$mod, 3, workspace, 3"
"$mod, 4, workspace, 4"
"$mod, 5, workspace, 5"
"$mod, 6, workspace, 6"
"$mod, 7, workspace, 7"
"$mod, 8, workspace, 8"
"$mod, 9, workspace, 9"
"$mod, 0, workspace, 10"
"$mod SHIFT, 1, movetoworkspacesilent, 1"
"$mod SHIFT, 2, movetoworkspacesilent, 2"
"$mod SHIFT, 3, movetoworkspacesilent, 3"
"$mod SHIFT, 4, movetoworkspacesilent, 4"
"$mod SHIFT, 5, movetoworkspacesilent, 5"
"$mod SHIFT, 6, movetoworkspacesilent, 6"
"$mod SHIFT, 7, movetoworkspacesilent, 7"
"$mod SHIFT, 8, movetoworkspacesilent, 8"
"$mod SHIFT, 9, movetoworkspacesilent, 9"
"$mod SHIFT, 0, movetoworkspacesilent, 10"
"$mod SHIFT, comma, focusmonitor, -1"
"$mod SHIFT, period, focusmonitor, +1"
# Launchers
"$mod, RETURN, exec, foot"
"$mod, D, exec, pkill tofi || tofi-drun | xargs hyprctl dispatch exec --"
"$mod SHIFT, D, exec, pkill tofi || tofi-run --require-match=false | xargs hyprctl dispatch exec --"
# Media
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
# Backlight
", XF86MonBrightnessUp, exec, light -A 5"
", XF86MonBrightnessDown, exec, light -U 5"
# XWayland Keymaps
"$mod SHIFT, F1, exec, setxkbmap us colemak_dh"
"$mod SHIFT, F2, exec, setxkbmap us basic"
# Screenshot
", PRINT, exec, grimblast --notify copysave screen"
"SHIFT, PRINT, exec, grimblast --notify copysave area"
# Playerctl
"$mod, P, exec, ${playerctl} play-pause"
", XF86AudioPlay, exec, ${playerctl} play-pause"
", XF86AudioNext, exec, ${playerctl} position 5+"
", XF86AudioPrev, exec, ${playerctl} position 5-"
"$mod, XF86AudioNext, exec, ${playerctl} next"
"$mod, XF86AudioPrev, exec, ${playerctl} previous"
];
binde = [
# Hyprland operations
"$mod SHIFT, Q, killactive,"
"$mod SHIFT, left, movewindow, l"
"$mod SHIFT, h, movewindow, l"
"$mod SHIFT, right, movewindow, r"
"$mod SHIFT, l, movewindow, r"
"$mod SHIFT, up, movewindow, u"
"$mod SHIFT, k, movewindow, u"
"$mod SHIFT, down, movewindow, d"
"$mod SHIFT, j, movewindow, d"
"SHIFT ALT, left, resizeactive, -10 0"
"SHIFT ALT, h, resizeactive, -10 0"
"SHIFT ALT, right, resizeactive, 10 0"
"SHIFT ALT, l, resizeactive, 10 0"
"SHIFT ALT, up, resizeactive, 0 -10"
"SHIFT ALT, k, resizeactive, 0 -10"
"SHIFT ALT, down, resizeactive, 0 10"
"SHIFT ALT, j, resizeactive, 0 10"
];
bindm = [
# Mouse
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
"$mod ALT, mouse:272, resizewindow"
];
exec-once = [
(with config.home.pointerCursor; "hyprctl setcursor ${name} ${toString size} ")
]
++ (with config.programs; lib.optional eww.enable "${eww.package}/bin/eww open bar");
};
};
};
};
}

80
home/natto/hyprlock.nix Normal file
View File

@@ -0,0 +1,80 @@
{
config,
pkgs,
conf,
...
}:
{
programs.hyprlock = {
enable = true;
settings = with conf.colors.argb { a = "ee"; }; {
general = {
hide_cursor = false;
};
background = [
{
monitor = "";
path = "screenshot";
blur_passes = 2;
}
];
input-field = [
{
monitor = "";
size = "300, 60";
outline_thickness = 4;
valign = "center";
halign = "center";
font_color = "0x${text}";
outer_color = "0x${mauve}";
inner_color = "0x${surface0}";
check_color = "0x${blue}";
fail_color = "0x${red}";
capslock_color = "0x${yellow}";
fade_on_empty = false;
hide_input = false;
placeholder_text = "Logged in as <b>$USER</b>";
fail_text = "Fail! <b>($ATTEMPTS)</b>";
dots_spacing = 0.2;
dots_center = true;
}
];
label = [
{
monitor = "";
text = "Layout: $LAYOUT";
font_size = 25;
color = "0x${text}";
position = "30, -30";
valign = "top";
halign = "left";
}
{
monitor = "";
text = "$TIME";
font_size = 90;
color = "0x${text}";
position = "-30, 0";
valign = "top";
halign = "right";
}
{
monitor = "";
text = "cmd[update:3600000] date +\"%A, %d %B %Y\"";
font_size = 25;
color = "0x${text}";
position = "-30, -150";
valign = "top";
halign = "right";
}
];
};
};
}

18
home/natto/hyprpaper.nix Normal file
View File

@@ -0,0 +1,18 @@
{
config,
...
}:
{
services.hyprpaper = {
enable = true;
settings =
let
wallpaper = "${config.home.homeDirectory}/wallpaper.png";
in
{
preload = [ "${wallpaper}" ];
wallpaper = [ ", ${wallpaper}" ];
};
};
}

13
home/natto/mpv.nix Normal file
View File

@@ -0,0 +1,13 @@
{ ... }:
{
programs = {
mpv = {
enable = true;
config = {
force-window = true;
keep-open = true;
save-position-on-quit = true;
};
};
};
}

View File

@@ -3,7 +3,7 @@ let
home = config.home.homeDirectory;
in
{
services = {
services = rec {
mpd = {
enable = true;
musicDirectory = "${home}/Music";
@@ -18,17 +18,25 @@ in
};
mpd-discord-rpc = {
enable = true;
inherit (mpd) enable;
settings = {
id = 1039532008424099850; # dont really care
format = {
large_image = "koishi";
small_image = "";
small_image = "koishifumo";
large_text = "real";
small_text = "the";
};
};
};
mpdris2 = {
inherit (mpd) enable;
mpd = {
inherit (mpd) musicDirectory;
host = "localhost";
};
};
};
systemd.user.services = {
@@ -58,12 +66,15 @@ in
home = {
packages = with pkgs; [
spotify
mpc_cli
(ncmpcpp.override {
visualizerSupport = true;
clockSupport = true;
})
mpdas
mpc_cli
(tauon.override {
withDiscordRPC = true;
})
];
file.ncmpcpp = {
@@ -75,5 +86,8 @@ in
age.secrets.mpdasrc = {
file = ./secrets/mpdasrc.age;
path = "${home}/.config/mpdasrc";
symlink = false;
};
services.playerctld.enable = true;
}

6
home/natto/pass.nix Normal file
View File

@@ -0,0 +1,6 @@
{ ... }:
{
programs = {
password-store.enable = true;
};
}

18
home/natto/pdf.nix Normal file
View File

@@ -0,0 +1,18 @@
{ ... }:
{
programs = {
zathura = {
enable = true;
extraConfig = builtins.readFile ./config/zathura/zathurarc;
options = {
recolor = true;
recolor-lightcolor = "rgba(0,0,0,0)";
default-bg = "rgba(0,0,0,0.8)";
};
};
sioyek = {
enable = true;
};
};
}

View File

@@ -1,86 +1,54 @@
{ config, flake, inputs, pkgs, ... }:
{
home.packages = with pkgs; [
flake,
pkgs,
config,
...
}:
{
home.packages =
with pkgs;
[
# A/V, codec and media stuff
ffmpeg-full
wireplumber
pulseaudio
pavucontrol
imagemagick
# A/V, codec and media stuff
ffmpeg-full
wireplumber
mpv
pulseaudio
pavucontrol
spotify
imagemagick
# Utils
neofetch
rage
curl
yt-dlp
p7zip
unrar
vim
(flake.packages.${system}.customscripts)
cachix
steam-run
# Utils
rage
curl
yt-dlp
p7zip
unrar
vim
jmtpfs
neofetch
(inputs.nbfc.packages.${pkgs.system}.nbfc-client-c)
(flake.packages.${pkgs.system}.customscripts)
translate-shell
powertop
cachix
undervolt
# GUI
vesktop
(xfce.thunar.override {
thunarPlugins = with xfce; [
thunar-media-tags-plugin
thunar-volman
thunar-archive-plugin
];
})
xfce.xfconf
xfce.tumbler
qbittorrent
hexchat
dunst
zenity
# GUI utils
(discord.override {
nss = nss_latest;
})
qbittorrent
hexchat
luajit
dunst
feh
authy
gnome.zenity
# Wine and games and stuff
steam
wineWowPackages.stable
winetricks
# (inputs.nix-gaming.packages.${pkgs.system}.osu-stable)
(flake.packages.${pkgs.system}.tlauncher)
mangohud
# Programming and dev stuff
rust-analyzer
(texlive.combine {
inherit (texlive)
scheme-small
babel
lm
graphics-def
url
mhchem
wrapfig
capt-of
minted
fvextra
xstring
catchfile
framed
upquote
pdfsync
tocloft
enumitem
tcolorbox;
})
python3Packages.pygments
inform7
ghc
nodejs
rust-bin.nightly.latest.default
clang-tools
openjdk
# Misc
anki-bin
tor-browser-bundle-bin
mailcap
];
# Misc
mailcap
libsForQt5.qtstyleplugins
]
++ lib.optionals config.isLaptop [
powertop
undervolt
];
}

View File

@@ -1,31 +0,0 @@
{ pkgs, config, ... }:
{
programs = {
home-manager.enable = true;
firefox = {
enable = true;
profiles.natto = {
name = "natto";
};
};
chromium = {
enable = true;
package = pkgs.ungoogled-chromium;
};
zathura = {
enable = true;
extraConfig = builtins.readFile ./config/zathura/zathurarc;
options = {
recolor = true;
recolor-lightcolor = "rgba(0,0,0,0)";
default-bg = "rgba(0,0,0,0.8)";
};
};
go.enable = true;
password-store.enable = true;
direnv.enable = true;
foot = {
enable = false;
};
};
}

Binary file not shown.

Binary file not shown.

View File

@@ -1,41 +1,32 @@
{ config, lib, pkgs, ... }: {
{
config,
lib,
pkgs,
...
}:
{
xdg = {
enable = true;
userDirs.enable = true;
};
age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
age.identityPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
home = {
sessionVariables = {
LV2_PATH = lib.makeSearchPath "lib/lv2" (with pkgs; [ calf ]);
QT_X11_NO_MITSHM = "1";
HM_CONF_DIR = "/etc/nixos";
};
shellAliases = rec {
ec = "emacsclient";
ecc = ec + " -c";
ecnw = ec + " -nw";
};
file = with config; {
stalonetray = {
source = ./config/stalonetrayrc;
target = "${home.homeDirectory}/.stalonetrayrc";
};
mpv = {
source = ./config/mpv/mpv.conf;
target = "${xdg.configHome}/mpv/mpv.conf";
};
QT_QPA_PLATFORMTHEME = "gtk2";
};
};
i18n = {
inputMethod = {
# enabled = "fcitx5";
# fcitx5.addons = with pkgs; [ fcitx5-m17n fcitx5-mozc ];
enabled = "fcitx";
fcitx.engines = with pkgs.fcitx-engines; [ m17n mozc ];
enable = true;
type = "fcitx5";
fcitx5.addons = with pkgs; [
fcitx5-m17n
fcitx5-mozc
];
};
};
}

37
home/natto/tofi.nix Normal file
View File

@@ -0,0 +1,37 @@
{
conf,
pkgs,
config,
...
}:
{
home.file.tofi = {
source = pkgs.writeText "tofi-config" (
pkgs.lib.generators.toKeyValue { } (
with conf.colors.default;
{
# https://github.com/philj56/tofi/blob/master/themes/fullscreen
width = "100%";
height = "100%";
border-width = 0;
outline-width = 0;
padding-left = "35%";
padding-top = "35%";
result-spacing = 25;
num-results = 5;
font = "Fira Mono";
font-size = 15;
text-color = foreground;
selection-color = rosewater;
selection-match-color = red;
background-color = "#000A";
}
)
);
target = "${config.xdg.configHome}/tofi/config";
};
home.packages = with pkgs; [
tofi
];
}

View File

@@ -1,19 +1,11 @@
{ pkgs, config, ... }:
{ pkgs, inputs, ... }:
{
wayland = {
windowManager = {
sway = {
enable = true;
};
hyprland = {
enable = false;
xwayland = {
enable = true;
hidpi = true;
};
nvidiaPatches = true;
};
};
};
home.packages = with pkgs; [
grim
slurp
inputs.hyprland-contrib.packages.${pkgs.system}.grimblast
wl-clipboard
swayimg
swaybg
];
}

View File

@@ -1,15 +1,10 @@
{ pkgs, config, flake, ... }:
{
home.pointerCursor = {
package = flake.packages.${pkgs.system}.simp1e-cursors;
name = "Simp1e-Solarized-Light";
x11 = {
enable = true;
defaultCursor = "crosshair";
};
gtk.enable = true;
};
pkgs,
config,
flake,
...
}:
{
xsession = {
enable = true;
windowManager = {
@@ -28,7 +23,6 @@
};
home.packages = with pkgs; [
(dmenu.override { patches = [ ./patches/dmenu.patch ]; })
(st.override {
patches = [ ./patches/st.patch ];
extraLibs = [ harfbuzz ];
@@ -37,18 +31,15 @@
xorg.xkbcomp
xorg.xmodmap
sxiv
feh
xdotool
(xfce.thunar.override {
thunarPlugins = with xfce; [
thunar-media-tags-plugin
thunar-volman
thunar-archive-plugin
];
})
xfce.xfconf
xfce.tumbler
flameshot
xmobar
stalonetray
];
home.file.stalonetray = {
source = ./config/stalonetrayrc;
target = "${config.home.homeDirectory}/.stalonetrayrc";
};
}

View File

@@ -1,33 +1,16 @@
{ config, ... }:
{ config, lib, ... }:
let
secretPath = "${config.home.homeDirectory}/.zshenv_secret";
in
{
programs.zsh = {
enable = true;
autocd = true;
history = rec {
expireDuplicatesFirst = true;
ignoreDups = true;
size = 30000;
save = size;
};
enableAutosuggestions = true;
enableCompletion = true;
enableSyntaxHighlighting = true;
prezto = {
enable = true;
prompt.theme = "pure";
autosuggestions.color = "fg=yellow,bold";
};
initExtra = ''
. ${secretPath};
'';
};
programs.zsh.initContent = lib.mkAfter ''
. ${secretPath};
'';
age.secrets.zshenv_secret = {
file = ./secrets/.zshenv_secret;
file = ./secrets/zshenv_secret;
path = secretPath;
symlink = false;
mode = "660";
};
}

View File

@@ -0,0 +1,13 @@
final: prev:
let
pam = prev.pam.overrideAttrs (oa: {
postPatch = ''
substituteInPlace modules/module-meson.build \
--replace "sbindir / 'unix_chkpwd'" "'/usr/bin/unix_chkpwd'"
'';
});
in
{
hyprlock = prev.hyprlock.override { inherit pam; };
swaylock = prev.swaylock.override { inherit pam; };
}

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