510 Commits

Author SHA1 Message Date
oysteikt af691352d2 WIP: fix hyprland 2026-05-21 14:37:36 +09:00
oysteikt d4050cda3d WIP: treewide: fixes for nixos 26.05 2026-05-21 14:36:13 +09:00
oysteikt 12b0871364 xps16/disks: fix zstd compress mount option 2026-04-27 05:36:17 +09:00
oysteikt c5fd9d1d28 home/emacs: a lot of configuration changes, set up rocq 2026-04-13 14:28:31 +09:00
oysteikt df6351c694 home/gpg/fetchers: add some todos 2026-04-13 14:27:48 +09:00
oysteikt c7d02db34e home/emacs: fetch a lot of packages directly from nixpkgs 2026-04-13 14:26:58 +09:00
oysteikt fefd7c540b home/packages: add penpot-desktop 2026-04-13 14:26:10 +09:00
oysteikt 3314ec4312 home: use systemd for envvars 2026-04-13 14:25:43 +09:00
oysteikt 48397d98d0 home/xdg: set OPAMROOT override 2026-02-20 15:23:02 +09:00
oysteikt 392b856863 home/email: add meli 2026-02-20 15:22:26 +09:00
oysteikt 79835dd63e home/packages: add signal-desktop 2026-02-20 15:21:59 +09:00
oysteikt 7ea25a1bed home/ssh: disable persistent sockets, manually specify defaults 2026-02-20 15:21:36 +09:00
oysteikt ecd71b180c home/neomutt: better default paths, enable sidebar 2026-02-06 13:15:48 +09:00
oysteikt 502b825051 xps16/disks: don't mount snapshot dirs as readonly 2026-02-06 13:15:48 +09:00
oysteikt b42b1b0797 home/email: init 2026-02-06 13:15:47 +09:00
oysteikt 25fa892f66 home/ssh: add smask to pvv machine list 2026-02-03 13:03:01 +09:00
oysteikt ebe6fe999d home/ssh: add powerpuff to pvv machine list, move buskerud 2026-02-03 13:00:46 +09:00
oysteikt 66371e050e home/ssh: add wegonke to pvv machine list 2026-02-02 23:13:52 +09:00
oysteikt 2ba599fa11 home/anyrun: fix (but it's barely holding on tbh) 2026-02-02 23:08:36 +09:00
oysteikt 478e607b8d home/tmux: increase history buffer tenfold 2026-02-02 23:06:48 +09:00
oysteikt 625dca5c2e common: install a bunch of manpages 2026-02-02 23:06:00 +09:00
oysteikt 743adf0735 treewide: yeet some proprietary slop, also name and shame 2026-02-02 23:05:29 +09:00
oysteikt 2821f23ef5 flake.lock: bump 2026-02-02 10:54:25 +01:00
oysteikt 5a92dad529 hosts/xps16: add ~/archive mount 2026-02-02 17:38:42 +09:00
oysteikt 6e033dcca3 hosts/xps16: automount snapshot dirs 2026-02-02 17:38:41 +09:00
oysteikt fcfbde58f5 hosts/xps16: fix disko device name 2026-02-02 17:32:55 +09:00
oysteikt 78b5339a95 hosts/xps16: flatten ~/{git,music} subvols 2026-02-02 16:44:52 +09:00
oysteikt f928ebdb50 hosts/xps16: mount btrfs snapshots as readonly 2026-02-02 16:35:42 +09:00
oysteikt 8f521284c8 hosts/xps16: flatten out some btrfs subvols 2026-02-02 16:32:36 +09:00
oysteikt 9dda35094d hosts/xps16: 8 gigs of swap 2026-02-02 16:00:00 +09:00
oysteikt 43d37864db hosts/xps16: use disko as source of truth for fileSystems 2026-02-02 15:33:26 +09:00
oysteikt 37e127d89d Revert "home/hyprland: replace uwsm for app2unit for starting scratchpads"
This reverts commit 19980dc75b.
2026-01-26 17:24:18 +09:00
oysteikt 0a940328f2 zed: trust all worktrees 2026-01-26 17:22:29 +09:00
oysteikt 700d52db60 home/hyprland: replace uwsm for app2unit for adhoc terminals 2026-01-22 12:20:59 +09:00
oysteikt 19980dc75b home/hyprland: replace uwsm for app2unit for starting scratchpads 2026-01-22 12:19:45 +09:00
oysteikt c1143c78db home/ssh: add more pvv machines 2026-01-21 17:29:26 +09:00
oysteikt b05354c23b tsuki/matrix: setup livekit 2026-01-21 17:28:42 +09:00
oysteikt 96e74326d3 home/alacritty: send alt+z on super+z 2026-01-18 16:18:58 +09:00
oysteikt de84111822 modules/duperemove: init 2026-01-18 04:43:51 +09:00
oysteikt d7fa0ed77e {flake.nix,home/packages}: remove remains of dosei 2026-01-18 04:07:23 +09:00
oysteikt 1d320fc3c3 home/zed: configure php lsp 2026-01-18 04:04:51 +09:00
oysteikt b0e9cf2151 home/neovim: store backups 2026-01-18 04:03:04 +09:00
oysteikt 5a61436308 home/firefox: set kagi as default search engine 2026-01-18 03:59:36 +09:00
oysteikt ca8f9efe05 home/git/switch-interactive: add colors, list tags 2026-01-18 03:25:56 +09:00
oysteikt cadba619d1 tsuki/matrix: set web client location 2026-01-18 00:03:07 +09:00
oysteikt 7e949a3c14 hosts/xps16: remove redundant ipu6 config 2026-01-18 00:02:41 +09:00
oysteikt 9f2a4e3035 hosts/xps16/home: new monitor config for hyprland 2026-01-18 00:02:12 +09:00
oysteikt b013771c9f hosts/xps16: attempt muting audio on closing laptop lid 2026-01-18 00:01:36 +09:00
oysteikt a5b9c6eab5 hosts/xps16: use stable kernel again 2026-01-17 23:59:52 +09:00
oysteikt 7708de4a8a hosts/xps16: move ipu6 config to separate file, extend 2026-01-16 23:58:46 +09:00
oysteikt c9f899cb4c flake.nix: switch nixos-matrix-modules upstream 2026-01-13 19:37:38 +01:00
oysteikt 632be8fdf3 tsuki/matrix: update trusted key servers 2026-01-14 02:13:58 +09:00
oysteikt 1a96108ba9 home/git/author-lines.sh: skip binary files 2025-12-31 04:03:45 +09:00
oysteikt d6e83cb4c4 home/git: add diffc script 2025-12-29 17:58:01 +09:00
oysteikt 5bd5355150 flake.lock: bump 2025-12-29 16:59:38 +09:00
oysteikt d9e6c35e51 common: don't install fonts on headless machines 2025-12-29 16:54:57 +09:00
oysteikt 266a1b1730 hosts/tsuki: send ntfy message on awaiting zfs pass 2025-12-29 16:45:13 +09:00
oysteikt b1b0f87ac6 home/xsession: use xdg.configHome 2025-12-29 14:28:30 +09:00
oysteikt 9863a33778 home/newsboat: upstream automation to home-manager 2025-12-29 14:24:50 +09:00
oysteikt 282b46a768 home/zed: use ty 2025-12-18 12:34:37 +09:00
oysteikt a006630ddc README: fix security critical typo
Thx to @vegardbm for the find
2025-12-15 18:11:01 +09:00
oysteikt 058a43fcba home/git: add all-commits script 2025-12-14 01:06:36 +09:00
oysteikt 186a0c901b home/git: add author-lines script 2025-12-10 14:46:42 +09:00
oysteikt 13f890f096 home/zed: disable nil 2025-12-05 15:34:42 +09:00
oysteikt a554a50439 tsuki: update to 25.11 2025-12-05 07:33:13 +01:00
oysteikt 7ce64ff4fd flake.nix: fix input urls 2025-12-05 14:52:39 +09:00
oysteikt 414f9d4c33 home/zed: misc improvements 2025-12-05 14:51:45 +09:00
oysteikt 1cbb2dce68 home/nix: toggle enable 2025-11-30 22:03:54 +09:00
oysteikt d62846811b home/tmux: add workaround for double-prefix bug 2025-11-30 22:03:13 +09:00
oysteikt 010472a7b6 xps16: re-enable latest kernel + IPU 2025-11-30 22:02:25 +09:00
oysteikt fddefdde61 Update nixpkgs to 25.11-beta 2025-11-25 21:07:42 +09:00
oysteikt 6d89b7b2af flake.lock: bump 2025-11-05 01:54:46 +01:00
oysteikt 56ef2b09b2 common/udisks2: only enable on graphical machines 2025-11-05 09:54:32 +09:00
oysteikt 36c9a5affc common/wpa_supplicant: harden 2025-11-05 09:47:16 +09:00
oysteikt 5a7269f55d common/irqbalance: apply chroot 2025-11-05 09:38:54 +09:00
oysteikt 99fac5e5aa common/rtkit: harden 2025-11-05 09:38:53 +09:00
oysteikt 80d078739b common/udisks2: harden 2025-11-05 09:38:53 +09:00
oysteikt 4d516b7bab common/polkit: apply chroot 2025-11-05 09:38:53 +09:00
oysteikt 31c4434627 home/shell: add shellscript for preparing backup of file 2025-11-05 09:13:17 +09:00
oysteikt be70280f18 home/shell: reactivate functions as shellscripts 2025-11-05 09:09:43 +09:00
oysteikt 704be04e26 common/packages: add more manpages 2025-11-05 08:50:16 +09:00
oysteikt 664be83949 common/packages: split off file from default.nix 2025-11-05 08:49:47 +09:00
oysteikt f2ce070f0b home/firefox: disable additional telemetry options 2025-11-05 08:44:36 +09:00
oysteikt 6d5deb059c hosts/xps16: use stable kernel 2025-11-05 08:43:57 +09:00
oysteikt fe4a25d447 hosts/xps16: disable displaylink 2025-11-05 08:43:22 +09:00
oysteikt 4ad2f1dc61 hosts/xps16: enable apparmor for firefox 2025-11-05 08:43:03 +09:00
oysteikt 52607f7ee6 common/dbus: temporarily undo hardening, system broke :( 2025-11-05 08:41:07 +09:00
oysteikt 27ac053b47 xps16/btrfs/scrub: disable internet, restrict filesystems 2025-10-28 14:32:01 +09:00
oysteikt f2931da4ab common/dbus: harden dbus-broker units 2025-10-28 13:46:26 +09:00
oysteikt a3542e6a6c common: use nsncd instead of nscd 2025-10-28 11:52:49 +09:00
oysteikt 5d866049a0 common: use nftables as firewall 2025-10-28 11:52:09 +09:00
oysteikt 47ddf0cd1e tsuki: move to different machine and reinit 2025-10-24 12:22:01 +09:00
oysteikt 6a4337e34f home/git: don't delete main/master on delete-merged 2025-10-24 11:45:00 +09:00
oysteikt 68268ec2a0 home/fcitx5: fix eval against NixOS 25.11 2025-10-24 11:44:18 +09:00
oysteikt d99347f708 home/shellAliases: fix eval against NixOS 25.11 2025-10-24 11:43:40 +09:00
oysteikt 6158692b97 home/zed: fix a few options 2025-10-12 00:57:10 +09:00
oysteikt bec478767f xps16: change timezone 2025-10-03 10:47:36 +09:00
oysteikt 96631ae9cf home/ssh: register kyoto-u machines 2025-10-03 10:46:51 +09:00
oysteikt 5b4cf2289f home/xdg: set XDG_SCREENSHOTS_DIR 2025-08-29 15:26:01 +02:00
oysteikt 9b15aae9d7 hyprland: add keybind for saved fullscreen screenshots 2025-08-29 15:25:34 +02:00
oysteikt 7f1ca1e761 flake.nix: remove nixGL from pvv home config 2025-08-27 16:57:54 +02:00
oysteikt 0ee8659117 home/zed: use builtin option to configure theme 2025-08-27 16:57:28 +02:00
oysteikt dd3a8975a7 home/breakerbox: make keybase breakers 2025-08-23 21:46:18 +02:00
oysteikt d5a0e9ec2d home/breakerbox: make fcitx5 breaker 2025-08-23 21:44:32 +02:00
oysteikt 36db01748e home/zed: fix config conditionals 2025-08-23 15:42:49 +02:00
oysteikt b941fa4143 home/zed: fix breaker 2025-08-23 15:37:34 +02:00
oysteikt 6916515737 home/fcitx5: use home-manager module options for config 2025-08-23 15:34:16 +02:00
oysteikt dd37bdc08a home/breakerbox: make gtk breaker 2025-08-22 14:51:23 +02:00
oysteikt df745d64cc home/breakerbox: only enable texlive on machines with graphics 2025-08-22 14:39:43 +02:00
oysteikt 652420556c home/breakerbox: add rest of wayland stuff 2025-08-22 14:36:49 +02:00
oysteikt 32a3bd27a8 hosts/dosei: drop 2025-08-22 14:25:51 +02:00
oysteikt 57b1390e45 treewide: get rid of nordic related config 2025-08-22 14:25:51 +02:00
oysteikt 26a8de0e9a home/ghci: init 2025-08-22 14:11:32 +02:00
oysteikt de3aa0a7da tsuki/nginx: enable quic for testmap 2025-08-22 14:10:44 +02:00
oysteikt 74ee5599dd tsuki/kanidm: unpin package 2025-08-22 14:10:43 +02:00
oysteikt 4c2c0bd977 hosts/tsuki: bump kernel version 2025-08-22 14:10:42 +02:00
oysteikt 55f8a7fbf3 flake.nix: update matrix-synapse-next 2025-08-22 14:10:42 +02:00
oysteikt a788f3c087 home/breakerbox: make zathura breaker 2025-08-22 13:48:05 +02:00
oysteikt 65e357e8ff home/breakerbox: make anyrun breaker 2025-08-22 13:48:05 +02:00
oysteikt 690da7585d home/vscode: remove old vendored extension 2025-08-22 13:48:04 +02:00
oysteikt 83c2971bb9 home/breakerbox: make vscode breaker 2025-08-22 13:48:04 +02:00
oysteikt 04dee771e2 home/breakerbox: make zed breaker 2025-08-22 13:48:04 +02:00
oysteikt df56e9bc1c flake.lock: bump 2025-08-20 17:36:33 +02:00
oysteikt 6bd0968075 flake.nix: add pvv home-manager config 2025-08-20 16:52:16 +02:00
oysteikt 549d87eae4 home/zed: register path to nodejs 2025-08-20 16:34:41 +02:00
oysteikt 739c88f2db hosts/xps16: disable ipu6 2025-08-20 16:34:15 +02:00
oysteikt caf215c9a0 hosts/xps16: enable displaylink 2025-08-20 16:34:06 +02:00
oysteikt 57c74d4615 hosts/xps16: pin kernel to 6.15 2025-08-20 16:33:56 +02:00
oysteikt ea872ad977 home/packages: add mumble 2025-08-20 16:33:25 +02:00
oysteikt 22b69810bb xps16/home: additional wayland monitor declarations 2025-08-20 16:15:40 +02:00
oysteikt 1d8897ace8 secrets/common: update github token 2025-08-11 21:23:24 +02:00
oysteikt f426ba832d home/ssh: register more pvv machines 2025-08-11 21:12:24 +02:00
oysteikt 671f4a1a7f home/packages: use gimp3 2025-08-11 21:12:00 +02:00
oysteikt 927577a770 home/breakerbox: add more service breakers 2025-06-04 12:45:18 +02:00
oysteikt 11d7401695 dosei: fix to 6.14 kernel 2025-06-04 12:17:48 +02:00
oysteikt de542913a2 home/helix: init 2025-06-04 12:16:46 +02:00
oysteikt 0bdd97a80b home/breakerbox: add more program breakers 2025-06-04 12:12:36 +02:00
oysteikt 0026cfb484 home/breakerbox: init 2025-06-04 12:01:57 +02:00
oysteikt 465d33fadf home/packages: use unstable discord 2025-05-27 18:31:12 +02:00
oysteikt e85619b5b4 home/downloads-sorter: fix issue where dlsorter ate .tar.*.part files 2025-05-27 16:57:22 +02:00
oysteikt 7100852dde home/zsh: precreate compinit directory with systemd-tmpfiles 2025-05-27 16:24:52 +02:00
oysteikt e55a4a4093 home/hyprland: split into separate files 2025-05-27 16:11:56 +02:00
oysteikt f2f329d6ac home/hyprland: use xdg-desktop-portal-termfilechooser 2025-05-27 13:54:07 +02:00
oysteikt c3d4f91952 home/yazi: init 2025-05-27 13:52:28 +02:00
oysteikt 5f4228eab7 home/hyprland: set session.slice for multiple units 2025-05-27 12:28:02 +02:00
oysteikt 17b79e60bf home/hyprland: enable hyprpolkitagent 2025-05-27 12:23:45 +02:00
oysteikt 8f6c8bc338 common/gnome-keyring: move to session.slice 2025-05-27 12:23:15 +02:00
oysteikt 345e8acbc6 home/anyrun: fix config file 2025-05-27 12:12:18 +02:00
oysteikt 18e37aa599 common/dconf: move to session.slice 2025-05-27 12:12:18 +02:00
oysteikt b97efab47f home/hyprland: add extra xdg portals 2025-05-27 11:15:58 +02:00
oysteikt d77bba0ab1 home/zed: more lsp stuff 2025-05-27 11:08:41 +02:00
oysteikt 1c72aae1bc home/hyprland: swap stop keys 2025-05-27 11:07:31 +02:00
oysteikt 96b66673ec home/modules: start background tasks in background.slice 2025-05-27 11:06:33 +02:00
oysteikt a76415de95 README: add badge 2025-05-21 10:48:38 +02:00
oysteikt 9c73af2b12 home: disable ~/.icons generation 2025-05-21 10:19:22 +02:00
oysteikt ef33e52880 common/docker: split file, fix auto-prune service 2025-05-21 10:03:35 +02:00
oysteikt c71f91a87f common/display-manager: split file, fix sddm theme, fix default compositor choice 2025-05-21 09:55:39 +02:00
oysteikt 8534bc90ea home/shell: restrict shells for cds 2025-05-21 00:26:14 +02:00
oysteikt 3dcab3e966 home/modules/shellAliases: add support for restricting shells 2025-05-21 00:25:47 +02:00
oysteikt abac62b42b nixpkgs 25.05 🎉 2025-05-20 20:57:25 +02:00
oysteikt 9132b537fd common/uptimed: add settings, sd_notify 2025-05-08 16:19:50 +02:00
oysteikt 150089a583 {common,home}/nix: finegrained tokens 2025-05-06 13:05:21 +02:00
oysteikt 045ca620ea kasei: grub -> systemd-boot 2025-05-05 22:30:47 +02:00
oysteikt 3e39d48d27 home/shell: don't load envvars for nushell 2025-05-05 22:29:37 +02:00
oysteikt de1140b84d home/homedir-structure: add more dirs, set mode 2025-05-05 22:29:09 +02:00
oysteikt c114b72b40 home/xdg: set dir modes via tmpfiles 2025-05-05 22:28:42 +02:00
oysteikt b32342219c hosts/xps16: collect bootloader config in one place 2025-05-05 22:27:58 +02:00
oysteikt 6cad08b8f3 home/homedir-structure: use modern tmpfiles api 2025-05-05 21:14:42 +02:00
oysteikt 86fb8dde57 home/shell: use modern tmpfiles api 2025-05-05 21:13:40 +02:00
oysteikt 5c0ab7bfdc home/mpd: use modern tmpfiles api 2025-05-05 21:05:18 +02:00
oysteikt a4e332ced8 home/modules/prism-launcher: use modern tmpfiles api 2025-05-05 21:04:13 +02:00
oysteikt 9349553d3e home/downloads-sorter: sort more stuff 2025-05-05 21:01:09 +02:00
oysteikt 9bad62502d home/modules/downloads-sorter: extend 2025-05-05 21:00:26 +02:00
oysteikt 1b206b70e8 home/xdg: use downloads as download dir 2025-05-05 18:28:18 +02:00
oysteikt b948b6cb7e home/git: properly quote realpath in maintenance preexec script 2025-05-05 18:27:36 +02:00
oysteikt c015ca8a61 home/modules/downloads-sorter: init 2025-05-05 18:27:06 +02:00
oysteikt 495224528e home/ssh: register garp and bolle 2025-05-04 21:33:56 +02:00
oysteikt 50c4b43391 home/tmux: move some settings out of extraConfig 2025-05-04 21:14:56 +02:00
oysteikt 8e15ae90db home/modules/prism-launcher: look for screens in new instance data location 2025-05-04 21:14:32 +02:00
oysteikt a53f2a9a1e treewide: a bit of formatting 2025-05-04 14:32:32 +02:00
oysteikt 29f2fa44fb kasei/programs/steam: init 2025-05-04 14:31:46 +02:00
oysteikt f667e77cdb home/git: fix maintenance preexec script 2025-05-04 14:26:26 +02:00
oysteikt e55dcc2584 home/bottom: don't show temperature sensor data 2025-05-04 14:06:13 +02:00
oysteikt 07ef7a596a home/zed: remove trailing whitespace 2025-05-04 14:05:33 +02:00
oysteikt 07b522969e tsuki/matrix-irc: postgresql.port -> postgresql.settings.port 2025-04-28 15:12:19 +02:00
oysteikt 9567f3177a home: put dconf behind graphics condition 2025-04-28 15:09:35 +02:00
oysteikt e39821c15a flake.lock: bump 2025-04-28 14:59:31 +02:00
oysteikt f38c03d787 europa is kil 2025-04-28 10:45:00 +02:00
oysteikt 68594651ac dosei/home: don't install pcloud 2025-04-28 10:38:37 +02:00
oysteikt f85ed829a9 home/git: preexec maintenance with repo discovery script 2025-04-28 10:31:41 +02:00
oysteikt 479434f156 home/git: misc added settings 2025-04-28 08:57:55 +02:00
oysteikt 1f43c4a4ba common: add loopback addresses for fqdn 2025-04-25 22:48:47 +02:00
oysteikt eb6ae1a054 kasei/systemd-networkd: ignore tailscale0 for wait-online 2025-04-25 22:41:33 +02:00
oysteikt 959e0a5a22 flake.nix: don't include C toolchain in devshell 2025-04-25 16:38:16 +02:00
oysteikt 7e3c6e4d45 home/xdg: add more overrides 2025-04-25 16:36:42 +02:00
oysteikt 48ea97af39 home/xdg: move some envvars to their respective modules 2025-04-25 16:02:28 +02:00
oysteikt e465db8888 home: move nix config to separate module 2025-04-25 15:04:21 +02:00
oysteikt bc1800a1de home: move tmpfiles rules to separate module 2025-04-25 15:00:27 +02:00
oysteikt b1d84ce0c6 home/ssh: use correct ssh key for github 2025-04-25 14:54:04 +02:00
oysteikt 039822db24 flake.nix: point anyrun input at upstream repo 2025-04-25 14:41:50 +02:00
oysteikt 4de32aabb3 home/direnv: set silent = true 2025-04-25 14:41:12 +02:00
oysteikt f78b7be4f4 home: set DO_NOT_TRACK envvar 2025-04-25 14:40:45 +02:00
oysteikt c429cdf347 home/python: collect python config into module 2025-04-25 14:40:28 +02:00
oysteikt 7ca3b76226 home/gtk: gnome.gnome-themes-extra -> gnome-themes-extra 2025-04-25 11:27:54 +02:00
oysteikt 2eef271389 home/xdg: add misc overrides 2025-04-25 11:27:06 +02:00
oysteikt 0a74f8f058 home: prepare not generating ~/.icons for 25.05 2025-04-25 11:27:06 +02:00
oysteikt 64c4c8f121 home/cargo: move config envvar to correct module 2025-04-25 11:27:06 +02:00
oysteikt 342b08c4a2 home/eza: enable icons 2025-04-25 11:27:06 +02:00
oysteikt 655438a544 home/zed: set prediction provider to copilot 2025-04-23 19:50:11 +02:00
oysteikt f55dbaf984 xps16/machines/arch: init 2025-04-22 20:06:50 +02:00
oysteikt a99a522f41 home/sqlite: init 2025-04-22 20:06:07 +02:00
oysteikt ed946ece62 tsuki/matrix/stickers: bump hash for hutao stickerpack 2025-04-12 23:30:30 +02:00
oysteikt 85b7aab992 tsuki/plex: proxy websockets 2025-04-11 09:23:18 +02:00
oysteikt 29eeccdd2f {kasei,xps16}: enable debug info 2025-04-11 09:22:33 +02:00
oysteikt fa5b61f3f8 xps16: use latest kernel 2025-04-10 18:30:36 +02:00
oysteikt 1f2d983f43 home/gtk: use adwaita-dark 2025-04-10 18:29:39 +02:00
oysteikt 70356efa1a home/ssh: better choice of controlPaths 2025-04-09 13:12:24 +02:00
oysteikt 18e932be29 flake.nix: overlay unstable gitoxide 2025-04-09 12:13:07 +02:00
oysteikt 9c26c25419 home/shell: remove alias for zed 2025-04-09 12:12:30 +02:00
oysteikt 9e34c0cd86 home/zed: configure lsps for nix and rust 2025-04-09 12:12:04 +02:00
oysteikt 3dcd926d8b home/zed: fix extension list 2025-04-09 12:11:50 +02:00
oysteikt 13d2ca8338 flake.lock: bump 2025-04-09 07:26:22 +02:00
oysteikt 0f9e01d288 home/shell: watch -> viddy 2025-04-07 08:28:21 +02:00
oysteikt 77e580c918 kasei: fix music bindmount 2025-04-04 00:09:33 +02:00
oysteikt 3c34a1a854 kasei: remove redundant avahi service config 2025-04-03 23:49:59 +02:00
oysteikt 6f3ee68430 kasei: specify dns 2025-04-03 23:46:25 +02:00
oysteikt a30b0f2423 kasei: replace a few symlinks with bindmounts 2025-04-03 23:45:18 +02:00
oysteikt b33aa09212 home/modules/prism-launcher: init 2025-04-03 22:47:45 +02:00
oysteikt f929d267ba home/modules/prism-launcher: init 2025-04-03 19:17:46 +02:00
oysteikt 4d21a1325c home/modules/cargo: remove leftover trace 2025-04-03 18:44:53 +02:00
oysteikt 5f751ffa5b home: import modules in flake.nix 2025-04-03 18:43:37 +02:00
oysteikt f87d54e83b home/ssh: use modern tmpfiles module 2025-04-03 18:37:40 +02:00
oysteikt c2398ba93b home/modules/systemd-tmpfiles: vendor tmpfiles module from nixpkgs 2025-04-03 18:37:06 +02:00
oysteikt cfd3f364a3 home/git: add extra prefix for work repo detection 2025-04-03 16:13:04 +02:00
oysteikt 48ac907d9e home/cargo: init 2025-04-03 16:13:03 +02:00
oysteikt c374c8916e flake.nix: add bcachefs installer iso package 2025-04-03 01:07:10 +02:00
oysteikt 91cc7b69aa kasei: use systemd-networkd instead of networkmanager 2025-04-02 16:02:08 +02:00
oysteikt 81730e52c4 home/firefox: prefer dark mode in css 2025-04-02 15:03:00 +02:00
oysteikt dac61b76cd home/browser: fix home-manager search engine 2025-04-02 14:56:23 +02:00
oysteikt e541f67ecf home/browser: steal github nix config search engine from @pbsds 2025-04-02 14:56:09 +02:00
oysteikt 65d8f6b7b3 home/firefox: cooonf 2025-04-02 14:55:05 +02:00
oysteikt 3ff2fbc293 home: create a few more common dirs via tmpfiles 2025-04-02 13:32:37 +02:00
oysteikt 9fd4401c88 dosei: use systemd-networkd 2025-04-02 13:11:52 +02:00
oysteikt b810921f8b dosei: override boot.kernelPackages 2025-04-02 13:10:03 +02:00
oysteikt 4cef1e6a53 README: create guide to set up new machine 2025-04-02 12:55:24 +02:00
oysteikt 03be7baf9f home/ssh: create mutable_config, use tmpfiles for control masters dir 2025-04-02 12:54:35 +02:00
oysteikt 123bb9a769 home/mpd: create dirs before startup, runtimedir, tmpfiles 2025-04-02 12:53:56 +02:00
oysteikt faaebbedca home: create a few common dirs via tmpfiles 2025-04-02 12:53:12 +02:00
oysteikt 6924ad447c home/shell: create mutable_env.sh via tmpfiles 2025-04-02 12:52:45 +02:00
oysteikt 5cb5595012 dosei: reinstall 2025-04-02 12:51:15 +02:00
oysteikt c941b24880 {common,dosei/home}: set uid to 1000 2025-04-02 12:49:33 +02:00
oysteikt 9616b3ffeb home/packages: add foliate, sort seahorse 2025-04-02 09:00:21 +02:00
oysteikt a943a9a1a6 flake.nix: move several overlays to flake outputs 2025-04-02 08:57:25 +02:00
oysteikt 64b1be2a3c common: don't start docker on boot 2025-04-01 11:05:53 +02:00
oysteikt 9ae857fb74 common: disable kernel module locking 2025-04-01 10:53:21 +02:00
oysteikt 770fd05e26 common/docker: enable autopruning 2025-04-01 10:53:03 +02:00
oysteikt f216517412 dosei: proxyjump through microbel instead of drolsum 2025-04-01 09:20:29 +02:00
oysteikt 24572e5055 home/ssh: enable control master sockets 2025-04-01 09:13:45 +02:00
oysteikt 66abe25322 home/mpd: move update-database path unit to separate module 2025-03-31 17:00:42 +02:00
oysteikt ad9ebff11f tsuki/zfs: pin kernel + zfs package 2025-03-29 00:59:36 +01:00
oysteikt da55b9e803 flake.lock: bump 2025-03-29 00:59:30 +01:00
oysteikt ee369aa153 home/zed: enable a few more extensions 2025-03-28 17:24:23 +01:00
oysteikt d9b81a8457 home/fcitx5: force unset *_IM_MODULE envvars 2025-03-28 16:52:57 +01:00
oysteikt 31b14ad781 tsuki/kanidm: pin package to 1_5 2025-03-28 09:16:51 +01:00
oysteikt d8b10d9aa6 flake.nix: remove mpd overlay 2025-03-28 09:12:30 +01:00
oysteikt dc66ec321a flake.nix: overlay linuxPackages 2025-03-28 00:41:00 +01:00
oysteikt ea11dbb6ae flake.nix: inherit (nixpkgs) lib as output 2025-03-27 16:38:59 +01:00
oysteikt 12a1f5deea home/hyprland: float gimps 'Open Image' dialog properly 2025-03-27 15:44:05 +01:00
oysteikt 1b1fd42b61 home/git: use upstream git-maintenance units 2025-03-27 15:06:44 +01:00
oysteikt 0b24782307 home/zed: install cmake extension 2025-03-27 15:05:34 +01:00
oysteikt 307d1e9217 home/zed: use unstable-pkgs 2025-03-27 15:05:22 +01:00
oysteikt 1307e2908e home/zed: unset TMUX_PANE in terminal 2025-03-27 14:21:21 +01:00
oysteikt 67f257c027 home/zed: reduce terminal fontsize 2025-03-27 14:13:29 +01:00
oysteikt 4874b74060 home/hyprland: enable hyprpaper 2025-03-27 13:56:21 +01:00
oysteikt 0930701e43 home/hyprland: fix exit 2025-03-27 12:39:19 +01:00
oysteikt ee60382833 home/hyprland: remove outdated todos 2025-03-27 12:39:02 +01:00
oysteikt b3cd28d215 home/hyprland: fix boomer 2025-03-27 12:38:40 +01:00
oysteikt deb4dc24ea home/hyprland: float picture in picture 2025-03-27 12:38:15 +01:00
oysteikt 3a857a6df5 home/hyprlock: lock immediately 2025-03-27 10:52:01 +01:00
oysteikt a2f54a8f72 home/shell: cloc -> tokei 2025-03-26 14:15:04 +01:00
oysteikt 7a2155b30c home/modules/shellAliases: move logic info format, rewrite text gen 2025-03-25 13:26:42 +01:00
oysteikt f765e90de2 home/direnv: remove auto-prune module (moved to modules) 2025-03-24 16:26:03 +01:00
oysteikt e298262966 home/modules: move newsboat automation to module 2025-03-24 15:38:58 +01:00
oysteikt 3269834e3f home/modules: add wip module downloads-sorter 2025-03-24 14:57:02 +01:00
oysteikt a04c13b8d9 home/modules: add wip module downloads-siphon 2025-03-24 14:55:33 +01:00
oysteikt 7189c245b5 home/modules: add automation for direnv 2025-03-24 14:23:43 +01:00
oysteikt f09a1ee2d0 home/modules: add wip clean nixpkgs-review worktrees service 2025-03-24 14:16:58 +01:00
oysteikt a552a0d60d home: move nix-index automation to modules 2025-03-24 14:08:15 +01:00
oysteikt d65f7eebda home: move neovim automation to modules 2025-03-24 14:08:15 +01:00
oysteikt a36869282a home: move gpg automation to modules 2025-03-24 13:44:59 +01:00
oysteikt e32051c662 home/hyprland: format window rules, add zed to ws3 2025-03-24 13:07:02 +01:00
oysteikt 1454a1dcd6 flake.lock: bump 2025-03-24 12:31:33 +01:00
oysteikt ca3ecd39ee home/shell: add a few more aliases 2025-03-24 11:13:25 +01:00
oysteikt 11119d0a79 home/neovim: add vim-trailing-whitespace plugin, sort plugins 2025-03-24 11:12:48 +01:00
oysteikt 2d3e7f8825 home/mpv: misc config 2025-03-24 11:12:11 +01:00
oysteikt 5cebcf6a60 home/hyprland: tile nsxiv 2025-03-24 11:11:55 +01:00
oysteikt ec670da983 home/bash: set a few shell options 2025-03-24 11:11:28 +01:00
oysteikt 0580da2dca home/packages: add imv 2025-03-24 11:11:02 +01:00
oysteikt 8897177f51 home/xdg/mimetypes: add more mimetypes 2025-03-24 11:10:19 +01:00
oysteikt adcb61bc09 home/nix-channel-update: idle scheduling 2025-03-24 07:36:16 +01:00
oysteikt 548b4a26df home/gtk: modify dir bookmarks 2025-03-22 20:11:00 +01:00
oysteikt 3ab68507c1 home/hyprland: add hyprpolkitagent 2025-03-22 20:09:33 +01:00
oysteikt 3d22177948 home/hyprland: register pvv monitors 2025-03-22 20:09:20 +01:00
oysteikt 21ee8bb547 home/ssh/pvv: add host kommode 2025-03-17 19:18:29 +01:00
oysteikt 9675ab4f15 flake.lock: bump 2025-03-17 10:33:15 +01:00
oysteikt e1e9e7a398 common/openssh: more config 2025-03-17 09:48:19 +01:00
oysteikt 8e5e6d7a44 home/uv: init 2025-03-16 20:16:46 +01:00
oysteikt 661d2e0010 flake.lock: bump 2025-03-15 02:21:46 +01:00
oysteikt dc87ac678f flake.nix: remove unused inputs, bump inputs 2025-03-15 02:21:40 +01:00
oysteikt 433b8b46a8 common/userdbd: fix 2025-03-15 02:20:25 +01:00
oysteikt f80069b1a0 home/rofi: vendor theme 2025-03-15 01:43:28 +01:00
oysteikt cce75f872f common: enable more systemd stuff 2025-03-15 00:44:43 +01:00
oysteikt 00c97b8da1 common: protect kernel image 2025-03-15 00:44:42 +01:00
oysteikt 5197de939a common/nix: restrict users 2025-03-15 00:44:42 +01:00
oysteikt 1c71991f09 common/graphical-desktop: enable 2025-03-15 00:44:42 +01:00
oysteikt 824d964d61 common/udisks2: enable 2025-03-15 00:44:42 +01:00
oysteikt a1e5d18687 home/shell: add 'e' -> '$EDITOR' alias 2025-03-15 00:44:42 +01:00
oysteikt 33fb8a9209 common/locate: use root user (plocate does not support localuser) 2025-03-15 00:44:41 +01:00
oysteikt ac657c4a82 common: lock kernel modules 2025-03-15 00:44:41 +01:00
oysteikt 21187f3fb8 common: more tpm2 stuff 2025-03-15 00:44:41 +01:00
oysteikt 6200f89ef7 common/bluetooth: powerOnBoot by default 2025-03-15 00:44:41 +01:00
oysteikt cdefda67de common: use tmpfs for /tmp 2025-03-15 00:44:41 +01:00
oysteikt 5a50e7fd02 common/nix: use latest 2025-03-15 00:44:40 +01:00
oysteikt 80668c0fd3 common: enable sysrq 2025-03-15 00:44:40 +01:00
oysteikt 881c5f3633 common/nixseparatedebuginfod: init 2025-03-15 00:44:40 +01:00
oysteikt c885d4f515 common/locate: init 2025-03-15 00:44:40 +01:00
oysteikt 6633ff106c home/zed: add a few more extensions 2025-03-13 18:50:48 +01:00
oysteikt e6f84b1a68 home/zed: add some file ext <-> lang mappings 2025-03-13 18:50:32 +01:00
oysteikt 2a53c6b420 tsuki/nginx: set LimitNOFILE 2025-03-13 16:28:05 +01:00
oysteikt c68a6515ef tsuki/postgresql: 14 -> 17 2025-03-13 16:24:19 +01:00
oysteikt ccc72027c5 tsuki/ssh: set Macs 2025-03-13 16:23:46 +01:00
oysteikt a11ba13813 flake.nix: add overlays for tsuki 2025-03-13 16:21:46 +01:00
oysteikt edec7f8e9b flake.lock: bump 2025-03-13 16:19:15 +01:00
oysteikt bcf29eb442 {common,home}/nix: use sops templates for access tokens 2025-03-13 15:13:59 +01:00
oysteikt f8a11ae4fb common/nix: upgrade CPU scheduling policy 2025-03-13 15:06:53 +01:00
oysteikt 583db61b3f common/nix: auto optimise, auto gc 2025-03-13 15:06:52 +01:00
oysteikt bbaf7eb9e2 home/zed: more config 2025-03-13 14:02:32 +01:00
oysteikt e275f2ff72 home/zed: use bleeding edge package 2025-03-13 14:02:05 +01:00
oysteikt 8bc4caac12 flake.nix: add nixosModules and homeModules 2025-03-04 14:03:37 +01:00
oysteikt a5c5350f80 common/bluetooth: enable A2DP sink 2025-03-04 13:39:33 +01:00
oysteikt a1a98fc580 common/pipewire: fix 2025-03-04 13:39:04 +01:00
oysteikt 2e83ced9a0 home/mpris-proxy: init 2025-03-04 13:37:23 +01:00
oysteikt c1dcf35d63 common/pipewire: enable wireplumber, add bluetooth config 2025-03-04 13:05:51 +01:00
oysteikt 317e729844 home: let multiple nushell integrations depend on nushell.enable 2025-03-04 13:04:43 +01:00
oysteikt fba3b614bd common/blueman: init 2025-03-04 13:04:43 +01:00
oysteikt e46453cdeb home/nushell: init 2025-02-27 18:00:31 +01:00
oysteikt edff5b3313 kasei/stateVersion: 22.05 -> 25.05 2025-02-26 10:21:42 +01:00
oysteikt 5a168a6e5d kasei/postgres: bump from 14 -> 17 2025-02-26 10:21:02 +01:00
oysteikt b2e9ae5130 home/stateVersion: 22.05 -> 25.05 2025-02-26 10:14:02 +01:00
oysteikt 9772592ea7 home/shell: fix gitoxide alias 2025-02-26 10:02:40 +01:00
oysteikt ea12f16718 home/git: fzf -> skim, coreutils -> uutils 2025-02-26 10:02:39 +01:00
oysteikt 0bd882eb1a home/skim: init 2025-02-26 09:57:29 +01:00
oysteikt 8471c5139e home/shell: s -> nsxiv 2025-02-25 23:39:17 +01:00
oysteikt 2dac13a50f home/shell: g -> gix 2025-02-25 23:38:32 +01:00
oysteikt 67ecc9552a home/shell: add a bunch of system tool replacements, change aliasing convention 2025-02-25 23:28:02 +01:00
oysteikt 4cf009d5ce home/packages: add a bunch of cli tools 2025-02-25 23:28:02 +01:00
oysteikt 350654cd03 home/vscode: add vscoq extension 2025-02-24 10:45:47 +01:00
oysteikt 2ab3e40dbd home/git: add reset-to-upstream alias, sort aliases 2025-02-24 10:45:23 +01:00
oysteikt d91827be7e xps16: enable adb 2025-02-24 10:43:30 +01:00
oysteikt b1f2e24b2b overlays/pcloud: init 2025-02-24 10:42:47 +01:00
oysteikt 6cacc32ec7 flake.lock: bump 2025-02-04 19:02:04 +01:00
oysteikt 27e4978f8a home/gtk: more gtk bookmark dirs 2025-02-04 18:59:46 +01:00
oysteikt 3cc4b1473e flake.lock: bump 2024-12-22 23:44:10 +01:00
oysteikt 6a0f5c8686 home/vscode: replace keyboard-quickfix with native solution 2024-12-22 23:43:18 +01:00
oysteikt 9aaea1c28e home/hyprland: add keybinds for moving/resizing windows 2024-12-22 23:41:39 +01:00
oysteikt 39e718701b flake.nix: allow dotnet 6 packages for naps2 2024-12-13 22:07:24 +01:00
oysteikt d0d9238c2c kasei: disable zfs 2024-12-13 22:06:32 +01:00
oysteikt 6475f80982 kasei: switch back to nvidia drivers 2024-12-13 22:06:12 +01:00
oysteikt dc4284a1a0 flake.nix: add nixos-hardware modules for kasei 2024-12-13 22:04:20 +01:00
oysteikt fdf5f47462 flake.nix: overlay bleeding edge mpd 2024-12-13 22:03:56 +01:00
oysteikt 2d7577ee99 home/ssh: add ustetind to pvv 2024-12-09 21:34:36 +01:00
oysteikt e42f0db2dc dosei/home: add groovy to env packages 2024-12-09 21:32:25 +01:00
oysteikt fbf3a6bc29 home/shell: add alias for zed 2024-12-09 16:19:56 +01:00
oysteikt 55582df9f1 home/shell: add backwards compat for nsxiv 2024-12-09 16:18:13 +01:00
oysteikt a42e66b9a5 home/zed: adjust a bunch of settings 2024-12-09 16:17:41 +01:00
oysteikt bc3e2e648f xps16/tlp: add some recommended settings from arch wiki 2024-12-08 18:30:58 +01:00
oysteikt a9565942fd home/vscode: adhere to xkb options 2024-12-08 18:30:38 +01:00
oysteikt 77fa595e86 home/hyprland: add a few more window rules 2024-12-08 18:30:05 +01:00
oysteikt 0e81a9bc81 xps16/fprintd: init 2024-12-08 18:29:37 +01:00
oysteikt 029196bc84 flake.lock: bump 2024-12-08 15:13:20 +01:00
oysteikt 54c53130bd home/hyprland: fix windowrule for vscode 2024-12-08 15:10:08 +01:00
oysteikt a369c33a44 home/dconf: prefer dark colorscheme 2024-12-08 15:08:25 +01:00
oysteikt 096783c00a home/anyrun: show results immediately 2024-12-08 15:07:56 +01:00
oysteikt b3cd1f66f0 hosts/xps16: enable ipu6 2024-12-08 14:59:34 +01:00
oysteikt f3727dc392 home/hyprland: use shorthand for lib.getExe 2024-12-08 14:28:14 +01:00
oysteikt 6d86cce0ff home/hyprland: fix fullscreen command 2024-12-08 14:01:11 +01:00
oysteikt f5ca2d5050 home/hyprland: swap out rofi for anyrun 2024-12-08 14:00:48 +01:00
oysteikt 8a4a6fc2e3 home/packages: add mission-center 2024-12-08 13:46:08 +01:00
oysteikt 637234c492 home/fcitx5: correct systemd target 2024-12-08 13:45:50 +01:00
oysteikt 0e169d4a26 home/fcitx5: add systemd service alias 2024-12-08 13:45:18 +01:00
oysteikt 4f04827b14 hosts/xps16: enable blueman 2024-12-08 13:44:56 +01:00
oysteikt cd906a2075 overlays/wayland-ime: use text-input version 3 for electron apps 2024-12-08 13:44:11 +01:00
oysteikt dd1b1dae8b fixup! home/anyrun: init 2024-12-08 13:43:34 +01:00
oysteikt 502503add8 home/zed: re-enable 2024-12-08 13:43:12 +01:00
oysteikt e4fe666d29 home/hyprland: finalize uwsm on startup 2024-12-08 13:42:37 +01:00
oysteikt ac8e5dfe8c home/hyprland: quit gracefully via uwsm 2024-12-08 13:42:23 +01:00
oysteikt 2b9b14b0c1 home/hyprland: dont spawn oneshot commands via uwsm 2024-12-08 13:42:04 +01:00
oysteikt 163085a548 home/anyrun: init 2024-12-08 13:40:51 +01:00
oysteikt 28469c1876 home: disable xsession in wayland 2024-12-06 10:33:35 +01:00
oysteikt 4e98f67748 dosei: enable wayland 2024-12-06 10:31:35 +01:00
oysteikt 102df55379 home/packages: add webcamoid 2024-12-06 10:30:23 +01:00
oysteikt 7293373b25 home/hyprland: fix a few systemd unit targets 2024-12-05 21:14:32 +01:00
oysteikt 130c794082 common/sddm: fix theme 2024-12-05 20:34:52 +01:00
oysteikt 3becdc7da4 hyprland: enable uwsm 2024-12-05 20:30:56 +01:00
oysteikt 3c6bb656e9 home/{hyprland,waybar}: init 2024-12-05 19:43:58 +01:00
oysteikt 19e89266a7 package-overrides/{fcitx5-mozc,mozc}: remove 2024-12-05 19:06:53 +01:00
oysteikt fe50198759 xps16/tlp: init 2024-12-05 19:06:52 +01:00
oysteikt a2a0356bf6 thermald: move from common to xps16 2024-12-05 19:06:52 +01:00
oysteikt ffee26da2b common/nix: add shells to registry 2024-12-05 18:22:02 +01:00
oysteikt 101f0f6ca0 flake.nix: remove fcitx5-mozc from unstable overlay 2024-12-05 10:30:30 +01:00
oysteikt acd1ac89e5 flake.lock: bump 2024-12-05 10:20:46 +01:00
oysteikt cb3318bc93 home/vscode: fix zsh tab completion in other terminal issue 2024-12-05 10:10:02 +01:00
oysteikt e9fb3d71d8 common: use latest linux kernel by default 2024-12-05 10:09:18 +01:00
oysteikt c17b068aae common/fwupd: init 2024-12-05 10:08:52 +01:00
oysteikt ec0b505f7b {dosei,europa}: add nixos-hardware imports 2024-12-05 10:07:23 +01:00
oysteikt abb5ae9473 flake.nix: expose input sources as packages 2024-12-05 10:06:36 +01:00
oysteikt b41c16e234 common/fonts: add noto fonts into default queue 2024-12-04 23:07:04 +01:00
oysteikt a1f48392ed common/sddm: init 2024-12-04 23:07:01 +01:00
oysteikt f0a869d49b treewide: misc optimizations for xps 2024-12-04 23:05:47 +01:00
oysteikt 3315535a2f xps16: init 2024-12-04 20:06:57 +01:00
oysteikt 3bf91d810f common/libinput: move to own nix file 2024-12-03 13:32:15 +01:00
oysteikt 67f156c3b2 common/irqbalance: move to own nix file 2024-12-03 13:30:24 +01:00
oysteikt 020bc31713 common/thermald: enable 2024-12-03 13:21:59 +01:00
oysteikt 8a41a97bbf home/xdg: set base dirs for npm 2024-12-03 13:20:41 +01:00
oysteikt 6a70c086f9 common: add h7x4 to rtkit group 2024-12-03 13:20:09 +01:00
oysteikt e75bba4e36 common/xfce: enable by default 2024-12-03 13:19:33 +01:00
oysteikt 9393d47390 home/psd: init 2024-12-02 16:11:16 +01:00
oysteikt 5f8001dc86 common: fix global wireshark permissions 2024-12-02 12:07:39 +01:00
oysteikt f9d175fc43 common: disable a bunch of kernel modules by default 2024-12-02 08:42:46 +01:00
oysteikt 387ff505b5 common: enable tpm by default 2024-12-02 08:42:45 +01:00
oysteikt 967ebc0bba common/journald: store logs for 30 days 2024-12-02 08:23:17 +01:00
oysteikt 430a223a63 common/userborn: init 2024-12-02 08:22:14 +01:00
oysteikt 32077bf639 common/uptimed: init 2024-12-02 08:20:57 +01:00
oysteikt 967d92ae48 {tsuki,dosei}: use sops templates for wstunnel 2024-12-02 08:14:49 +01:00
oysteikt cf90dd577c home: fix pvv ssh jumps for dosei 2024-12-02 08:13:06 +01:00
oysteikt 265ba953f0 common: temporarily disable systemd strictShellChecks 2024-11-29 01:36:34 +01:00
oysteikt 82bba20e46 home/zed: temporarily disable 2024-11-29 01:35:44 +01:00
oysteikt 0abd0c6251 home/ssh: simplify pvv ssh config 2024-11-29 01:35:14 +01:00
oysteikt e0683af8eb flake.nix: remove overlayed calibre 2024-11-29 01:32:44 +01:00
oysteikt 8aaad61fd3 flake.lock: bump 2024-11-29 01:32:04 +01:00
oysteikt 1301e848ed tsuki/hedgedoc: use sops templates for env, dedent 2024-11-29 00:41:30 +01:00
oysteikt fac13db8cb tsuki/configuration: use sops templates for cirno drive creds 2024-11-29 00:27:44 +01:00
oysteikt edf81976ac tsuki/osuchan: use sops template for secrets 2024-11-29 00:17:35 +01:00
oysteikt 1d42923e3e flake.nix: remove inputs.secrets 2024-11-28 23:56:39 +01:00
oysteikt c332f5dff6 tsuki/minecraft: remove usage of secrets module 2024-11-28 23:53:57 +01:00
oysteikt 908c48be89 tsuki/matrix: remove usage of secrets module 2024-11-28 23:49:50 +01:00
oysteikt 8ef308d3e6 tsuki/configuration: remove usage of secrets module 2024-11-28 16:47:33 +01:00
oysteikt 219d364353 tsuki/kanidm: add toggleable debug flag 2024-11-28 16:36:45 +01:00
oysteikt 4082011c98 tsuki/coturn: remove usage of secrets module 2024-11-28 16:36:03 +01:00
oysteikt 45c51639ca tsuki/nginx: fix minecraft map hosting 2024-11-28 16:34:43 +01:00
oysteikt ec628240b0 README: add a few useful commands 2024-11-28 16:33:51 +01:00
oysteikt 596d5429ba tsuki/nginx: general optimizations 2024-11-28 16:32:07 +01:00
oysteikt 0ceeb49c23 home/direnv-auto-prune: only run if direnv has prunable state 2024-11-28 16:31:28 +01:00
oysteikt e6d429a970 tsuki/matrix-appservice-irc: reinit 2024-11-28 16:31:27 +01:00
oysteikt 7c36272914 home/neovim: remove unused plugin 2024-11-19 13:54:37 +01:00
oysteikt 3efeeed023 home/mpd: misc upgrades 2024-11-19 13:54:15 +01:00
oysteikt 4e1eb31336 home: split programs/services into their own modules 2024-11-19 10:42:23 +01:00
oysteikt b8bd8612bb home: prefer modules over direct package imports 2024-11-19 10:26:21 +01:00
oysteikt dc79a237b3 tsuki: fixes for nixos 24.11 2024-11-18 15:18:52 +01:00
oysteikt a4cc770a08 home/neovim: misc plugin changes 2024-11-18 14:29:27 +01:00
oysteikt 9526c31c23 common: enable systemd strict shellchecks 2024-11-18 14:28:44 +01:00
oysteikt 03aa1c3c39 dosei: disable nix-builders 2024-11-18 14:28:21 +01:00
oysteikt e341e72875 treewide: update to nixos 24.11 2024-11-18 14:27:31 +01:00
oysteikt d65273e67a home/tmux: add missing scripts 2024-11-18 14:27:30 +01:00
oysteikt 2b8a661288 tsuki/coturn: use default certificate 2024-11-15 12:15:32 +01:00
oysteikt 4371bf9bd0 mozc/jawiki: bump 2024-11-15 12:10:50 +01:00
oysteikt 2c325cf540 treewide: remove more usage of nix-secrets repository 2024-11-15 10:20:32 +01:00
oysteikt e0a957e448 home/git: add fixup-interactive script 2024-11-14 14:03:36 +01:00
oysteikt 35e75ec9ad home/git: unroll log alias format strings 2024-11-13 17:09:49 +01:00
oysteikt fb6cb3f09d home: add uid/gid options, correctly configure atuin 2024-11-13 17:04:21 +01:00
oysteikt 84c9562bfc home/git: add rebase-fixups script 2024-11-13 16:57:47 +01:00
oysteikt a5cad921ff home/git: add git-post-pr script 2024-11-13 16:57:47 +01:00
oysteikt 49f0a457e5 home/git: add git-fixup-fixup script 2024-11-13 16:32:36 +01:00
oysteikt 61a22b96cd flake.lock: bump 2024-10-08 01:15:59 +02:00
oysteikt 822ec8cb95 home/newsboat: add sources 2024-10-08 01:14:15 +02:00
oysteikt 01ad63a473 home/xmonad: compile :) 2024-10-08 01:13:50 +02:00
oysteikt 942c99b0f6 home/packages: add VPN stuff to packages 2024-10-08 01:13:25 +02:00
oysteikt 0b54e2c090 home/shell: create alias for connecting to work VPN 2024-10-08 01:13:00 +02:00
oysteikt 50d845a772 kasei: add testconfig file 2024-10-05 12:19:26 +02:00
oysteikt 17f019cbc0 kasei: binfmt i686-linux 2024-10-05 12:09:15 +02:00
oysteikt db82ee3419 kasei: add arch nspawn container 2024-10-05 12:08:58 +02:00
oysteikt b3e782d716 home/git: add tmcommit script 2024-10-05 12:07:34 +02:00
oysteikt 40d5a8af88 home/git: add alias for fetching submodules 2024-10-04 16:32:07 +02:00
oysteikt 9115c0c5c2 home/git: set pager 2024-10-02 12:31:10 +02:00
oysteikt 1d8c2752f5 hosts/common: remove unused module args 2024-09-26 10:23:14 +02:00
oysteikt 7500197568 extendedLib: attrsets.concatAttrs -> lib.mergeAttrsList 2024-09-26 10:14:42 +02:00
oysteikt 0ea394dbf9 home/qt: fix theme 2024-09-26 10:06:52 +02:00
oysteikt f7030546a5 home/xsession: set 2024-09-26 10:06:52 +02:00
oysteikt 7d80f6941f home/packages: sxiv -> nsxiv 2024-09-26 10:06:52 +02:00
oysteikt ea541f2f2b home: prefer modules for some packages 2024-09-26 09:56:38 +02:00
oysteikt 7d7d0868ce dosei: install nrf tools 2024-09-25 13:00:06 +02:00
oysteikt d47f1102e6 home/browser: update bookmarks 2024-09-25 12:19:04 +02:00
oysteikt bd1cbe53b9 home/newsboat: update sources 2024-09-25 12:18:30 +02:00
oysteikt 7c79a6c37b europa: enable journald-remote 2024-09-04 10:35:34 +02:00
oysteikt fbd5b3798b dosei: enable journald-remote 2024-09-04 10:33:16 +02:00
oysteikt e8db1d6612 home/packages: add a few more packages 2024-09-04 10:31:47 +02:00
oysteikt 46e12cfc9e home/vscode: nit 2024-09-04 10:30:29 +02:00
oysteikt 2b81c752f0 home/zed: use unstable package 2024-09-04 10:30:00 +02:00
oysteikt c533a7df56 home/ssh: add missing pvv hosts 2024-09-04 10:29:31 +02:00
oysteikt 3de3b459ad home/gh: fix pager 2024-09-04 10:29:16 +02:00
oysteikt 28364a66f1 home: enable _JAVA_AWT_WM_NONPARENTING 2024-09-04 10:28:54 +02:00
oysteikt 94bddadd50 common: harden logrotate 2024-08-27 14:54:33 +02:00
oysteikt 810311bbc2 common: harden cups 2024-08-27 14:54:16 +02:00
oysteikt 0a5e8774c7 home/packages: add lnav 2024-08-27 14:53:38 +02:00
oysteikt f8bd568bd6 home/aria2: init 2024-08-24 01:58:39 +02:00
oysteikt 20296fa754 home/vscode: update extensions 2024-08-24 01:53:18 +02:00
oysteikt d7a6ac7c81 kasei: enable btrfs scrubbing 2024-08-24 01:45:35 +02:00
oysteikt dc947a2edc common: enable services.irqbalance 2024-08-24 01:45:02 +02:00
oysteikt 2d34226781 package-overrides: add links to pr 2024-08-19 23:12:14 +02:00
oysteikt d7d83da9a6 home/xdg: add some more directory spec envvars 2024-08-16 12:39:57 +02:00
246 changed files with 8877 additions and 3923 deletions
+14 -11
View File
@@ -1,10 +1,11 @@
keys:
- &gpg_h7x4 F7D37890228A907440E1FD4846B9228E814A2AAC
- &host_tsuki age1c92j4w0gqh32hwssl5m2mfrggssxax9pge8qxwytv9lmrnfttcvqdrgsst
- &host_tsuki age1ue7uv559wf6tfjsutn9dsh07vpk53sgrfkdzqy4ltg6dnxcxeg7srx800u
- &host_kasei age1eu2a6m3adakfzelfa9pqpl74a5dz0wkyr0v7gegm5ajnx7aqmqcqsp2ftc
- &host_dosei age179y7apa80p9unvyjtsphpzyhve90ex986vlxkx43xt9n6m7en3csqnug7c
- &host_europa age14mer45e52r2q4uz8n3fmv69tvk8gvwany4m4ndudud8ajv3jm4nqdj9m6a
- &host_dosei age1s6s4w7cdfgajm30z9gy8va8pvs2lrzk5gnsg0hmn5z2sl8z36seqej406r
- &host_xps16 age1np3fg9ue2tp4l47x7waapvjxh5zcaye2j54laapy7uklamve2c4qv3gytm
- &home age10f4a5acpar8vwz3v298r3nv7gggfpmyh4wxpkc2hwq9paq0scf8qee8lau
- &home_dosei age17acs5lw7npma4sughxq3wj3cs5gjkenqdzscyvaks0er33n8gupsce7jlp
creation_rules:
- path_regex: secrets/common.yaml
@@ -15,8 +16,9 @@ creation_rules:
- *host_tsuki
- *host_kasei
- *host_dosei
- *host_europa
- *host_xps16
- *home
- *home_dosei
- path_regex: secrets/home.yaml
key_groups:
@@ -24,6 +26,14 @@ creation_rules:
- *gpg_h7x4
age:
- *home
- *home_dosei
- path_regex: secrets/xps16.yaml
key_groups:
- pgp:
- *gpg_h7x4
age:
- *host_xps16
- path_regex: secrets/kasei.yaml
key_groups:
@@ -45,10 +55,3 @@ creation_rules:
- *gpg_h7x4
age:
- *host_dosei
- path_regex: secrets/europa.yaml
key_groups:
- pgp:
- *gpg_h7x4
age:
- *host_europa
+73 -3
View File
@@ -1,5 +1,7 @@
[![built with nix](https://builtwithnix.org/badge.svg)](https://builtwithnix.org)
![works on my machine](https://img.shields.io/badge/status-works_on_my_machine-blue)
# Nix Dotfiles
These are my dotfiles for several nix machines.
@@ -14,7 +16,8 @@ Here are some of the interesting files and dirs:
| `/modules` | Custom nixos modules that I use in my own configuration. If you see options that does not appear in [NixOS Search][nixos-search], they might be defined here. |
| `/package-overrides` | Updated or pinned versions of packages that have not been upstreamed to nixpkgs (yet). |
| `/secrets` | Encrypted [sops-nix][sops-nix] secrets. |
| `flake.nix` | The root of everyting. Defines the inputs and outputs of the project. Also applies misc overlays and adds config-wide modules. See [Nix Flakes][nix-flakes] for more information. |
| `flake.nix` | The root of everything. Defines the inputs and outputs of the project. Also applies misc overlays and adds config-wide modules. See [Nix Flakes][nix-flakes] for more information. |
## Hosts
@@ -22,8 +25,7 @@ Here are some of the interesting files and dirs:
|------|--------------|---------|
| `Tsuki` | Dell Poweredge r710 server | Data storage / Build server / Selfhosted services. This server hosts a wide variety of services, including websites, matrix server, git repos, CI/CD and more. **This is probably the most interesting machine to pick config from** |
| `Kasei` | AMD Zen 2 CPU / AMD GPU - desktop computer | Semi-daily driver. This is my main computer at home. |
| `Dosei` | Dell Optiplex | Work computer, mostly used for development and testing. |
| `Europa` | Dell Optiplex | Other work computer, used as nix builder for `Dosei`. |
## home-manager configuration
@@ -36,6 +38,74 @@ Here are some of the interesting files and dirs:
| `/home/services` | Configuration for services/daemons that are user-specific. |
| `/home/shell.nix` | Shell-agnostic configuration. This includes aliases, envvars, functions, etc. |
## Some useful long commands
Build configuration without switching:
```
nix build .#nixosConfigurations.tsuki.config.system.build.toplevel -L
```
Check why configuration depends on package:
```
NIXPKGS_ALLOW_INSECURE=1 nix why-depends .#nixosConfigurations.tsuki.config.system.build.toplevel .#pkgs.suspiciousPackage
```
Re-encrypt sops secrets with new key:
```
sops updatekeys secrets/hosts/file.yml
```
## Setting up a new machine
### 1. Move gpg keys to
```console
# Export on some machine
gpg --export-secret-keys --armor nani.wtf > ~/SD/gpg_keys.pem
# Import
gpg --import ~/SD/gpg_keys.pem
```
### 2. Generating host keys, and converting to age keys for nix-sops host secrets
```console
# Create host keys
ssh-keygen -A
# Convert public key to age format
nix-shell -p ssh-to-age --run 'cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age'
# Register this key in `.sops.yaml`
$EDITOR .sops.yaml
# Update keys
sops updatekeys secrets/common.yaml
sops updatekeys secrets/$(hostname).yaml # if present
```
### 3. Creating new ssh key for nix-sops home secrets
```console
# Create new key
ssh-keygen -t ed25519 -b 4096 -C "sops-nix home key" -f ~/.ssh/id_ed25519_home_sops -N ''
# Convert public key to age format
nix-shell -p ssh-to-age --run 'cat ~/.ssh/id_ed25519_home_sops.pub | ssh-to-age'
# Register this key in `.sops.yaml`
$EDITOR .sops.yaml
# Update keys
sops updatekeys secrets/common.yaml
sops updatekeys secrets/home.yaml
```
[home-manager]: https://github.com/nix-community/home-manager
[nixos-search]: https://search.nixos.org/options
[sops-nix]: https://github.com/Mic92/sops-nix
Generated
+91 -197
View File
@@ -1,30 +1,34 @@
{
"nodes": {
"dotfiles": {
"flake": false,
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1654179945,
"narHash": "sha256-vnD7vu/hRBPoqL6Wse9CELitW30a9P++QTPnNm1qHjE=",
"ref": "master",
"rev": "37bdd48de4bfa8e03a8ab5ef840b2509e193e6a1",
"revCount": 96,
"type": "git",
"url": "https://git.pvv.ntnu.no/oysteikt/dotfiles"
"lastModified": 1768920986,
"narHash": "sha256-CNzzBsRhq7gg4BMBuTDObiWDH/rFYHEuDRVOwCcwXw4=",
"owner": "nix-community",
"repo": "disko",
"rev": "de5708739256238fb912c62f03988815db89ec9a",
"type": "github"
},
"original": {
"ref": "master",
"type": "git",
"url": "https://git.pvv.ntnu.no/oysteikt/dotfiles"
"owner": "nix-community",
"ref": "v1.13.0",
"repo": "disko",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
@@ -33,55 +37,6 @@
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"fonts": {
"flake": false,
"locked": {
"lastModified": 1668957008,
"narHash": "sha256-er2eUfNSG9qdBh0JvtxtftQjFfTFjRqqD8dnk5nZ1qw=",
"path": "/home/h7x4/git/fonts",
"type": "path"
},
"original": {
"path": "/home/h7x4/git/fonts",
"type": "path"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -89,40 +44,20 @@
]
},
"locked": {
"lastModified": 1718530513,
"narHash": "sha256-BmO8d0r+BVlwWtMLQEYnwmngqdXIuyFzMwvmTcLMee8=",
"lastModified": 1769580047,
"narHash": "sha256-tNqCP/+2+peAXXQ2V8RwsBkenlfWMERb+Uy6xmevyhM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "a1fddf0967c33754271761d91a3d921772b30d0e",
"rev": "366d78c2856de6ab3411c15c1cb4fb4c2bf5c826",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.05",
"ref": "release-25.11",
"repo": "home-manager",
"type": "github"
}
},
"home-manager-local": {
"inputs": {
"nixpkgs": [
"nixpkgs-unstable"
]
},
"locked": {
"lastModified": 1719170506,
"narHash": "sha256-AROqng7/S3mTByq8DBVR6r0iW1yZH+otJkqOwLHvELE=",
"ref": "refs/heads/fix-stalonetrayrc-path",
"rev": "0e5656163c2f9ac6e2cc4de3b44beb7a137abbe6",
"revCount": 3588,
"type": "git",
"url": "file:///home/h7x4/git/home-manager"
},
"original": {
"type": "git",
"url": "file:///home/h7x4/git/home-manager"
}
},
"matrix-synapse-next": {
"inputs": {
"nixpkgs": [
@@ -130,18 +65,18 @@
]
},
"locked": {
"lastModified": 1717234745,
"narHash": "sha256-MFyKRdw4WQD6V3vRGbP6MYbtJhZp712zwzjW6YiOBYM=",
"owner": "dali99",
"repo": "nixos-matrix-modules",
"rev": "d7dc42c9bbb155c5e4aa2f0985d0df75ce978456",
"type": "github"
"lastModified": 1769430305,
"narHash": "sha256-ae92wLbdzLAFIHP3EigPCQzG4MSrxN4Nq4QQjQNqPvg=",
"ref": "main",
"rev": "45e302b9ff3835229cf9b76c62bceb11904725d8",
"revCount": 87,
"type": "git",
"url": "https://git.pvv.ntnu.no/oysteikt/nixos-matrix-modules"
},
"original": {
"owner": "dali99",
"ref": "v0.6.0",
"repo": "nixos-matrix-modules",
"type": "github"
"ref": "main",
"type": "git",
"url": "https://git.pvv.ntnu.no/oysteikt/nixos-matrix-modules"
}
},
"maunium-stickerpicker": {
@@ -185,71 +120,88 @@
"minecraft": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs-unstable"
]
],
"systems": "systems"
},
"locked": {
"lastModified": 1719278718,
"narHash": "sha256-gWQb4P9CZgKzTn4F4eWMYeUv2AQOXFlcFmFXh2apoyA=",
"lastModified": 1770000653,
"narHash": "sha256-QO/twGynxjOSUDtxbqJLshc/Q5/wImLH5O6KV2p9eoE=",
"owner": "infinidoge",
"repo": "nix-minecraft",
"rev": "b6ff85f3b416a700ac35e33c214d7c9f4fe071fa",
"rev": "6a2ddb643aaf7949caa6158e718c5efc3dda7dc1",
"type": "github"
},
"original": {
"owner": "infinidoge",
"ref": "master",
"repo": "nix-minecraft",
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1769302137,
"narHash": "sha256-QEDtctEkOsbx8nlFh4yqPEOtr4tif6KTqWwJ37IM2ds=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "a351494b0e35fd7c0b7a1aae82f0afddf4907aa8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1719145550,
"narHash": "sha256-K0i/coxxTEl30tgt4oALaylQfxqbotTSNb1/+g+mKMQ=",
"lastModified": 1769900590,
"narHash": "sha256-I7Lmgj3owOTBGuauy9FL6qdpeK2umDoe07lM4V+PnyA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e4509b3a560c87a8d4cb6f9992b8915abf9e36d8",
"rev": "41e216c0ca66c83b12ab7a98cc326b5db01db646",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-24.05",
"ref": "nixos-25.11",
"type": "indirect"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1719099622,
"narHash": "sha256-YzJECAxFt+U5LPYf/pCwW/e1iUd2PF21WITHY9B/BAs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5e8e3b89adbd0be63192f6e645e0a54080004924",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1719254875,
"narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=",
"lastModified": 1769983348,
"narHash": "sha256-mXYq4h7AFmbLMQtINwejLLL3DiW/ERJbg5UXqMTEV2M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60",
"rev": "eb8d947de7b05897b2b5f4117d184f9c9846cd06",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"ref": "nixpkgs-unstable",
"type": "indirect"
}
},
"nixpkgs-yet-unstabler": {
"locked": {
"lastModified": 1770025348,
"narHash": "sha256-nUJyE7QwmFQZ46YpgKdhkvacWnxiPVG0H1u96yTbnGI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0b407490c176a5e0d0af9e105108e534e93bbeeb",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"osuchan": {
"inputs": {
"nixpkgs": [
@@ -257,11 +209,11 @@
]
},
"locked": {
"lastModified": 1672838459,
"narHash": "sha256-SIXzj9fbSvr/jfhhil+0cS7I6KONijdH80PFGxJi+CA=",
"lastModified": 1742203788,
"narHash": "sha256-nRqyf+msCPEXvvXF6bvfiYH/B089dqWPc7ljRXieA7g=",
"ref": "refs/heads/master",
"rev": "392fb541ce39f1f52908eee336d5ed409cd798ed",
"revCount": 42,
"rev": "c4e353e745b4012feb75dd1c4405a71f6318ed02",
"revCount": 51,
"type": "git",
"url": "file:///home/h7x4/git/osuchan-line-bot"
},
@@ -272,53 +224,31 @@
},
"root": {
"inputs": {
"dotfiles": "dotfiles",
"fonts": "fonts",
"disko": "disko",
"home-manager": "home-manager",
"home-manager-local": "home-manager-local",
"matrix-synapse-next": "matrix-synapse-next",
"maunium-stickerpicker": "maunium-stickerpicker",
"minecraft": "minecraft",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable",
"nixpkgs-yet-unstabler": "nixpkgs-yet-unstabler",
"osuchan": "osuchan",
"secrets": "secrets",
"sops-nix": "sops-nix",
"vscode-server": "vscode-server"
}
},
"secrets": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"dirtyRev": "1d1e3c1a3293e22be504749eb92ac3b050cd8622-dirty",
"dirtyShortRev": "1d1e3c1-dirty",
"lastModified": 1683506783,
"narHash": "sha256-iwnpd6v4tKXFDTRomzJxwYPr2mm2JR9DCCnkqsofX5c=",
"type": "git",
"url": "file:///home/h7x4/git/nix-secrets"
},
"original": {
"type": "git",
"url": "file:///home/h7x4/git/nix-secrets"
"sops-nix": "sops-nix"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
]
},
"locked": {
"lastModified": 1719268571,
"narHash": "sha256-pcUk2Fg5vPXLUEnFI97qaB8hto/IToRfqskFqsjvjb8=",
"lastModified": 1769921679,
"narHash": "sha256-twBMKGQvaztZQxFxbZnkg7y/50BW9yjtCBWwdjtOZew=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "c2ea1186c0cbfa4d06d406ae50f3e4b085ddc9b3",
"rev": "1e89149dcfc229e7e2ae24a8030f124a31e4f24f",
"type": "github"
},
"original": {
@@ -341,42 +271,6 @@
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"vscode-server": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1713958148,
"narHash": "sha256-8PDNi/dgoI2kyM7uSiU4eoLBqUKoA+3TXuz+VWmuCOc=",
"owner": "nix-community",
"repo": "nixos-vscode-server",
"rev": "fc900c16efc6a5ed972fb6be87df018bcf3035bc",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-vscode-server",
"type": "github"
}
}
},
"root": "root",
+182 -81
View File
@@ -1,18 +1,23 @@
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
nixpkgs.url = "nixpkgs/nixos-25.11";
# nixpkgs.url = "nixpkgs/nixos-unstable";
nixpkgs-unstable.url = "nixpkgs/nixpkgs-unstable";
nixpkgs-yet-unstabler.url = "github:NixOS/nixpkgs/master";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
url = "github:nix-community/home-manager/release-25.11";
# url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
dotfiles = {
url = "git+https://git.pvv.ntnu.no/oysteikt/dotfiles?ref=master";
flake = false;
disko = {
url = "github:nix-community/disko/v1.13.0";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
@@ -23,45 +28,18 @@
inputs.nixpkgs.follows = "nixpkgs";
};
# TODO: fix website
# website = {
# url = "git+https://git.pvv.ntnu.no/oysteikt/nani.wtf?ref=main";
# url = "path:/home/h7x4/git/nani.wtf";
# inputs.nixpkgs.follows = "nixpkgs";
# };
maunium-stickerpicker = {
url = "github:h7x4/maunium-stickerpicker-nix/0.1.0";
inputs.nixpkgs.follows = "nixpkgs";
};
minecraft = {
url = "github:infinidoge/nix-minecraft";
url = "github:infinidoge/nix-minecraft/master";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
matrix-synapse-next = {
url = "github:dali99/nixos-matrix-modules/v0.6.0";
inputs.nixpkgs.follows = "nixpkgs";
};
vscode-server = {
url = "github:nix-community/nixos-vscode-server";
inputs.nixpkgs.follows = "nixpkgs";
};
ra-multiplex = {
url = "github:pr2502/ra-multiplex";
inputs.nixpkgs.follows = "nixpkgs";
};
# Nix expressions and keys (TODO: move keys to another solution like agenix)
# which should be kept from the main repo for privacy reasons.
#
# Includes stuff like usernames, emails, ports, other server users, ssh hosts, etc.
secrets = {
# TODO: Push this to a remote.
url = "git+file:///home/h7x4/git/nix-secrets";
url = "git+https://git.pvv.ntnu.no/oysteikt/nixos-matrix-modules?ref=main";
inputs.nixpkgs.follows = "nixpkgs";
};
};
@@ -70,18 +48,17 @@
self,
nixpkgs,
nixpkgs-unstable,
nixpkgs-yet-unstabler,
home-manager,
disko,
nixos-hardware,
dotfiles,
matrix-synapse-next,
maunium-stickerpicker,
minecraft,
osuchan,
secrets,
sops-nix,
vscode-server,
ra-multiplex
# website
# anyrun,
}: let
system = "x86_64-linux";
@@ -89,55 +66,108 @@
inherit system;
config = {
allowUnfree = true;
allowUnfreePredicate = pkg: nixpkgs.lib.elem (nixpkgs.lib.getName pkg) [
"discord"
"geogebra"
"ipu6-camera-bins"
"ipu6-camera-bins-unstable"
"ivsc-firmware"
"ivsc-firmware-unstable"
"semshi"
"vim-polyglot"
"vim-trailing-whitespace"
];
android_sdk.accept_license = true;
segger-jlink.acceptLicense = true;
permittedInsecurePackages = [
"segger-jlink-qt4-794l"
"segger-jlink-qt4-810"
];
};
overlays = let
nonrecursive-unstable-pkgs = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
in [
(self: super: {
inherit (nonrecursive-unstable-pkgs) atuin wstunnel;
})
overlays = [
self.overlays.pcloud
self.overlays.unstableLinuxPackages
self.overlays.waylandImeIntegration
self.overlays.gitoxide
(self: super: {
ra-multiplex = ra-multiplex.packages.${system}.default;
})
# https://github.com/NixOS/nixpkgs/pull/251706
(self: super: {
mozc = self.qt6Packages.callPackage ./package-overrides/mozc.nix { };
fcitx5-mozc = self.callPackage ./package-overrides/fcitx5-mozc.nix { };
})
(self: super: {
mpv-unwrapped = super.mpv-unwrapped.override {
ffmpeg = super.ffmpeg_6-full;
};
})
minecraft.overlays.default
osuchan.overlays.default
];
};
pkgs = import nixpkgs pkgs-config;
unstable-pkgs = import nixpkgs-unstable pkgs-config;
yet-unstabler-pkgs = import nixpkgs-yet-unstabler pkgs-config;
in {
inherit pkgs;
inherit (nixpkgs) lib;
extendedLib = import ./lib { stdlib = pkgs.lib; };
inherit pkgs;
inputs = pkgs.lib.mapAttrs (_: src: src.outPath) inputs;
packages.${system} = {
inherit (pkgs) kanidm pcloud;
devShells.${system}.default = pkgs.mkShellNoCC {
packages = with pkgs; [ sops ];
};
devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [ sops ];
packages.${system} = {
bcachefsInstallerIso = let
nixosSystem = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal-new-kernel-no-zfs.nix"
({ lib, pkgs, ... }: {
boot.supportedFilesystems = [ "bcachefs" ];
boot.kernelPackages = lib.mkOverride 0 pkgs.linuxPackages_latest;
})
];
};
in nixosSystem.config.system.build.isoImage;
};
overlays = let
nonrecursive-unstable-pkgs = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
config.segger-jlink.acceptLicense = true;
config.permittedInsecurePackages = [
"segger-jlink-qt4-796s"
];
};
in {
pcloud = import ./overlays/pcloud.nix {
inherit (nixpkgs) lib;
pkgs = nonrecursive-unstable-pkgs;
};
gitoxide = _: _: {
gitoxide = nonrecursive-unstable-pkgs.gitoxide;
};
unstableLinuxPackages = _: _: {
linuxPackages_latest = nonrecursive-unstable-pkgs.linuxPackages_latest;
};
waylandImeIntegration = import ./overlays/wayland-ime-integration.nix;
};
nixosModules = {
machineVars = ./modules/machineVars.nix;
socketActivation = ./modules/socketActivation.nix;
duperemove = ./modules/duperemove.nix;
};
homeModules = {
colors = ./home/modules/colors.nix;
direnv-auto-prune = ./home/modules/programs/direnv/auto-prune.nix;
downloads-sorter = ./home/modules/services/downloads-sorter.nix;
gpg = ./home/modules/programs/gpg;
mpd-auto-updater = ./home/modules/services/mpd.nix;
neovim-auto-clean-swapfiles = ./home/modules/programs/neovim/auto-clean-swapfiles.nix;
nix-index-auto-update-database = ./home/modules/programs/nix-index/auto-update-database.nix;
prism-launcher = ./home/modules/programs/prism-launcher;
shellAliases = ./home/modules/shellAliases.nix;
systemd-tmpfiles = ./home/modules/systemd-tmpfiles.nix;
};
homeConfigurations = {
@@ -147,12 +177,12 @@
username = "h7x4";
homeDirectory = "/home/h7x4";
stateVersion = "22.05";
stateVersion = "25.05";
configuration = {
imports = [
./home/home.nix
./modules/machineVars.nix
];
] ++ (builtins.attrValues self.homeModules);
machineVars = {
headless = false;
@@ -163,6 +193,55 @@
};
};
};
pvv = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit inputs;
inherit unstable-pkgs;
inherit yet-unstabler-pkgs;
inherit (self) extendedLib;
machineName = "pvv-machine";
machineVars = {
headless = true;
# fixDisplayCommand = "echo 'not available'";
gaming = false;
development = true;
laptop = false;
battery = null;
wlanInterface = null;
wayland = false;
};
};
modules = [
./home/home.nix
./modules/machineVars.nix
inputs.sops-nix.homeManagerModules.sops
({ config, pkgs, lib, ... }: {
home = {
username = lib.mkForce "oysteikt";
homeDirectory = lib.mkForce "/home/pvv/d/oysteikt";
stateVersion = "25.05";
packages = [
# NOTE: nix on pvv machines is severely outdated
# putting it in the path of home-manager
# will ensure we use the new one by default
config.nix.package
];
};
nix.package = pkgs.nix;
nix.settings.use-xdg-base-directories = lib.mkForce false;
local.shell.aliases."Nix Stuff" = {
nxr = lib.mkForce "echo \"Local rebuilds are not available on this machine\"";
nxrl = lib.mkForce "echo \"Local rebuilds are not available on this machine\"";
};
})
] ++ (builtins.attrValues self.homeModules);
};
};
nixosConfigurations = let
@@ -176,8 +255,8 @@
specialArgs = {
inherit inputs;
inherit unstable-pkgs;
inherit yet-unstabler-pkgs;
inherit (self) extendedLib;
secrets = secrets.outputs.settings;
} // (extraConfig.specialArgs or { });
modules = [
@@ -189,7 +268,6 @@
./modules/machineVars.nix
./modules/socketActivation.nix
secrets.outputs.nixos-config
sops-nix.nixosModules.sops
({ config, ... }:
@@ -198,14 +276,16 @@
useGlobalPkgs = true;
extraSpecialArgs = {
inherit inputs;
inherit unstable-pkgs;
inherit yet-unstabler-pkgs;
inherit (self) extendedLib;
inherit (config) machineVars;
secrets = secrets.outputs.settings;
machineName = name;
};
sharedModules = [
inputs.sops-nix.homeManagerModules.sops
];
] ++ (builtins.attrValues self.homeModules);
users.h7x4.imports = [
./home/home.nix
@@ -221,14 +301,35 @@
"specialArgs"
]));
in {
dosei = nixSys "dosei" { };
kasei = nixSys "kasei" { };
europa = nixSys "europa" { };
kasei = nixSys "kasei" {
modules = [
nixos-hardware.nixosModules.common-pc
nixos-hardware.nixosModules.common-pc-ssd
nixos-hardware.nixosModules.common-cpu-amd
nixos-hardware.nixosModules.common-cpu-amd-pstate
nixos-hardware.nixosModules.common-gpu-nvidia-nonprime
];
};
xps16 = nixSys "xps16" {
modules = [
nixos-hardware.nixosModules.common-hidpi
nixos-hardware.nixosModules.common-pc-laptop
nixos-hardware.nixosModules.common-pc-laptop-ssd
nixos-hardware.nixosModules.common-cpu-intel
nixos-hardware.nixosModules.common-gpu-intel
disko.nixosModules.default
];
};
tsuki = nixSys "tsuki" {
modules = [
nixos-hardware.nixosModules.common-cpu-amd
nixos-hardware.nixosModules.common-pc-ssd
disko.nixosModules.default
matrix-synapse-next.nixosModules.default
osuchan.outputs.nixosModules.default
vscode-server.nixosModules.default
maunium-stickerpicker.nixosModules.default
(args: import minecraft.outputs.nixosModules.minecraft-servers (args // {
+192
View File
@@ -0,0 +1,192 @@
{ config, lib, machineVars, ... }:
let
inherit (lib) mkForce mkIf optionals;
graphics = !machineVars.headless;
in
{
imports = [
./config/gtk.nix
./programs/nix.nix
./programs/ahoviewer.nix
./programs/alacritty.nix
./programs/anki.nix
./programs/anyrun
./programs/aria2.nix
./programs/atuin.nix
./programs/bash.nix
./programs/bat.nix
./programs/beets.nix
./programs/bottom.nix
./programs/cargo.nix
# ./programs/comma.nix
./programs/delta.nix
./programs/direnv
./programs/element-desktop.nix
./programs/emacs
./programs/eza.nix
./programs/fastfetch.nix
./programs/feh.nix
./programs/firefox.nix
./programs/fzf.nix
./programs/gdb.nix
./programs/gh-dash.nix
./programs/gh.nix
./programs/ghci.nix
./programs/git
./programs/gpg.nix
./programs/home-manager.nix
./programs/hyprland
./programs/jq.nix
./programs/less.nix
./programs/man.nix
./programs/meli.nix
./programs/mpv.nix
./programs/ncmpcpp.nix
./programs/neomutt.nix
./programs/neovim
./programs/newsboat
./programs/nix-index
./programs/nushell.nix
./programs/nyxt.nix
./programs/obs-studio.nix
./programs/obsidian.nix
./programs/pandoc.nix
./programs/prism-launcher.nix
./programs/python.nix
./programs/qutebrowser.nix
./programs/rclone.nix
./programs/ripgrep.nix
./programs/rofi
./programs/skim.nix
./programs/sqlite.nix
./programs/ssh
./programs/taskwarrior.nix
./programs/tealdeer
./programs/texlive.nix
./programs/thunderbird.nix
./programs/tmux
./programs/uv.nix
./programs/vscode
./programs/waybar.nix
./programs/yazi.nix
./programs/yt-dlp.nix
./programs/zathura.nix
./programs/zed
./programs/zoxide.nix
./programs/zsh
./services/copyq.nix
./services/dunst.nix
./services/fcitx5.nix
./services/gnome-keyring.nix
./services/mpd.nix
./services/mpris-proxy.nix
./services/network-manager.nix
./services/nix-channel-update.nix
./services/psd.nix
./services/pueue.nix
./services/tumblerd.nix
] ++ (optionals (!machineVars.wayland) [
./programs/xmonad
# ./programs/xmobar
./services/picom.nix
./services/polybar.nix
./services/screen-locker.nix
# ./services/stalonetray.nix
./services/sxhkd.nix
]);
programs.aria2.enable = true;
programs.atuin.enable = true;
programs.bash.enable = true;
programs.bat.enable = true;
programs.beets.enable = true;
programs.bottom.enable = true;
programs.cargo.enable = true;
# programs.comma.enable = true;
programs.direnv.enable = true;
programs.eza.enable = true;
programs.fastfetch.enable = true;
programs.fzf.enable = true;
programs.gdb.enable = true;
programs.gh-dash.enable = true;
programs.gh.enable = true;
programs.ghci.enable = true;
programs.git.enable = true;
programs.gpg.enable = true;
programs.helix.enable = true;
programs.home-manager.enable = true;
programs.jq.enable = true;
programs.less.enable = true;
programs.man.enable = true;
programs.meli.enable = true;
programs.neomutt.enable = true;
programs.neovim.enable = true;
programs.nix-index.enable = true;
programs.nushell.enable = true;
programs.pandoc.enable = true;
programs.python.enable = true;
programs.rclone.enable = true;
programs.ripgrep.enable = true;
programs.skim.enable = true;
programs.sqlite.enable = true;
programs.ssh.enable = true;
programs.tealdeer.enable = true;
programs.tmux.enable = true;
programs.uv.enable = true;
programs.yazi.enable = true;
programs.yt-dlp.enable = true;
programs.zoxide.enable = true;
programs.zsh.enable = true;
services.pueue.enable = true;
gtk.enable = graphics;
programs.ahoviewer.enable = graphics;
programs.alacritty.enable = graphics;
programs.anki.enable = graphics;
programs.chromium.enable = graphics;
programs.element-desktop.enable = graphics;
programs.emacs.enable = graphics;
programs.feh.enable = graphics;
programs.firefox.enable = graphics;
programs.mpv.enable = graphics;
programs.ncmpcpp.enable = graphics;
programs.newsboat.enable = graphics;
programs.nyxt.enable = graphics;
programs.obs-studio.enable = graphics;
programs.obsidian.enable = false;
programs.prism-launcher.enable = graphics;
programs.qutebrowser.enable = graphics;
programs.rofi.enable = graphics;
programs.taskwarrior.enable = graphics;
programs.texlive.enable = graphics;
programs.thunderbird.enable = graphics;
programs.vscode.enable = graphics;
programs.zathura.enable = graphics;
programs.zed-editor.enable = graphics;
services.copyq.enable = graphics;
services.dunst.enable = graphics;
services.gnome-keyring.enable = graphics;
services.kbfs.enable = graphics;
services.keybase.enable = graphics;
services.mpd.enable = graphics;
services.mpris-proxy.enable = graphics;
services.network-manager-applet.enable = graphics;
services.psd.enable = graphics;
services.tumblerd.enable = graphics;
i18n.inputMethod = mkIf graphics {
enable = true;
type = "fcitx5";
};
programs.anyrun.enable = machineVars.wayland;
programs.waybar.enable = machineVars.wayland;
wayland.windowManager.hyprland.enable = machineVars.wayland;
}
+129
View File
@@ -0,0 +1,129 @@
{ config, lib, ... }:
let
cfg = config.services.downloads-sorter;
in
{
services.downloads-sorter = {
enable = true;
mappings = {
"archives" = [
"*.rar"
"*.zip"
"*.7z"
"*.tar"
"*.tar.bz2"
"*.tar.gz"
"*.tar.lz4"
"*.tar.lzma"
"*.tar.sz"
"*.tar.sz"
"*.tar.xz"
"*.tar.zst"
"*.tbz"
"*.tbz2"
"*.tgz"
"*.tlz4"
"*.tlzma"
"*.tsz"
"*.txz"
"*.tzst"
"*.bz2"
"*.gz"
"*.lz4"
"*.lzma"
"*.sz"
"*.sz"
"*.xz"
"*.zst"
];
"pictures" = {
createDirIfNotExists = false;
globs = [
"*.gif"
"*.jpeg"
"*.jpg"
"*.png"
"*.svg"
"*.webp"
];
};
"docs" = {
createDirIfNotExists = false;
globs = [
"*.md"
"*.pdf"
"*.PDF" # why do people do this
"*.docx"
"*.doc"
"*.xlsx"
"*.xls"
"*.ppt"
"*.pptx"
"*.odt"
"*.ods"
"*.odp"
"*.odg"
"*.odf"
];
};
"books" = {
createDirIfNotExists = false;
globs = [ "*.epub" ];
};
"videos" = {
createDirIfNotExists = false;
globs = [
"*.mp4"
"*.webm"
"*.mov"
];
};
"isos" = [
"*.iso"
"*.img"
];
"jars" = [ "*.jar" ];
"txt" = [ "*.txt" ];
"patches" = [
"*.patch"
"*.diff"
];
};
};
systemd.user.tmpfiles.settings."10-downloads-sorter-service" = let
inherit (cfg) downloadsDirectory;
inherit (config.xdg) userDirs;
symlink = link: target: {
"${link}".L = {
user = config.home.username;
mode = "0770";
argument = "${target}";
};
"${target}".d = {
user = config.home.username;
mode = "0770";
};
};
in lib.mkMerge [
(symlink "${downloadsDirectory}/books" "${userDirs.documents}/books/downloads")
(symlink "${downloadsDirectory}/docs" "${userDirs.documents}/downloads")
(symlink "${downloadsDirectory}/pictures" "${userDirs.pictures}/downloads")
(symlink "${downloadsDirectory}/videos" "${userDirs.videos}/downloads")
];
}
+46
View File
@@ -0,0 +1,46 @@
{ config, ... }:
{
systemd.user.tmpfiles.settings."05-homedir" = let
home = config.home.homeDirectory;
user = config.home.username;
defaultDirConf = {
d = {
inherit user;
mode = "0700";
};
};
symlink = target: {
L = {
inherit user;
argument = target;
mode = "0600";
};
};
in {
"${home}/SD" = defaultDirConf;
"${home}/ctf" = defaultDirConf;
"${home}/git" = defaultDirConf;
"${home}/pvv" = defaultDirConf;
"${home}/tmp" = defaultDirConf;
"${home}/work" = defaultDirConf;
"${home}/pictures/icons" = defaultDirConf;
"${home}/pictures/photos" = defaultDirConf;
"${home}/pictures/screenshots" = defaultDirConf;
"${home}/pictures/stickers" = defaultDirConf;
"${home}/pictures/wallpapers" = defaultDirConf;
"${home}/documents/books" = defaultDirConf;
"${home}/documents/manuals" = defaultDirConf;
"${home}/documents/music-sheets" = defaultDirConf;
"${home}/documents/scans" = defaultDirConf;
"${home}/documents/schematics" = defaultDirConf;
"${home}/Downloads" = symlink "${home}/downloads";
"${config.xdg.dataHome}/wallpapers" = symlink "${home}/pictures/wallpapers";
"${config.systemd.user.sessionVariables.TEXMFHOME}" = symlink "${home}/git/texmf";
};
}
+15 -11
View File
@@ -1,18 +1,18 @@
{ pkgs, config, machineVars, ... }:
{ pkgs, config, ... }:
{
gtk = pkgs.lib.mkIf (!machineVars.headless) {
enable = true;
font = {
name = "Droid Sans";
};
gtk = {
font.name = "Droid Sans";
iconTheme = {
package = pkgs.papirus-icon-theme;
name = "Papirus";
package = pkgs.papirus-icon-theme;
};
theme = {
package = pkgs.vimix-gtk-themes;
name = "VimixDark";
name = "Adwaita-dark";
package = pkgs.gnome-themes-extra;
};
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
gtk3.bookmarks = map (s: "file://${config.home.homeDirectory}/${s}") [
@@ -22,10 +22,14 @@
"music"
".config"
".local/share"
# "Dropbox"
"SD"
"git"
"git/pvv"
"pvv"
"nix"
"work"
"ctf"
];
gtk4.theme = config.gtk.theme;
};
}
+38 -9
View File
@@ -1,21 +1,50 @@
{ config, ... }:
{ config, lib, ... }:
let
cfg = config.xdg.userDirs;
in
{
imports = [
./mimetypes.nix
./directory-spec-overrides.nix
];
xdg = {
enable = true;
userDirs = {
enable = true;
desktop = "${config.home.homeDirectory}/Desktop";
documents = "${config.home.homeDirectory}/documents";
download = "${config.home.homeDirectory}/Downloads";
music = "${config.home.homeDirectory}/music";
pictures = "${config.home.homeDirectory}/pictures";
publicShare = "${config.home.homeDirectory}/public";
templates = "${config.home.homeDirectory}/templates";
videos = "${config.home.homeDirectory}/videos";
setSessionVariables = true;
desktop = lib.mkDefault "${config.home.homeDirectory}/Desktop";
documents = lib.mkDefault "${config.home.homeDirectory}/documents";
download = lib.mkDefault "${config.home.homeDirectory}/downloads";
music = lib.mkDefault "${config.home.homeDirectory}/music";
pictures = lib.mkDefault "${config.home.homeDirectory}/pictures";
projects = lib.mkDefault "${config.home.homeDirectory}/git";
publicShare = lib.mkDefault "${config.home.homeDirectory}/public";
templates = lib.mkDefault "${config.home.homeDirectory}/templates";
videos = lib.mkDefault "${config.home.homeDirectory}/videos";
};
};
systemd.user.sessionVariables.XDG_SCREENSHOTS_DIR = "${cfg.pictures}/screenshots";
systemd.user.tmpfiles.settings."05-xdg-userdirs" = let
dirCfg = {
d = {
user = config.home.username;
mode = "0700";
};
};
in {
"${cfg.desktop}" = dirCfg;
"${cfg.documents}" = dirCfg;
"${cfg.download}" = dirCfg;
"${cfg.music}" = dirCfg;
"${cfg.pictures}" = dirCfg;
"${cfg.publicShare}" = dirCfg;
"${cfg.templates}" = dirCfg;
"${cfg.videos}" = dirCfg;
"${config.systemd.user.sessionVariables.XDG_SCREENSHOTS_DIR}" = dirCfg;
};
}
+46 -5
View File
@@ -2,46 +2,87 @@
{
nix.settings.use-xdg-base-directories = true;
home.sessionVariables = let
home.preferXdgDirectories = true;
systemd.user.sessionVariables = let
inherit (config.xdg) dataHome cacheHome configHome userDirs;
runtimeDir = "/run/user/${toString config.home.uid}";
in {
TEXMFHOME = "${dataHome}/texmf";
TEXMFVAR = "${cacheHome}/texlive";
TEXMFCONFIG = "${configHome}/texlive";
EM_CONFIG = "${configHome}/emscripten/config";
EM_CACHE = "${cacheHome}/emscripten/cache";
EM_PORTS = "${dataHome}/emscripten/cache";
PSQL_HISTORY = "${dataHome}/psql_history";
SQLITE_HISTORY= "${dataHome}/sqlite_history";
MYSQL_HISTFILE = "${dataHome}/mysql_history";
NODE_REPL_HISTORY = "${dataHome}/node_repl_history";
GDB_HISTFILE = "${dataHome}/gdb_history";
PYTHON_HISTORY = "${dataHome}/python_history";
HISTFILE = "${dataHome}/bash_history";
CALCHISTFILE = "${dataHome}/calc_history";
GHCUP_USE_XDG_DIRS = "true";
MIX_XDG = "true";
__GL_SHADER_DISK_CACHE_PATH = "${cacheHome}/nv";
_JAVA_OPTIONS = "-Djava.util.prefs.userRoot=${configHome}/java";
ANDROID_USER_HOME = "${dataHome}/android";
AZURE_CONFIG_DIR = "${dataHome}/azure";
CARGO_HOME = "${dataHome}/cargo";
BZRPATH = "${configHome}/bazaar";
BZR_PLUGIN_PATH = "${dataHome}/bazaar";
BZR_HOME = "${cacheHome}/bazaar";
CUDA_CACHE_PATH = "${cacheHome}/nv";
DISCORD_USER_DATA_DIR = "${dataHome}/discord";
DOCKER_CONFIG = "${configHome}/docker";
DOTNET_CLI_HOME = "${dataHome}/dotnet";
DOT_SAGE = "${configHome}/sagemath";
ELM_HOME = "${configHome}/";
FFMPEG_DATADIR = "${configHome}/ffmpeg";
GOCACHE = "${cacheHome}/go/build";
GOMODCACHE = "${cacheHome}/go/mod";
GOPATH = "${dataHome}/go";
GRIPHOME = "${configHome}/grip";
GRADLE_USER_HOME = "${dataHome}/gradle";
GRIPHOME = "${configHome}/grip";
ICEAUTHORITY = "${cacheHome}/ICEauthority";
NIMBLE_DIR = "${dataHome}/nimble";
NLTK_DATA = "${dataHome}/nltk_data";
NODE_COMPILE_CACHE = "${cacheHome}/node-compile-cache";
NPM_CONFIG_CACHE = "${cacheHome}/npm";
NPM_CONFIG_INIT_MODULE = "${configHome}/npm/config/npm-init.js";
NPM_CONFIG_TMP = "${runtimeDir}/npm";
NRFUTIL_HOME = "${dataHome}/nrfutil";
NUGET_PACKAGES = "${cacheHome}/nuget-packages";
OPAMROOT = "${dataHome}/opam";
PARALLEL_HOME = "${configHome}/parallel";
PGPASSFILE = "${configHome}/pg/pgpass";
PSQLRC = "${configHome}/pg/psqlrc";
PYENV_ROOT = "${dataHome}/pyenv";
RUFF_CACHE_DIR = "${cacheHome}/ruff";
RUSTUP_HOME = "${dataHome}/rustup";
RYE_HOME = "${dataHome}/rye";
STACK_ROOT = "${dataHome}/stack";
W3M_DIR = "${dataHome}/w3m";
WINEPREFIX = "${dataHome}/wine";
SBT_OPTS = lib.concatStringsSep " " [
"-Dsbt.ivy.home=${cacheHome}/ivy"
"-Dsbt.boot.directory=${cacheHome}/sbt/boot"
"-Dsbt.preloaded=${cacheHome}/sbt/preloaded"
"-Dsbt.global.base=${cacheHome}/sbt"
"-Dsbt.global.staging=${cacheHome}/sbt/staging"
"-Dsbt.global.zinc=${cacheHome}/sbt/zinc"
"-Dsbt.dependency.base=${cacheHome}/sbt/dependency"
"-Dsbt.repository.config=${configHome}/sbt/repositories"
"-Dsbt.global.settings=${configHome}/sbt/global"
"-Dsbt.global.plugins=${configHome}/sbt/plugins"
"-Dmaven.repo.local=${cacheHome}/maven/repository"
"-Divy.settings.dir=${configHome}/ivy2"
"-Divy.home=${cacheHome}/ivy2"
"-Divy.cache.dir=${cacheHome}/ivy2/cache"
];
# TODO: these needs to be set before the user session has fully initialized
# XINITRC = "$XDG_CONFIG_HOME/x11/initrc";
# XAUTHORITY
+99 -12
View File
@@ -61,6 +61,26 @@ let
woff2 = "font/woff2";
};
archive = {
"7z" = "application/x-7z-compressed";
ar = "application/x-archive";
bz2 = "application/x-bzip2";
deb = "application/x-debian-package";
gzip = "application/gzip";
lz = "application/x-lzip";
lzma = "application/x-lzma";
lzo = "application/x-lzop";
rar = "application/vnd.rar";
rar-compressed = "application/x-rar-compressed";
tar = "application/x-tar";
tar-compressed = "application/x-gtar";
x-zip = "multipart/x-zip";
xz = "application/x-xz";
zip = "application/zip";
zip-compressed = "application/x-zip-compressed";
zst = "application/zstd";
};
documents = {
azv = "application/vnd.amazon.ebook";
cbr = "application/vnd.comicbook+rar";
@@ -72,31 +92,98 @@ let
pdf = "application/pdf";
};
office = {
doc = "application/msword";
docm = "application/vnd.ms-word.document.macroEnabled.12";
docx = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
dot = "application/msword";
dotm = "application/vnd.ms-word.template.macroEnabled.12";
dotx = "application/vnd.openxmlformats-officedocument.wordprocessingml.template";
mdb = "application/vnd.ms-access";
pot = "application/vnd.ms-powerpoint";
potm = "application/vnd.ms-powerpoint.template.macroEnabled.12";
potx = "application/vnd.openxmlformats-officedocument.presentationml.template";
ppa = "application/vnd.ms-powerpoint";
ppam = "application/vnd.ms-powerpoint.addin.macroEnabled.12";
pps = "application/vnd.ms-powerpoint";
ppsm = "application/vnd.ms-powerpoint.slideshow.macroEnabled.12";
ppsx = "application/vnd.openxmlformats-officedocument.presentationml.slideshow";
ppt = "application/vnd.ms-powerpoint";
pptm = "application/vnd.ms-powerpoint.presentation.macroEnabled.12";
pptx = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
xla = "application/vnd.ms-excel";
xlam = "application/vnd.ms-excel.addin.macroEnabled.12";
xls = "application/vnd.ms-excel";
xlsb = "application/vnd.ms-excel.sheet.binary.macroEnabled.12";
xlsm = "application/vnd.ms-excel.sheet.macroEnabled.12";
xlsx = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
xlt = "application/vnd.ms-excel";
xltm = "application/vnd.ms-excel.template.macroEnabled.12";
xltx = "application/vnd.openxmlformats-officedocument.spreadsheetml.template";
odc = "application/vnd.oasis.opendocument.chart";
odf = "application/vnd.oasis.opendocument.formula";
odg = "application/vnd.oasis.opendocument.graphics";
odi = "application/vnd.oasis.opendocument.image";
odm = "application/vnd.oasis.opendocument.text-master";
odp = "application/vnd.oasis.opendocument.presentation";
odt = "application/vnd.oasis.opendocument.text";
otg = "application/vnd.oasis.opendocument.graphics-template";
oth = "application/vnd.oasis.opendocument.text-web";
otm = "application/vnd.oasis.opendocument.text-master-template";
otp = "application/vnd.oasis.opendocument.presentation-template";
ots = "application/vnd.oasis.opendocument.spreadsheet-template";
ott = "application/vnd.oasis.opendocument.text-template";
};
code = {
css = "text/css";
csv = "text/csv";
html = "text/html";
js = "application/x-javascript";
latex = "application/x-latex";
php = "application/x-httpd-php";
pl = "application/x-perl";
rtf = "application/rtf";
sh = "application/x-sh";
tex = "application/x-tex";
txt = "text/plain";
xhtml = "application/xhtml+xml";
xml = "text/xml";
};
misc = {
web = {
about = "x-scheme-handler/about";
chrome = "x-scheme-handler/chrome";
html = "text/html";
http = "x-scheme-handler/http";
https = "x-scheme-handler/https";
wine-ini = "application/x-wine-extension-ini";
mxwinurl = "application/x-mswinurl";
unknown = "x-scheme-handler/unknown";
x-htm = "application/x-extension-htm";
x-html = "application/x-extension-html";
x-shtml = "application/x-extension-shtml";
x-xht = "application/x-extension-xht";
x-xhtml = "application/x-extension-xhtml";
xhtml-xml = "application/xhtml+xml";
};
misc = {
ics = "text/calendar";
url = "application/x-mswinurl";
wine-ini = "application/x-wine-extension-ini";
wine-osz = "application/x-wine-extension-osz";
};
};
# Applications
ark = "org.kde.ark.desktop";
firefox = "firefox.desktop";
vscode = "code.desktop";
zed = "dev.zed.Zed.desktop";
mpv = "mpv.desktop";
zathura = "org.pwmt.zathura.desktop";
sxiv = "sxiv.desktop";
nsxiv = "nsxiv.desktop";
font-viewer = "org.gnome.font-viewer.desktop";
libreoffice = "startcenter.desktop";
in {
xdg.configFile."mimeapps.list".force = true;
xdg.mimeApps = {
@@ -104,18 +191,18 @@ in {
# associations.added = {};
# associations.removed = {};
defaultApplications =
(lib.mapAttrs' (_: v: lib.nameValuePair v sxiv) mime.image)
(lib.mapAttrs' (_: v: lib.nameValuePair v nsxiv) mime.image)
// (lib.mapAttrs' (_: v: lib.nameValuePair v mpv) mime.audio)
// (lib.mapAttrs' (_: v: lib.nameValuePair v mpv) mime.video)
// (lib.mapAttrs' (_: v: lib.nameValuePair v font-viewer) mime.font)
// (lib.mapAttrs' (_: v: lib.nameValuePair v libreoffice) mime.office)
// (lib.mapAttrs' (_: v: lib.nameValuePair v zathura) mime.documents)
// (lib.mapAttrs' (_: v: lib.nameValuePair v vscode) mime.code)
// (lib.mapAttrs' (_: v: lib.nameValuePair v zed) mime.code)
// (lib.mapAttrs' (_: v: lib.nameValuePair v ark) mime.archive)
// (lib.mapAttrs' (_: v: lib.nameValuePair v firefox) mime.web)
// {
${mime.misc.http} = firefox;
${mime.misc.https} = firefox;
${mime.misc.wine-ini} = vscode;
${mime.misc.ics} = vscode;
${mime.misc.url} = firefox;
${mime.misc.wine-ini} = zed;
${mime.misc.ics} = zed;
};
};
}
+129
View File
@@ -0,0 +1,129 @@
{ config, lib, pkgs, ... }:
let
cfg = config.accounts.email;
in
{
sops.secrets = {
"email/naniwtf/password" = { };
"email/kyoto-u/password" = { };
"email/pvv/password" = { };
};
accounts.email = {
maildirBasePath = "mail";
accounts = {
"naniwtf" = let
userName = "h7x4";
domain = "nani.wtf";
in {
primary = true;
userName = "${userName}@${domain}";
realName = "h7x4";
address = "${userName}@${domain}";
passwordCommand = "${lib.getExe' pkgs.coreutils "cat"} ${config.sops.secrets."email/naniwtf/password".path}";
imap = {
host = "redbull.mxrouting.net";
port = 993;
authentication = "plain";
tls.enable = true;
};
smtp = {
host = "redbull.mxrouting.net";
port = 465;
authentication = "plain";
tls.enable = true;
};
gpg = {
key = "46B9228E814A2AAC";
signByDefault = true;
};
neomutt.enable = true;
thunderbird.enable = true;
meli.enable = true;
};
"pvv" = let
userName = "oysteikt";
domain = "pvv.ntnu.no";
in {
inherit userName;
realName = "Øystein K Tveit";
address = "${userName}@${domain}";
passwordCommand = "${lib.getExe' pkgs.coreutils "cat"} ${config.sops.secrets."email/pvv/password".path}";
imap = {
host = "imap.${domain}";
port = 993;
authentication = "plain";
tls.enable = true;
};
smtp = {
host = "redbull.mxrouting.net";
port = 587;
authentication = "plain";
tls = {
enable = true;
useStartTls = true;
};
};
gpg = {
key = "";
signByDefault = true;
};
neomutt.enable = true;
thunderbird.enable = true;
meli.enable = true;
};
"kyoto-u" = let
userName = "oysteikt";
domain = "fos.kuis.kyoto-u.ac.jp";
in {
inherit userName;
realName = "";
address = "${userName}@${domain}";
passwordCommand = "${lib.getExe' pkgs.coreutils "cat"} ${config.sops.secrets."email/kyoto-u/password".path}";
imap = {
host = "io.kuis.kyoto-u.ac.jp";
port = 993;
authentication = "plain";
tls.enable = true;
};
smtp = {
host = "io.kuis.kyoto-u.ac.jp";
port = 587;
authentication = "plain";
tls = {
enable = true;
useStartTls = true;
};
};
# gpg = {
# };
neomutt.enable = true;
thunderbird.enable = true;
meli.enable = true;
};
};
};
systemd.user.tmpfiles.settings."10-maildir" = lib.mkIf (lib.any (acct: acct.enable) (lib.attrValues cfg.accounts)) {
"${config.home.homeDirectory}/${cfg.maildirBasePath}".d = {
mode = "0700";
user = config.home.username;
};
};
}
+22 -128
View File
@@ -3,75 +3,19 @@
graphics = !machineVars.headless;
in {
imports = [
./shell.nix
./breakerbox.nix
./email.nix
./packages.nix
./shell.nix
./config/xdg
./programs/atuin.nix
./programs/comma.nix
./programs/direnv
./programs/gdb.nix
./programs/gh.nix
./programs/git
./programs/gpg
./programs/less.nix
./programs/neovim
./programs/nix-index
./programs/ssh
./programs/tealdeer
./programs/tmux.nix
./programs/zsh
./services/nix-channel-update.nix
./services/pueue.nix
./modules/colors.nix
./modules/shellAliases.nix
] ++ optionals graphics [
./config/gtk.nix
./programs/alacritty.nix
./programs/emacs
./programs/firefox.nix
./programs/ncmpcpp.nix
./programs/newsboat
./programs/qutebrowser.nix
./programs/rofi.nix
./programs/taskwarrior.nix
./programs/vscode
# ./programs/xmobar
./programs/xmonad
./programs/zathura.nix
./programs/zed
./services/copyq.nix
./services/dunst.nix
./services/fcitx5.nix
./services/mpd.nix
./services/picom.nix
./services/polybar.nix
./services/ra-multiplex.nix
./services/screen-locker.nix
# ./services/stalonetray.nix
./services/sxhkd.nix
./services/tumblerd.nix
./config/ensure-homedir-structure.nix
./config/downloads-sorter.nix
];
sops.defaultSopsFile = ../secrets/home.yaml;
sops.age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519_home_sops" ];
sops.secrets."nix/access-tokens" = {
sopsFile = ../secrets/common.yaml;
};
nix = {
settings.use-xdg-base-directories = true;
extraOptions = ''
!include ${config.sops.secrets."nix/access-tokens".path}
'';
};
home = {
username = "h7x4";
homeDirectory = "/home/h7x4";
@@ -90,81 +34,34 @@ in {
package = pkgs.capitaine-cursors;
name = "capitaine-cursors";
size = 16;
dotIcons.enable = false;
};
keyboard.options = [ "caps:escape" ];
};
sessionVariables = {
CARGO_NET_GIT_FETCH_WITH_CLI = "true";
PYTHONSTARTUP = "${config.xdg.configHome}/python/pyrc";
systemd.user.sessionVariables = {
DO_NOT_TRACK = "1";
_JAVA_AWT_WM_NONREPARENTING = "1";
};
dconf.settings = mkIf graphics {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
};
xdg.configFile = {
"ghc/ghci.conf".text = ''
:set prompt "${extendedLib.termColors.front.magenta "[GHCi]λ"} "
'';
"python/pyrc".text = ''
#!/usr/bin/env python3
import sys
# You also need \x01 and \x02 to separate escape sequence, due to:
# https://stackoverflow.com/a/9468954/1147688
sys.ps1='\x01\x1b${extendedLib.termColors.front.blue "[Python]> "}\x02>>>\x01\x1b[0m\x02 ' # bright yellow
sys.ps2='\x01\x1b[1;49;31m\x02...\x01\x1b[0m\x02 ' # bright red
'';
xsession = {
enable = !machineVars.wayland;
# TODO: declare using xdg config home
scriptPath = "${config.xdg.configHome}/X11/xsession";
profilePath = "${config.xdg.configHome}/X11/xprofile";
};
news.display = "silent";
fonts.fontconfig.enable = mkForce true;
programs = {
home-manager.enable = true;
bash = {
enable = true;
historyFile = "${config.xdg.dataHome}/bash_history";
historySize = 100000;
bashrcExtra = ''
source "${config.xdg.configHome}/mutable_env.sh"
'';
};
bat.enable = true;
bottom = {
enable = true;
settings.flags.enable_gpu = true;
};
eza.enable = true;
feh.enable = mkIf graphics true;
fzf = {
enable = true;
defaultCommand = "fd --type f";
};
man = {
enable = true;
generateCaches = true;
};
mpv.enable = mkIf graphics true;
obs-studio.enable = mkIf graphics true;
ssh = {
enable = true;
includes = [ "mutable_config" ];
};
texlive = {
enable = true;
# packageSet = pkgs.texlive.combined.scheme-medium;
};
zoxide.enable = true;
};
services = {
gnome-keyring.enable = mkIf graphics true;
network-manager-applet.enable = mkIf graphics true;
};
manual = {
html.enable = true;
manpages.enable = true;
@@ -173,10 +70,7 @@ in {
qt = mkIf graphics {
enable = true;
platformTheme.name = "gtk";
style = {
name = "adwaita-dark";
package = pkgs.adwaita-qt;
};
platformTheme.name = "adwaita";
style.name = "adwaita-dark";
};
}
@@ -0,0 +1,52 @@
{ config, pkgs, lib, ... }:
let
cfg = config.programs.direnv;
in
{
options.programs.direnv.auto-prune-allowed-dirs = {
enable = lib.mkEnableOption "automatic pruning of direnv dirs";
onCalendar = lib.mkOption {
type = lib.types.str;
default = "daily";
example = "weekly";
# TODO: link to systemd manpage for format.
description = "How often to prune dirs.";
};
};
config = lib.mkIf cfg.auto-prune-allowed-dirs.enable {
systemd.user.services.direnv-auto-prune-allowed-dirs = {
Unit = {
Description = "Prune unused allowed directories for direnv";
Documentation = [ "man:direnv(1)" ];
ConditionPathExists = "${config.xdg.dataHome}/direnv/allow";
};
Service = {
Type = "oneshot";
Slice = "background.slice";
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
ExecStart = "${lib.getExe cfg.package} prune";
};
};
systemd.user.timers.direnv-auto-prune-allowed-dirs = {
Unit = {
Description = "Prune unused allowed directories for direnv";
Documentation = [ "man:direnv(1)" ];
};
Timer = {
Unit = "direnv-auto-prune-allowed-dirs.service";
OnCalendar = cfg.auto-prune-allowed-dirs.onCalendar;
Persistent = true;
};
Install = {
WantedBy = [ "timers.target" ];
};
};
};
}
@@ -32,6 +32,7 @@ in
Service = {
Type = "oneshot";
Slice = "background.slice";
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
ExecStart = "${lib.getExe cfg.package} --refresh-keys";
@@ -32,6 +32,7 @@ in
Service = {
Type = "oneshot";
Slice = "background.slice";
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
ExecStart = "${lib.getExe cfg.package} --update-trustdb";
+10
View File
@@ -0,0 +1,10 @@
{ ... }:
{
imports = [
./auto-refresh-keys.nix
./auto-update-trust-db.nix
# ./key-fetchers/declarative-github-key-fetcher.nix # WIP
./key-fetchers/declarative-keyserver-key-fetcher.nix
];
}
@@ -0,0 +1,102 @@
{ config, pkgs, lib, ... }:
let
cfg = config.programs.gpg;
in
{
# TODO: Create proper descriptions
options = {
programs.gpg.key-fetchers.github = {
enable = lib.mkEnableOption "auto fetching of gpg keys by github username";
useGh = lib.mkEnableOption "" // {
description = "Whether to use the GitHub API through the gh tools to fetch GPG keys";
default = config.programs.gh.enable;
defaultText = lib.literalExpression "config.programs.gh.enable";
};
# TODO: default time interval
keys = lib.mkOption {
description = "";
default = { };
type = lib.types.attrsOf (lib.types.submodule ({ name, ... }: {
options = {
# id = lib.mkOption {
# description = "";
# default = name;
# example = "";
# type = lib.types.str;
# };
username = lib.mkOption {
description = "";
default = name;
type = lib.types.nonEmptyStr;
};
trust = lib.mkOption {
description = "If marked as null, it's mutable";
default = null;
example = 4;
type = with lib.types; nullOr (ints.between 1 5);
};
# TODO: time interval override
};
}));
};
};
};
config = lib.mkIf cfg.key-fetchers.github.enable {
systemd.user.services."gpg-fetch-github-key@" = {
description = "Fetch GPG keys for GitHub user %i";
serviceConfig = {
Type = "oneshot";
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
# TODO: warn if user or key does not exist
ExecStart = let
ghScript = pkgs.writeShellApplication {
name = "fetch-github-gpg-keys";
runtimeInputs = [
config.programs.gh.package
pkgs.jq
cfg.package
];
text = ''
gh api users/''${1}/gpg_keys | jq -r '.[].raw_key' | gpg --import
'';
};
curlScript = pkgs.writeShellApplication {
name = "fetch-github-gpg-keys";
runtimeInputs = [
pkgs.curl
pkgs.jq
cfg.package
];
text = ''
curl -s https://api.github.com/users/''${1}/gpg_keys | jq -r '.[].raw_key' | gpg --import
'';
};
in if cfg.key-fetchers.github.useGh then ghScript else curlScript;
Restart = "on-failure";
RestartSec = "10s";
Environment = [
"GNUPGHOME=${cfg.homedir}"
];
};
};
systemd.user.timers."gpg-fetch-github-keys@" = {
description = "Fetch GPG keys for GitHub user %i";
wantedBy = [ "timers.target" ];
timerConfig = {
};
};
};
}
@@ -3,10 +3,14 @@ let
cfg = config.programs.gpg;
in
{
# TODO: per-key timers
# TODO: Create proper descriptions
options = {
programs.gpg.fetch-keys = {
programs.gpg.key-fetchers.keyserver = {
enable = lib.mkEnableOption "auto fetching of gpg keys by fingerprint";
# TODO: default time interval
keys = lib.mkOption {
description = "";
default = { };
@@ -23,8 +27,7 @@ in
description = "If marked as null, use config";
default = null;
example = "hkps://keys.openpgp.org";
type = with lib.types; nullOr str;
apply = v: if v == null then "@NULL@" else v;
type = with lib.types; coercedTo (nullOr str) (v: if v == null then "@NULL@" else v) str;
};
trust = lib.mkOption {
@@ -33,6 +36,8 @@ in
example = 4;
type = with lib.types; nullOr (ints.between 1 5);
};
# TODO: time interval override
};
}));
};
@@ -43,7 +48,7 @@ in
# TODO: Fix the module so that this unit runs whenever something changes
systemd.user.services.gpg-fetch-keys = let
fetchKeysApplication = let
recvKeysByKeyserver = lib.pipe cfg.fetch-keys.keys [
recvKeysByKeyserver = lib.pipe cfg.key-fetchers.keyserver.keys [
lib.attrValues
(lib.foldl (acc: key: acc // {
${key.keyserver} = (acc.${key.keyserver} or []) ++ [ key.id ];
@@ -69,7 +74,7 @@ in
}
'';
trustKeys = lib.pipe cfg.fetch-keys.keys [
trustKeys = lib.pipe cfg.key-fetchers.keyserver.keys [
lib.attrValues
(lib.filter (key: key.trust != null))
(map ({ id, trust, ... }: "importTrust '${id}' '${toString trust}'"))
@@ -84,7 +89,7 @@ in
trustKeys
];
};
in lib.mkIf cfg.fetch-keys.enable {
in lib.mkIf cfg.key-fetchers.keyserver.enable {
Unit = {
Description = "Fetch declaratively listed gpg keys";
Documentation = [ "man:gpg(1)" ];
@@ -1,9 +1,29 @@
{ config, pkgs, lib, ... }:
let
daysBeforeDeletion = 2;
cfg = config.programs.neovim.auto-clean-swapfiles;
in
{
config = {
options.programs.neovim.auto-clean-swapfiles = {
enable = lib.mkEnableOption "automatic cleanup of neovim swapfiles";
daysBeforeDeletion = lib.mkOption {
type = lib.types.ints.positive;
default = 2;
example = 7;
description = "How long many days old the swapfile should be before it gets cleaned up";
};
onCalendar = lib.mkOption {
type = lib.types.str;
default = "daily";
example = "weekly";
# TODO: link to systemd manpage for format.
description = "How often to run the cleanup.";
};
};
config = lib.mkIf cfg.enable {
systemd.user.services.clean-neovim-swap-files = {
Unit = {
Description = "Clean old swap files for neovim";
@@ -11,6 +31,7 @@ in
Service = {
Type = "oneshot";
Slice = "background.slice";
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
ExecStart = lib.getExe (pkgs.writeShellApplication {
@@ -19,7 +40,7 @@ in
text = ''
echo "Cleaning old swap files for neovim"
OLD_SWAPFILES=$(find "${config.xdg.stateHome}/nvim/swap" -type f -name '*.swp' -mtime +${toString daysBeforeDeletion})
OLD_SWAPFILES=$(find "${config.xdg.stateHome}/nvim/swap" -type f -name '*.swp' -mtime +${toString cfg.daysBeforeDeletion})
if [ -z "$OLD_SWAPFILES" ]; then
echo "No old swap files found"
@@ -44,7 +65,7 @@ in
Timer = {
Unit = "clean-neovim-swap-files.service";
OnCalendar = "daily";
OnCalendar = cfg.onCalendar;
Persistent = true;
};
@@ -1,12 +1,25 @@
{ config, pkgs, lib, ... }:
let
cfg = config.programs.nix-index;
cfg = config.programs.nix-index.autoUpdateDatabase;
in
{
options.programs.nix-index.enableDatabaseFetcher = lib.mkEnableOption "timed unit that fetches an updated database of nixpkgs outputs";
options.programs.nix-index.autoUpdateDatabase = {
enable = lib.mkEnableOption "timed unit that fetches an updated database of nixpkgs outputs";
# TODO: let users specify forks and other sources
# url = "";
onCalendar = lib.mkOption {
type = lib.types.str;
default = "weekly";
example = "montly";
# TODO: link to systemd manpage for format.
description = "How often to update the database.";
};
};
config = {
systemd.user.timers.fetch-nix-index-database = lib.mkIf cfg.enableDatabaseFetcher {
systemd.user.timers.fetch-nix-index-database = lib.mkIf cfg.enable {
Unit = {
Description = "Fetch nix-index database";
Documentation = [ "https://github.com/nix-community/nix-index-database" ];
@@ -14,7 +27,7 @@ in
Timer = {
Unit = "fetch-nix-index-database.service";
OnCalendar = "weekly";
OnCalendar = cfg.onCalendar;
Persistent = true;
};
@@ -23,7 +36,7 @@ in
};
};
systemd.user.services.fetch-nix-index-database = lib.mkIf cfg.enableDatabaseFetcher {
systemd.user.services.fetch-nix-index-database = lib.mkIf cfg.enable {
Unit = {
Description = "Fetch nix-index database";
Documentation = [ "https://github.com/nix-community/nix-index-database" ];
@@ -31,6 +44,7 @@ in
Service = {
Type = "oneshot";
Slice = "background.slice";
ExecStart = lib.getExe (pkgs.writeShellApplication {
name = "fetch-nix-index-database";
runtimeInputs = with pkgs; [
@@ -39,6 +53,8 @@ in
wget
];
# TODO: allow fetching with gh + github token
# Source: https://github.com/nix-community/nix-index-database?tab=readme-ov-file#ad-hoc-download
# Slightly modified to satisfy shellcheck
text = ''
@@ -0,0 +1,110 @@
{ config, pkgs, lib, ... }:
let
cfg = config.programs.prism-launcher;
in
{
imports = [
../../systemd-tmpfiles.nix
];
options.programs.prism-launcher = {
enable = lib.mkEnableOption "PrismLauncher, an open source minecraft launcher";
package = lib.mkPackageOption pkgs "prismlauncher" { };
stateDir = lib.mkOption {
description = "The directory where PrismLauncher stores it's state";
type = lib.types.path;
default = "${config.xdg.dataHome}/PrismLauncher";
defaultText = lib.literalExpression ''"''${config.xdg.dataHome}/PrismLauncher"'';
};
screenshotMover = {
enable = lib.mkEnableOption "a systemd unit that automatically moves screenshots from all minecraft instances into a common dir";
screenshotDir = lib.mkOption {
description = "Where to move the minecraft screenshots.";
type = lib.types.path;
default = if config.xdg.userDirs.pictures != null
then "${config.xdg.userDirs.pictures}/prismlauncher-screenshots"
else "${config.home.homeDirectory}/Pictures";
defaultText = lib.literalExpression ''
if config.xdg.userDirs.pictures != null
then "''${config.xdg.userDirs.pictures}/prismlauncher-screenshots"
else "''${config.home.homeDirectory}/Pictures"
'';
example = lib.literalExpression ''
"''${config.home.homeDirectory}/minecraft-screenshots"
'';
};
};
};
config = lib.mkIf cfg.enable {
home.packages = [ cfg.package ];
systemd.user.paths.prismlauncher-move-minecraft-screenshots = lib.mkIf cfg.screenshotMover.enable {
Install.WantedBy = [ "paths.target" ];
Unit.Description = "Watchdog that moves screenshots from all prismlauncher minecraft instances into a common dir";
Path = {
PathExistsGlob = [
"${cfg.stateDir}/instances/*/.minecraft/screenshots/*.png"
"${cfg.stateDir}/instances/*/minecraft/screenshots/*.png"
];
Unit = "prismlauncher-move-minecraft-screenshots.service";
TriggerLimitIntervalSec = "1s";
TriggerLimitBurst = "1";
};
};
systemd.user.services.prismlauncher-move-minecraft-screenshots = lib.mkIf cfg.screenshotMover.enable {
Unit.Description = "Watchdog that moves screenshots from all prismlauncher minecraft instances into a common dir";
Service = {
Type = "oneshot";
Slice = "background.slice";
ExecStart = lib.getExe (pkgs.writeShellApplication {
name = "prismlauncher-move-minecraft-screenshots.sh";
runtimeInputs = with pkgs; [ coreutils findutils ];
text = let
instancesDir = "${cfg.stateDir}/instances";
in ''
shopt -s nullglob
for idir in "${instancesDir}"/*/; do
INSTANCE_NAME="''${idir#${instancesDir}/}"
INSTANCE_NAME="''${INSTANCE_NAME%'/'}"
SCREENSHOT_TARGET_DIR="${cfg.screenshotMover.screenshotDir}/$INSTANCE_NAME"
mkdir -p "''${SCREENSHOT_TARGET_DIR}"
for variant in minecraft .minecraft; do
SCREENSHOT_SOURCE_DIR="${instancesDir}/$INSTANCE_NAME/$variant"/screenshots
if [ -d "$SCREENSHOT_SOURCE_DIR" ]; then
echo "Scanning for screenshots in $SCREENSHOT_SOURCE_DIR"
for screenshot in "$SCREENSHOT_SOURCE_DIR"/*.png; do
echo "Moving '$screenshot' -> '$SCREENSHOT_TARGET_DIR'"
cp --preserve=all "$screenshot" "$SCREENSHOT_TARGET_DIR"
rm "$screenshot"
done
fi
done
done
'';
});
PrivateUsers = true;
PrivateNetwork = true;
ProtectSystem = true;
NoNewPrivileges = true;
ProtectKernelTunables = true;
ProtectControlGroups = true;
RestrictAddressFamilies = [ ];
RestrictNamespaces = true;
};
};
systemd.user.tmpfiles.settings."10-prismlauncher" = lib.mkIf cfg.screenshotMover.enable {
${cfg.screenshotMover.screenshotDir}.d = {
user = config.home.username;
};
};
};
}
@@ -0,0 +1,9 @@
{ ... }:
{
# TODO: create thingamajig that watches ~/Downloads and pulls all new files to
# directory specified by systemd %i
# systemd.services.
# systemd.paths
}
+160
View File
@@ -0,0 +1,160 @@
{ config, lib, pkgs, ... }:
let
cfg = config.services.downloads-sorter;
in
{
imports = [
../systemd-tmpfiles.nix
];
options.services.downloads-sorter = {
enable = lib.mkEnableOption "downloads sorter units, path activated units to keep the download dir clean";
downloadsDirectory = lib.mkOption {
type = lib.types.path;
description = "Which directory to keep clean";
default = if config.xdg.userDirs.enable then config.xdg.userDirs.download else "${config.home.homeDirectory}/Downloads";
defaultText = ''
if config.xdg.userDirs.enable then config.xdg.userDirs.download else "''${config.home.homeDirectory}/Downloads"
'';
example = ''
"''${config.home.homeDirectory}/downloads"
'';
};
mappings = lib.mkOption {
type = let
mappingType = lib.types.submodule ({ name, ... }: {
options = {
unitName = lib.mkOption {
type = lib.types.str;
description = ''
The basename of the path/service unit responsible for this mapping
'';
default = "downloads-sorter@${name}";
example = "downloads-sorter@asdf";
};
dir = lib.mkOption {
type = lib.types.path;
description = ''
Absolute path to the directory where matching files should be moved.
'';
default = if builtins.substring 0 1 name == "/" then name else "${cfg.downloadsDirectory}/${name}";
defaultText = ''
if builtins.substring 0 1 name == "/" then name else "''${config.services.downloads-sorter.downloadsDirectory}/''${name}"
'';
};
globs = lib.mkOption {
type = with lib.types; listOf str;
description = ''
A list of globs that match the files that should be moved.
'';
example = [
"*.jpg"
"IMG_*_2020_*.png"
];
apply = map (g: "${cfg.downloadsDirectory}/${g}");
};
createDirIfNotExists = lib.mkOption {
type = lib.types.bool;
description = ''
Whether to create the target directory if it does not exist yet.
Turn this off if you'd like the target directory to be a symlink or similar.
'';
default = true;
example = false;
};
# TODO: allow specifying a dynamic filter together with a system path trigger in an attrset.
};
});
in with lib.types; attrsOf (coercedTo (listOf str) (globs: { inherit globs; }) mappingType);
description = ''
A mapping from a file pattern to the location where it should be moved.
By default, the output mapping is relative to the download dir.
If an absolute path is given, the sorter will move the files out of the downloads dir.
'';
default = { };
example = {
"pictures" = [
"*.png"
"*.jpg"
];
"documents" = {
createDirIfNotExists = false;
globs = [ "*.pdf" ];
};
"/home/<user>/archives" = [ "*.rar" ];
};
};
};
config = lib.mkIf cfg.enable {
systemd.user.paths = lib.mapAttrs' (dir: mapping: {
name = mapping.unitName;
value = {
Install.WantedBy = [ "paths.target" ];
Path = {
PathExistsGlob = mapping.globs;
Unit = "${mapping.unitName}.service";
TriggerLimitIntervalSec = "1s";
TriggerLimitBurst = "1";
};
};
}) cfg.mappings;
# TODO: deduplicate
systemd.user.services = lib.mapAttrs' (dir: mapping: {
name = mapping.unitName;
value = {
Unit.Description = "Downloads directory watchdog, sorts the downloads directory";
Service = {
Type = "oneshot";
Slice = "background.slice";
SyslogIdentifier = mapping.unitName;
ExecStart = let
script = pkgs.writeShellApplication {
name = "downloads-sorter-${dir}.sh";
runtimeInputs = [ pkgs.coreutils ];
text = ''
shopt -s nullglob
FILES=(${builtins.concatStringsSep " " mapping.globs})
for file in "''${FILES[@]}"; do
echo "$file -> ${mapping.dir}"
mv "$file" '${mapping.dir}'
done
'';
};
in lib.getExe script;
PrivateUsers = true;
ProtectSystem = true;
NoNewPrivileges = true;
ProtectKernelTunables = true;
ProtectControlGroups = true;
PrivateNetwork = true;
RestrictNamespaces = true;
};
};
}) cfg.mappings;
systemd.user.tmpfiles.settings."10-downloads-sorter-service" = let
absolutePaths = lib.pipe cfg.mappings [
builtins.attrValues
(builtins.filter (m: m.createDirIfNotExists))
(map (m: m.dir))
];
in lib.genAttrs absolutePaths (_: {
d = {
user = config.home.username;
};
});
};
}
+55
View File
@@ -0,0 +1,55 @@
{ config, pkgs, lib, ... }:
let
cfg = config.services.mpd;
in
{
options.services.mpd.autoUpdateDatabase = lib.mkEnableOption "watchdog that updates the mpd database upon file changes";
config = lib.mkIf cfg.autoUpdateDatabase {
systemd.user.paths.mpd-update-database = {
Install.WantedBy = [ "paths.target" ];
Unit = {
Description = "Watchdog that updates the mpd database upon file changes";
Documentation = [
"man:mpd(1)"
"man:mpd.conf(5)"
];
};
Path = {
PathChanged = [
cfg.musicDirectory
cfg.playlistDirectory
];
Unit = "mpd-update-database.service";
TriggerLimitIntervalSec = "1s";
TriggerLimitBurst = "1";
};
};
systemd.user.services.mpd-update-database = {
Unit = {
Description = "Watchdog that updates the mpd library whenever the files are modified";
Documentation = [
"man:mpd(1)"
"man:mpd.conf(5)"
];
};
Service = {
Type = "oneshot";
Slice = "background.slice";
ExecStart = "${lib.getExe pkgs.mpc} update --wait";
PrivateUsers = true;
ProtectSystem = true;
NoNewPrivileges = true;
ProtectKernelTunables = true;
ProtectControlGroups = true;
RestrictAddressFamilies = [
"AF_INET"
"AF_UNIX"
];
RestrictNamespaces = true;
};
};
};
}
+177 -162
View File
@@ -1,50 +1,171 @@
{ pkgs, lib, extendedLib, inputs, config, ... }: let
inherit (lib) types mkEnableOption mkOption mdDoc;
{ config, pkgs, lib, extendedLib, ... }: let
cfg = config.local.shell;
# NOTE:
# This module is an over-engineered solution to a non-problem.
# It is a fun experiment in using the Nix language to create a
# shell alias system that organizes aliases into a tree structure,
# with categories and subcategories and subsubcategories and so on.
#
# It also has a lazy join function that will join a list of commands
# with a separator, but render it in a prettier way in a documentation
# file that you can print out and read.
isAlias = v: builtins.isAttrs v && v ? "alias" && v ? "type";
in {
options.local.shell = {
aliases = let
coerceStrToAlias = str: {
type = " ";
alias = [ str ];
};
aliasType = (types.coercedTo types.str coerceStrToAlias (types.submodule {
options = {
type = mkOption {
type = types.enum [ "|" "&&" ";" " " ];
default = ";";
description = ''
If the alias is a list of commands, this is the kind of separator that will be used.
'';
shellAliasesFormat = let
formatLib = {
functors = let
inherit (extendedLib.termColors.front) blue;
in
{
"|" = {
apply = f: lib.concatStringsSep " | " f.alias;
stringify = f: lib.concatStringsSep (blue "\n| ") f.alias;
};
alias = mkOption {
type = types.listOf types.str;
"&&" = {
apply = f: lib.concatStringsSep " && " f.alias;
stringify = f: lib.concatStringsSep (blue "\n&& ") f.alias;
};
";" = {
apply = f: lib.concatStringsSep "; " f.alias;
stringify = f: lib.concatStringsSep (blue ";\n ") f.alias;
};
" " = {
apply = f: lib.concatStringsSep " " f.alias;
stringify = f: lib.concatStringsSep " \\\n " f.alias;
};
};
})) // {
# NOTE: this check is necessary, because nix will recurse on types.either,
# and report that the option does not exist.
# See https://discourse.nixos.org/t/problems-with-types-oneof-and-submodules/15197
check = v: builtins.isString v || isAlias v;
isAlias = v: builtins.isAttrs v && v ? alias;
};
in {
lib = formatLib;
type = let
rawAliasType = lib.types.submodule {
options = {
type = lib.mkOption {
description = "If the alias is a list of commands, this is the kind of separator that will be used.";
type = lib.types.enum (lib.attrNames formatLib.functors);
default = ";";
example = "&&";
};
alias = lib.mkOption {
description = "List of commands that will be concatenated together.";
type = with lib.types; listOf str;
example = [
"ls"
"grep nix"
];
};
shells = lib.mkOption {
description = "List of shells for which the alias is valid.";
type = with lib.types; listOf (enum [
"bash"
"zsh"
"fish"
"nushell"
]);
default = [
"bash"
"zsh"
"fish"
"nushell"
];
example = [
"bash"
"zsh"
];
};
# TODO:
# subshell = lib.mkEnableOption "" // {
# description = "Whether to run the aliased command in a subshell";
# };
};
};
recursingAliasTreeType = types.attrsOf (types.either aliasType recursingAliasTreeType);
in mkOption {
type = recursingAliasTreeType;
coercedAliasType = with lib.types; let
coerce = str: {
type = " ";
alias = [ str ];
};
in addCheck (coercedTo str coerce rawAliasType) (v: builtins.isString v || formatLib.isAlias v);
aliasTreeType = with lib.types; attrsOf (either coercedAliasType aliasTreeType) // {
description = "Alias tree";
};
in aliasTreeType;
# Alias Tree -> String -> { :: Alias }
generateAttrs = shell: let
generateAttrs' = attrset: lib.pipe attrset [
(attrset: {
right = lib.filterAttrs (_: v: formatLib.isAlias v) attrset;
wrong = lib.filterAttrs (_: v: !(formatLib.isAlias v)) attrset;
})
({ right, wrong }:
# Leaf nodes
(lib.pipe right [
(lib.filterAttrs (_: v: lib.elem shell v.shells))
(builtins.mapAttrs (_: v: formatLib.functors.${v.type}.apply v))
])
//
# Subsets
(lib.pipe wrong [
builtins.attrValues
(map generateAttrs')
(lib.foldr (a: b: a // b) { })
])
)
];
in generateAttrs';
# Alias Tree -> String
generateText = aliases: let
inherit (extendedLib.termColors.front) red green blue;
# String -> Alias -> String
stringifyAlias = aliasName: alias: let
# String -> String
removeNixLinks = text: let
maybeMatches = lib.match "(|.*[^)])(/nix/store/.*/bin/).*" text;
matches = lib.mapNullable (lib.remove "") maybeMatches;
in
if (maybeMatches == null)
then text
else lib.replaceStrings matches (lib.replicate (lib.length matches) "") text;
# Alias -> String
applyFunctor = attrset: let
applied = formatLib.functors.${attrset.type}.stringify attrset;
indent' = lib.strings.replicate (lib.stringLength "${aliasName} -> ") " ";
in
lib.replaceStrings ["\n"] [("\n" + indent')] applied;
in "${red aliasName} -> ${blue "\""}${removeNixLinks (applyFunctor alias)}${blue "\""}";
# String -> String
indent = x: lib.pipe x [
(x: "\n" + x)
(lib.replaceStrings ["\n"] [("\n" + (lib.strings.replicate 2 " "))])
(lib.removePrefix "\n")
];
# String -> { :: Alias | Category } -> String
stringifyCategory = categoryName: category: lib.pipe category [
(category: let
aliases = lib.filterAttrs (_: formatLib.isAlias) category;
in {
inherit aliases;
subcategories = lib.removeAttrs category (lib.attrNames aliases);
})
({ aliases, subcategories }: {
aliases = lib.mapAttrsToList stringifyAlias aliases;
subcategories = lib.mapAttrsToList stringifyCategory subcategories;
})
({ aliases, subcategories }:
lib.concatStringsSep "\n" (lib.filter (x: lib.trim x != "") [
"[${green categoryName}]"
(indent (lib.concatStringsSep "\n" aliases) + "\n")
(indent (lib.concatStringsSep "\n" subcategories) + "\n")
])
)
];
in (stringifyCategory "Aliases" aliases);
};
in {
options.local.shell = {
aliases = lib.mkOption {
# TODO: freeformType
type = shellAliasesFormat.type;
description = "A tree of aliases";
default = { };
example = {
@@ -71,8 +192,8 @@ in {
};
};
variables = mkOption {
type = types.attrsOf types.str;
variables = lib.mkOption {
type = with lib.types; attrsOf str;
description = "Environment variables";
default = { };
};
@@ -82,129 +203,19 @@ in {
# };
enablePackageManagerLecture = mkEnableOption "distro reminder messages, aliased to common package manager commands";
enableAliasOverview = mkEnableOption "`aliases` command that prints out a list of all aliases" // {
enablePackageManagerLecture = lib.mkEnableOption "distro reminder messages, aliased to common package manager commands";
enableAliasOverview = lib.mkEnableOption "`aliases` command that prints out a list of all aliases" // {
default = true;
example = false;
};
};
config = let
sedColor =
color:
inputPattern:
outputPattern:
"-e \"s|${inputPattern}|${outputPattern.before or ""}$(tput setaf ${toString color})${outputPattern.middle}$(tput op)${outputPattern.after or ""}|g\"";
colorRed = sedColor 1;
colorSlashes = colorRed "/" {middle = "/";};
# Alias type functors
# These will help pretty print the commands
functors = let
inherit (lib.strings) concatStringsSep;
inherit (extendedLib.termColors.front) blue;
in
{
"|" = {
apply = f: concatStringsSep " | " f.alias;
stringify = f: concatStringsSep (blue "\n| ") f.alias;
};
"&&" = {
apply = f: concatStringsSep " && " f.alias;
stringify = f: concatStringsSep (blue "\n&& ") f.alias;
};
";" = {
apply = f: concatStringsSep "; " f.alias;
stringify = f: concatStringsSep (blue ";\n ") f.alias;
};
" " = {
apply = f: concatStringsSep " " f.alias;
stringify = f: concatStringsSep " \\\n " f.alias;
};
};
aliasTextOverview = let
inherit (lib) stringLength length concatStringsSep replaceStrings
attrValues mapAttrs isAttrs remove replicate mapNullable;
inherit (extendedLib.termColors.front) red green blue;
# String -> String -> String
wrap' = wrapper: str: wrapper + str + wrapper;
# [String] -> String -> String -> String
replaceStrings' = from: to: replaceStrings from (replicate (length from) to);
# String -> Int -> String
repeatString = string: times: concatStringsSep "" (replicate times string);
# int -> String -> AttrSet -> String
stringifyCategory = level: name: category: let
title = "${repeatString " " level}[${green name}]";
commands = attrValues ((lib.flip mapAttrs) category (n: v: let
# String
indent = repeatString " " level;
# String -> String
removeNixLinks = text: let
maybeMatches = builtins.match "(|.*[^)])(/nix/store/.*/bin/).*" text;
matches = mapNullable (remove "") maybeMatches;
in
if (maybeMatches == null)
then text
else replaceStrings' matches "" text;
applyFunctor = attrset: let
applied = functors.${attrset.type}.stringify attrset;
indent' = indent + (repeatString " " ((stringLength " -> \"") + (stringLength n))) + " ";
in
replaceStrings' ["\n"] ("\n" + indent') applied;
recurse = stringifyCategory (level + 1) n v;
in if isAlias v
then "${indent} ${red n} -> ${wrap' (blue "\"") (removeNixLinks (applyFunctor v))}"
else recurse
));
in concatStringsSep "\n" ([title] ++ commands) + "\n";
in (stringifyCategory 0 "Aliases" cfg.aliases) + "\n";
flattenedAliases = let
inherit (lib) mapAttrs attrValues filterAttrs isAttrs
isString concatStringsSep foldr;
applyFunctor = attrset: functors.${attrset.type}.apply attrset;
# TODO: better naming
allAttrValuesAreStrings = attrset: let
# [ {String} ]
filteredAliases = [(filterAttrs (n: v: isString v) attrset)];
# [ {String} ]
remainingFunctors = let
functorSet = filterAttrs (_: v: isAlias v) attrset;
appliedFunctorSet = mapAttrs (n: v: applyFunctor v) functorSet;
in [ appliedFunctorSet ];
# [ {AttrSet} ]
remainingAliasSets = attrValues (filterAttrs (_: v: isAttrs v && !isAlias v) attrset);
# [ {String} ]
recursedAliasSets = filteredAliases
++ (remainingFunctors)
++ (map allAttrValuesAreStrings remainingAliasSets);
in foldr (a: b: a // b) {} recursedAliasSets;
in
allAttrValuesAreStrings cfg.aliases;
in {
config = {
xdg.dataFile = {
aliases.text = aliasTextOverview;
packageManagerLecture = lib.mkIf cfg.enablePackageManagerLecture {
"aliases".text = shellAliasesFormat.generateText cfg.aliases;
"packageManagerLecture" = lib.mkIf cfg.enablePackageManagerLecture {
target = "package-manager.lecture";
text = let
inherit (extendedLib.termColors.front) red blue;
@@ -242,18 +253,22 @@ in {
programs = {
zsh = {
shellAliases = flattenedAliases;
shellAliases = shellAliasesFormat.generateAttrs "zsh" cfg.aliases;
sessionVariables = cfg.variables;
};
bash = {
shellAliases = flattenedAliases;
shellAliases = shellAliasesFormat.generateAttrs "bash" cfg.aliases;
sessionVariables = cfg.variables;
};
fish = {
shellAliases = flattenedAliases;
shellAliases = shellAliasesFormat.generateAttrs "fish" cfg.aliases;
# TODO: fish does not support session variables?
# localVariables = cfg.variables;
};
nushell = {
shellAliases = shellAliasesFormat.generateAttrs "nushell" cfg.aliases;
environmentVariables = cfg.variables;
};
};
};
}
+168
View File
@@ -0,0 +1,168 @@
# Taken from nixpkgs: nixos/modules/system/boot/systemd/tmpfiles.nix
{ config, pkgs, lib, unstable-pkgs, ... }:
let
# TODO: 24.05, year of the types.attrsWith
inherit (unstable-pkgs.lib) types mkOption;
cfg = config.systemd.user.tmpfiles;
attrsWith' =
placeholder: elemType:
types.attrsWith {
inherit elemType;
inherit (lib) placeholder;
};
escapeArgument = lib.strings.escapeC [
"\t"
"\n"
"\r"
" "
"\\"
];
settingsOption = {
description = ''
Declare systemd-tmpfiles rules to create, delete, and clean up volatile
and temporary files and directories.
Even though the service is called `*tmp*files` you can also create
persistent files.
'';
example = {
"10-mypackage" = {
"/var/lib/my-service/statefolder".d = {
mode = "0755";
user = "root";
group = "root";
};
};
};
default = { };
type = attrsWith' "config-name" (
attrsWith' "path" (
attrsWith' "tmpfiles-type" (
lib.types.submodule (
{ name, config, ... }:
{
options.type = mkOption {
type = types.str;
default = name;
defaultText = "tmpfiles-type";
example = "d";
description = ''
The type of operation to perform on the file.
The type consists of a single letter and optionally one or more
modifier characters.
Please see the upstream documentation for the available types and
more details:
{manpage}`tmpfiles.d(5)`
'';
};
options.mode = mkOption {
type = types.str;
default = "-";
example = "0755";
description = ''
The file access mode to use when creating this file or directory.
'';
};
options.user = mkOption {
type = types.str;
default = "-";
example = "root";
description = ''
The user of the file.
This may either be a numeric ID or a user/group name.
If omitted or when set to `"-"`, the user and group of the user who
invokes systemd-tmpfiles is used.
'';
};
options.group = mkOption {
type = types.str;
default = "-";
example = "root";
description = ''
The group of the file.
This may either be a numeric ID or a user/group name.
If omitted or when set to `"-"`, the user and group of the user who
invokes systemd-tmpfiles is used.
'';
};
options.age = mkOption {
type = types.str;
default = "-";
example = "10d";
description = ''
Delete a file when it reaches a certain age.
If a file or directory is older than the current time minus the age
field, it is deleted.
If set to `"-"` no automatic clean-up is done.
'';
};
options.argument = mkOption {
type = types.str;
default = "";
example = "";
description = ''
An argument whose meaning depends on the type of operation.
Please see the upstream documentation for the meaning of this
parameter in different situations:
{manpage}`tmpfiles.d(5)`
'';
};
}
)
)
)
);
};
# generates a single entry for a tmpfiles.d rule
settingsEntryToRule = path: entry: ''
'${entry.type}' '${path}' '${entry.mode}' '${entry.user}' '${entry.group}' '${entry.age}' ${escapeArgument entry.argument}
'';
# generates a list of tmpfiles.d rules from the attrs (paths) under tmpfiles.settings.<name>
pathsToRules = lib.mapAttrsToList (
path: types: lib.concatStrings (lib.mapAttrsToList (_type: settingsEntryToRule path) types)
);
mkRuleFileContent = paths: lib.concatStrings (pathsToRules paths);
in
{
options.systemd.user.tmpfiles.settings = lib.mkOption settingsOption;
config = lib.mkIf (cfg.settings != { }) {
assertions = [
(lib.hm.assertions.assertPlatform "systemd.user.tmpfiles" pkgs
lib.platforms.linux)
];
xdg.configFile = {
"systemd/user/basic.target.wants/systemd-tmpfiles-setup.service".source =
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-setup.service";
"systemd/user/systemd-tmpfiles-setup.service".source =
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-setup.service";
"systemd/user/timers.target.wants/systemd-tmpfiles-clean.timer".source =
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-clean.timer";
"systemd/user/systemd-tmpfiles-clean.service".source =
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-clean.service";
} // (lib.mapAttrs' (name: paths: {
name = "user-tmpfiles.d/${name}.conf";
value = {
text = mkRuleFileContent paths;
onChange = "${pkgs.systemd}/bin/systemd-tmpfiles --user --create";
};
}) cfg.settings);
};
}
+56 -55
View File
@@ -1,39 +1,44 @@
{ pkgs, config, machineVars, ... }:
{ pkgs, yet-unstabler-pkgs, config, machineVars, machineName, ... }:
{
home.packages = with pkgs; [
beets
bandwhich
binutils
cloc
cyme
czkawka
delta
diskonaut
difftastic
# diskonaut
duf
duff
fclones
ffmpeg
file
gh-dash
fselect
gitoxide
glances
gpauth
gpclient
gpg-tui
gping
graphviz
hexyl
htmlq
httpie
huniq
hyperfine
imagemagick
jq
kepubify
# keybase
keymapviz
libwebp
lnav
lolcat
lurk
mdcat
mediainfo
meli
mkvtoolnix
mmv
mtr
neofetch
nix-diff
nix-index
nix-output-monitor
nix-tree
nix-update
@@ -41,29 +46,29 @@
# nixops
nmap
ouch
pandoc
parallel
pipr
progress
python3
rclone
ripgrep
pwntools
rip2
rnr
rsync
# sc-im
slack-term
# slack-term
tea
tealdeer
terminal-parrot
termtosvg
toilet
tokei
trippy
unpaper
unzip
usbutils
uutils-coreutils
uutils-coreutils-noprefix
waifu2x-converter-cpp
watchexec
wavemon
wiki-tui
yt-dlp
yubico-pam
yubikey-agent
yubikey-manager
@@ -75,63 +80,63 @@
zlib
icu
openssl
xorg.xprop
xprop
] ++ (
lib.optionals (!machineVars.headless) [
ahoviewer
alsa-utils
anki
ark
birdtray
kdePackages.ark
brightnessctl
calibre
cool-retro-term
darktable
discord
element-desktop
yet-unstabler-pkgs.discord
foliate
geogebra
gimp
gnome.gnome-font-viewer
gnome.seahorse
google-chrome
ghidra
gimp3-with-plugins
gnome-font-viewer
imhex
imv
inkscape
insomnia
iwgtk
kid3
koreader
krita
ktouch
# kdePackages.ktouch
libnotify
libreoffice
light
mopidy
mopidy-mpd
mopidy-soundcloud
mopidy-youtube
mpc_cli
mission-center
# mopidy
# mopidy-mpd
# mopidy-soundcloud
# mopidy-youtube
mpc
mumble
naps2
nyxt
obsidian
# pcloud
nsxiv
pcloud
pdfarranger
penpot-desktop
pwvucontrol
# scrcpy
seahorse
shellcheck
slack
signal-desktop
# slack
# sublime3
# swiPrologWithGui
sxiv
tagainijisho
tenacity
thunderbird
# transcribe
wireshark
webcamoid
xcalib
xclip
xdotool
xorg.xmodmap
(xfce.thunar.override {
thunarPlugins = with xfce; [
xmodmap
(thunar.override {
thunarPlugins = [
thunar-volman
# thunar-dropbox-plugin
thunar-archive-plugin
@@ -147,16 +152,12 @@
touchegg
] ++ lib.optionals (machineVars.gaming) [
desmume
osu-lazer
(prismlauncher.override {
jdk17 = jdk21;
})
retroarchFull
steam
steam-tui
# osu-lazer
# retroarchFull
# steam
# steam-tui
stepmania
taisei
# taisei
]
);
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }:
{
programs.ahoviewer = { };
}
+12 -3
View File
@@ -1,7 +1,6 @@
{ pkgs, lib, config, ... }:
{
programs.alacritty = {
enable = true;
settings = {
window = {
padding = { x = 15; y = 15; };
@@ -18,6 +17,16 @@
size = 12.0;
};
keyboard.bindings = [
# NOTE: Allows for Ctrl+A Super+Z to work as Ctrl+A Alt+Z in tmux,
# very nice for a keyboard with Alt and Super switched.
{
key = "z";
mods = "Super";
chars = "\\u001bz";
}
];
colors =
let
inherit (lib.attrsets) getAttrs filterAttrs;
@@ -43,9 +52,9 @@
duration = 20;
};
live_config_reload = true;
general.live_config_reload = true;
shell = {
terminal.shell = {
program = "${pkgs.zsh}/bin/zsh";
args = [ "--login" ];
};
+4
View File
@@ -0,0 +1,4 @@
{ ... }:
{
programs.anki = { };
}
+38
View File
@@ -0,0 +1,38 @@
{ pkgs, lib, ... }:
{
programs.anyrun = {
config = {
y.fraction = 0.3;
width.fraction = 0.25;
plugins = [
"${pkgs.anyrun}/lib/libapplications.so"
];
hidePluginInfo = true;
closeOnClick = true;
showResultsImmediately = true;
};
extraCss = builtins.readFile ./style.css;
extraConfigFiles."applications.ron".text = let
preprocess_script = pkgs.writeShellApplication {
name = "anyrun-preprocess-application-exec";
runtimeInputs = [ ];
text = ''
shift # Remove term|no-term
echo "uwsm app -- $*"
'';
};
in ''
Config(
desktop_actions: false,
max_entries: 10,
preprocess_exec_script: Some("${lib.getExe preprocess_script}"),
terminal: Some(Terminal(
command: "${lib.getExe pkgs.alacritty}",
args: "-e {}",
)),
)
'';
};
}
+76
View File
@@ -0,0 +1,76 @@
@define-color accent #5599d2;
@define-color bg-color #161616;
@define-color fg-color #eeeeee;
@define-color desc-color #cccccc;
window {
background: transparent;
}
box.main {
padding: 5px;
margin: 10px;
border-radius: 10px;
border: 2px solid @accent;
background-color: @bg-color;
box-shadow: 0 0 5px black;
}
text {
min-height: 30px;
padding: 5px;
border-radius: 5px;
color: @fg-color;
}
.matches {
background-color: rgba(0, 0, 0, 0);
border-radius: 10px;
}
box.plugin:first-child {
margin-top: 5px;
}
box.plugin.info {
min-width: 200px;
}
list.plugin {
background-color: rgba(0, 0, 0, 0);
}
label.match {
color: @fg-color;
}
label.match.description {
font-size: 10px;
color: @desc-color;
}
label.plugin.info {
font-size: 14px;
color: @fg-color;
}
.match {
background: transparent;
}
.match:selected {
border-left: 4px solid @accent;
background: transparent;
animation: fade 0.1s linear;
}
@keyframes fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }:
{
programs.aria2 = { };
}
+4 -6
View File
@@ -1,15 +1,13 @@
{ config, ... }:
{ config, lib, ... }:
let
cfg = config.programs.atuin;
# TODO: retrieve this in a more dynamic and correct manner
xdg_runtime_dir = "/run/user/1000";
xdg_runtime_dir = "/run/user/${toString config.home.uid}";
in
{
lib.mkIf cfg.enable {
programs.atuin = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
enableNushellIntegration = config.programs.nushell.enable;
settings = {
db_path = "${config.xdg.dataHome}/atuin/history.db";
+18
View File
@@ -0,0 +1,18 @@
{ config, lib, ... }:
let
cfg = config.programs.bash;
in
{
programs.bash = {
historyFile = "${config.xdg.dataHome}/bash_history";
historySize = 100000;
bashrcExtra = ''
source "${config.xdg.configHome}/mutable_env.sh"
'';
shellOptions = [
"histappend"
"checkwinsize"
"checkjobs"
];
};
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }:
{
programs.bat = { };
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }:
{
programs.beets = { };
}
+43
View File
@@ -0,0 +1,43 @@
{ config, lib, ... }:
let
cfg = config.programs.bottom;
in
{
programs.bottom = {
settings = {
flags.enable_gpu = true;
row = [
{
ratio = 30;
child = [{ type = "cpu"; }];
}
{
ratio = 40;
child = [
{
ratio = 4;
type = "mem";
}
{
ratio = 3;
type = "disk";
}
];
}
{
ratio = 30;
child = [
{
type = "net";
}
{
default = true;
type = "proc";
}
];
}
];
};
};
}
+20 -7
View File
@@ -9,7 +9,7 @@ in [
(link "GitHub" "http://github.com")
(short "/u/" "danger/u/" "https://dangeru.us/")
(link "PVV" "https://www.pvv.ntnu.no/")
(short "PVVM" "PVV Mail" "https://webmail2.pvv.ntnu.no/roundcube/")
(short "PVVM" "PVV Mail" "https://webmail.pvv.ntnu.no/roundcube/")
(short "ΩV" "Omega Verksted" "https://omegav.no/")
(dir "Nix" [
@@ -31,21 +31,34 @@ in [
])
(dir "CTF" [
(link "HackTheBox" "https://www.hackthebox.eu/")
(link "TryHackMe" "https://tryhackme.com/dashboard")
(link "OverTheWire" "https://overthewire.org/wargames/")
(link "NetGarage" "https://io.netgarage.org/")
(link "Revshells" "https://revshells.com/")
(link "Exploit Education" "http://exploit.education/")
(link "Webhook" "https://webhook.site")
(link "CyberChef" "https://gchq.github.io/CyberChef/")
(link "Aperisolve" "https://www.aperisolve.com/")
(link "how2heap" "https://github.com/shellphish/how2heap")
(link "Heap Search" "https://kissprogramming.com/heap/heap-search")
(link "CrackStation" "https://crackstation.net/")
(link "FactorDB" "http://factordb.com/")
(link "Syscalls" "https://syscalls.w3challs.com/")
(link "DogBolt" "https://dogbolt.org/")
(link "HackTricks" "https://book.hacktricks.xyz/")
(dir "Practise" [
(link "S2G" "https://s2gctf.ncr.ntnu.no")
(link "Pico CTF" "https://play.picoctf.org/practice")
(link "Pwn college" "https://pwn.college/")
(link "HackTheBox" "https://www.hackthebox.eu")
(link "Crackmes" "https://crackmes.one")
(link "Nightmare" "https://guyinatuxedo.github.io/")
])
])
(dir "Misc & Tools" [
(link "ASCIIFlow" "https://asciiflow.com/#/")
(link "CopyChar" "https://copychar.cc/")
(link "CyberChef" "https://gchq.github.io/CyberChef/")
(link "Device Info" "https://www.deviceinfo.me/")
(link "Diagrams" "https://app.diagrams.net/")
(link "FakeMail" "http://www.fakemailgenerator.com/")
(link "FilePizza" "https://file.pizza/")
(link "IPLeak" "https://ipleak.net/")
(link "LaTeX" "https://www.codecogs.com/latex/eqneditor.php")
(link "ManualsLib" "https://www.manualslib.com/")
+36 -8
View File
@@ -1,10 +1,10 @@
{ pkgs, ... }:
{ pkgs, lib, ... }:
{
"Amazon.com".metaData.hidden = true;
"Bing".metaData.hidden = true;
"Wikipedia (en)".metaData.hidden = true;
"Google".metaData.alias = "gg";
"DuckDuckGo".metaData.alias = "dd";
"amazondotcom-us".metaData.hidden = true;
"bing".metaData.hidden = true;
"wikipedia".metaData.hidden = true;
"google".metaData.alias = "gg";
"ddg".metaData.alias = "dd";
"Arch Package Repository" = {
urls = [{
@@ -57,9 +57,29 @@
definedAliases = [ "gh" ];
};
"GitHub Nix Configs" = {
urls = [{
template = "https://github.com/search";
params = [
{ name = "type"; value = "code"; }
{
name = "q";
value = lib.concatStringsSep " " [
"lang:nix"
"-is:fork"
"-repo:nixos/nixpkgs"
"{searchTerms}"
];
}
];
}];
icon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/github.svg";
definedAliases = [ "ghn" ];
};
"HomeManager Options" = {
urls = [{
template = "https://mipmip.github.io/home-manager-option-search/?{searchTerms}";
template = "https://mipmip.github.io/home-manager-option-search/?query={searchTerms}";
}];
icon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/nixos.svg";
definedAliases = [ "hms" ];
@@ -75,6 +95,14 @@
definedAliases = [ "hg" ];
};
"Kagi" = {
urls = [{
template = "https://kagi.com/search";
params = [{ name = "q"; value = "{searchTerms}"; }];
}];
definedAliases = "k";
};
"Melpa" = {
urls = [{
template = "https://melpa.org/";
@@ -146,7 +174,7 @@
definedAliases = [ "ut" ];
};
"YouTube" = {
"youtube" = {
urls = [{
template = "https://www.youtube.com/results";
params = [{ name = "search_query"; value = "{searchTerms}"; }];
+13
View File
@@ -0,0 +1,13 @@
{ config, lib, ... }:
let
cfg = config.programs.cargo;
in
lib.mkIf cfg.enable {
programs.cargo = {
settings = {
cargo-new.vcs = "git";
};
};
systemd.user.sessionVariables.CARGO_NET_GIT_FETCH_WITH_CLI = "true";
}
+11
View File
@@ -0,0 +1,11 @@
{ ... }:
{
programs.delta = {
enableGitIntegration = true;
options = {
line-numbers = true;
side-by-side = true;
theme = "Monokai Extended Origin";
};
};
}
-38
View File
@@ -1,38 +0,0 @@
{ config, pkgs, lib, ... }:
let
cfg = config.programs.direnv;
in
{
config = {
systemd.user.services.prune-allowed-direnv-dirs = {
Unit = {
Description = "Prune unused allowed directories for direnv";
Documentation = [ "man:direnv(1)" ];
};
Service = {
Type = "oneshot";
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
ExecStart = "${lib.getExe cfg.package} prune";
};
};
systemd.user.timers.prune-allowed-direnv-dirs = {
Unit = {
Description = "Prune unused allowed directories for direnv";
Documentation = [ "man:direnv(1)" ];
};
Timer = {
Unit = "prune-allowed-direnv-dirs.service";
OnCalendar = "daily";
Persistent = true;
};
Install = {
WantedBy = [ "timers.target" ];
};
};
};
}
+11 -7
View File
@@ -1,12 +1,16 @@
{ ... }:
{ config, lib, ... }:
let
cfg = config.programs.direnv;
in
{
imports = [
./auto-prune.nix
];
programs.direnv = {
enable = true;
enableZshIntegration = true;
silent = true;
nix-direnv.enable = true;
enableZshIntegration = true;
enableNushellIntegration = config.programs.nushell.enable;
auto-prune-allowed-dirs.enable = true;
};
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }:
{
programs.element-desktop = { };
}
File diff suppressed because it is too large Load Diff
+55 -18
View File
@@ -1,4 +1,6 @@
{ pkgs, ... }: let
{ config, lib, pkgs, ... }:
let
cfg = config.programs.emacs;
configEl = pkgs.stdenv.mkDerivation {
name = "config.el";
@@ -14,28 +16,63 @@
'';
};
in {
in
lib.mkIf cfg.enable {
xdg.configFile."emacs/init.el".source = configEl.outPath;
programs.emacs = {
enable = true;
extraPackages = epkgs: with epkgs; [
# # package
# gruber-darker-theme
# recentf
centaur-tabs
company
company-box
company-coq
counsel
dashboard
doom-modeline
drag-stuff
emojify
envrc
evil
evil-collection
evil-escape
evil-nerd-commenter
evil-org
fira-code-mode
flycheck
general
git-gutter
helpful
highlight-defined
hl-todo
ivy
ivy-rich
ivy-yasnippet
lorem-ipsum
lsp-ivy
lsp-mode
lsp-treemacs
lsp-ui
magit
monokai-theme
nix-mode
org
org-superstar
projectile
proof-general
rainbow-delimiters
ripgrep
swiper
treemacs
treemacs-evil
treemacs-icons-dired
treemacs-magit
treemacs-projectile
use-package
# evil
# evil-collection
# evil-nerd-commenter
# # org
# evil-org
# monokai-theme
# gruber-darker-theme
# company
# flycheck
# projectile
# yasnippet
# magit
# # recentf
# which-key
which-key
writeroom-mode
yasnippet
];
};
}
+10
View File
@@ -0,0 +1,10 @@
{ config, lib, ... }:
let
cfg = config.programs.eza;
in
{
programs.eza = {
icons = "auto";
enableNushellIntegration = config.programs.nushell.enable;
};
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }:
{
programs.fastfetch = { };
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }:
{
programs.feh = { };
}
+68 -9
View File
@@ -1,18 +1,77 @@
{ pkgs, ... }:
{ config, lib, pkgs, ... }:
{
programs.firefox = {
enable = true;
configPath = "${config.xdg.configHome}/mozilla/firefox";
profiles.h7x4 = {
bookmarks = [{
toolbar = true;
bookmarks = import ./browser/bookmarks.nix;
}];
bookmarks = {
force = true;
settings = [{
toolbar = true;
bookmarks = import ./browser/bookmarks.nix;
}];
};
search = {
default = "Google";
engines = import ./browser/engines.nix { inherit pkgs; };
default = "Kagi";
engines = import ./browser/engines.nix { inherit pkgs lib; };
force = true;
};
settings = {};
# TODO: make into structured attrs
settings = {
# TODO: collect more stuff from here
# https://github.com/arkenfox/user.js
"browser.aboutConfig.showWarning" = false;
"browser.newtabpage.activity-stream.showSponsored" = false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
"browser.newtabpage.activity-stream.feeds.telemetry" = false;
"browser.newtabpage.activity-stream.telemetry" = false;
"datareporting.policy.dataSubmissionEnabled" = false;
"datareporting.healthreport.uploadEnabled" = false;
"toolkit.telemetry.archive.enabled" = false;
"toolkit.telemetry.bhrPing.enabled" = false;
"toolkit.telemetry.coverage.opt-out" = true;
"toolkit.telemetry.enabled" = false;
"toolkit.telemetry.firstShutdownPing.enabled" = false;
"toolkit.telemetry.hybridContent.enabled" = false;
"toolkit.telemetry.newProfilePing.enabled" = false;
"toolkit.telemetry.prompted" = 2;
"toolkit.telemetry.rejected" = true;
"toolkit.telemetry.reportingpolicy.firstRun" = false;
"toolkit.telemetry.server" = "data:,";
"toolkit.telemetry.shutdownPingSender.enabled" = false;
"toolkit.telemetry.unified" = false;
"toolkit.telemetry.unifiedIsOptIn" = false;
"toolkit.telemetry.updatePing.enabled" = false;
"toolkit.coverage.opt-out" = true;
"toolkit.coverage.endpoint.base" = "";
"layout.css.prefers-color-scheme.content-override" = "dark";
"font.cjk_pref_fallback_order" = lib.concatStringsSep "," [
"ja"
"zh-cn"
"zh-hk"
"zh-tw"
"ko"
];
} // (lib.pipe null [
(_: {
"ja" = "JP";
"ko" = "KR";
"zh-CN" = "SC";
"zh-HK" = "HK";
"zh-TW" = "TC";
})
(lib.mapAttrsToList (lang: notoSuffix: {
"font.name.monospace.${lang}" = "Noto Sans Mono CJK ${notoSuffix}";
"font.name.sans-serif.${lang}" = "Noto Sans CJK ${notoSuffix}";
"font.name.serif.${lang}" = "Noto Serif CJK ${notoSuffix}";
}))
(lib.foldl lib.mergeAttrs { })
]);
};
};
}
+9
View File
@@ -0,0 +1,9 @@
{ config, lib, ... }:
let
cfg = config.programs.fzf;
in
{
programs.fzf = {
defaultCommand = "fd --type f";
};
}
+26 -19
View File
@@ -1,25 +1,32 @@
{ pkgs, ... }:
{ config, lib, pkgs, ... }:
let
cfg = config.programs.gdb;
in
{
xdg.configFile."gdb/gdbinit".text = ''
# C++ related beautifiers
set print pretty on
set print object on
set print static-members on
set print vtbl on
set print demangle on
set print sevenbit-strings off
set print asm-demangle on
set print elements 0
options.programs.gdb.enable = lib.mkEnableOption "gdb";
# Assembly
set disassembly-flavor intel
config = lib.mkIf cfg.enable {
xdg.configFile."gdb/gdbinit".text = ''
# C++ related beautifiers
set print pretty on
set print object on
set print static-members on
set print vtbl on
set print demangle on
set print sevenbit-strings off
set print asm-demangle on
set print elements 0
# Save command history between sessions:
set history save
# Assembly
set disassembly-flavor intel
# Print a beautifully colored prompt:
set prompt \001\033[1;36m\002(gdb) \001\033[0m\002
'';
# Save command history between sessions:
set history save
local.shell.aliases."System Tool Replacements".gdb = "${pkgs.pwndbg}/bin/pwndbg";
# Print a beautifully colored prompt:
set prompt \001\033[1;36m\002(gdb) \001\033[0m\002
'';
# local.shell.aliases."System Tool Replacements".gdb = "${pkgs.pwndbg}/bin/pwndbg";
};
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }:
{
programs.gh-dash = { };
}
+1 -2
View File
@@ -1,10 +1,9 @@
{ pkgs, ... }:
{
programs.gh = {
enable = true;
settings = {
gitProtocol = "ssh";
pager = "${pkgs.bat}/git/bat";
pager = "${pkgs.bat}/bin/bat";
aliases = {
co = "pr checkout";
pv = "pr view";
+22
View File
@@ -0,0 +1,22 @@
{ config, lib, pkgs, extendedLib, ... }:
let
cfg = config.programs.ghci;
in
{
options.programs.ghci = {
enable = lib.mkEnableOption "ghci, interactive haskell shell";
package = lib.mkPackageOption pkgs "ghc" { };
};
config = lib.mkIf cfg.enable {
home.packages = [ cfg.package ];
# Personal config
xdg.configFile = {
"ghc/ghci.conf".text = ''
:set prompt "${extendedLib.termColors.front.magenta "[GHCi]λ"} "
'';
};
};
}
+192 -68
View File
@@ -13,53 +13,104 @@ let
"github.com:"
];
in
{
imports = [
./maintenance-timers.nix
];
# TODO: convert to template once nix-sops supports it in hm module
sops.secrets."git/nordicsemi-config" = { };
lib.mkIf cfg.enable {
programs.git = lib.mkMerge [
{
enable = true;
package = pkgs.gitFull;
userName = "h7x4";
userEmail = "h7x4@nani.wtf";
signing = {
key = "46B9228E814A2AAC";
# format = "openpgp";
signByDefault = true;
};
maintenance.enable = true;
lfs.enable = true;
delta = {
enable = true;
options = {
line-numbers = true;
side-by-side = true;
theme = "Monokai Extended Origin";
settings = {
user = {
name = "h7x4";
email = "h7x4@nani.wtf";
};
};
aliases = {
aliases = "!git config --get-regexp alias | sed -re 's/alias\\.(\\S*)\\s(.*)$/\\1 = \\2/g'";
delete-merged = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d";
graph = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all";
graphv = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all";
forcepush = "push --force-with-lease --force-if-includes";
authors = "shortlog --summary --numbered --email";
si = "switch-interactive";
rebase-author = "rebase -i -x \"git commit --amend --reset-author -CHEAD\"";
git = "!git";
};
alias = {
aliases = "!git config --get-regexp alias | sed -re 's/alias\\.(\\S*)\\s(.*)$/\\1 = \\2/g'";
authors = "shortlog --summary --numbered --email";
delete-merged = "!git branch --merged | grep -v -e '\\*' -e 'master' -e 'main' | xargs -n 1 git branch -d";
ff = "fixup-fixup";
fi = "fixup-interactive";
forcepush = "push --force-with-lease --force-if-includes";
git = "!git";
pp = "post-pr";
rebase-author = "rebase -i -x \"git commit --amend --reset-author -CHEAD\"";
reset-to-upstream = "!git reset --hard \"origin/$(git rev-parse --abbrev-ref HEAD)\"";
rf = "rebase-fixups";
si = "switch-interactive";
subs = "submodule update --init --recursive";
} // (let
c = c: s: "%C(${c})${s}%C(reset)";
in {
graph = let
fmt = lib.concatStringsSep "" [
" - "
(c "bold blue" "%h")
" - "
(c "bold green" "(%ar)")
" "
(c "white" "> %s")
" "
(c "dim white" "- %an")
(c "bold yellow" "%d")
];
in "log --graph --abbrev-commit --decorate --format=format:'${fmt}' --all";
graphv = let
fmt = lib.concatStringsSep "" [
(c "bold blue" "%h")
" - "
(c "bold cyan" "%aD")
" "
(c "bold green" "(%ar)")
(c "bold yellow" "%d")
"%n"
" "
(c "white" "%s")
" "
(c "dim white" "- %an")
];
in "log --graph --abbrev-commit --decorate --format=format:'${fmt}' --all";
l = let
fmt = lib.concatStringsSep "%n" (map (x: if builtins.isList x then lib.concatStringsSep " " x else x) [
[ (c "bold yellow" "%H") (c "auto" "%d") ]
[ (c "bold white" "Author:") (c "bold cyan" "%aN <%aE>") (c "bold green" "(%ah)") ]
[ (c "bold white" "Committer:") (c "bold cyan" "%cN <%cE>") (c "bold green" "(%ah)") ]
[ (c "bold white" "GPG: (%G?)") (c "bold magenta" "%GF") "-" (c "bold cyan" "%GS") (c "bold blue" "(%GT) ") ]
""
(c "bold white" "# %s")
"%+b"
(c "dim yellow" "%+N")
]);
# sedExpressions = let
# colorExpr = "\\x1B\\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]";
# colorEndExpr = "\\x1B\\[m";
# colored = x: "${colorExpr}${x}${colorEndExpr}";
# in lib.concatMapStringsSep " " (x: "-e '${x}'") [
# "s|${colored "GPG: \\(N\\)"} ${colored "F3CDA86CC55A9F10D7A069819F2F7D8250F35146"} - ${colored "h7x4 <h7x4@nani.wtf>"} ${colored "\\(ultimate\\)"}|GPG: h7x4|"
# "s|${colored "GPG: \\(N\\)"} ${colored ""} - ${colored ""} ${colored "\\(undefined\\)"}||"
# ];
in "log --decorate --format=tformat:'${fmt}'";
# in "!git log --color=always --format=format:'${fmt}' | sed -E ${sedExpressions} | $PAGER";
});
extraConfig = {
core = {
whitespace = "space-before-tab,-indent-with-non-tab,trailing-space";
whitespace = lib.concatStringsSep "," [
"space-before-tab"
"-indent-with-non-tab"
"trailing-space"
"blank-at-eof"
];
untrackedCache = true;
editor = "nvim";
};
@@ -124,10 +175,13 @@ in
diff = {
mnemonicPrefix = true;
renames = true;
compactionHeuristic = true;
tool = "nvimdiff";
submodule = "log";
};
pager.show = lib.getExe pkgs.bat;
status = {
showUntrackedFiles = "all";
relativePaths = true;
@@ -164,7 +218,22 @@ in
"url \"${lib.head github-uri-prefixes}\"".insteadOf = lib.tail github-uri-prefixes;
web.browser = "google-chrome-stable";
"url \"git@gist.github.com:\"".insteadOf = [
"git://gist.github.com/"
"https://gist.github.com/"
];
"url \"aur@aur.archlinux.org:\"".insteadOf = [
"aur:"
"https://aur.archlinux.org/"
];
gc = {
reflogExpire = "90 days";
reflogExpireUnreachable = "90 days";
};
web.browser = "firefox";
"filter \"lfs\"" = {
required = true;
@@ -202,7 +271,7 @@ in
];
in lib.genAttrs organizations (org: map (uri-prefix: "${uri-prefix}${org}") uri-prefixes);
in {
extraConfig."url \"${lib.head uri-prefixes}\"".insteadOf = lib.tail uri-prefixes;
settings."url \"${lib.head uri-prefixes}\"".insteadOf = lib.tail uri-prefixes;
includes = map (x: {
contentSuffix = "pvv.gitconfig";
@@ -215,43 +284,36 @@ in
};
}) (lib.flatten (lib.attrValues prefixes-per-org));
})
];
(let
bitbucket-uri-prefixes = [
# Preferred
"bitbucket-nordicsemi:"
# Alternative
"ssh://git@bitbucket.nordicsemi.no:7999"
"https://projecttools.nordicsemi.no/bitbucket/scm"
systemd.user.services."git-maintenance@".Service = lib.mkIf cfg.maintenance.enable {
ExecStartPre = let
repoDirs = lib.escapeShellArgs [
"${config.home.homeDirectory}/git"
"${config.home.homeDirectory}/work"
"${config.home.homeDirectory}/pvv"
];
prefixes-per-org = let
organizations = [
"NordicSemiconductor"
"NordicPlayground"
"nrfconnect"
"oysteintveit-nordicsemi"
];
in lib.genAttrs organizations (org: map (uri-prefix: "${uri-prefix}${org}") github-uri-prefixes);
in {
extraConfig = lib.mergeAttrs
{
"url \"${lib.head bitbucket-uri-prefixes}\"".insteadOf = lib.tail bitbucket-uri-prefixes;
}
(lib.mapAttrs' (org: uri-prefixes: {
name = "url \"github-nordicsemi:${org}\"";
value.insteadOf = uri-prefixes;
}) prefixes-per-org)
;
script = pkgs.writeShellApplication {
name = "discover-git-maintenance-repos";
text = ''
{
echo "[maintenance]"
for repoLocation in ${repoDirs}; do
for repo in "$repoLocation"/*/.git; do
echo "repo = $('${pkgs.coreutils}/bin/realpath' "''${repo%"/.git"}")"
done
done
} > "$1"
'';
};
in "${lib.getExe script} %t/maintenance-repos";
ExecStart = lib.mkForce ''
"${lib.getExe cfg.package}" -c include.path="%t/maintenance-repos" for-each-repo --keep-going --config=maintenance.repo maintenance run --schedule=%i
'';
};
includes = map (x: {
contentSuffix = "nordicsemi.gitconfig";
condition = "hasconfig:remote.*.url:${x}/**";
path = config.sops.secrets."git/nordicsemi-config".path;
}) (bitbucket-uri-prefixes ++ (lib.flatten (lib.attrValues prefixes-per-org)));
})
];
home.packages = [
(pkgs.writeShellApplication {
@@ -259,14 +321,76 @@ in
runtimeInputs = with pkgs; [ cfg.package coreutils ];
text = lib.fileContents ./scripts/git-tcommit.sh;
})
(pkgs.writeShellApplication {
name = "git-tmcommit";
runtimeInputs = with pkgs; [ cfg.package coreutils ];
text = lib.pipe ./scripts/git-tcommit.sh [
lib.fileContents
(builtins.replaceStrings ["hours" "tcommit"] ["minutes" "tmcommit"])
];
})
(pkgs.writeShellApplication {
name = "git-fixup-fixup";
runtimeInputs = with pkgs; [ cfg.package ];
text = lib.fileContents ./scripts/git-fixup-fixup.sh;
})
(pkgs.writeShellApplication {
name = "git-rebase-fixups";
runtimeInputs = with pkgs; [ cfg.package gnused ];
text = lib.fileContents ./scripts/git-rebase-fixups.sh;
})
(pkgs.writeShellApplication {
name = "git-fixup-interactive";
runtimeInputs = with pkgs; [ cfg.package gnused gnugrep skim ];
text = lib.fileContents ./scripts/git-fixup-interactive.sh;
})
(pkgs.writeShellApplication {
name = "git-switch-interactive";
runtimeInputs = with pkgs; [ cfg.package fzf gnused coreutils ];
runtimeInputs = with pkgs; [ cfg.package skim gnused gnugrep uutils-coreutils-noprefix ];
text = lib.fileContents ./scripts/git-switch-interactive.sh;
excludeShellChecks = [
"SC2001" # (style): See if you can use ${variable//search/replace} instead. (sed invocation)
"SC2155"
];
})
(pkgs.writeShellApplication {
name = "git-author-lines";
runtimeInputs = with pkgs; [ cfg.package gnused gnugrep gawk uutils-coreutils-noprefix ];
text = lib.fileContents ./scripts/git-author-lines.sh;
})
(pkgs.writeShellApplication {
name = "git-all-commits";
runtimeInputs = with pkgs; [ cfg.package gnugrep gawk findutils uutils-coreutils-noprefix ];
text = lib.fileContents ./scripts/git-all-commits.sh;
})
(pkgs.writeShellApplication {
name = "git-diffc";
runtimeInputs = with pkgs; [ cfg.package gawk ];
text = let
printfLiteral = lib.concatStrings [
"\\033[36m%s\\033[0m\\n"
"\\033[32m%s\\033[0m\\n"
"\\033[31m%s\\033[0m\\n"
];
in ''
git --no-pager diff --shortstat "$@" | awk -F',' '{ printf "${printfLiteral}", $1, $2 ? $2 : "", $3 ? $3 : ""; }'
'';
})
((pkgs.writers.writePython3Bin "git-post-pr" {
libraries = with pkgs.python3Packages; [
tkinter
];
flakeIgnore = [
"E501" # I like long lines grr
];
} (lib.fileContents ./scripts/git-post-pr.py)).overrideAttrs (_: {
postFixup = ''
wrapProgram $out/bin/git-post-pr \
--prefix PATH : ${lib.makeBinPath [
pkgs.github-cli
]}
'';
}))
pkgs.git-absorb
];
-56
View File
@@ -1,56 +0,0 @@
{ config, pkgs, lib, ... }:
let
cfg = config.programs.git;
in
{
systemd.user.services."git-maintenance@" = {
Unit = {
Description = "Optimize Git repositories data";
Documentation = [ "man:git-maintenance(1)" ];
};
Service = {
Type = "oneshot";
ExecStart = "${lib.getExe pkgs.git} for-each-repo --config=maintenance.repo maintenance run --no-quiet --schedule=%i";
Environment = [
"PATH=${lib.makeBinPath (with pkgs; [ cfg.package openssh ])}"
];
LockPersonality = "yes";
MemoryDenyWriteExecute = "yes";
NoNewPrivileges = "yes";
RestrictAddressFamilies = [
"AF_UNIX"
"AF_INET"
"AF_INET6"
"AF_VSOCK"
];
RestrictNamespaces = "yes";
RestrictRealtime = "yes";
RestrictSUIDSGID = "yes";
SystemCallArchitectures = "native";
SystemCallFilter = "@system-service";
};
};
systemd.user.timers."git-maintenance@" = {
Unit = {
Description = "Optimize Git repositories data";
Documentation = [ "man:git-maintenance(1)" ];
};
Timer = {
Persistent = true;
OnCalendar = "%i";
};
Install = {
WantedBy = [ "timers.target" ];
};
};
systemd.user.timers."git-maintenance@hourly".Timer.OnCalendar = "*-*-* 1..23:05:00";
systemd.user.timers."git-maintenance@daily".Timer.OnCalendar = "Tue..Sun *-*-* 0:05:00";
systemd.user.timers."git-maintenance@weekly".Timer.OnCalendar = "Mon 0:05:00";
}
@@ -0,0 +1,15 @@
GIT_ROOT="$(git rev-parse --show-toplevel)"
find "$GIT_ROOT/.git/objects" -type f | \
while read -r file; do
if echo "$file" | grep -Eq '\.idx$'; then
git show-index < "$file" | awk '{print $2}'
elif echo "$file" | grep -Eq '[0-9a-f]{38}$'; then
echo "$(basename "$(dirname "$file")")$(basename "$file")"
fi
done | \
while read -r hash; do
if [ "$(git cat-file -t "$hash")" = commit ]; then
echo "$hash"
fi
done
@@ -0,0 +1,21 @@
set -euo pipefail
if [ -n "${1:-}" ]; then
REF="${1}"
else
REF="HEAD"
fi
# TODO: optionally keep track of which files the authors were present in,
# and print a list of up to N files where the authors contributed the most.
git ls-tree -r "${REF}" \
| while read -r _filemode _objtype _githash filepath; do
if git grep -Il . -- "$filepath" >/dev/null; then
git --no-pager blame --line-porcelain "${filepath}"
fi
done \
| grep --binary-files=without-match '^author ' \
| sed -e 's/author //' \
| awk '{ a[$0]+=1 } END{ for (i in a) { print a[i],i } }' \
| sort --numeric-sort --key 1 --reverse
@@ -0,0 +1,14 @@
if [ -n "${1:-}" ]; then
TARGET_COMMIT="$1"
shift
else
TARGET_COMMIT="HEAD"
fi
COMMIT_MESSAGE=$(git log -1 --pretty=format:'%s' "$TARGET_COMMIT")
if [[ $COMMIT_MESSAGE =~ ^fixup!* ]]; then
git commit -m "$COMMIT_MESSAGE" "$@"
else
git commit --fixup "$TARGET_COMMIT" "$@"
fi
@@ -0,0 +1,18 @@
if [ -n "${1:-}" ]; then
TARGET_BRANCH="$1"
shift
else
TARGET_BRANCH=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')
fi
FORK_POINT=$(git merge-base --fork-point "$TARGET_BRANCH")
COMMITS_SINCE_FORK_POINT=$(git log --format=format:'%s' "$FORK_POINT"..HEAD | grep -v -E '^fixup!')
RESULT=$(sk <<<"$COMMITS_SINCE_FORK_POINT")
if [ "$RESULT" == "" ]; then
echo "Doing nothing..."
else
git commit -m "fixup! $RESULT" "$@"
fi
+130
View File
@@ -0,0 +1,130 @@
import argparse
import json
import subprocess
import tkinter
# TODO: add support for gitea, and maybe other git hosting options.
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
prog="post-pr",
description="Post links to PRs",
)
parser.add_argument("-n", "--no-clipboard", action="store_true", help="do not copy the message to the clipboard")
pr_id = parser.add_mutually_exclusive_group()
pr_id.add_argument("-c", "--current-branch", action="store_true", help="generate post for the PR for the current branch")
pr_id.add_argument("-l", "--latest", action="store_true", help="generate post for the latest PR for the current user")
pr_id.add_argument("pr_id", nargs="?", default=None, help="generate post for the PR with the given ID")
args = parser.parse_args()
if not any([args.current_branch, args.latest, args.pr_id,]):
args.current_branch = True
return args
def _gh(args: list[str]) -> str:
try:
return subprocess.check_output(["gh"] + args).decode("utf8")
except subprocess.CalledProcessError as e:
raise RuntimeError(f"GitHub CLI command failed: 'gh {' '.join(args)}'") from e
def _gh_retcode(args: list[str]) -> int:
return subprocess.run(["gh"] + args, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode
def ensure_gh_installed():
try:
if _gh_retcode(["--version"]) != 0:
raise RuntimeError("GitHub CLI (gh) is not installed, please install it")
except FileNotFoundError:
raise RuntimeError("GitHub CLI (gh) is not installed, please install it")
def ensure_gh_authenticated():
if _gh_retcode(["auth", "status"]) != 0:
raise RuntimeError("Failed to authenticate with GitHub, please run 'gh auth login'")
GH_PR_JSON_FIELDS = ",".join([
"additions",
"deletions",
"state",
"title",
"url",
])
def fetch_pr_data(current_branch: bool, latest: bool, pr_id: str | None) -> dict[str, any]:
if pr_id:
pr_data = _gh(["pr", "view", pr_id, "--json", GH_PR_JSON_FIELDS])
pr_data = json.loads(pr_data)
elif latest:
pr_list = _gh(["pr", "list", "--author", "@me", "--limit", "1", "--json", GH_PR_JSON_FIELDS])
pr_list = json.loads(pr_list)
if len(pr_list) == 0:
raise RuntimeError("Failed to find PR, are you sure you have any open PRs?")
pr_data = pr_list[0]
elif current_branch:
pr_data = _gh(["pr", "view", "--json", GH_PR_JSON_FIELDS])
pr_data = json.loads(pr_data)
return pr_data
def format_message(pr_data: dict[str, any]) -> str:
additions = pr_data["additions"]
deletions = pr_data["deletions"]
title = pr_data["title"]
pr_url = pr_data["url"]
pr_state = pr_data["state"]
state_html = f"({pr_state.lower()}) " if pr_state != "OPEN" else ""
additions_html = f"+{additions}" if additions > 0 else str(additions)
deletions_html = f"-{deletions}" if deletions > 0 else str(deletions)
return f"""{state_html}{pr_url} {title} [diff: {additions_html}/{deletions_html}]"""
def copy_to_clipboard(message: str):
r = tkinter.Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append(message)
r.update()
r.destroy()
def main():
args = parse_args()
ensure_gh_installed()
ensure_gh_authenticated()
pr_data = fetch_pr_data(args.current_branch, args.latest, args.pr_id)
message = format_message(pr_data)
print("Message:\n")
print(f" {message}\n")
if not args.no_clipboard:
copy_to_clipboard(message)
print("Copied to clipboard")
if __name__ == "__main__":
try:
main()
except Exception as e:
print(f"Error: {e}")
exit(1)
@@ -0,0 +1,10 @@
if [ -n "${1:-}" ]; then
TARGET_BRANCH="$1"
shift
else
TARGET_BRANCH=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')
fi
FORK_POINT=$(git merge-base --fork-point "$TARGET_BRANCH")
git rebase "$FORK_POINT" --autosquash "$@"
@@ -1,16 +1,136 @@
set -euo pipefail
if [ -n "${1:-}" ]; then
if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ] || [ $# -ge 2 ]; then
declare -r ARGV0=$(basename "${0:-git-switch-interactive.sh}")
printf 'Usage: %s [BRANCH]\n' "$ARGV0" >&2
cat <<'EOF' >&2
Interactively choose a local branch, remote branch, or tag to switch to.
Options:
-h, --help Show this help and exit
BRANCH If a single branch/tag/ref is provided, the script will
run git switch BRANCH and exit.
EOF
exit 0
fi
if [ $# -eq 1 ]; then
git switch "$1"
exit 0
fi
BRANCHES=$(cat <(git branch) <(git branch --remotes) | grep --invert-match '^\*\|HEAD ->' | sed 's|^\s*||')
CHOSEN_BRANCH=$(fzf --reverse --info=inline --preview 'git show --color {}' <<<"$BRANCHES")
declare -r BRANCH_COLOR=$'\033[32m'
declare -r REMOTE_COLOR=$'\033[33m'
declare -r ORIGIN_COLOR=$'\033[31m'
declare -r TAG_COLOR=$'\033[35m'
declare -r RESET_COLOR=$'\033[0m'
CLEAN_BRANCH_NAME=$(sed 's|^\s*||' <<<"$CHOSEN_BRANCH")
for REMOTE in $(git remote); do
CLEAN_BRANCH_NAME=$(sed "s|^${REMOTE}/||" <<<"$CLEAN_BRANCH_NAME")
done
if [ -n "${NO_COLOR:-}" ]; then
declare -r BRANCH_COLOR=''
declare -r REMOTE_COLOR=''
declare -r ORIGIN_COLOR=''
declare -r TAG_COLOR=''
declare -r RESET_COLOR=''
fi
git switch "${CLEAN_BRANCH_NAME}"
declare -r STRIP_ANSI_SED='s/\x1B\[[0-9;]*[a-zA-Z]//g'
declare -r TRIM_SPACE_SED='s/^[[:space:]]+//; s/[[:space:]]+$//'
declare -r STRIP_SURROUNDING_QUOTES_SED="s/^[[:space:]\"'[]+//; s/[[:space:]\"'\\]]+\$//; s/^\"\\[+//; s/^\\[+//; s/\\]+$//"
sanitize_ref_from_git() {
sed -E \
-e "$STRIP_ANSI_SED" \
-e "$TRIM_SPACE_SED" \
-e "$STRIP_SURROUNDING_QUOTES_SED" <<<"$1"
}
declare -a VISIBLE_ITEMS=()
while IFS= read -r ref; do
[ -z "$ref" ] && continue
VISIBLE_ITEMS+=("${BRANCH_COLOR}(branch)${RESET_COLOR} $(sanitize_ref_from_git "$ref")")
done < <(git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads 2>/dev/null)
while IFS= read -r ref; do
[ -z "$ref" ] && continue
case "$ref" in
*/*)
remote_part="$(sanitize_ref_from_git "${ref%%/*}")"
branch_part="$(sanitize_ref_from_git "${ref#*/}")"
if [ -z "$branch_part" ] || [ "$branch_part" = "HEAD" ]; then
continue
fi
VISIBLE_ITEMS+=("${REMOTE_COLOR}(remote)${RESET_COLOR} ${ORIGIN_COLOR}${remote_part}${RESET_COLOR}/${branch_part}")
;;
*)
continue
;;
esac
done < <(git for-each-ref --format='%(refname:short)' refs/remotes 2>/dev/null)
while IFS= read -r ref; do
[ -z "$ref" ] && continue
VISIBLE_ITEMS+=("${TAG_COLOR}(tag)${RESET_COLOR} $(sanitize_ref_from_git "$ref")")
done < <(git for-each-ref --format='%(refname:short)' refs/tags 2>/dev/null)
if [ ${#VISIBLE_ITEMS[@]} -eq 0 ]; then
echo "No branches or tags found." >&2
exit 1
fi
declare -r SKIM_PREVIEW_COMMAND_RAW=$(cat <<'EOF'
raw=$(printf "%s" {} | sed -r 's/\x1B\[[0-9;]*[A-Za-z]//g')
ref=$(printf "%s" "$raw" | sed -n -E 's/^[[:space:]]*\([^)]*\)[[:space:]]*(.*)$/\1/p')
git show --color "$ref" 2>/dev/null || git log -n 50 --color "$ref"
EOF
)
declare -r SKIM_PREVIEW_COMMAND_=${SKIM_PREVIEW_COMMAND_RAW//$'\n'/'; '}
declare -r SKIM_PREVIEW_COMMAND=${SKIM_PREVIEW_COMMAND_%'; '}
CHOSEN=$(printf '%s\n' "${VISIBLE_ITEMS[@]}" | sk --ansi --reverse --info=inline --preview "$SKIM_PREVIEW_COMMAND")
[ -z "${CHOSEN:-}" ] && exit 0
declare -r CLEAN=$(sed -E \
-e "$STRIP_ANSI_SED" \
-e "$TRIM_SPACE_SED" \
<<<"$CHOSEN"
)
declare -r PARSED=$(sed -n -E "s/^[[:space:]]*\(([^)]*)\)[[:space:]]*(.*)$/\1|\2/p" <<<"$CLEAN") || true
if [ -z "$PARSED" ]; then
echo "Failed to parse selection: $CLEAN" >&2
exit 2
fi
declare -r TYPE=${PARSED%%|*}
declare -r RAW_REF=${PARSED#*|}
declare -r REF=$(sanitize_ref_from_git "$RAW_REF")
case "$TYPE" in
tag)
git switch --detach "$REF"
;;
remote)
SWITCH_NAME="$REF"
for R in $(git remote 2>/dev/null); do
if [ "${REF#"${R}"/}" != "$REF" ]; then
CAND=${REF#"${R}"/}
if git show-ref --verify --quiet "refs/heads/$CAND"; then
SWITCH_NAME="$CAND"
break
fi
fi
done
git switch "$SWITCH_NAME"
;;
branch)
git switch "$REF"
;;
*)
git switch "$REF"
;;
esac
exit 0
+5
View File
@@ -1,5 +1,10 @@
set -euo pipefail
if [[ $# -lt 1 ]]; then
echo "Usage: git tcommit [-]<hours>"
exit 1
fi
HOUR_SHIFT="$1"
shift
@@ -1,13 +1,9 @@
{ pkgs, config, ... }:
{
imports = [
./auto-refresh-keys.nix
./auto-update-trust-db.nix
./declarative-key-fetcher.nix
];
{ config, lib, pkgs, ... }:
let
cfg = config.programs.gpg;
in
lib.mkIf cfg.enable {
programs.gpg = {
enable = true;
homedir = "${config.xdg.configHome}/gnupg";
auto-refresh-keys.enable = true;
@@ -20,7 +16,7 @@
];
};
fetch-keys = {
key-fetchers.keyserver = {
enable = true;
keys = {
"495A898FC1A0276F51EA3155355E5D82B18F4E71" = { trust = 4; };
@@ -32,10 +28,11 @@
services.gpg-agent = {
enable = true;
pinentryPackage = pkgs.pinentry-curses;
pinentry.package = pkgs.pinentry-curses;
enableExtraSocket = true;
enableSshSupport = true;
enableScDaemon = true;
enableNushellIntegration = config.programs.nushell.enable;
grabKeyboardAndMouse = false;
};
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }:
{
programs.helix = { };
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }:
{
programs.home-manager = { };
}
+56
View File
@@ -0,0 +1,56 @@
{ config, pkgs, lib, ... }:
let
cfg = config.wayland.windowManager.hyprland;
in
{
imports = [
./hypridle.nix
./hyprland.nix
./hyprlock.nix
./hyprpaper.nix
./hyprpolkitagent.nix
./keybinds.nix
./scratchpads.nix
./windowrules.nix
./xdg-portals.nix
];
config = lib.mkIf cfg.enable {
systemd.user.sessionVariables = {
WLR_NO_HARDWARE_CURSORS = "1";
WLR_RENDERER_ALLOW_SOFTWARE = "1";
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";
GDK_BACKEND = "wayland,x11,*";
QT_QPA_PLATFORM = "wayland;xcb";
NIXOS_OZONE_WL = "1";
MOZ_ENABLE_WAYLAND = "1";
SDL_VIDEODRIVER = "wayland";
OZONE_PLATFORM = "wayland";
CLUTTER_BACKEND = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
# QT_QPA_PLATFORMTHEME = "qt6ct";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
# LIBVA_DRIVER_NAME = "nvidia";
# GBM_BACKEND = "nvidia-drm";
# __GLX_VENDOR_LIBRARY_NAME = "nvidia";
};
home.packages = with pkgs; [
wl-clipboard-rs
];
systemd.user.services = {
waybar.Unit.After = lib.mkForce "graphical-session.target";
network-manager-applet.Unit.After = lib.mkForce "graphical-session.target";
fcitx5-daemon = {
Unit.After = lib.mkForce "graphical-session.target";
Service.Slice = "session.slice";
};
};
};
}
+36
View File
@@ -0,0 +1,36 @@
{ config, pkgs, lib, ... }:
let
cfg = config.wayland.windowManager.hyprland;
in
{
config = lib.mkIf cfg.enable {
services.hypridle = {
enable = true;
settings = {
general = {
ignore_dbus_inhibit = false;
lock_cmd = "pidof hyprlock || ${config.programs.hyprlock.package}/bin/hyprlock";
before_sleep_cmd = "${pkgs.systemd}/bin/loginctl lock-session";
after_sleep_cmd = "${cfg.finalPackage}/bin/hyprctl dispatch dpms on";
};
listener = [
{
timeout = 900;
on-timeout = "${config.programs.hyprlock.package}/bin/hyprlock";
}
{
timeout = 1200;
on-timeout = "${cfg.finalPackage}/bin/hyprctl dispatch dpms off";
on-resume = "${cfg.finalPackage}/bin/hyprctl dispatch dpms on";
}
];
};
};
systemd.user.services.hypridle = {
Unit.After = lib.mkForce "graphical-session.target";
Service.Slice = "session.slice";
};
};
}
+135
View File
@@ -0,0 +1,135 @@
{ lib, ... }:
{
wayland.windowManager.hyprland = {
systemd.enable = false;
systemd.enableXdgAutostart = false;
configType = "lua";
settings = {
on._args = [
"hyprland.start"
(lib.generators.mkLuaInline ''
function()
hl.exec_cmd("uwsm finalize")
end
'')
];
monitor = [
# TODO: host specific
{
output = "eDP-1";
mode = "3840x2400@90.00Hz";
position = "0x0";
scale = "2";
}
# PVV Demiurgen
{
output = "desc:Hewlett Packard HP ZR24w CNT01711G6";
mode = "1920x1200";
position = "1920x-1200";
scale = "1";
}
{
output = "desc:Hewlett Packard HP ZR24w CNT018103H";
mode = "1920x1200";
position = "0x-1200";
scale = "1";
}
# PVV Eirin
{
output = "desc:Hewlett Packard HP ZR24w CNT01710L4";
mode = "1920x1200";
position = "1920x-1200";
scale = "1";
}
{
output = "desc:Hewlett Packard HP ZR24w CNT0181039";
mode = "1920x1200";
position = "0x-1200";
scale = "1";
}
{
output = "";
mode = "preferred";
position = "auto";
scale = "auto";
}
];
config = {
general = {
gaps_in = 5;
gaps_out = 15;
border_size = 2;
"col.active_border" = {
colors = [
"rgba(33ccffee)"
"rgba(00ff99ee)"
];
angle = 45;
};
"col.inactive_border" = "rgba(595959aa)";
resize_on_border = false;
allow_tearing = false;
layout = "master";
};
decoration = {
rounding = 10;
# Change transparency of focused and unfocused windows
active_opacity = 1.0;
inactive_opacity = 1.0;
# drop_shadow = true;
# shadow_range = 4;
# shadow_render_power = 3;
# "col.shadow" = "rgba(1a1a1aee)";
# https://wiki.hyprland.org/Configuring/Variables/#blur
blur = {
enabled = true;
size = 3;
passes = 1;
vibrancy = 0.1696;
};
};
animations.enabled = false;
master = {
new_status = "slave";
};
misc = {
force_default_wallpaper = 0; # Set to 0 or 1 to disable the anime mascot wallpapers
disable_hyprland_logo = false; # If true disables the random hyprland logo / anime girl background. :(
};
input ={
kb_layout = "us";
kb_variant = "";
kb_model = "";
kb_options = "caps:escape";
kb_rules = "";
follow_mouse = 1;
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
touchpad = {
natural_scroll = false;
};
};
};
};
};
}
+48
View File
@@ -0,0 +1,48 @@
{ config, pkgs, lib, ... }:
let
cfg = config.wayland.windowManager.hyprland;
in
{
config = lib.mkIf cfg.enable {
programs.hyprlock = {
enable = true;
settings = {
general = {
disable_loading_bar = true;
grace = 0;
hide_cursor = true;
no_fade_in = false;
};
background = [
{
path = "screenshot";
blur_passes = 3;
blur_size = 8;
}
];
input-field = [
{
size = "200, 50";
position = "0, -80";
monitor = "";
dots_center = true;
fade_on_empty = false;
font_color = "rgb(202, 211, 245)";
inner_color = "rgb(91, 96, 120)";
outer_color = "rgb(24, 25, 38)";
outline_thickness = 5;
placeholder_text = ''Password...'';
shadow_passes = 2;
}
];
auth = {
"pam:enabled" = true;
"pam:module" = "hyprlock";
};
};
};
};
}
+17
View File
@@ -0,0 +1,17 @@
{ config, lib, ... }:
let
cfg = config.wayland.windowManager.hyprland;
in
{
config = lib.mkIf cfg.enable {
services.hyprpaper = {
enable = true;
settings.ipc = true;
};
systemd.user.services.hyprpaper = {
Unit.After = lib.mkForce "graphical-session.target";
Service.Slice = "session.slice";
};
};
}
@@ -0,0 +1,14 @@
{ config, lib, ... }:
let
cfg = config.wayland.windowManager.hyprland;
in
{
config = lib.mkIf cfg.enable {
services.hyprpolkitagent.enable = true;
systemd.user.services.hyprpolkitagent = {
Unit.After = lib.mkForce "graphical-session.target";
Service.Slice = "session.slice";
};
};
}
+196
View File
@@ -0,0 +1,196 @@
{ config, pkgs, lib, ... }:
let
cfg = config.wayland.windowManager.hyprland;
in
{
config = lib.mkIf cfg.enable {
wayland.windowManager.hyprland.settings = let
exe = lib.getExe;
in {
mod._var = "SUPER";
# https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h
bind = let
lua = lib.generators.mkLuaInline;
mod = key: args: {
_args = [
(lua "mod .. \" + ${key}\"")
] ++ args;
};
in [
(mod "SHIFT + Q" [
(lua "hl.dsp.exec_cmd(\"uwsm stop\")")
])
(mod "ALT + SHIFT + Q" [
(lua "hl.dsp.exec_cmd(\"${pkgs.systemd}/bin/loginctl terminate-user '${config.home.username}'\")")
])
(mod "R" [
(lua "hl.dsp.exec_cmd(\"uwsm app -- ${exe config.programs.anyrun.package}\")")
])
(mod "T" [
(lua "hl.dsp.window.float({ action = \"toggle\" })")
])
(mod "F" [
(lua "hl.dsp.window.fullscreen({ action = \"toggle\", mode = \"maximized\" })")
])
(mod "SHIFT + F" [
(lua "hl.dsp.window.fullscreen({ action = \"toggle\", mode = \"fullscreen\" })")
])
(mod "C" [
(lua "hl.dsp.exec_cmd(\"${cfg.finalPackage}/bin/hyprctl reload\")")
])
(mod "BACKSPACE" [
(lua "hl.dsp.window.close()")
])
(mod "SHIFT + BACKSPACE" [
(lua "hl.dsp.window.kill()")
])
(mod "SHIFT + RETURN" [
(lua "hl.dsp.exec_cmd(\"${exe pkgs.app2unit} -t service -C -s app-graphical.slice -- ${exe pkgs.alacritty} --class termTerminal -e ${exe pkgs.tmux} new-session -A -s term\")")
])
(mod "SHIFT + SPACE" [
(lua "hl.dsp.exec_cmd(\"${exe pkgs.app2unit} -t service -C -s app-graphical.slice -- ${exe pkgs.alacritty} --class termTerminal -e ${exe pkgs.tmux} new-session -A -s term\")")
])
(mod "j" [(lua "hl.dsp.layout(\"cyclenext\")")])
(mod "k" [(lua "hl.dsp.layout(\"cycleprev\")")])
(mod "SHIFT + j" [(lua "hl.dsp.layout(\"swapnext\")")])
(mod "SHIFT + k" [(lua "hl.dsp.layout(\"swapprev\")")])
(mod "1" [(lua "hl.dsp.focus({ workspace = 1, on_current_monitor = true })")])
(mod "2" [(lua "hl.dsp.focus({ workspace = 2, on_current_monitor = true })")])
(mod "3" [(lua "hl.dsp.focus({ workspace = 3, on_current_monitor = true })")])
(mod "4" [(lua "hl.dsp.focus({ workspace = 4, on_current_monitor = true })")])
(mod "5" [(lua "hl.dsp.focus({ workspace = 5, on_current_monitor = true })")])
(mod "6" [(lua "hl.dsp.focus({ workspace = 6, on_current_monitor = true })")])
(mod "7" [(lua "hl.dsp.focus({ workspace = 7, on_current_monitor = true })")])
(mod "8" [(lua "hl.dsp.focus({ workspace = 8, on_current_monitor = true })")])
(mod "9" [(lua "hl.dsp.focus({ workspace = 9, on_current_monitor = true })")])
(mod "SHIFT + 1" [(lua "hl.dsp.window.move({ workspace = 1 })")])
(mod "SHIFT + 2" [(lua "hl.dsp.window.move({ workspace = 2 })")])
(mod "SHIFT + 3" [(lua "hl.dsp.window.move({ workspace = 3 })")])
(mod "SHIFT + 4" [(lua "hl.dsp.window.move({ workspace = 4 })")])
(mod "SHIFT + 5" [(lua "hl.dsp.window.move({ workspace = 5 })")])
(mod "SHIFT + 6" [(lua "hl.dsp.window.move({ workspace = 6 })")])
(mod "SHIFT + 7" [(lua "hl.dsp.window.move({ workspace = 7 })")])
(mod "SHIFT + 8" [(lua "hl.dsp.window.move({ workspace = 8 })")])
(mod "SHIFT + 9" [(lua "hl.dsp.window.move({ workspace = 9 })")])
(mod "b" [(lua "hl.dsp.exec_cmd(\"${pkgs.fcitx5}/bin/fcitx5-remote -s mozc\")")])
(mod "n" [(lua "hl.dsp.exec_cmd(\"${pkgs.fcitx5}/bin/fcitx5-remote -s keyboard-no\")")])
(mod "m" [(lua "hl.dsp.exec_cmd(\"${pkgs.fcitx5}/bin/fcitx5-remote -s keyboard-us\")")])
(mod "l" [(lua "hl.dsp.exec_cmd(\"${pkgs.systemd}/bin/loginctl lock-session\")")])
# TODO: fix
# "super + minus" = "${pkgs.xcalib}/bin/xcalib -invert -alter"
{
_args = [
(lua "\"PRINT\"")
(lua "hl.dsp.exec_cmd(\"${exe pkgs.grimblast} copy area\")")
];
}
{
_args = [
(lua "\"SHIFT + PRINT\"")
(lua "hl.dsp.exec_cmd(\"${lib.getExe pkgs.grimblast} save\")")
];
}
# "SHIFT, Print, exec, ${lib.getExe pkgs.grimblast} save"
# "shift + @Print" = "${pkgs.maim}/bin/maim --hidecursor --nokeyboard $SCREENSHOT_DIR/$(date +%s).png"
# "$mod, Print, exec, ${exe pkgs.woomer}"
(mod "mouse:272" [
(lua "hl.dsp.window.drag()")
(lua "{ mouse = true }")
])
(mod "Control_L" [
(lua "hl.dsp.window.drag()")
(lua "{ mouse = true }")
])
(mod "mouse:273" [
(lua "hl.dsp.window.resize()")
(lua "{ mouse = true }")
])
(mod "ALT_L" [
(lua "hl.dsp.window.resize()")
(lua "{ mouse = true }")
])
(mod "p" [
(lua "hl.dsp.exec_cmd(\"${exe pkgs.mpc} toggle\")")
(lua "{ locked = true }")
])
{
_args = [
(lua "\"XF86AudioPlay\"")
(lua "hl.dsp.exec_cmd(\"${exe pkgs.mpc} toggle\")")
(lua "{ locked = true }")
];
}
{
_args = [
(lua "\"XF86AudioPrev\"")
(lua "hl.dsp.exec_cmd(\"${exe pkgs.mpc} prev\")")
(lua "{ locked = true }")
];
}
{
_args = [
(lua "\"XF86AudioNext\"")
(lua "hl.dsp.exec_cmd(\"${exe pkgs.mpc} next\")")
(lua "{ locked = true }")
];
}
{
_args = [
(lua "\"XF86MonBrightnessUp\"")
(lua "hl.dsp.exec_cmd(\"${exe pkgs.brightnessctl} s +5%\")")
(lua "{ locked = true, repeating = true }")
];
}
{
_args = [
(lua "\"XF86MonBrightnessDown\"")
(lua "hl.dsp.exec_cmd(\"${exe pkgs.brightnessctl} s 5%-\")")
(lua "{ locked = true, repeating = true }")
];
}
{
_args = [
(lua "\"XF86AudioLowerVolume\"")
(lua "hl.dsp.exec_cmd(\"${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-\")")
(lua "{ locked = true, repeating = true }")
];
}
{
_args = [
(lua "\"XF86AudioRaiseVolume\"")
(lua "hl.dsp.exec_cmd(\"${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%+\")")
(lua "{ locked = true, repeating = true }")
];
}
(mod "F7" [
(lua "hl.dsp.exec_cmd(\"${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-\")")
(lua "{ locked = true, repeating = true }")
])
(mod "F8" [
(lua "hl.dsp.exec_cmd(\"${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%+\")")
(lua "{ locked = true, repeating = true }")
])
];
};
};
}
+140
View File
@@ -0,0 +1,140 @@
{ config, pkgs, lib, ... }: let
cfg = config.wayland.windowManager.hyprland;
in
{
config = lib.mkIf cfg.enable {
wayland.windowManager.hyprland.settings = let
exe = lib.getExe;
scratchpads = [
(rec {
title = "Floating terminal";
class = "floatingTerminal";
command = "uwsm app -- ${exe pkgs.alacritty} --class ${class} -e ${exe pkgs.tmux} new-session -A -s f";
size = { h = 90; w = 95; };
keys = [
(lib.generators.mkLuaInline "mod .. \" + RETURN\"")
(lib.generators.mkLuaInline "mod .. \" + SPACE\"")
];
})
(rec {
title = "Ncmpcpp";
class = "floatingNcmpcpp";
command = "uwsm app -- ${exe pkgs.alacritty} --class ${class} -e ${exe pkgs.ncmpcpp}";
size = { h = 90; w = 95; };
keys = [
(lib.generators.mkLuaInline "mod .. \" + Q\"")
];
})
# "$mod, W, emacs"
# "$mod, E, filebrowser"
# "$mod, X, taskwarriortui"
];
in {
scratchpads._var = scratchpads;
fixScratchpad._var = lib.generators.mkLuaInline ''
function(scratchpad, window, monitor_)
local monitor = monitor_
if monitor == nil then
monitor = window.monitor
end
local scaled_w = monitor.width * (1/monitor.scale)
local scaled_h = monitor.height * (1/monitor.scale)
-- I have no idea why these need to be run twice, but despite the values being the same,
-- it somehow always misplaces the window the first time around...
hl.dispatch(hl.dsp.window.move({
x = monitor.x + (scaled_w * (((100 -scratchpad.size.w) / 2) / 100)),
y = monitor.y + (scaled_h * (((100 -scratchpad.size.h) / 2) / 100)),
relative = false
}))
hl.dispatch(hl.dsp.window.resize({
x = scaled_w * scratchpad.size.w / 100,
y = scaled_h * scratchpad.size.h / 100,
relative = false
}))
hl.dispatch(hl.dsp.window.move({
x = monitor.x + (scaled_w * (((100 -scratchpad.size.w) / 2) / 100)),
y = monitor.y + (scaled_h * (((100 -scratchpad.size.h) / 2) / 100)),
relative = false
}))
hl.dispatch(hl.dsp.window.resize({
x = scaled_w * scratchpad.size.w / 100,
y = scaled_h * scratchpad.size.h / 100,
relative = false
}))
end
'';
invokeScratchpad._var = lib.generators.mkLuaInline ''
function(scratchpad)
local scratchpad_window = hl.get_window("class:^(" .. scratchpad.class .. ")$")
local current_workspace = hl.get_active_workspace()
if scratchpad_window == nil then
hl.dispatch(hl.dsp.exec_cmd(scratchpad.command, {
workspace = current_workspace.id
}))
else
hl.dispatch(hl.dsp.focus({ window = scratchpad_window }))
if scratchpad_window.workspace.id ~= current_workspace.id then
hl.dispatch(hl.dsp.window.move({ workspace = current_workspace.id }))
fixScratchpad(scratchpad, scratchpad_window, current_workspace.monitor)
else
hl.dispatch(hl.dsp.window.move({ workspace = "special:" .. scratchpad.class .. "Ws", follow = false }))
end
end
end
'';
bind = lib.concatLists (lib.imap1 (i: { keys, command, class, size, ... }: map (key: {
_args = [
key
(lib.generators.mkLuaInline "function() invokeScratchpad(scratchpads[${toString i}]) end")
];
}) keys) scratchpads);
window_rule = map ({ class, size, ... }: {
name = "scratchpad_${class}";
match.class = "^(${class})$";
float = true;
size = [
"(monitor_w*${toString (size.w / 100.0)})"
"(monitor_h*${toString (size.h / 100.0)})"
];
move = [
"(monitor_w*${toString (((100 - size.w) / 2) / 100.0)})"
"(monitor_h*${toString (((100 - size.h) / 2) / 100.0)})"
];
}) scratchpads;
# TODO: fix me
on._args = [
"workspace.move_to_monitor"
(lib.mkLuaInline ''
function(workspace, monitor)
for _, scratchpad in pairs(scratchpads) do
local scratchpad_window = hl.get_window("class:^(" .. scratchpad.class .. ")$")
if scratchpad_window == nil or scratchpad_window.workspace.id ~= workspace.id then
-- NOTE: crazy that there's no continue in lua...
goto continue
end
-- hl.notification.create({
-- time = 3000,
-- text = "Fixing scratchpad " .. scratchpad.class .. " to monitor " .. monitor.name
-- })
fixScratchpad(scratchpad, scratchpad_window, monitor)
::continue::
end
end
'')
];
};
};
}
+114
View File
@@ -0,0 +1,114 @@
{ config, lib, ... }:
let
cfg = config.wayland.windowManager.hyprland;
in
{
config = lib.mkIf cfg.enable {
wayland.windowManager.hyprland.settings.window_rule = [
{
match.class = "^(Rofi)$";
float = true;
}
{
match.class = "^(xdg-desktop-portal-gtk)$";
float = true;
}
{
match.title = "^(.*Bitwarden Password Manager.*)$";
float = true;
}
{
match.title = "^(Picture-in-Picture)$";
float = true;
}
{
match.class = "^(Nsxiv)$";
tile = true;
}
{
match.class = "^(Gimp-2.*)$";
match.title = "^(Open Image)$";
float = true;
size = [
"70%"
"70%"
];
center = true;
}
# {
# match.class = "^(xdg-desktop-portal-gtk)$";
# dimaround = true;
# }
{
match.title = "^(Firefox Sharing Indicator)$";
workspace = "special:silent";
}
{
match.title = "^(Zen Sharing Indicator)$";
workspace = "special:silent";
}
{
match.title = "^(.*is sharing (your screen|a window)\\.)$";
workspace = "special:silent";
}
{
}
{
match.class = "^(firefox)$";
workspace = 2;
}
{
match.class = "^(chromium)$";
workspace = 2;
}
{
match.class = "^(Emacs)$";
workspace = 3;
}
{
match.class = "^(code)$";
workspace = 3;
}
{
match.class = "^(code-url-handler)$";
workspace = 3;
}
{
match.class = "^(dev.zed.Zed)$";
workspace = 3;
}
{
match.class = "^(discord)$";
workspace = 5;
}
{
match.class = "^(Element)$";
workspace = 5;
}
{
match.class = "^(anyrun)$";
float = true;
}
{
match.class = "^(xdg-desktop-portal-termfilechooser)$";
float = true;
size = [
"70%"
"80%"
];
move = [
"15%"
"10%"
];
}
];
};
}
+34
View File
@@ -0,0 +1,34 @@
{ config, pkgs, lib, ... }:
let
cfg = config.wayland.windowManager.hyprland;
in {
config = lib.mkIf cfg.enable {
xdg.portal = {
xdgOpenUsePortal = true;
configPackages = with pkgs; [ gnome-session ];
extraPortals = with pkgs; [
gnome-keyring
xdg-desktop-portal-gtk
xdg-desktop-portal-termfilechooser
];
config.hyprland = {
default = "hyprland;gtk;";
"org.freedesktop.impl.portal.FileChooser" = [ "termfilechooser" ];
"org.freedesktop.impl.portal.OpenURI" = [ "gtk" ];
"org.freedesktop.impl.portal.Notification" = [ "gtk" ];
"org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ];
};
};
xdg.configFile."xdg-desktop-portal-termfilechooser/config".source =
(pkgs.formats.ini { listsAsDuplicateKeys = true; }).generate "xdg-desktop-portal-termfilechooser.ini" {
filechooser = {
cmd = "${pkgs.xdg-desktop-portal-termfilechooser}/share/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh";
default_dir = "$HOME";
env = [
"TERMCMD=alacritty -T \"Filechooser\" --class \"xdg-desktop-portal-termfilechooser\" --command"
];
};
};
};
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }:
{
programs.jq = { };
}
+1 -2
View File
@@ -1,8 +1,7 @@
{ config, ... }:
{
programs.less = {
enable = true;
keys = ''
config = ''
#env
LESS = -i -R
LESSHISTSIZE=20000
+6
View File
@@ -0,0 +1,6 @@
{ ... }:
{
programs.man = {
generateCaches = true;
};
}
+8
View File
@@ -0,0 +1,8 @@
{ pkgs, ... }:
{
programs.meli = {
package = pkgs.meli.overrideAttrs {
doCheck = false;
};
};
}
+14
View File
@@ -0,0 +1,14 @@
{ config, lib, machineVars, ... }:
{
programs.mpv = {
config = {
screenshot-directory = "${config.xdg.userDirs.pictures}/mpv-screenshots";
#https://wiki.nixos.org/wiki/Accelerated_Video_Playback
hwdec = "auto-safe";
vo = "gpu";
profile = "gpu-hq";
gpu-context = lib.mkIf machineVars.wayland "wayland";
};
};
}
+4 -5
View File
@@ -1,7 +1,6 @@
{pkgs, ...}:
{ config, pkgs, ... }:
{
programs.ncmpcpp = {
enable = true;
package = pkgs.ncmpcpp.override { visualizerSupport = true; };
bindings = [
@@ -332,11 +331,11 @@
window_border_color = "green";
active_window_border = "red";
visualizer_data_source = "/tmp/mpd.fifo";
visualizer_data_source = "/run/user/${toString config.home.uid}/mpd/visualizer.fifo";
visualizer_output_name = "Visualizer feed";
visualizer_in_stereo = "no";
visualizer_type = "spectrum"; # spectrum, ellipse, wave_filled, wave
visualizer_look = "+"; # wave | spectrum, ellipse, wave_filled
# visualizer_type = "spectrum"; # spectrum, ellipse, wave_filled, wave
# visualizer_look = "+█"; # wave | spectrum, ellipse, wave_filled
};
};
}
+39
View File
@@ -0,0 +1,39 @@
{ config, lib, ... }:
let
cfg = config.programs.neomutt;
in lib.mkIf cfg.enable {
programs.neomutt = {
vimKeys = true;
sidebar.enable = true;
settings = {
debug_file = "${config.xdg.dataHome}/neomutt/debug0";
history_file = "${config.xdg.dataHome}/neomutt/history";
mailcap_path = "${config.xdg.configHome}/neomutt/mailcap";
# header_cache = "${config.xdg.cacheHome}/neomutt/headers";
# message_cache_dir = "${config.xdg.cacheHome}/neomutt/messages";
news_cache_dir = "${config.xdg.cacheHome}/neomutt/news";
tmp_dir = "/run/user/${toString config.home.uid}/neomutt";
alias_file = "${config.xdg.dataHome}/neomutt/aliases";
};
extraConfig = ''
source "${config.xdg.dataHome}/neomutt/aliases"
# vim: filetype=neomuttrc
'';
};
xdg.configFile."neomutt/mailcap".text = ''
# vim: filetype=muttrc
text/plain; nvim %s
#PDFs
application/pdf; zathura %s pdf
#Images
image/png; feh %s
image/jpeg; feh %s
'';
}
+61 -25
View File
@@ -1,29 +1,36 @@
{ pkgs, home, ... }:
{
imports = [
./auto-clean-swapfiles.nix
];
{ config, pkgs, lib, machineVars, ... }:
let
cfg = config.programs.neovim;
in
lib.mkIf cfg.enable {
programs.neovim = {
enable = true;
auto-clean-swapfiles.enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
withPython3 = true;
withRuby = false;
plugins = with pkgs.vimPlugins; [
direnv-vim
vim-commentary
vim-gitgutter
fzf-vim
vim-which-key
vim-commentary
vim-css-color
vim-fugitive
vim-gitgutter
vim-nix
vim-surround
vim-fugitive
vim-css-color
vim-trailing-whitespace
vim-which-key
] ++ (lib.optionals machineVars.wayland [
vim-wayland-clipboard
]) ++ [
semshi
{
plugin = goyo-vim;
type = "viml";
# TODO: The mapleader definition should be in extraConfig, but setting
# the mapleader before defining keymaps messes things up.
@@ -66,25 +73,56 @@
}
limelight-vim
vim-tmux-navigator
vim-polyglot
lightline-vim
vim-better-whitespace
{
plugin = rainbow;
plugin = nvim-treesitter.withAllGrammars;
type = "lua";
config = ''
let g:rainbow_active = 1
require('nvim-treesitter').setup {
highlight = {
enable = true,
},
}
'';
}
{
plugin = rainbow-delimiters-nvim;
type = "lua";
config = ''
local rainbow_delimiters = require 'rainbow-delimiters'
vim.g.rainbow_delimiters = {
["highlight"] = {
'RainbowDelimiterRed',
'RainbowDelimiterYellow',
'RainbowDelimiterBlue',
'RainbowDelimiterGreen',
'RainbowDelimiterViolet',
'RainbowDelimiterCyan',
},
}
'';
}
{
plugin = vim-monokai;
type = "viml";
config = ''
colorscheme monokai
autocmd ColorScheme * highlight Normal ctermbg=0
autocmd ColorScheme * highlight LineNr ctermbg=0
autocmd ColorScheme * highlight CursorLineNR ctermbg=0 ctermfg=208
autocmd ColorScheme * highlight SignColumn ctermbg=0
autocmd ColorScheme * highlight GitGutterAdd ctermbg=0
autocmd ColorScheme * highlight GitGutterChange ctermbg=0
autocmd ColorScheme * highlight GitGutterDelete ctermbg=0
autocmd ColorScheme monokai highlight Normal ctermbg=0
autocmd ColorScheme monokai highlight LineNr ctermbg=0
autocmd ColorScheme monokai highlight CursorLineNR ctermbg=0 ctermfg=208
autocmd ColorScheme monokai highlight SignColumn ctermbg=0
autocmd ColorScheme monokai highlight GitGutterAdd ctermbg=0
autocmd ColorScheme monokai highlight GitGutterChange ctermbg=0
autocmd ColorScheme monokai highlight GitGutterDelete ctermbg=0
autocmd ColorScheme monokai highlight RainbowDelimiterRed { fg = g:terminal_color_9 }
autocmd ColorScheme monokai highlight RainbowDelimiterYellow { fg = g:terminal_color_11 }
autocmd ColorScheme monokai highlight RainbowDelimiterBlue { fg = g:terminal_color_12 }
autocmd ColorScheme monokai highlight RainbowDelimiterGreen { fg = g:terminal_color_10 }
autocmd ColorScheme monokai highlight RainbowDelimiterViolet { fg = g:terminal_color_13 }
autocmd ColorScheme monokai highlight RainbowDelimiterCyan { fg = g:terminal_color_14 }
'';
}
];
@@ -104,7 +142,7 @@
vnoremap <A-k> :m '<-2<CR>gv=gv
'';
extraLuaConfig = ''
initLua = ''
local function paste_buf()
local content = os.getenv("NVIM_CLIPBOARD")
@@ -118,6 +156,4 @@
vim.keymap.set('n', ';', paste_buf)
'';
};
home.sessionVariables = { EDITOR = "nvim"; };
}
+4 -78
View File
@@ -2,16 +2,15 @@
let
cfg = config.programs.newsboat;
# package = cfg.package;
package = pkgs.newsboat;
defaultBrowser = "google-chrome-stable %u";
defaultBrowser = "firefox %u";
videoViewer = "mpv %u";
in {
imports = [ ./sources.nix ];
programs.newsboat = {
enable = true;
autoFetchArticles.enable = true;
autoVacuum.enable = true;
autoReload = true;
maxItems = 50;
browser = ''"${defaultBrowser}"'';
@@ -70,77 +69,4 @@ in {
''
];
};
systemd.user.slices.app-newsboat = {
Unit = {
Description = "Newsboat automation";
Documentation = [ "man:newsboat(1)" ];
};
};
# TODO: wait for internet
systemd.user.services.newsboat-fetch-articles = {
Unit = {
Description = "Automatically fetch new articles for newsboat";
Documentation = [ "man:newsboat(1)" ];
};
Service = {
Type = "oneshot";
Slice = "app-newsboat.slice";
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
ExecStart = "${lib.getExe pkgs.flock} %t/newsboat.lock ${lib.getExe package} --execute=reload";
};
};
systemd.user.timers.newsboat-fetch-articles = {
Unit = {
Description = "Automatically fetch new articles for newsboat";
Documentation = [ "man:newsboat(1)" ];
After = [ "network.target" ];
};
Timer = {
Unit = "newsboat-fetch-articles.service";
OnCalendar = lib.mkDefault "daily";
Persistent = true;
};
Install = {
WantedBy = [ "timers.target" ];
};
};
systemd.user.services.newsboat-vacuum = {
Unit = {
Description = "Automatically clean newsboat cache";
Documentation = [ "man:newsboat(1)" ];
};
Service = {
Type = "oneshot";
Slice = "app-newsboat.slice";
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
ExecStart = "${lib.getExe pkgs.flock} %t/newsboat.lock ${lib.getExe package} --vacuum";
};
};
systemd.user.timers.newsboat-vacuum = {
Unit = {
Description = "Automatically clean newsboat cache";
Documentation = [ "man:newsboat(1)" ];
};
Timer = {
Unit = "newsboat-vacuum.service";
OnCalendar = lib.mkDefault "weekly";
Persistent = true;
};
Install = {
WantedBy = [ "timers.target" ];
};
};
}
+34 -28
View File
@@ -3,40 +3,46 @@ let
mkSource = tags: url: { inherit tags url; };
in {
programs.newsboat.urls = [
(mkSource [ "tech" "linux" ] "https://lukesmith.xyz/rss.xml")
(mkSource [ "tech" "vim" "old" ] "https://castel.dev/rss.xml")
(mkSource [ "tech" "linux" "nixos" ] "https://christine.website/blog.rss")
(mkSource [ "japanese" "language" "old" ] "http://feeds.feedburner.com/LocalizingJapan")
(mkSource [ "tech" "linux" ] "http://xahlee.info/comp/blog.xml")
(mkSource [ "japanese" "language" ] "https://www.outlier-linguistics.com/blogs/japanese.atom")
(mkSource [ "tech" "linux" ] "https://archlinux.org/feeds/news/")
(mkSource [ "tech" "linux" ] "https://bartoszmilewski.com/feed/")
(mkSource [ "tech" "linux" "nixos" ] "https://nixos.org//blog/announcements-rss.xml")
(mkSource [ "tech" "linux" ] "https://www.digitalneanderthal.com/index.xml")
(mkSource [ "tech" "linux" "nixos" ] "https://nixos.org/blog/announcements-rss.xml")
(mkSource [ "tech" "ntnu" ] "https://omegav.no/newsrss")
(mkSource [ "tech" ] "https://code.visualstudio.com/feed.xml")
(mkSource [ "ntnu" ] "https://varsel.it.ntnu.no/subscribe/rss/")
(mkSource [ "tech" ] "https://blog.hackeriet.no/feed.xml")
(mkSource [ "tech" ] "https://fribyte.no/rss.xml")
(mkSource [ "tech" ] "https://existentialtype.wordpress.com/feed/")
(mkSource [ "tech" "linux" "ntnu" ] "https://wiki.pvv.ntnu.no/w/api.php?hidebots=1&urlversion=1&days=90&limit=50&action=feedrecentchanges&format=xml")
(mkSource [ "tech" "linux" "nixos" ] "https://dandellion.xyz/atom.xml")
(mkSource [ "tech" "linux" ] "http://xahlee.info/comp/blog.xml")
(mkSource [ "tech" ] "https://branchfree.org/feed/")
(mkSource [ "tech" ] "https://search.marginalia.nu/news.xml")
(mkSource [ "tech" "linux" ] "https://bartoszmilewski.com/feed/")
(mkSource [ "tech" "linux" "nixos" ] "https://myme.no/atom-feed.xml")
(mkSource [ "tech" "linux" "nixos" ] "https://blog.ysndr.de/atom.xml")
(mkSource [ "tech" "linux" "nixos" ] "https://kaushikc.org/atom.xml")
(mkSource [ "tech" "linux" "nixos" ] "https://ianthehenry.com/feed.xml")
(mkSource [ "tech" "linux" "ntnu" ] "https://www.pvv.ntnu.no/w/api.php?hidebots=1&urlversion=1&days=7&limit=50&action=feedrecentchanges&feedformat=atom")
(mkSource [ "ntnu" ] "https://varsel.it.ntnu.no/subscribe/rss/")
(mkSource [ "tech" "linux" "japanese" ] "https://www.ncaq.net/feed.atom")
(mkSource [ "tech" "linux" "haskell" "nixos" "functional-programming" ] "https://www.haskellforall.com/feeds/posts/default")
(mkSource [ "tech" "haskell" "functional-programming" ] "https://williamyaoh.com/feed.atom")
(mkSource [ "tech" "haskell" "functional-programming" ] "https://www.parsonsmatt.org/feed.xml")
(mkSource [ "tech" "haskell" "functional-programming" "python" ] "http://blog.ezyang.com/feed/")
(mkSource [ "tech" "haskell" "functional-programming" ] "https://lexi-lambda.github.io/feeds/all.rss.xml")
(mkSource [ "tech" "haskell" "functional-programming" ] "https://www.stephendiehl.com/feed.rss")
(mkSource [ "tech" "haskell" "functional-programming" "emacs" ] "https://chrisdone.com/rss.xml")
(mkSource [ "tech" "haskell" "functional-programming" "nixos" ] "https://markkarpov.com/feed.atom")
(mkSource [ "tech" "flutter" ] "https://resocoder.com/feed/")
(mkSource [ "tech" "compilers" ] "https://existentialtype.wordpress.com/feed/")
(mkSource [ "tech" "compilers" "haskell" "functional-programming" "old" ] "https://skilpat.tumblr.com/rss")
(mkSource [ "tech" "linux" "nixos" "emacs" "japanese" ] "https://apribase.net/program/feed")
(mkSource [ "tech" "linux" "nixos" "functional-programming" ] "https://www.haskellforall.com/feeds/posts/default")
(mkSource [ "tech" "linux" "nixos" ] "https://christine.website/blog.rss")
(mkSource [ "tech" "functional-programming" "nixos" ] "https://markkarpov.com/feed.atom")
(mkSource [ "tech" "functional-programming" ] "https://williamyaoh.com/feed.atom")
(mkSource [ "tech" "functional-programming" ] "https://www.parsonsmatt.org/feed.xml")
(mkSource [ "tech" "functional-programming" "python" ] "http://blog.ezyang.com/feed/")
(mkSource [ "tech" "functional-programming" ] "https://lexi-lambda.github.io/feeds/all.rss.xml")
(mkSource [ "tech" "functional-programming" ] "https://www.stephendiehl.com/feed.rss")
(mkSource [ "tech" "functional-programming" "emacs" ] "https://chrisdone.com/rss.xml")
(mkSource [ "tech" ] "https://go.dev/blog/feed.atom")
(mkSource [ "tech" "linux" ] "https://jfx.ac/blog/index.xml")
(mkSource [ "tech" "linux" ] "https://lukesmith.xyz/rss.xml")
(mkSource [ "japanese" "language" ] "https://www.outlier-linguistics.com/blogs/japanese.atom")
(mkSource [ "language" ] "https://feeds.feedburner.com/blogspot/Ckyi")
(mkSource [ "tech" "compilers" ] "https://go.dev/blog/feed.atom")
(mkSource [ "tech" "linux" "nixos" ] "https://myme.no/feed.xml")
(mkSource [ "tech" "linux" "nixos" "compilers" ] "https://flyx.org/feed.xml")
(mkSource [ "tech" "linux" ] "https://blog.jfx.ac/feed.xml")
(mkSource [ "tech" "linux" "nixos" ] "https://dandellion.xyz/atom.xml")
(mkSource [ "japanese" "language" "old" ] "http://feeds.feedburner.com/LocalizingJapan")
(mkSource [ "japanese" "language" ] "https://wesleycrobertson.wordpress.com/feed/")
(mkSource [ "tech" "vim" "old" ] "https://castel.dev/rss.xml")
(mkSource [ "tech" "functional-programming" "old" ] "https://skilpat.tumblr.com/rss")
(mkSource [ "tech" ] "https://resocoder.com/feed/")
# Broken?
(mkSource [ "tech" "linux" "nixos" ] "https://flyx.org/feed.xml")
];
}
+2 -5
View File
@@ -1,9 +1,6 @@
{ ... }:
{
imports = [ ./fetch-nix-index-database.nix ];
programs.nix-index = {
enable = true;
enableDatabaseFetcher = true;
autoUpdateDatabase.enable = true;
};
}
}
+30
View File
@@ -0,0 +1,30 @@
{ config, lib, ... }:
{
sops = {
secrets = {
"nix/access-tokens/github" = { sopsFile = ./../../secrets/common.yaml; };
"nix/access-tokens/pvv-git" = { sopsFile = ./../../secrets/common.yaml; };
};
templates."nix-access-tokens.conf".content = let
inherit (config.sops) placeholder;
tokens = {
"github.com" = placeholder."nix/access-tokens/github";
"git.pvv.ntnu.no" = placeholder."nix/access-tokens/pvv-git";
};
in "access-tokens = ${lib.pipe tokens [
lib.attrsToList
(builtins.sort (p: q: p.name > q.name))
(map ({ name, value }: "${name}=${value}"))
(builtins.concatStringsSep " ")
]}";
};
nix = {
enable = true;
settings.use-xdg-base-directories = true;
extraOptions = ''
!include ${config.sops.templates."nix-access-tokens.conf".path}
'';
};
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }:
{
programs.nushell = { };
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }:
{
programs.nyxt = { };
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }:
{
programs.obs-studio = { };
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }:
{
programs.obsidian = { };
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }:
{
programs.pandoc = { };
}

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