Compare commits

...

371 Commits

Author SHA1 Message Date
Sam afaf3c4697 create xmodmap-arrow config 2024-09-15 10:12:56 +01:00
Sam 16fee36e96 rm xmodmap from xinitrc 2024-09-15 10:02:02 +01:00
Sam e374498aa4 key-remaps to xinitrc and nixvim buffer switch remaps 2024-09-15 09:51:21 +01:00
Sam f7ffba2266 add nvim buffer switch keymap & change dbt models 2024-09-14 20:19:07 +01:00
Sam a8e0ae35da updated postgres 2024-09-09 11:41:10 +01:00
Sam 564d4f6230 update flake and add .scripts to path 2024-08-31 21:29:38 +01:00
Sam 55d96ce54e Merge branch 'master' of git.bitlab21.com:sam/nixos 2024-08-31 10:30:45 +01:00
Sam d86a05d7c3 add qgis, transmission and mpv to home-manager 2024-08-31 10:30:36 +01:00
Sam 5a6dca3b5d nixvim conform add postgres language to sql-formatter 2024-08-31 10:29:45 +01:00
Sam d418d16fa4 nfs homeshare and photos 2024-08-26 21:04:19 +01:00
Sam 9fe49f4d79 added sql-formatter config 2024-08-25 23:27:42 +01:00
Sam 1af24715ff config conform.nvim
- removed sqlfmt and replaced with sql-formatter
2024-08-25 23:22:24 +01:00
Sam 6f5f8867fd configure dbui 2024-08-24 23:32:48 +01:00
Sam c25d56f350 add yazi to home-manager 2024-08-20 13:14:24 +01:00
Sam 3d90deadf9 nixvim spell 2024-08-20 10:19:24 +01:00
Sam f3ad132675 fix issue with clipboard-save 2024-08-15 13:32:04 +01:00
Sam f6b8aeca69 add tmux to home-manager and removed yaml lsp from nixvim 2024-08-03 12:58:38 +01:00
Sam 9f5e92d452 postgres 2024-08-02 22:53:01 +01:00
Sam dd94dea696 Update LSP plugin configuration
- Enable TypeScript server (tsserver)
- Disable SQL server (sqls)
2024-07-29 13:30:35 +01:00
Sam 19f0057503 add comment plugin to nvim 2024-07-27 11:23:14 +01:00
Sam dabff16a37 Add src alias to zshrc 2024-07-27 11:13:19 +01:00
Sam 5fae14f4fc Add nvim language servers for cls and r 2024-07-27 11:12:41 +01:00
Sam c51cb70732 Change dunst border for urgen notifications 2024-07-27 11:12:16 +01:00
Sam c4ac477d6f update sqlfmt 2024-07-21 20:26:56 +01:00
Sam ff300d8542 Updated dwm 2024-07-21 18:23:24 +01:00
Sam e30e731d61 Added shell.nix to nixos config 2024-07-21 18:22:59 +01:00
Sam 07d19c4535 Remaps Alt_l arrow keys using hjkl 2024-07-21 16:23:47 +01:00
Sam 2ec9f2db77 Modify tlp settings 2024-07-21 16:23:35 +01:00
Sam 0e0e2b2ae7 Add back bind_to_address for mpd 2024-07-21 16:21:54 +01:00
Sam b26aceec76 Disabled alpha plugin for nixvim 2024-07-21 14:52:45 +01:00
Sam 06f6aa1ffd MODIFY: updated battery-status script 2024-07-21 14:46:11 +01:00
Sam 3421360317 Import optional/notes for citadel 2024-07-21 14:42:57 +01:00
Sam 154b474868 Moved hm notes to optional 2024-07-21 14:42:22 +01:00
Sam d5f72ee2fd Added dwm scripts for battery-status and notification 2024-07-21 01:03:28 +01:00
Sam 46018fb461 Removed unnecessary sxhkdrc keybindings 2024-07-21 01:02:48 +01:00
Sam 621e97d8f1 Add backlight to citadel 2024-07-20 23:52:08 +01:00
Sam ae64001bc7 Add bluetooth to citadel 2024-07-20 23:51:40 +01:00
Sam 9d287792c6 Add tlp power save service to citadel 2024-07-20 23:51:10 +01:00
Sam c448a8c0cd Add thinkpad modules to citadel 2024-07-20 23:50:33 +01:00
Sam 87f30f8ace Define cursor and use xresources module 2024-07-20 20:23:02 +01:00
Sam a5e41acf63 Use -merge in xrdb 2024-07-20 20:22:41 +01:00
Sam 21bdc107eb Add gtk cursor theme 2024-07-20 20:22:02 +01:00
Sam d56fc29336 MODIFY: Tweak semita scaling 2024-07-20 18:49:27 +01:00
Sam 9788e0d6e2 remove bind_to_address from mpd 2024-07-20 18:18:53 +01:00
Sam bf30739d8b Xserver scaling, input settings 2024-07-20 17:38:49 +01:00
Sam f8f662daf7 Removed unnecessary monitors option in xinitrc 2024-07-20 17:35:31 +01:00
Sam 04782f64f5 Disabled sb-updates script 2024-07-20 17:34:53 +01:00
Sam cf8c449e5e MODIFY: Removed scaling in xresources for citadel and semita 2024-07-20 17:34:37 +01:00
Sam f7e23e39c7 MODIFY: Add deploy_key into sops hosts 2024-07-20 16:14:09 +01:00
Sam 86f27abb2f MODIFY: Firmware configuration for citadel to enable wifi 2024-07-20 16:13:24 +01:00
Sam fa060dba70 Added sam to networkmanager group 2024-07-20 16:12:49 +01:00
Sam f411adbf20 FIX: Renamed sb-battery 2024-07-20 16:12:10 +01:00
Sam 5e0230dcdd Added dmenu-wifi to dwm 2024-07-20 16:11:42 +01:00
Sam 1049ecbd76 Update flake.lock 2024-07-20 16:10:53 +01:00
Sam e3a1143ca5 Add sb-battery to dwm 2024-07-20 14:48:51 +01:00
Sam b991fa4236 Add citadel to flake.nix 2024-07-20 14:48:32 +01:00
Sam 5f672c2665 Fix justfile for new nix-secrets location 2024-07-20 14:48:04 +01:00
Sam 22ce3e08c2 Fix bootstrap script for new nix-secrets location 2024-07-20 14:47:26 +01:00
Sam 5147d02fa9 Update flake.lock secrets 2024-07-20 14:47:08 +01:00
Sam 6fbd5447b8 Update SOPS_FILE path in justfile
- Changed the path of SOPS_FILE in justfile from "../nix-secrets/secrets.yaml" to "~/.local/share/src/nix-secrets/secrets.yaml"
2024-07-20 13:49:01 +01:00
Sam 1743869b07 Add xresources to semita 2024-07-20 12:39:36 +01:00
Sam 0fb3056a4c Add citadel host 2024-07-20 12:38:57 +01:00
Sam 32bf8eca1f Removed xresources from desktop 2024-07-20 12:38:03 +01:00
Sam c9409866b7 enable printing and add network printer 2024-07-19 13:09:20 +01:00
Sam c5da58fc3b Add vimwiki-sync plugin to nixvim 2024-07-19 11:27:05 +01:00
Sam 82b0838f5c Add get-notes in home-manager activation script 2024-07-19 11:26:32 +01:00
Sam 7440a6662f oil.nvim plugin 2024-07-15 21:30:24 +01:00
mrsu 959d734fd1 Merge branch 'master' of git.bitlab21.com:sam/nixos 2024-07-14 21:04:49 +01:00
mrsu 394a24567b removed test hosts fileserver & nixdev 2024-07-14 21:04:36 +01:00
Sam 6472e085c7 add nameservers to semita 2024-07-14 19:51:09 +01:00
Sam 937b53db87 nixvim todo-comments and fixed TODOs in codebase 2024-07-07 18:26:24 +01:00
Sam fb7cf9e280 merge master 2024-07-07 16:48:11 +01:00
Sam efb6128704 deactivate otter.nvim and rm lxd reference 2024-07-07 16:46:39 +01:00
sam 539ac37b8a Merge branch 'master' into docker 2024-07-07 16:25:47 +01:00
Sam 22aa6d3fa4 nvim_ufo fold plugin fix name 2024-07-07 16:24:50 +01:00
sam 8e527473ac Merge branch 'docker' of git.bitlab21.com:sam/nixos into docker 2024-07-07 16:24:00 +01:00
Sam db7bce57e7 Add arion package 2024-07-07 16:23:36 +01:00
Sam 614b9765dd Docker and postgres config 2024-07-07 16:23:36 +01:00
Sam 4b85810128 small fix 2024-07-07 16:23:36 +01:00
Sam a7c8b86b1f Postgres docker configuration 2024-07-07 16:23:36 +01:00
Sam 89ab4e8f9d Modify postgres docker container
- add sops-secrets for admin pwd
- POSTGRES_MULTIPLE_DATABASES as json to specify users and extensions
- initdb docker entrypoint script to create dbs, users and extensions
  from json
2024-07-07 16:23:36 +01:00
Sam 01ad0238a7 Update nix-secrets 2024-07-07 16:23:36 +01:00
Sam 688c2c9bcd Add arion package 2024-07-07 16:23:36 +01:00
Sam b8973040d5 pg init script to configure db on start
- create users & dbs
- setup db permissions
- install extensions
2024-07-07 16:23:36 +01:00
Sam ba9f593bcd pgdata dir and admin_db default database 2024-07-07 16:23:36 +01:00
Sam 3dbe85853e Build postgres using dockerfile
- use dockerfile to install postgis during build
2024-07-07 16:23:36 +01:00
Sam ba19ee9125 Minor fixes 2024-07-07 16:23:36 +01:00
Sam 8173a0dc94 Podman to user groups 2024-07-07 16:23:36 +01:00
Sam 600160bd9a Arion flake input 2024-07-07 16:23:36 +01:00
Sam 5205e606c1 Docker and postgres config 2024-07-07 16:23:36 +01:00
Sam 5b8a1430fe Add postgres btrfs zvol 2024-07-07 16:23:36 +01:00
Sam 8f458590e2 Remove deploy_key from sops 2024-07-07 16:23:36 +01:00
Sam bcea6919fb Update flake secrets 2024-07-07 16:23:36 +01:00
Sam aa8d4ca3ae nvim_ufo fold plugin 2024-07-07 16:23:05 +01:00
Sam 653901f823 Removed precognition config 2024-07-07 15:39:07 +01:00
sam febc33faee Merge branch 'docker' of git.bitlab21.com:sam/nixos into docker 2024-07-07 15:36:51 +01:00
Sam 2f99d05406 small fix 2024-07-07 15:36:34 +01:00
Sam 947ddaca43 Postgres docker configuration 2024-07-07 15:36:34 +01:00
Sam 529fc394ef Modify postgres docker container
- add sops-secrets for admin pwd
- POSTGRES_MULTIPLE_DATABASES as json to specify users and extensions
- initdb docker entrypoint script to create dbs, users and extensions
  from json
2024-07-07 15:36:34 +01:00
Sam 89646a5d6a Update nix-secrets 2024-07-07 15:36:34 +01:00
Sam 804d6bf4d0 Add arion package 2024-07-07 15:36:34 +01:00
Sam 491350bc58 pg init script to configure db on start
- create users & dbs
- setup db permissions
- install extensions
2024-07-07 15:36:34 +01:00
Sam baaaa3e8d6 pgdata dir and admin_db default database 2024-07-07 15:36:34 +01:00
Sam 591a9ce48f Build postgres using dockerfile
- use dockerfile to install postgis during build
2024-07-07 15:36:34 +01:00
Sam 7df7970414 Minor fixes 2024-07-07 15:36:34 +01:00
Sam 052c941e81 Podman to user groups 2024-07-07 15:36:34 +01:00
Sam f7695f4d15 Arion flake input 2024-07-07 15:36:34 +01:00
Sam 52a3b85c8f Docker and postgres config 2024-07-07 15:36:34 +01:00
Sam c9ee7c7e80 Add postgres btrfs zvol 2024-07-07 15:36:34 +01:00
Sam fc2f6f4ca3 Remove deploy_key from sops 2024-07-07 15:36:34 +01:00
Sam 67e3d9dded Update flake secrets 2024-07-07 15:36:34 +01:00
Sam 4fbfbee45b Removed precognition nixvim plugin 2024-07-07 15:35:38 +01:00
Sam b8f85256a7 small fix 2024-07-06 21:17:32 +01:00
Sam 271b5958b8 Postgres docker configuration 2024-07-06 20:53:26 +01:00
Sam 2f0ddf8375 Modify postgres docker container
- add sops-secrets for admin pwd
- POSTGRES_MULTIPLE_DATABASES as json to specify users and extensions
- initdb docker entrypoint script to create dbs, users and extensions
  from json
2024-07-06 16:02:10 +01:00
Sam e419389862 Update nix-secrets 2024-07-06 16:01:40 +01:00
Sam fec1dae750 Add arion package 2024-07-06 16:01:17 +01:00
Sam 3b7a597d8f pg init script to configure db on start
- create users & dbs
- setup db permissions
- install extensions
2024-07-06 10:28:09 +01:00
Sam 1e95ba6c36 pgdata dir and admin_db default database 2024-07-06 10:27:15 +01:00
Sam d29250a2a6 Build postgres using dockerfile
- use dockerfile to install postgis during build
2024-07-06 10:26:08 +01:00
Sam f71ece31f1 Minor fixes 2024-07-05 18:59:10 +01:00
Sam a71ee506d3 Podman to user groups 2024-07-05 18:58:46 +01:00
Sam 7f9c3535ef Arion flake input 2024-07-05 18:58:30 +01:00
Sam 9ace130029 Docker and postgres config 2024-07-05 18:58:03 +01:00
Sam 92d09646fa Add postgres btrfs zvol 2024-07-05 18:57:17 +01:00
Sam 33981eea6d Remove deploy_key from sops 2024-07-05 18:56:41 +01:00
Sam bd719c72fa Update flake secrets 2024-07-05 18:56:18 +01:00
sam 37192edd83 Merge branch 'master' of git.bitlab21.com:sam/nixos 2024-07-05 16:34:11 +01:00
Sam 911d7d6905 ifTheuExist and extra groups to user sam 2024-07-05 16:32:49 +01:00
Sam 74dab0c38d nebula zfs configuration and post-install-setup script 2024-07-05 16:31:58 +01:00
Sam f6290f3215 music_player to dwm 2024-07-04 17:19:33 +01:00
Sam 8c13a24cc8 Added music nfs mount to semita 2024-07-04 17:18:55 +01:00
Sam 60b6064ded Added personal build of kunst as package overlay 2024-07-04 17:18:05 +01:00
Sam 5000138b85 Update flake nixvim 2024-07-04 17:16:58 +01:00
Sam 20bdddf472 Enabled fontconfig (caused issues with symbols in dwm) 2024-07-02 12:21:38 +01:00
Sam bcf6db040e Updated dwm (patched functional gaps) 2024-07-02 12:20:48 +01:00
Sam 63ba2ebaba Update fontconfig settings
- Remove unnecessary import
2024-06-28 20:30:26 +01:00
mrsu e6f0770f97 tidied disks 2024-06-28 20:21:27 +01:00
mrsu 05ee6da5ee removed admin deploykey in home and reverted persistance change 2024-06-28 18:16:15 +01:00
mrsu 739018e98f moved fonts.nix to fontconfig in display 2024-06-28 18:15:36 +01:00
mrsu 906d11b3b0 add enable persistance option 2024-06-28 16:05:12 +01:00
mrsu 89dceb1827 modified overseer to nebula, setup zfs 2024-06-28 15:26:16 +01:00
mrsu 0f83b32f2b deploy key added in hosts 2024-06-25 22:04:28 +01:00
mrsu 91eda4f7cd created overseer host, upgraded stateVersion to 24.04 2024-06-25 18:19:47 +01:00
Sam ecdf80143d Update flake.lock and flake.nix
* Remove flake-utils_2, nix-github-actions, nixpkgs_2, poetry2nix, systems_2, systems_3, and treefmt-nix_2 from flake.lock
* Add alpha plugin configuration in home/common/core/nixvim/plugins/alpha.nix
* Include alpha plugin in home/common/core/nixvim/plugins/default.nix
2024-06-23 15:22:51 +01:00
Sam a227c6e17f added toipe package to dwm 2024-06-23 15:14:24 +01:00
Sam 57d5f3350d housekeeping 2024-06-23 15:13:01 +01:00
Sam 13bed86ae6 Added sqlfmt as python wheel derivation
* Removed personal packages repo import for sqlfmt and poetry2nix
* Removed homeConfigurations section from flake.nix
* Updated home.packages in home/common/core/nixvim/default.nix to include sqlfmt
* Added sqlfmt package in pkgs/default.nix and pkgs/sqlfmt/default.nix
* Removed unused imports in hosts/common/users/sam/default.nix
2024-06-23 12:29:49 +01:00
Sam 5c7a624c94 Add aichat-wrapper script to dwm configuration
- Add a new script to the dwm configuration that allows for easy selection
and use of different AI models using the aichat command line interface.
2024-06-22 21:10:15 +01:00
Sam aef3c1c1ce Update git-commit-ai script: remove endpoint, use aichat for model selection
- Replace hardcoded endpoint with aichat for model selection
- Remove system_message variable and its usage in query
- Use aichat command for generating commit message instead of curl
2024-06-22 15:12:31 +01:00
Sam 5b65d7d5b1 update to nixpkgs 24.04 2024-06-22 14:37:19 +01:00
Sam db746efe7e Update git-commit-ai and xinitrc, bump nsxiv version
- Remove echo command in git-commit-ai script
- Add clipboard-save to autostart in xinitrc
- Update nsxiv to latest version
2024-06-20 13:29:33 +01:00
Sam ed4f367713 Update git-commit-ai and add new scripts
- update DWM config
- add tiktoken-cli for token counting
- introduce a shell script for generating AI-assisted commit messages
2024-06-20 13:07:20 +01:00
Sam 37bd716e05 Added/modified default environment options
- Added IMAGE_EDITOR = drawing
- Added IMAGE_VIEWER = nsxiv
- Modified TERMINAL from alacritty to st
2024-06-20 10:35:22 +01:00
Sam d804790b9b Moved gtk/qt themes to dedicated themes folder.
- Created dedicated themes folder in desktop/common/themes
- Created a new theme "standard-dark.nix"
- Import theme in host "semita"
- Removed theme options from user profile
2024-06-20 10:30:28 +01:00
Sam 974b90d997 Added fugitive package to nixvim 2024-06-20 10:08:10 +01:00
Sam b385de186b Merge branch 'master' of git.bitlab21.com:sam/nixos 2024-06-19 22:32:32 +01:00
Sam 73d507f453 update clipboard-image-recall screen size function 2024-06-19 22:32:27 +01:00
Sam 65b59676ba added get-focused-monitor helper script 2024-06-19 22:30:52 +01:00
Sam 1a4bf927a4 nsxiv xresources 2024-06-19 22:29:42 +01:00
Sam 100f444d8a restore flake.lock nixvim issue 2024-06-19 22:28:58 +01:00
Sam f630a57b43 restore flake.lock nixvim issue 2024-06-19 22:25:25 +01:00
Sam 01d348c310 flake update 2024-06-19 10:33:04 +01:00
Sam d180075914 nixvim remap leader to space 2024-06-17 20:27:57 +01:00
Sam f6304cf25f added github access token to nix.conf 2024-06-17 20:20:33 +01:00
Sam fd20921d1e emoji-picker notification time, modify sb-scripts, xresources stuff 2024-06-16 22:16:59 +01:00
Sam 97ff165b02 modify feh-wallpaper-changer to kill previous instance 2024-06-16 12:53:07 +01:00
Sam 08f1789b50 created nsxiv package 2024-06-16 02:05:11 +01:00
Sam 20da292709 updated dwm to add nsxiv-float rule 2024-06-16 02:04:39 +01:00
Sam cfa74f52fe modified clipboard-image-recall for nsxiv-float 2024-06-16 02:04:02 +01:00
Sam 97d8a879eb added clipboard manager scripts to dwm 2024-06-16 00:26:14 +01:00
Sam 0d6b762a6e updated dwm to modify clipboard commands 2024-06-16 00:24:59 +01:00
Sam 056dbc106b updated dmenu and dwm for xresources 2024-06-15 23:48:13 +01:00
Sam 72a03e8490 add dmenu.*, dwm.font and modify st to St in xresources 2024-06-15 23:47:55 +01:00
Sam 26f0335da8 modified emoji-picker script to use notify-send 2024-06-15 20:06:09 +01:00
Sam 7f93cea6e3 emoji-picker script 2024-06-15 18:37:15 +01:00
Sam 7a2b125646 housekeeping 2024-06-15 18:37:00 +01:00
Sam 3d49b1c5f1 added dunstrc 2024-06-15 17:26:12 +01:00
Sam 5ecafc3879 fix volume font icons 2024-06-15 17:25:54 +01:00
Sam b30410e747 added fontconfig back 2024-06-15 17:24:21 +01:00
Sam fbd8946612 custom colorscheme and xresources 2024-06-15 17:22:54 +01:00
Sam 8ff60b5f00 update base16 colors in dwm 2024-06-15 13:55:42 +01:00
Sam 1a8d9eab46 updated dwm to fix floading scratchpad issue 2024-06-15 13:09:42 +01:00
Sam 6af30c93a9 removed fontconfig 2024-06-15 13:08:55 +01:00
Sam fcfc907c57 autostart feh bg 2024-06-15 02:32:01 +01:00
Sam 8246ea052c Merge branch 'master' of git.bitlab21.com:sam/nixos 2024-06-15 01:49:24 +01:00
Sam f5a34598a9 cinnamon wallpaper changer permissions 2024-06-15 01:49:18 +01:00
= 7c994c2712 Merge branch 'master' of git.bitlab21.com:sam/nixos 2024-06-15 01:32:01 +01:00
= 853755bce0 lutris 2024-06-15 01:31:56 +01:00
Sam 9ea47f6057 cinnamon wallpaper changer 2024-06-15 01:28:33 +01:00
Sam 75cdf136e3 modularise dwm 2024-06-15 01:20:42 +01:00
Sam 1d61c343d1 libqalculate 2024-06-15 00:50:30 +01:00
Sam c4a76219c9 call nix packages in script 2024-06-14 22:00:56 +01:00
Sam 63874ede17 refactored shell scripts to nix files 2024-06-14 21:48:43 +01:00
Sam a4815aa56b added dunst vol script & moved sb scripts to dwm 2024-06-14 21:12:38 +01:00
Sam f3b506ac81 fix fonts 2024-06-14 18:04:48 +01:00
Sam 2aea6ff2f4 fonts and xresources for dwm/st 2024-06-14 17:31:17 +01:00
Sam c226add411 added dmenu and moved st to x11 2024-06-14 12:18:25 +01:00
Sam 658744d33c feh-wallpaper-changer 2024-06-14 00:39:02 +01:00
Sam a9ecc94a77 home x11 dir & pkill update-flake 2024-06-13 23:39:22 +01:00
Sam e4161bfed9 dwmblocks sb scripts 2024-06-13 23:33:14 +01:00
Sam 18448d340a dwmblocks derivation 2024-06-13 17:44:06 +01:00
Sam 326d8fbae7 st derivation and startx in hm 2024-06-13 17:31:49 +01:00
Sam 108f9b7028 dwm 2024-06-13 14:36:34 +01:00
Sam 3eb837c371 flake.lock conflict 2024-06-13 12:33:05 +01:00
Sam 2f3fec9e5c postgres credentials and dbt profiles 2024-06-13 12:30:21 +01:00
mrsu b7a9b98dee merge conflict 2024-06-13 12:24:13 +01:00
mrsu c1ad764777 flake.lock 2024-06-13 12:22:46 +01:00
Sam 75faf815b9 gamescope sparky 2024-06-10 17:06:45 +01:00
Sam abefe52504 steam 2024-06-10 14:05:06 +01:00
Sam eda162a7ff zotero prefs 2024-06-08 17:04:37 +01:00
Sam 93c8f1593d added zotero and persisted .zotero for media user 2024-06-06 19:55:17 +01:00
Sam 0121b7a636 added nur as overlay & refactored firefox 2024-06-06 18:53:22 +01:00
Sam 44f9408372 nixvim theme disable dim inactive view 2024-06-06 18:15:59 +01:00
Sam 20b64f5707 pyprland and scratchpads 2024-06-06 18:13:16 +01:00
mrsu 08e3aeeb38 na 2024-06-06 18:11:36 +01:00
mrsu 4141beb4cf flake.lock 2024-06-06 18:09:29 +01:00
Sam 861f58946b added zotero package and persist cinnamon-monitors.xml 2024-06-06 18:07:59 +01:00
Sam f60f4bee7a waybar ricing and alacritty transparency 2024-06-05 23:27:36 +01:00
Sam bd8fbdacd0 dadbod-completion 2024-06-05 12:36:22 +01:00
Sam cd7b3c9d0d dbui connections.json as sops-nix template 2024-06-05 12:30:55 +01:00
Sam a0f084a465 nixvim buffer_manager 2024-06-04 12:37:26 +01:00
Sam c754aa2fba added new plugins to nixvim 2024-06-04 11:47:56 +01:00
Sam 9b205b2c1c added sqlfmt 2024-06-04 01:32:43 +01:00
Sam e9fde8a82b removed sqlfmt 2024-06-03 19:14:07 +01:00
Sam d6dc868814 modularise nixvim 2024-06-03 11:05:46 +01:00
Sam 33d41f4256 rice 2024-06-02 14:30:14 +01:00
Sam 2c8dcf74e4 added semita sound firmware 2024-06-01 16:39:14 +01:00
Sam e06d88e7ac alacritty config 2024-06-01 15:55:54 +01:00
Sam 7d5e5cd6ca create wallpaper dir if missing & fix home dir persistance 2024-06-01 15:42:59 +01:00
Sam 7681168109 various changes 2024-06-01 00:50:17 +01:00
Sam 6ce28c8b54 fixed ssh ownership issue & removed hypr swapescape 2024-05-31 22:52:54 +01:00
mrsu 57e98861d7 prep for semita install 2024-05-31 22:18:40 +01:00
Sam 6ea135b770 added alacritty 2024-05-31 22:09:56 +01:00
Sam baceb411ce revert monitors 2024-05-31 17:27:38 +01:00
Sam 2f13f63c80 revert monitors 2024-05-31 17:26:32 +01:00
Sam d14e0e34a3 cinnamon-monitors 2024-05-31 15:48:46 +01:00
Sam 39d407d236 refactor desktop 2024-05-31 11:22:16 +01:00
Sam afc6ef3e56 fonts & waybar 2024-05-31 00:17:16 +01:00
Sam f5094f4749 username 2024-05-30 22:02:21 +01:00
mrsu af0a899f55 semita home persistance 2024-05-30 21:23:59 +01:00
Sam 95bb8156a6 hyprland monitors 2024-05-30 21:20:39 +01:00
Sam eca3a72a8f install nvidia drivers for sparky 2024-05-29 20:14:20 +01:00
Sam 393c5b6a91 fix screen tearing 2024-05-29 19:49:31 +01:00
Sam 4efc1d3e61 add git user to ssh config 2024-05-28 21:08:51 +01:00
Sam 2e46781189 adsd user to ssh config 2024-05-28 21:04:15 +01:00
Sam 2b74cf80e2 persist cinnamon-monitors.xml 2024-05-28 20:19:30 +01:00
Sam 66523171c9 firefox default search engine 2024-05-28 15:44:21 +01:00
Sam 6ec05f1d16 firefox default search engine 2024-05-28 15:42:25 +01:00
Sam b82a9df299 remove deploy_key from persistance 2024-05-28 14:42:30 +01:00
Sam 805f9ace72 parametised disk formatting and fixed secrets issue in bootstrapping 2024-05-28 14:06:33 +01:00
Sam 2910b2d267 auto: bootstrapping sparky 2024-05-27 16:19:00 +01:00
Sam 34cf736bea auto: bootstrapping sparky 2024-05-27 16:03:39 +01:00
Sam 967d09c24a auto: bootstrapping sparky 2024-05-27 15:42:50 +01:00
Sam 920aa6e8f6 auto: bootstrapping sparky 2024-05-27 15:04:34 +01:00
Sam 748a03aa7b auto: bootstrapping sparky 2024-05-26 22:29:26 +01:00
Sam baa690800c changed sparky disk 2024-05-26 22:20:15 +01:00
Sam 93e5c04d21 merge development add luks encryption 2024-05-26 22:09:38 +01:00
Sam 8b4da0e70d auto: bootstrapping sparky 2024-05-26 21:39:04 +01:00
Sam dbbd032191 auto: bootstrapping sparky 2024-05-26 21:26:19 +01:00
Sam 50f75d0fe2 auto: bootstrapping sparky 2024-05-26 21:21:28 +01:00
Sam e520e7c6f2 auto: bootstrapping sparky 2024-05-26 21:12:33 +01:00
Sam 20cbdc28b6 auto: bootstrapping sparky 2024-05-26 20:45:22 +01:00
Sam 0c3ec14949 auto: bootstrapping sparky 2024-05-26 20:32:02 +01:00
Sam cf831cee04 auto: bootstrapping sparky 2024-05-26 20:31:07 +01:00
Sam 9296b4b4aa auto: bootstrapping sparky 2024-05-26 17:23:15 +01:00
Sam 3c4e2bd19e auto: bootstrapping sparky 2024-05-26 17:22:20 +01:00
Sam d7ce738cd1 auto: bootstrapping sparky 2024-05-26 16:22:04 +01:00
Sam bf1845e2e1 auto: bootstrapping sparky 2024-05-26 16:20:22 +01:00
Sam 767c6ac5aa auto: bootstrapping sparky 2024-05-26 15:52:58 +01:00
Sam b0021b5f83 encryption-keys to nixos-anywhere 2024-05-26 15:52:08 +01:00
Sam f94ab6584e auto: bootstrapping sparky 2024-05-26 14:32:19 +01:00
Sam 6a8c8a98c4 auto: bootstrapping sparky 2024-05-26 14:19:32 +01:00
Sam b7e0b6bc84 auto: bootstrapping sparky 2024-05-26 14:18:14 +01:00
Sam 95a5f258f9 auto: bootstrapping sparky 2024-05-26 14:07:26 +01:00
Sam 280d7a6213 auto: bootstrapping sparky 2024-05-26 13:57:10 +01:00
Sam 29ef289456 auto: bootstrapping sparky 2024-05-26 13:55:47 +01:00
Sam dbcadf5315 auto: bootstrapping sparky 2024-05-26 13:52:51 +01:00
Sam b7d7f40171 auto: bootstrapping sparky 2024-05-26 13:25:20 +01:00
Sam 7bb5689128 auto: bootstrapping sparky 2024-05-26 13:23:35 +01:00
Sam 15291a162d auto: bootstrapping sparky 2024-05-26 13:16:16 +01:00
Sam 7739e82f8e auto: bootstrapping sparky 2024-05-26 13:13:35 +01:00
Sam 245bbb8de6 auto: bootstrapping sparky 2024-05-26 13:11:54 +01:00
Sam 4d60e46541 auto: bootstrapping sparky 2024-05-26 02:11:54 +01:00
Sam 013e5ce859 rice nixvim 2024-05-26 01:51:57 +01:00
Sam 328438e8ec removed unnecessary groups 2024-05-25 20:58:44 +01:00
Sam 816388f358 capitalised keep and sync dirs 2024-05-25 20:50:08 +01:00
Sam fb42ab7421 added persistence.nix 2024-05-25 20:48:50 +01:00
Sam 5b942d4708 modified home ssh to be user specific 2024-05-25 20:26:55 +01:00
Sam efa11640e8 minor fix with strings 2024-05-25 18:45:48 +01:00
Sam f3a8dac948 parameterised username in users 2024-05-25 18:44:35 +01:00
Sam 305237c3ea reorg hosts 2024-05-25 18:34:37 +01:00
Sam e3c1278a29 modify justfile 2024-05-25 15:31:51 +00:00
Sam 486a03ca47 added persist test, nixvim to flake, user ssh config 2024-05-25 15:23:00 +00:00
Sam 2d0c12a033 add zshrc 2024-05-24 20:23:56 +00:00
Sam c0575c77ae added flatpaks 2024-05-24 13:32:18 +00:00
Sam 55ce313df7 setup firefox 2024-05-24 13:01:19 +00:00
Sam 2da6205ca2 firefox 2024-05-23 20:24:21 +01:00
Sam aff5f14a81 re-enable cinnamon 2024-05-23 19:41:54 +01:00
Sam a369c2adb0 persistance to user 2024-05-23 16:57:41 +01:00
Sam c1afa65ffe media hashed password file 2024-05-23 15:21:30 +01:00
Sam 41f9d12c88 auto: bootstrapping sparky 2024-05-23 14:02:11 +01:00
Sam d60e28ad17 modify boostrap.sh 2024-05-23 13:49:46 +01:00
Sam 2a09f91ddd add core packages to bootstrap 2024-05-23 13:47:31 +01:00
Sam 25018e8c41 auto: bootstrapping sparky 2024-05-23 13:38:43 +01:00
Sam 3381e2e689 auto: bootstrapping sparky 2024-05-23 13:37:11 +01:00
Sam 172e5faefa add host private key with sops 2024-05-23 13:33:56 +01:00
Sam 547504e3c4 add host private key with sops 2024-05-23 13:19:21 +01:00
Sam 8a1eba393a auto: bootstrapping bootstrap 2024-05-23 12:44:26 +01:00
Sam d49bae7e85 auto: bootstrapping bootstrap 2024-05-23 12:44:12 +01:00
Sam d3510e67a0 auto: bootstrapping bootstrap 2024-05-23 12:43:56 +01:00
Sam ccd2b52bd2 auto: bootstrapping bootstrap 2024-05-23 12:42:57 +01:00
Sam 3e5ebafed6 sops to create ssh keys for users 2024-05-23 09:48:00 +00:00
Sam 1c0725912d minimal bootstrap install 2024-05-23 00:10:58 +01:00
Sam 8679f14566 minimal bootstrap install 2024-05-22 23:38:48 +01:00
Sam 0b58cf8c4d auto: bootstrapping bootstrap 2024-05-22 21:21:20 +01:00
Sam 9271ecc22b auto: bootstrapping bootstrap-nixos 2024-05-22 21:17:27 +01:00
Sam d0b5a08056 auto: bootstrapping bootstrap-nixos 2024-05-22 21:15:58 +01:00
Sam 84bc747593 auto: bootstrapping bootstrap-nixos 2024-05-22 21:15:22 +01:00
Sam 5fea003213 auto: bootstrapping bootstrap-nixos 2024-05-22 21:14:47 +01:00
Sam 104bcd2615 auto: bootstrapping bootstrap-nixos 2024-05-22 21:14:20 +01:00
Sam 806c8364d7 auto: bootstrapping bootstrap-nixos 2024-05-22 21:10:41 +01:00
Sam 871d4f7256 auto: bootstrapping sparky 2024-05-22 20:34:18 +01:00
Sam b482071005 auto: bootstrapping sparky 2024-05-22 17:44:08 +01:00
Sam 623c979342 auto: bootstrapping sparky 2024-05-22 17:39:12 +01:00
Sam 9ded1a9371 auto: bootstrapping sparky 2024-05-22 17:32:02 +01:00
Sam 02b9de7372 auto: bootstrapping sparky 2024-05-22 17:31:06 +01:00
Sam b3b8e178e1 removed some persisted files 2024-05-22 17:27:24 +01:00
Sam e9823f76b2 more changes 2024-05-22 17:23:17 +01:00
Sam 0178448748 added passwds to config & updated bootstrap script 2024-05-21 19:11:23 +01:00
Sam 2d3398b217 remove sops paths 2024-05-20 00:33:06 +01:00
Sam 3b653ecb20 modify justfile 2024-05-19 23:34:15 +01:00
Sam c914883610 revert bootstrap 2024-05-19 23:33:42 +01:00
Sam 82f5d9ebfe change bootstap to get age key from target host 2024-05-19 21:55:25 +01:00
Sam 521bafe3f8 xdg dirs 2024-05-18 14:53:10 +01:00
Sam b83147b16b xdg dirs 2024-05-18 14:51:03 +01:00
Sam 54caab4d8c changed ssh keys 2024-05-18 14:46:08 +01:00
Sam 578ddc7921 removed passphrase from deploy key 2024-05-18 11:54:14 +01:00
Sam 9df3bf2ff8 changed media to sparky 2024-05-17 20:17:53 +01:00
Sam 878fffd900 fixed sam home zsh issue 2024-05-17 10:54:53 +01:00
Sam 58d5e6b58f persistance working 2024-05-17 09:38:40 +01:00
Sam 234fb16de9 move persist to nixos system 2024-05-17 09:17:03 +01:00
Sam 4fa3b400d7 move persist to nixos system 2024-05-17 09:16:33 +01:00
Sam 12229e57b6 move persist to nixos system 2024-05-17 09:15:46 +01:00
samual.shop@proton.me 07f064e4fd impermanence module and home-manager 2024-05-17 00:07:42 +00:00
Sam f90f7cf8a4 working btrfs impermanence & added lvm to disko 2024-05-17 00:37:19 +01:00
Sam b4feb6e77a btrfs-impermanence.nix 2024-05-16 23:27:06 +01:00
Sam 57c4e06080 resolved conflict 2024-05-16 20:20:05 +01:00
Sam ebc79952ff added media 2024-05-16 20:19:01 +01:00
samual.shop@proton.me 014cc98716 added hardware-config.nix 2024-05-16 19:18:24 +00:00
Sam 178b0f3931 add devices var to disko and modified bootstrap.sh 2024-05-16 19:14:21 +01:00
Sam f6b48d0b25 update just file, revisions to bootstrap.sh 2024-05-16 16:54:21 +01:00
samual.shop@proton.me 0359491756 fixed wallpaper-changer 2024-05-16 11:55:24 +01:00
Sam 5329b3e4ad fileserver nfs 2024-05-15 21:46:48 +01:00
Sam b82b079966 just rebuild-system changed path of flake 2024-05-15 21:07:41 +01:00
Sam 9b0a1d4919 added git to core system packages 2024-05-15 21:06:04 +01:00
Sam 60bcc38773 modified networking to add correct hostname 2024-05-15 20:55:48 +01:00
Sam c307ac5586 removed grub from fileserver 2024-05-15 20:52:03 +01:00
Sam aa7c7186cf removed grub from fileserver 2024-05-15 20:50:42 +01:00
Sam 006814d6c1 added just commands, updated flake 2024-05-15 20:44:17 +01:00
Sam 11702e8bf8 just command 2024-05-15 20:07:47 +01:00
Sam 648a4431a5 fileserver host 2024-05-15 19:54:39 +01:00
Sam dd837fb296 finalise bootstrap & fix home-manager 2024-05-15 19:44:13 +01:00
Sam e432cbe473 changes keys to gitea 2024-05-15 15:39:30 +01:00
Sam af75086a7e bootstrap script 2024-05-14 18:26:45 +01:00
Sam 51533f7d07 disko config and bootstrapping 2024-05-14 14:51:09 +01:00
Sam 6b33a88d9e removed sops secrets and added nix-secrets input 2024-05-13 22:36:10 +01:00
Sam 154d7b0528 refactor for adding new hosts 2024-05-13 22:17:40 +01:00
Sam 651e3a9f3b openssh private and public keys 2024-05-12 20:45:37 +01:00
Sam c908a6a01f added ssh pub key 2024-05-12 20:10:41 +01:00
Sam 240c099526 users in hosts 2024-05-12 19:58:55 +01:00
140 changed files with 5866 additions and 415 deletions

View File

@ -1,5 +1,265 @@
{
"nodes": {
"arion": {
"inputs": {
"flake-parts": "flake-parts",
"haskell-flake": "haskell-flake",
"hercules-ci-effects": "hercules-ci-effects",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1720147808,
"narHash": "sha256-hlWEQGUbIwYb+vnd8egzlW/P++yKu3HjV/rOdOPVank=",
"owner": "hercules-ci",
"repo": "arion",
"rev": "236f9dd82d6ef6a2d9987c7a7df3e75f1bc8b318",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "arion",
"rev": "236f9dd82d6ef6a2d9987c7a7df3e75f1bc8b318",
"type": "github"
}
},
"base16-schemes": {
"flake": false,
"locked": {
"lastModified": 1696158499,
"narHash": "sha256-5yIHgDTPjoX/3oDEfLSQ0eJZdFL1SaCfb9d6M0RmOTM=",
"owner": "tinted-theming",
"repo": "base16-schemes",
"rev": "a9112eaae86d9dd8ee6bb9445b664fba2f94037a",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-schemes",
"type": "github"
}
},
"devshell": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1722113426,
"narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=",
"owner": "numtide",
"repo": "devshell",
"rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1715070411,
"narHash": "sha256-5CNvkH0Nf7yMwgKhjUNg/lUK40C7DXB4zKOuA2jVO90=",
"owner": "nix-community",
"repo": "disko",
"rev": "4677f6c53482a8b01ee93957e3bdd569d51261d6",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "v1.6.1",
"repo": "disko",
"type": "github"
}
},
"flake-compat": {
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"revCount": 57,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"arion",
"nixpkgs"
]
},
"locked": {
"lastModified": 1719994518,
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"arion",
"hercules-ci-effects",
"nixpkgs"
]
},
"locked": {
"lastModified": 1712014858,
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
"type": "github"
},
"original": {
"id": "flake-parts",
"type": "indirect"
}
},
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1722555600,
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat_2",
"gitignore": "gitignore",
"nixpkgs": [
"nixvim",
"nixpkgs"
],
"nixpkgs-stable": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1724857454,
"narHash": "sha256-Qyl9Q4QMTLZnnBb/8OuQ9LSkzWjBU1T5l5zIzTxkkhk=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "4509ca64f1084e73bc7a721b20c669a8d4c5ebe6",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"nixvim",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"haskell-flake": {
"locked": {
"lastModified": 1675296942,
"narHash": "sha256-u1X1sblozi5qYEcLp1hxcyo8FfDHnRUVX3dJ/tW19jY=",
"owner": "srid",
"repo": "haskell-flake",
"rev": "c2cafce9d57bfca41794dc3b99c593155006c71e",
"type": "github"
},
"original": {
"owner": "srid",
"ref": "0.1.0",
"repo": "haskell-flake",
"type": "github"
}
},
"hercules-ci-effects": {
"inputs": {
"flake-parts": "flake-parts_2",
"nixpkgs": [
"arion",
"nixpkgs"
]
},
"locked": {
"lastModified": 1719226092,
"narHash": "sha256-YNkUMcCUCpnULp40g+svYsaH1RbSEj6s4WdZY/SHe38=",
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"rev": "11e4b8dc112e2f485d7c97e1cee77f9958f498f5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -7,38 +267,167 @@
]
},
"locked": {
"lastModified": 1715077503,
"narHash": "sha256-AfHQshzLQfUqk/efMtdebHaQHqVntCMjhymQzVFLes0=",
"lastModified": 1720042825,
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "6e277d9566de9976f47228dd8c580b97488734d4",
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.05",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1720042825,
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.05",
"repo": "home-manager",
"type": "github"
}
},
"impermanence": {
"locked": {
"lastModified": 1724489415,
"narHash": "sha256-ey8vhwY/6XCKoh7fyTn3aIQs7WeYSYtLbYEG87VCzX4=",
"owner": "nix-community",
"repo": "impermanence",
"rev": "c7f5b394397398c023000cf843986ee2571a1fd7",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "impermanence",
"type": "github"
}
},
"nix-colors": {
"inputs": {
"base16-schemes": "base16-schemes",
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1707825078,
"narHash": "sha256-hTfge2J2W+42SZ7VHXkf4kjU+qzFqPeC9k66jAUBMHk=",
"owner": "misterio77",
"repo": "nix-colors",
"rev": "b01f024090d2c4fc3152cd0cf12027a7b8453ba1",
"type": "github"
},
"original": {
"owner": "misterio77",
"repo": "nix-colors",
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1724561770,
"narHash": "sha256-zv8C9RNa86CIpyHwPIVO/k+5TfM8ZbjGwOOpTe1grls=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "ac5694a0b855a981e81b4d9f14052e3ff46ca39e",
"type": "github"
},
"original": {
"owner": "lnl7",
"repo": "nix-darwin",
"type": "github"
}
},
"nix-secrets": {
"flake": false,
"locked": {
"lastModified": 1726340825,
"narHash": "sha256-6gv36ea3aAjJH7osZVzVU0GRoJeVR+iwSP9bSaJC+MI=",
"ref": "refs/heads/master",
"rev": "73d4d304a201f7db200ffb5955c8a2f521f635a7",
"revCount": 160,
"type": "git",
"url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git"
},
"original": {
"type": "git",
"url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git"
}
},
"nixpkgs": {
"locked": {
"lastModified": 0,
"narHash": "sha256-UlRZtrCnhPFSJlDQE7M0eyhgvuuHBTe1eJ9N9AQlJQ0=",
"path": "/nix/store/3pif36ks3f56py4wb1dkq6sh0nkf3ygj-source",
"type": "path"
"lastModified": 1720031269,
"narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9f4128e00b0ae8ec65918efeba59db998750ead6",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1697935651,
"narHash": "sha256-qOfWjQ2JQSQL15KLh6D7xQhx0qgZlYZTYlcEiRuAMMw=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "e1e11fdbb01113d85c7f41cada9d2847660e3902",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1721524707,
"narHash": "sha256-5NctRsoE54N86nWd0psae70YSLfrOek3Kv1e8KoXe/0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "556533a23879fc7e5f98dd2e0b31a6911a213171",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1714906307,
"narHash": "sha256-UlRZtrCnhPFSJlDQE7M0eyhgvuuHBTe1eJ9N9AQlJQ0=",
"lastModified": 1724819573,
"narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "25865a40d14b3f9cf19f19b924e2ab4069b09588",
"rev": "71e91c409d1e654808b2621f28a327acfdad8dc2",
"type": "github"
},
"original": {
@ -48,11 +437,120 @@
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1724855419,
"narHash": "sha256-WXHSyOF4nBX0cvHN3DfmEMcLOVdKH6tnMk9FQ8wTNRc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ae2fc9e0e42caaf3f068c1bfdc11c71734125e06",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixvim": {
"inputs": {
"devshell": "devshell",
"flake-compat": "flake-compat",
"flake-parts": "flake-parts_3",
"git-hooks": "git-hooks",
"home-manager": "home-manager_2",
"nix-darwin": "nix-darwin",
"nixpkgs": [
"nixpkgs"
],
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1724910205,
"narHash": "sha256-eH2yPsTkaGp87rtxATx9d2dGBQUXH3kQPEOTKmaEb0s=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "d150ce320e4eda99d8865bbd4c74ee8c47a88097",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "nixos-24.05",
"repo": "nixvim",
"type": "github"
}
},
"nur": {
"locked": {
"lastModified": 1725083573,
"narHash": "sha256-F9WeDQi+U1+y6BDGvW8PYyi9LALbpo4DlpzfZONh5a0=",
"owner": "nix-community",
"repo": "NUR",
"rev": "83ead973ba76b6ecf2d72dff9b60b56749e29518",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
"root": {
"inputs": {
"arion": "arion",
"disko": "disko",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
"impermanence": "impermanence",
"nix-colors": "nix-colors",
"nix-secrets": "nix-secrets",
"nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable",
"nixvim": "nixvim",
"nur": "nur",
"sops-nix": "sops-nix"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1723501126,
"narHash": "sha256-N9IcHgj/p1+2Pvk8P4Zc1bfrMwld5PcosVA0nL6IGdE=",
"owner": "mic92",
"repo": "sops-nix",
"rev": "be0eec2d27563590194a9206f551a6f73d52fa34",
"type": "github"
},
"original": {
"owner": "mic92",
"repo": "sops-nix",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1724833132,
"narHash": "sha256-F4djBvyNRAXGusJiNYInqR6zIMI3rvlp6WiKwsRISos=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "3ffd842a5f50f435d3e603312eefa4790db46af5",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},

172
flake.nix
View File

@ -1,77 +1,143 @@
{
description = "Your new nix config";
description = "Nix Config";
inputs = {
# Nixpkgs
#nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
# You can access packages and modules from different nixpkgs revs
# at the same time. Here's an working example:
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Also see the 'unstable-packages' overlay at 'overlays/default.nix'.
# NUR
nur.url = "github:nix-community/NUR";
# Home manager
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
self,
nixpkgs,
home-manager,
...
} @ inputs: let
inherit (self) outputs;
# Supported systems for your flake packages, shell, etc.
systems = [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
forAllSystems = nixpkgs.lib.genAttrs systems;
in {
# Your custom packages
# Accessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
# Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt'
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
# Nixvim
nixvim = {
url = "github:nix-community/nixvim/nixos-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
# Your custom packages and modifications, exported as overlays
# Arion for docker
arion = {
url = "github:hercules-ci/arion/236f9dd82d6ef6a2d9987c7a7df3e75f1bc8b318";
};
# Nix colors
nix-colors.url = "github:misterio77/nix-colors";
# Declarative partitioning and formatting
disko = {
url = "github:nix-community/disko/v1.6.1";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence = {
url = "github:nix-community/impermanence";
};
# Secrets management
sops-nix = {
url = "github:mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-secrets = {
url = "git+ssh://git@git.bitlab21.com/sam/nix-secrets.git";
flake = false;
};
};
outputs =
{ self
, nixpkgs
, home-manager
, ...
} @ inputs:
let
inherit (self) outputs;
systems = [
"x86_64-linux"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
specialArgs = { inherit inputs outputs; };
in
{
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
overlays = import ./overlays { inherit inputs; };
# Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs
nixosModules = import ./modules/nixos;
# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
homeManagerModules = import ./modules/home-manager;
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
# System level configs
nixosConfigurations = {
# FIXME replace with your hostname
nixdev = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
inherit specialArgs;
modules = [
# > Our main nixos configuration file <
./hosts/nixdev
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = specialArgs;
}
];
};
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
# FIXME replace with your username@hostname
"sam@nixdev" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs;};
fileserver = nixpkgs.lib.nixosSystem {
inherit specialArgs;
modules = [
# > Our main home-manager configuration file <
./home/sam/nixdev.nix
./hosts/fileserver
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = specialArgs;
}
];
};
bootstrap = nixpkgs.lib.nixosSystem {
inherit specialArgs;
modules = [
./hosts/bootstrap
];
};
sparky = nixpkgs.lib.nixosSystem {
inherit specialArgs;
modules = [
./hosts/sparky
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = specialArgs;
}
];
};
semita = nixpkgs.lib.nixosSystem {
inherit specialArgs;
modules = [
./hosts/semita
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = specialArgs;
}
];
};
nebula = nixpkgs.lib.nixosSystem {
inherit specialArgs;
modules = [
./hosts/nebula
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = specialArgs;
}
];
};
citadel = nixpkgs.lib.nixosSystem {
inherit specialArgs;
modules = [
./hosts/citadel
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = specialArgs;
}
];
};
};

80
home/citadel.nix Normal file
View File

@ -0,0 +1,80 @@
{config, ...}: {
imports = [
# Import users
./users/sam
./common/core
# Import optional
./common/optional/git.nix
./common/optional/sops.nix
./common/optional/syncthing.nix
./common/optional/desktop/dwm
./common/optional/desktop/common/themes/standard-dark.nix
./common/optional/notes.nix
./common/optional/yazi.nix
];
colorScheme = {
slug = "serene";
name = "Serene";
author = "Bitlab21";
palette = {
base00 = "#1F1F28";
base01 = "#16161D";
base02 = "#223249";
base03 = "#363646";
base04 = "#727169";
base05 = "#DCD7BA";
base06 = "#C8C093";
base07 = "#717C7C";
base08 = "#C34043";
base09 = "#FFA066";
base0A = "#C0A36E";
base0B = "#76946A";
base0C = "#6A9589";
base0D = "#7E9CD8";
base0E = "#957FB8";
base0F = "#D27E99";
};
};
home.file.".Xresources" = {
recursive = true;
text = ''
! st
st.alpha: 0.8
St.font: monospace:pixelsize=31:antialias=true:autohint=true;
St.font2: NotoColorEmoji:pixelsize=24:antialias=true:autohint=true;
! dwm
dwm.borderpx: 6
dwm.font: monospace:size=14
dwm.col_base00: #${config.colorScheme.colors.base00}
dwm.col_base03: #${config.colorScheme.colors.base03}
dwm.col_base04: #${config.colorScheme.colors.base04}
dwm.col_base05: #${config.colorScheme.colors.base05}
dwm.col_base08: #${config.colorScheme.colors.base08}
dwm.col_base0B: #${config.colorScheme.colors.base0B}
! dmenu
dmenu.font: monospace:size=14
dmenu.font2: NotoColorEmoji:pixelsize=44:antialias=true:autohint=true
dmenu.topbar: 1
dmenu.normfgcolor: #${config.colorScheme.colors.base05}
dmenu.normbgcolor: #${config.colorScheme.colors.base03}
dmenu.selfgcolor: #${config.colorScheme.colors.base00}
dmenu.selbgcolor: #${config.colorScheme.colors.base0B}
Nsxiv.window.background: #${config.colorScheme.colors.base03}
Nsxiv.window.foreground: #${config.colorScheme.colors.base05}
Nsxiv.mark.foreground: #${config.colorScheme.colors.base08}
Nsxiv.bar.background: #${config.colorScheme.colors.base00}
Nsxiv.bar.foreground: #${config.colorScheme.colors.base05}
Nsxiv.bar.font: monospace:size=12
'';
};
}

View File

@ -0,0 +1,33 @@
{ pkgs, inputs, outputs, ... }:
{
imports = [
inputs.nix-colors.homeManagerModules.default
./zsh.nix
./nixvim
];
nixpkgs.overlays = [
inputs.nur.overlay
outputs.overlays.additions
outputs.overlays.unstable-packages
];
# Global home packages without config go here (for all hosts and users)
home.packages = builtins.attrValues {
inherit (pkgs)
ripgrep
fzf
eza
pciutils
tree
jq
coreutils
btop
htop
postgresql
libqalculate
tmux
;
};
home.stateVersion = "24.05";
}

View File

@ -0,0 +1,63 @@
{
inputs,
pkgs,
...
}: {
imports = [
inputs.nixvim.homeManagerModules.nixvim
./plugins
./options.nix
./theme.nix
./keymaps.nix
];
# Install home packages needed for nixvim
home.packages = [
pkgs.nixpkgs-fmt
pkgs.black
pkgs.yamllint
pkgs.yamlfmt
pkgs.prettierd
pkgs.sqlfmt
pkgs.nodePackages_latest.sql-formatter
pkgs.alejandra
pkgs.shellcheck
pkgs.shellharden
pkgs.shfmt
pkgs.stylua
];
programs.nixvim = {
enable = true;
enableMan = true; # install man pages for nixvim options
clipboard.register = "unnamedplus"; # use system clipboard instead of internal registers
globals.mapleader = " ";
extraConfigLua = ''
vim.api.nvim_set_keymap("", '<Space>', '<Nop>', { noremap = true, silent = true })
'';
extraConfigVim = ''
" ================ Persistent Undo ==================
" Keep undo history across sessions, by storing in file.
" Only works all the time.
if has('persistent_undo')
silent !mkdir ~/.vim/backups > /dev/null 2>&1
set undodir=~/.vim/backups
set undofile
endif
" ================ Vim Wiki config =================
" See :h vimwiki_list for info on registering wiki paths
let wiki_0 = {}
let wiki_0.path = '~/docs/wiki/'
let wiki_0.index = 'home'
let wiki_0.syntax = 'markdown'
let wiki_0.ext = '.md'
" ==== dbui
let g:db_ui_hide_schemas = ['pg_catalog', 'pg_toast_temp.*', 'pg_toast']
let g:db_ui_use_nerd_fonts = 1
let g:db_ui_execute_on_save = 0
'';
};
}

View File

@ -0,0 +1,117 @@
{
programs.nixvim.keymaps = [
# Switching buffers
{
mode = ["n"];
action = "<C-w>h";
key = "<S-h>";
options = {
silent = true;
};
}
{
mode = ["n"];
action = "<C-w>j";
key = "<S-j>";
options = {
silent = true;
};
}
{
mode = ["n"];
action = "<C-w>k";
key = "<S-k>";
options = {
silent = true;
};
}
{
mode = ["n"];
action = "<C-w>l";
key = "<S-l>";
options = {
silent = true;
};
}
# Toggle nvim-tree
{
mode = ["n"];
action = "<cmd>NvimTreeFindFileToggle<CR>";
key = "tt";
options = {
silent = true;
};
}
# Clear search highlighting
{
mode = ["n"];
key = "<space><space>";
action = "<cmd>nohlsearch<CR>";
options = {noremap = true;};
}
# Telescope Plugin
{
# find files
mode = ["n"];
key = "<Leader>ff";
action = "<cmd>Telescope find_files<CR>";
options = {noremap = true;};
}
{
# live grep
mode = ["n"];
key = "<Leader>fg";
action = "<cmd>Telescope live_grep<CR>";
options = {noremap = true;};
}
{
# buffers
mode = ["n"];
key = "<Leader>fb";
action = "<cmd>Telescope buffers<CR>";
options = {noremap = true;};
}
{
# help tags
mode = ["n"];
key = "<Leader>fh";
action = "<cmd>Telescope help_tags<CR>";
options = {noremap = true;};
}
# paste over selected text without yanking it
{
mode = ["v"];
key = "p";
action = "\"_dP";
options = {noremap = true;};
}
# resize window
{
mode = ["n"];
key = "<Right>";
action = ":vertical resize +1<CR>";
options = {noremap = true;};
}
{
mode = ["n"];
key = "<Left>";
action = ":vertical resize -1<CR>";
options = {noremap = true;};
}
{
mode = ["n"];
key = "<Down>";
action = ":resize -1<CR>";
options = {noremap = true;};
}
{
mode = ["n"];
key = "<Up>";
action = ": resize +1<CR>";
options = {noremap = true;};
}
];
}

View File

@ -0,0 +1,37 @@
{
programs.nixvim.opts = {
background = "";
number = true; # show line numbers
relativenumber = true; # show relative linenumbers
laststatus = 0; # Display status line always
history = 1000; # Store lots of :cmdline history
showcmd = true; # Show incomplete cmds down the bottom
showmode = true; # Show current mode down the bottom
autoread = true; # Reload files changed outside vim
lazyredraw = true; # Redraw only when needed
showmatch = true; # highlight matching braces
ruler = true; # show current line and column
visualbell = true; # No sounds
listchars = "trail:·"; # Display tabs and trailing spaces visually
autoindent = true;
cindent = true; # automatically indent braces
smartindent = true;
smarttab = true;
shiftwidth = 2;
softtabstop = 4;
tabstop = 2;
expandtab = true;
wildmode = "list:longest";
wildmenu = true; # enable ctrl-n and ctrl-p to scroll thru matches
scrolloff = 4; # Start scrolling when we're 4 lines away from margins
sidescrolloff = 15;
sidescroll = 1;
incsearch = true;
hlsearch = true;
ignorecase = true;
smartcase = true;
backspace = "indent,eol,start"; # allow backspace in insert mode
spell = true;
spelllang = "en_gb";
};
}

View File

@ -0,0 +1,119 @@
{
programs.nixvim.plugins = {
cmp-emoji = { enable = true; };
cmp = {
enable = true;
settings = {
autoEnableSources = true;
experimental = { ghost_text = true; };
performance = {
debounce = 60;
fetchingTimeout = 200;
maxViewEntries = 30;
};
snippet = { expand = "luasnip"; };
formatting = {
fields = [ "kind" "abbr" "menu" ];
format = ''
function(entry, vim_item)
vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind)
vim_item.menu = ({
nvim_lsp = "[LSP]",
nvim_lua = "[Lua]",
luasnip = "[Snippet]",
buffer = "[Buffer]",
path = "[Path]",
["vim-dadbod-completion"] = "[SQL-dadbod]"
})[entry.source.name]
return vim_item
end,
'';
};
sources = [
{ name = "nvim_lsp"; }
{ name = "nvim_lua"; }
{ name = "luasnip"; }
{ name = "buffer"; }
{ name = "path"; }
{ name = "vim-dadbod-completion"; }
];
window = {
completion = { border = "solid"; };
documentation = { border = "solid"; };
};
mapping = {
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
"<C-j>" = "cmp.mapping.select_next_item()";
"<C-k>" = "cmp.mapping.select_prev_item()";
"<C-e>" = "cmp.mapping.abort()";
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<S-CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })";
};
};
};
cmp-nvim-lsp = { enable = true; }; # lsp
cmp-buffer = { enable = true; };
cmp-path = { enable = true; }; # file system paths
cmp_luasnip = { enable = true; }; # snippets
cmp-cmdline = { enable = false; }; # autocomplete for cmdline
};
programs.nixvim.extraConfigLua = ''
luasnip = require("luasnip")
kind_icons = {
Text = "󰊄",
Method = "",
Function = "󰡱",
Constructor = "",
Field = "",
Variable = "󱀍",
Class = "",
Interface = "",
Module = "󰕳",
Property = "",
Unit = "",
Value = "",
Enum = "",
Keyword = "",
Snippet = "",
Color = "",
File = "",
Reference = "",
Folder = "",
EnumMember = "",
Constant = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = "",
}
local cmp = require'cmp'
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({'/', "?" }, {
sources = {
{ name = 'buffer' }
}
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = 'buffer' },
})
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
}),
}) '';
}

View File

@ -0,0 +1,6 @@
{
programs.nixvim.plugins.nvim-colorizer = {
enable = true;
fileTypes = [ "*" ];
};
}

View File

@ -0,0 +1,5 @@
{
programs.nixvim.plugins.comment = {
enable = true;
};
}

View File

@ -0,0 +1,44 @@
{
programs.nixvim.plugins.conform-nvim = {
enable = true;
formatOnSave = {
lspFallback = true;
timeoutMs = 500;
};
notifyOnError = true;
logLevel = "debug";
formattersByFt = {
html = ["prettierd"];
css = ["prettierd"];
javascript = ["prettierd"];
python = ["black"];
lua = ["stylua"];
nix = ["alejandra"];
markdown = ["prettierd"];
yaml = ["yamlfmt"];
sql = ["sql-formatter"];
bash = [
"shellcheck"
"shellharden"
"shfmt"
];
};
formatters = {
sql-formatter = {
command = "sql-formatter";
args = "--config ~/.config/sql-formatter/config.json";
};
};
};
home.file.".config/sql-formatter/config.json".text = ''
{
"language": "postgresql",
"tabWidth": 2,
"linesBetweenQueries": 1,
"expressionWidth": 88,
"newlineBeforeSemicolon": true
}
'';
}

View File

@ -0,0 +1,127 @@
{
pkgs,
config,
...
}: let
user = config.home.username;
in {
imports = [
./cmp.nix
./colorizer.nix
./conform.nix
./gitsigns.nix
./harpoon.nix
./lsp.nix
./lualine.nix
./luasnip.nix
./nvim-tree.nix
./surround.nix
./telescope.nix
./treesitter.nix
./fold.nix
./todo-comments.nix
./oil.nix
./comment.nix
];
# Load Plugins that aren't provided as modules by nixvim
programs.nixvim.extraPlugins = [
pkgs.vimPlugins.vim-numbertoggle
pkgs.vimPlugins.vimwiki
pkgs.vimPlugins.vim-dadbod
pkgs.vimPlugins.vim-dadbod-ui
pkgs.vimPlugins.vim-dadbod-completion
pkgs.vimPlugins.fugitive
(pkgs.vimUtils.buildVimPlugin
{
name = "buffer_manager.nvim";
src = pkgs.fetchFromGitHub {
owner = "j-morano";
repo = "buffer_manager.nvim";
rev = "fd36131";
sha256 = "sha256-abe9ZGmL7U9rC+LxC3LO5/bOn8lHke1FCKO0V3TZGs0=";
};
})
(pkgs.vimUtils.buildVimPlugin
{
name = "vimwiki-sync";
src = pkgs.fetchFromGitHub {
owner = "michal-h21";
repo = "vimwiki-sync";
rev = "99eeab3";
sha256 = "sha256-cz0dSFphIbQAI4AOqwIUpDBTuj/3xlOkhSlIVMdgsqM=";
};
})
# Keep vim-devicons as last entry
pkgs.vimPlugins.vim-devicons
];
programs.nixvim.extraConfigLua = ''
-- buffer_manager.nvim
local opts = {noremap = true}
require("buffer_manager").setup(
{
line_keys = "1234567890",
select_menu_item_commands = {
edit = {
key = "<CR>",
command = "edit"
}
},
focus_alternate_buffer = true,
short_file_names = false,
short_term_names = true,
height = 15,
width = 0.8,
loop_nav = true,
highlight = "",
win_extra_options = {},
borderchars = { "", "", "", "", "", "", "", "" },
order_buffers = "lastused",
show_indicators = "before",
}
)
-- Custom color for modified buffers
vim.api.nvim_set_hl(0, "BufferManagerModified", { fg = "#988100" })
local bmui = require("buffer_manager.ui")
vim.keymap.set('n', '<leader>b', bmui.toggle_quick_menu, opts)
vim.keymap.set('n', '<leader>n', bmui.nav_next, opts)
vim.keymap.set('n', '<leader>p', bmui.nav_prev, opts)
local keys="1234567890"
for i = 1, #keys do
local key = keys:sub(i,i)
vim.keymap.set('n', string.format('<leader>%s', key),
function () bmui.nav_file(i) end,
opts
)
end
-- Setup vimwiki
vim.g.vimwiki_list = {
{
syntax = "markdown",
ext = ".md",
path = "/home/${user}/.local/share/notes",
},
}
-- Format function for conform.nvim
vim.api.nvim_create_user_command("Format", function(args)
local range = nil
if args.count ~= -1 then
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
range = {
start = { args.line1, 0 },
["end"] = { args.line2, end_line:len() },
}
end
require("conform").format({ async = true, lsp_format = "fallback", range = range })
end, { range = true })
'';
}

View File

@ -0,0 +1,31 @@
{
programs.nixvim.plugins.nvim-ufo = {
enable = true;
};
programs.nixvim.extraConfigLua = ''
-- default fold options
vim.o.foldcolumn = '1'
vim.o.foldlevel = 99
vim.o.foldlevelstart = 99
vim.o.foldenable = true
-- nvim_ufo options
vim.keymap.set('n', 'zR', require('ufo').openAllFolds, { desc = "Open all folds" })
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds, { desc = "Close all folds" })
vim.keymap.set('n', 'zK', function()
local winid = require("ufo").peekFoldedLinesUnderCursor()
if not winid then
vim.lsp.buf.hover()
end
end , { desc = "Peed fold" })
require("ufo").setup({
provider_selector = function(bufnr, filetype, buftype)
return { 'lsp', 'indent' }
end
})
'';
}

View File

@ -0,0 +1,35 @@
{
programs.nixvim.plugins.gitsigns = {
enable = true;
settings.signs.add = {
hl = "GitSignsAdd";
text = " ";
numhl = "GitSignsAddNr";
linehl = "GitSignsAddLn";
};
settings.signs.change = {
hl = "GitSignsChange";
text = " ";
numhl = "GitSignsChangeNr";
linehl = "GitSignsChangeLn";
};
settings.signs.delete = {
hl = "GitSignsDelete";
text = " ";
numhl = "GitSignsDeleteNr";
linehl = "GitSignsDeleteLn";
};
settings.signs.topdelete = {
hl = "GitSignsDelete";
text = " ";
numhl = "GitSignsDeleteNr";
linehl = "GitSignsDeleteLn";
};
settings.signs.changedelete = {
hl = "GitSignsChange";
text = " ";
numhl = "GitSignsChangeNr";
linehl = "GitSignsChangeLn";
};
};
}

View File

@ -0,0 +1,8 @@
{
programs.nixvim.plugins.harpoon = {
enable = true;
keymaps = {
toggleQuickMenu = "<leader>h";
};
};
}

View File

@ -0,0 +1,59 @@
{
programs.nixvim.plugins = {
lsp = {
enable = true;
servers = {
lua-ls = {enable = true;};
nixd = {enable = true;};
bashls = {enable = true;};
pyright = {enable = true;};
html = {enable = true;};
marksman = {enable = true;};
ccls = {enable = true;};
cssls = {enable = true;};
r-language-server = {enable = true;};
tsserver = {enable = true;};
};
keymaps = {
lspBuf = {
gd = {
action = "definition";
desc = "Goto Definition";
};
gr = {
action = "references";
desc = "Goto References";
};
gD = {
action = "declaration";
desc = "Goto Declaration";
};
gI = {
action = "implementation";
desc = "Goto Implementation";
};
gT = {
action = "type_definition";
desc = "Type Definition";
};
gK = {
action = "hover";
desc = "Hover";
};
"<leader>cw" = {
action = "workspace_symbol";
desc = "Workspace Symbol";
};
"<leader>cr" = {
action = "rename";
desc = "Rename";
};
};
};
};
# TODO: enable otter.nvim when merged into nixvim stable
# otter = {
# enable = true;
# };
};
}

View File

@ -0,0 +1,13 @@
{
# Add tiny pictograms to lsp
programs.nixvim.plugins.lspkind = {
enable = true;
symbolMap = {
Copilot = "";
};
extraOptions = {
maxwidth = 50;
ellipsis_char = "...";
};
};
}

View File

@ -0,0 +1,22 @@
{
programs.nixvim.plugins.lualine = {
enable = true;
theme = "auto";
componentSeparators = {
left = "";
right = "";
};
sectionSeparators = {
left = "";
right = "";
};
sections = {
lualine_a = [ "mode" ];
lualine_b = [ "branch" "diff" "diagnostics" ];
lualine_c = [ "filename" ];
lualine_x = [ "encoding" "fileformat" "filetype" ];
lualine_y = [ "progress" ];
lualine_z = [ "locations" ];
};
};
}

View File

@ -0,0 +1,15 @@
{ pkgs, ... }: {
programs.nixvim.plugins.luasnip = {
enable = true;
extraConfig = {
enable_autosnippets = true;
store_selection_keys = "<Tab>";
};
fromVscode = [
{
lazyLoad = true;
paths = "${pkgs.vimPlugins.friendly-snippets}";
}
];
};
}

View File

@ -0,0 +1,12 @@
{
programs.nixvim.plugins.nvim-tree = {
enable = true;
view.width = {
min = 30;
max = -1;
padding = 1;
};
disableNetrw = true;
filters.dotfiles = true;
};
}

View File

@ -0,0 +1,5 @@
{
programs.nixvim.plugins.oil = {
enable = true;
};
}

View File

@ -0,0 +1,3 @@
{
programs.nixvim.plugins.surround.enable = true; # vim-surround
}

View File

@ -0,0 +1,6 @@
{
programs.nixvim.plugins.telescope = {
enable = true;
extensions.fzy-native.enable = true;
};
}

View File

@ -0,0 +1,19 @@
{
programs = {
nixvim = {
plugins.todo-comments = {
enable = true;
};
keymaps = [
{
mode = [ "n" ];
action = "<cmd>TodoTelescope<cr>";
key = "<leader>ft";
options = {
silent = true;
};
}
];
};
};
}

View File

@ -0,0 +1,5 @@
{
programs.nixvim.plugins.treesitter = {
enable = true;
};
}

View File

@ -0,0 +1,14 @@
{
programs.nixvim.colorschemes.kanagawa = {
enable = true;
settings = {
commentStyle = {
italic = true;
};
terminalColors = true;
theme = "wave";
transparent = true;
undercurl = true;
};
};
}

105
home/common/core/zsh.nix Normal file
View File

@ -0,0 +1,105 @@
{ config, ... }: {
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
ll = "ls -l";
src = "cd ~/.local/share/src";
};
history.size = 10000;
history.path = "${config.xdg.dataHome}/zsh/history";
initExtra = ''
bindkey -v
bindkey "^H" backward-delete-char
bindkey "^?" backward-delete-char
set -o vi
export TERM=xterm-256color
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
SESSION_TYPE="(ssh) "
fi
####
# Format prompt
####
# Define colors
COLOR_RED="red"
COLOR_MAGENTA="92"
COLOR_YELLOW="3"
COLOR_GREEN="36"
COLOR_BLUE="4"
COLOR_WHITE="7"
# Format git colors
autoload -Uz compinit && compinit
autoload -Uz add-zsh-hook
autoload -Uz vcs_info
add-zsh-hook precmd vcs_info
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' formats " %F{cyan}%c%u(%b)%f"
zstyle ':vcs_info:*' actionformats " %F{cyan}%c%u(%b)%f %a"
zstyle ':vcs_info:*' stagedstr "%F{$COLOR_RED}"
zstyle ':vcs_info:*' unstagedstr "%F{$COLOR_RED}"
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:git*+set-message:*' hooks git-untracked
+vi-git-untracked() {
if git --no-optional-locks status --porcelain 2> /dev/null | grep -q "^??"; then
hook_com[staged]+="%F{$COLOR_RED}"
elif git --no-optional-locks status --porcelain 2> /dev/null | grep -q "^A"; then
hook_com[staged]+="%F{$COLOR_YELLOW}"
else
hook_com[staged]+="%F{$COLOR_GREEN}"
fi
}
# Format prompt
setopt PROMPT_SUBST
PROMPT='%F{'$COLOR_GREEN'}'$(echo "$SESSION_TYPE")'''
PROMPT+='%F{'$COLOR_RED'}['
PROMPT+='%F{'$COLOR_GREEN'}%n'
PROMPT+='%F{red}@'
PROMPT+='%F{'$COLOR_YELLOW'}%m'
PROMPT+='%F{'$COLOR_RED'}] '
PROMPT+='%F{'$COLOR_WHITE'}['
PROMPT+='%F{'$COLOR_YELLOW'}%1~'
PROMPT+='%F{'$COLOR_WHITE'}]'
PROMPT+='$'
PROMPT+='vcs_info_msg_0_'
PROMPT+=' > '
export PROMPT
setopt autocd # Automatically cd into typed directory.
stty stop undef # Disable ctrl-s to freeze terminal.
setopt interactive_comments
# General opts
HISTSIZE=10000000
SAVEHIST=10000000
setopt appendhistory
# Change cursor shape for different vi modes.
function zle-keymap-select () {
case $KEYMAP in
vicmd) echo -ne '\e[1 q';; # block
viins|main) echo -ne '\e[5 q';; # beam
esac
}
zle -N zle-keymap-select
zle-line-init() {
zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
echo -ne "\e[5 q"
}
zle -N zle-line-init
echo -ne '\e[5 q' # Use beam shape cursor on startup.
preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
'';
};
}

View File

@ -0,0 +1,16 @@
{
home.file.".config/autostart/feh-wallpaper-changer.desktop" = {
recursive = true;
text = ''
[Desktop Entry]
Type=Application
Exec=feh-wallpaper-changer
X-GNOME-Autostart-enabled=true
NoDisplay=false
Hidden=false
Name[en_GB]=feh-wallpaper-changer
Comment[en_GB]=Periodically changes the wallpaper using feh
X-GNOME-Autostart-Delay=5
'';
};
}

View File

@ -0,0 +1,29 @@
{ pkgs, ... }: {
home.file.".config/cinnamon-monitors".text = ''
<monitors version="2">
<configuration>
${builtins.concatStringsSep "\n" (map (monitor: ''
<logicalmonitor>
<x>${toString monitor.x}</x>
<y>${toString monitor.y}</y>
<scale>${toString monitor.scale}</scale>
${if monitor.primary then "<primary>yes</primary>" else ""}
<monitor>
<monitorspec>
<connector>${toString monitor.name}</connector>
<vendor>${toString monitor.vendor}</vendor>
<product>${toString monitor.product}</product>
<serial>${toString monitor.serial}</serial>
</monitorspec>
<mode>
<width>${toString monitor.width}</width>
<height>${toString monitor.height}</height>
<rate>${toString monitor.refreshRate}</rate>
</mode>
</monitor>
</logicalmonitor>
''))}
</configuration>
</monitors>
'';
}

View File

@ -0,0 +1,9 @@
{
imports = [
../common
../common/x11
./autostart.nix
# This doesn't seem to work in Cinnamon
#./cinnamon-monitors.nix
];
}

View File

@ -0,0 +1,51 @@
{ config, pkgs, ... }:
{
programs.alacritty = {
enable = true;
settings = {
colors = with config.colorScheme.palette; {
bright = {
black = "0x${base03}";
blue = "0x${base04}";
cyan = "0x${base0F}";
green = "0x${base01}";
magenta = "0x${base06}";
red = "0x${base09}";
white = "0x${base07}";
yellow = "0x${base02}";
};
cursor = {
cursor = "0x${base05}";
text = "0x${base00}";
};
normal = {
black = "0x${base00}";
blue = "0x${base0D}";
cyan = "0x${base0C}";
green = "0x${base0B}";
magenta = "0x${base0E}";
red = "0x${base08}";
white = "0x${base05}";
yellow = "0x${base0A}";
};
primary = {
background = "0x${base00}";
foreground = "0x${base05}";
};
};
window = {
padding = {
x = 5;
y = 5;
};
blur = true;
opacity = 0.9;
};
shell.program = "${pkgs.zsh}/bin/zsh";
};
};
}

View File

@ -0,0 +1,22 @@
{pkgs, ...}: {
imports = [
./firefox.nix
./alacritty.nix
./zotero.nix
./fontconfig.nix
];
# Global packages for desktop environments
home.packages = [
pkgs.alacritty
pkgs.libnotify
pkgs.zathura
pkgs.xfce.thunar
pkgs.kcolorchooser
pkgs.zotero
pkgs.transmission
pkgs.qgis
pkgs.mpv
pkgs.gnome.simple-scan
];
}

View File

@ -0,0 +1,81 @@
{ pkgs, config, ... }:
let
user = config.home.username;
in
{
programs.firefox = {
enable = true;
profiles.${user} = {
search = {
force = true;
default = "Searx";
order = [ "Searx" "DuckDuckGo" ];
engines = {
"Nix Packages" = {
urls = [{
template = "https://search.nixos.org/packages";
params = [
{ name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"NixOS Wiki" = {
urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }];
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
};
"Searx" = {
urls = [{ template = "http://10.0.10.35:8855/?q={searchTerms}"; }];
iconUpdateURL = "https://docs.searxng.org/_static/searxng-wordmark.svg";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@searx" ];
};
"Bing".metaData.hidden = true;
"Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias
};
};
bookmarks = [
{
name = "wikipedia";
tags = [ "wiki" ];
keyword = "wiki";
url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go";
}
{
name = "bitlab21";
tags = [ "bitcoin" ];
keyword = "bitcoin";
url = "https://bitlab21.com";
}
];
settings = {
"dom.security.https_only_mode" = true;
"browser.download.panel.shown" = true;
"identity.fxaccounts.enabled" = false;
"signon.rememberSignons" = false;
"browser.compactmode.show" = true;
"browser.startup.homepage" = "http://10.0.10.35:8855";
"browser.search.defaultenginename" = "Searx";
"browser.search.order.1" = "Searx";
};
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
ublock-origin
return-youtube-dislikes
bitwarden
sponsorblock
darkreader
vimium
privacy-badger
zotero-connector
];
};
};
}

View File

@ -0,0 +1,24 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
nerdfonts
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
hack-font
liberation_ttf
libertine
font-awesome
];
fonts = {
fontconfig = {
enable = true;
defaultFonts = {
serif = [ "NotoSans Nerd Font" ];
sansSerif = [ "Linux Biolinum O" ];
monospace = [ "Hack Nerd Font" ];
};
};
};
}

View File

@ -0,0 +1,51 @@
{pkgs, ...}: {
# Prevent error when enabling gtk https://github.com/nix-community/home-manager/issues/3113
# error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.dconf was not provided by any .service files
home.packages = [
pkgs.dconf
];
# Get details about theme package
#cd $(nix build nixpkgs#kanagawa-gtk-theme --print-out-paths --no-link) && nix run nixpkgs#eza -- --tree --level 4
gtk = {
enable = true;
theme = {
name = "Kanagawa-B";
package = pkgs.kanagawa-gtk-theme;
};
iconTheme = {
package = pkgs.gnome.adwaita-icon-theme;
name = "Adwaita";
};
gtk3.extraConfig = {
Settings = ''
gtk-application-prefer-dark-theme=1
'';
};
gtk4.extraConfig = {
Settings = ''
gtk-application-prefer-dark-theme=1
'';
};
};
#gtk.theme.package = pkgs.kanagawa-gtk-theme;
# gtk.cursorTheme = {
# name = "Vimix-Cursors";
# package = pkgs.vimix-cursor-theme;
# };
# gtk.theme.name = "Kanagawa-B";
# gtk.iconTheme.package = pkgs.kanagawa-icon-theme;
# gtk.iconTheme.name = "Kanagawa";
qt.enable = true;
qt.platformTheme.name = "gtk";
qt.style.name = "adwaita-dark";
qt.style.package = pkgs.adwaita-qt;
}

View File

@ -0,0 +1,14 @@
{ pkgs, ... }:
{
imports = [
./mako.nix
./waybar.nix
./swww-wallpaper-changer.nix
];
home.packages = [
pkgs.wofi
pkgs.wl-clipboard
pkgs.pyprland
];
}

View File

@ -0,0 +1,12 @@
{ pkgs, config, ... }:
{
services.mako = {
enable = true;
backgroundColor = "#${config.colorScheme.colors.base00}";
borderColor = "#${config.colorScheme.colors.base0D}";
borderRadius = 5;
borderSize = 2;
textColor = "#${config.colorScheme.colors.base05}";
layer = "overlay";
};
}

View File

@ -0,0 +1,19 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellScriptBin "swww-wallpaper-changer" ''
export WAYLAND_DISPLAY="wayland-1"
wallpaper_dir="$HOME/.local/share/bg/"
[ -d "$wallpaper_dir" ] || mkdir -p "$wallpaper_dir"
${swww}/bin/swww-daemon &
while true; do
find "$wallpaper_dir" -type f -follow \( -iname \*.jpg -o -iname \*.png -o -iname \*.gif -o -iname \*.bmp \) | shuf | while read -r file; do
${swww}/bin/swww img "$file" --transition-step 10 --transition-fps 60
[ $? != 0 ] && echo "swww failed, exiting" && exit 1
sleep 600
done
done
'')
];
}

View File

@ -0,0 +1,230 @@
{ lib
, config
, pkgs
, ...
}: {
# Let it try to start a few more times
systemd.user.services.waybar = {
Unit.StartLimitBurst = 30;
};
programs.waybar = {
enable = true;
systemd.enable = true;
settings = {
primary = {
mode = "dock";
height = 30;
margin = "6";
spacing = 5;
modules-left = [
"custom/menu"
"hyprland/workspaces"
"hyprland/window"
];
modules-center = [
"clock"
];
modules-right = [
"cpu"
"memory"
"network"
"pulseaudio"
"battery"
"tray"
"custom/exit"
"custom/hostname"
"custom/ip"
];
"hyprland/window" = {
"format" = "{}";
"rewrite" = {
"(.*) Mozilla Firefox" = "$1";
};
"separate-outputs" = true;
};
"hyprland/workspaces" = {
"format" = "{name}";
"on-click" = "activate";
"format-icons" = {
"urgent" = "";
"active" = "";
"default" = "";
};
};
"clock" = {
"format" = "<span> </span>{:%y-%m-%d %H:%M:%S}";
"tooltip-format" = "<big>{:%B %Y}</big>\n<tt><small>{calendar}</small></tt>";
"on-click" = "calendar";
};
"cpu" = {
"interval" = 10;
"format" = " {}%";
"max-length" = 10;
"on-click" = "";
};
"memory" = {
"interval" = 30;
"format" = " {}%";
"format-alt" = " {used:0.1f}G";
"max-length" = 10;
};
"network" = {
"format-wifi" = " {signalStrength}%";
"format-ethernet" = " wired ({ipaddr})";
"format-disconnected" = "";
};
"battery" = {
"bat" = "BAT0";
"adapter" = "ADP0";
"interval" = 60;
"states" = {
"warning" = 30;
"critical" = 15;
};
"max-length" = 20;
"format" = "{icon} {capacity}%";
"format-warning" = "{icon} {capacity}%";
"format-critical" = "{icon} {capacity}%";
"format-charging" = "<span font-family='Font Awesome 6 Free'></span> {capacity}%";
"format-plugged" = " {capacity}%";
"format-alt" = "{icon} {time}";
"format-full" = " {capacity}%";
"format-icons" = [ " " " " " " " " " " ];
};
"tray" = {
"spacing" = 10;
};
"custom/menu" = {
"format" = " Nixos";
"on-click" = "wofi --show drun";
};
"custom/hostname" = {
"exec" = "echo $USER@$(hostname)";
"on-click" = "$TERMINAL";
};
"custom/exit" = {
"format" = "";
"on-click" = "wlogout";
};
"pulseaudio" = {
"format" = "{icon} {volume}%";
"format-muted" = " 0%";
"format-icons" = {
"headphone" = "";
"headset" = "";
"portable" = "";
"default" = [ "" "" "" ];
};
"on-click" = "pypr toggle volume";
};
};
};
style = ''
* {
font-family: JetBrainsMono Nerd Font;
font-size: 12pt;
padding: 0 8px;
}
.modules-right {
margin-right: -15px;
}
.modules-left {
margin-left: -15px;
}
window#waybar {
color: white;
background-color: #002635;
opacity: 0.95;
padding: 0;
border-radius: 10px;
}
window#waybar.bottom {
opacity: 0.90;
background-color: #002635;
border: 2px solid #14747e;
border-radius: 10px;
}
#workspaces button {
padding: 0 5px;
color: #7984A4;
background-color: transparent;
box-shadow: inset 0 -3px transparent;
border: none;
border-radius: 0;
}
#workspaces button.hidden {
background-color: #002635;
color: #869696;
}
#workspaces button.focused {
color: #bf616a;
}
#workspaces button.active {
color: #6a92d7;
}
#workspaces button.urgent {
background-color: #eb4d4b;
}
#clock {
padding-left: 15px;
padding-right: 15px;
margin-top: 0;
margin-bottom: 0;
border-radius: 10px;
}
#tray {
color: #a1a19a;
}
#custom-hostname {
background-color: white;
color: #002635;
padding-left: 15px;
padding-right: 18px;
margin-right: 0;
margin-top: 0;
margin-bottom: 0;
border-radius: 10px;
}
#custom-menu {
font-size: 16pt;
background-color: white;
color: #002635;
padding-left: 15px;
padding-right: 22px;
margin-left: 0;
margin-right: 10px;
margin-top: 0;
margin-bottom: 0;
border-radius: 10px;
}
'';
};
}

View File

@ -0,0 +1,14 @@
{ pkgs, ... }:
{
imports = [
./scripts/feh-wallpaper-changer.nix
];
home.packages = [
pkgs.flameshot
pkgs.st
pkgs.xclip
pkgs.feh
];
}

View File

@ -0,0 +1,36 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellScriptBin "feh-wallpaper-changer" ''
# Kill previous instance if exists
script_name=''${BASH_SOURCE[0]}
for pid in $(pidof -x $script_name); do
if [ $pid != $$ ]; then
kill -9 $pid
fi
done
wallpaper_dir="$HOME/.local/share/bg/"
if [ ! -d "$wallpaper_dir" ]; then
echo "No wallpapers in $wallpaper_dir, cloning from remote"
mkdir -p "$wallpaper_dir"
git clone https://git.bitlab21.com/sam/minimalistic-wallpaper-collection.git "$wallpaper_dir/minimalistic-wallpaper-collection"
[ $? != 0 ] && echo "cloning from gitea failed, exiting" && exit 1
fi
pics_exist=$(find "$wallpaper_dir" -type f -follow \( -iname \*.jpg -o -iname \*.png -o -iname \*.gif -o -iname \*.bmp \))
if [ -z "$pics_exist" ]; then
git clone https://git.bitlab21.com/sam/minimalistic-wallpaper-collection.git "$wallpaper_dir/minimalistic-wallpaper-collection"
[ $? != 0 ] && echo "cloning from gitea failed, exiting" && exit 1
fi
while true; do
find "$wallpaper_dir" -type f -follow \( -iname \*.jpg -o -iname \*.png -o -iname \*.gif -o -iname \*.bmp \) | shuf | while read -r file; do
${feh}/bin/feh --bg-fill "$file"
[ $? != 0 ] && echo "feh failed, exiting" && exit 1
sleep 600
done
done
'')
];
}

View File

@ -0,0 +1,33 @@
{ pkgs, config, ... }:
let
user = config.home.username;
in
{
home.packages = [
pkgs.zotero
];
home.file.".zotero/zotero/profiles.ini".text = ''
[General]
StartWithLastProfile=1
[Profile0]
Name=default
IsRelative=1
Path=zprofile.default
Default=1
'';
home.file.".zotero/zotero/zprofile.default/user.js".text = ''
user_pref("extensions.zotero.dataDir", "/home/${user}/.local/share/Zotero");
user_pref("extensions.zotero.firstRun.skipFirefoxProfileAccessCheck", true);
user_pref("extensions.zotero.firstRun2", false);
user_pref("extensions.zotero.useDataDir", true);
user_pref("intl.accept_languages", "en-GB, en");
user_pref("extensions.zotero.sync.server.username", "samual.shop@proton.me");
user_pref("extensions.zotero.sync.fulltext.enabled", false);
user_pref("extensions.zotero.sync.storage.enabled", false);
user_pref("extensions.zotero.sync.storage.groups.enabled", false);
'';
}

View File

@ -0,0 +1,46 @@
{ pkgs, ... }:
{
imports = [
../common
../common/x11
./xinitrc.nix
./sxhkdrc.nix
./picom.nix
./dunst.nix
./music_player.nix
# Status bar scripts
./scripts/sb-cpu-pct.nix
./scripts/sb-mem-pct.nix
./scripts/sb-volume.nix
./scripts/sb-network-status.nix
./scripts/sb-updates.nix
./scripts/sb-battery.nix
# Notification scripts
./scripts/dunstify-volume-notification.nix
./scripts/dunstify-battery-notification.nix
# Helper scripts
./scripts/emoji-picker.nix
./scripts/clipboard-save.nix
./scripts/clipboard-recall.nix
./scripts/get-focused-monitor.nix
./scripts/git-commit-ai.nix
./scripts/aichat-wrapper.nix
./scripts/dmenu-wifi.nix
./scripts/battery-status.nix
];
home.packages = [
pkgs.dwmblocks
pkgs.dmenu
pkgs.dunst
pkgs.picom
pkgs.sxhkd
pkgs.nsxiv
pkgs.unstable.aichat
pkgs.toipe
];
}

View File

@ -0,0 +1,179 @@
{ pkgs, config, ... }: {
home.packages = builtins.attrValues {
inherit (pkgs)
libnotify; # required by dunst
};
services.dunst = {
enable = true;
iconTheme = {
name = "Adwaita";
package = pkgs.gnome.adwaita-icon-theme;
size = "16x16";
};
settings = {
global = {
# Allow a small subset of html markup:<b></b>, <i></i>, <s></s>, and <u></u>.
# For a complete reference see
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
# If markup is not allowed, those tags will be stripped out of the message.
markup = "yes";
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# Markup is allowed
#format = ''%I %s %p\n%b'';
format = ''<b>%s:</b>\n%b\n\n%a '';
font = "monospace";
# Options are "left", "center", and "right".
alignment = "left";
# Sort messages by urgency.
sort = "yes";
# Show how many messages are currently hidden (because of geometry).
indicate_hidden = "yes";
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60;
# Split notifications into multiple lines if they don't fit into
# geometry.
word_wrap = "no";
# Ignore newlines '\n' in notifications.
ignore_newline = "no";
# The geometry of the window:
# [{width}]x{height}[+/-{x}+/-{y}]
# The geometry of the message window.
# The height is measured in number of notifications everything else
# in pixels. If the width is omitted but the height is given
# ("-geometry x2"), the message window expands over the whole screen
# (dmenu-like). If width is 0, the window expands to the longest
# message displayed. A positive x is measured from the left, a
# negative from the right side of the screen. Y is measured from
# the top and down respectevly.
# The width can be negative. In this case the actual width is the
# screen width minus the width defined in within the geometry option.
# geometry = "400x0-15+60";
# Shrink window if it's smaller than the width. Will be ignored if
# width is 0.
shrink = "yes";
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a windowmanager that exports the _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern windowmanagers.
#
# If this option is set to mouse or keyboard, the monitor option will be ignored.
follow = "none";
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = "yes";
# Maximum amount of notifications kept in history
history_length = 20;
# Display indicators for URLs (U) and actions (A).
show_indicators = "yes";
# The height of a single line. If the height is smaller than the
# font height, it will get raised to the font height.
# This adds empty space above and under the text.
line_height = 0;
# Draw a line of "separator_height" pixel height between two
# notifications. Set to 0 to disable.
separator_height = 0;
# Gap between messages - requires compositor
gap_size = 4;
# Padding between text and separator.
padding = 10;
# Horizontal padding.
horizontal_padding = 10;
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing windowmanager is
# present (e.g. xcompmgr, compiz, etc.).
transparency = 0;
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = "frame";
# Align icons left/right/off
icon_position = "left";
width = 400;
height = 300;
offset = "15x60";
origin = "top-right";
frame_color = "#${config.colorScheme.colors.base0B}";
frame_width = 2;
# Browser for opening urls in context menu.
browser = "firefox";
# Shortcuts are specified as [modifier+][modifier+]...key
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
# "mod3" and "mod4" (windows-key).
# Xev might be helpful to find names for keys.
# Close notification.
close = "ctrl+space";
# Close all notifications.
close_all = "ctrl+shift+space";
# Redisplay last message(s).
history = "ctrl+shift+h";
# Context menu.
context = "ctrl+shift+c";
};
urgency_low = {
background = "#${config.colorScheme.colors.base03}";
foreground = "#${config.colorScheme.colors.base05}";
timeout = 15;
};
urgency_normal = {
background = "#${config.colorScheme.colors.base03}";
foreground = "#${config.colorScheme.colors.base05}";
timeout = 15;
};
urgency_critical = {
background = "#${config.colorScheme.colors.base08}";
foreground = "#${config.colorScheme.colors.base05}";
frame_color = "#${config.colorScheme.colors.base05}";
timeout = 0;
};
};
};
}

View File

@ -0,0 +1,66 @@
{ pkgs, config, ... }:
{
home.file."mus/music_data".source = config.lib.file.mkOutOfStoreSymlink /media/media/music/music_data;
home.packages = [
pkgs.ffmpeg
pkgs.nsxiv
pkgs.kunst
pkgs.mpc-cli
pkgs.jq
pkgs.imagemagick
];
services.mpd = {
enable = true;
package = pkgs.mpd;
extraConfig = ''
music_directory "~/mus/music_data"
playlist_directory "~/.local/share/mpd/playlists"
log_file "~/.local/share/mpd/log"
db_file "~/.local/share/mpd/database"
pid_file "~/.local/share/mpd/pid"
state_file "~/.local/share/mpd/state"
sticker_file "~/.local/share/mpd/sticker.sql"
auto_update "yes"
audio_output {
type "pipewire"
name "PipeWire Sound Server"
}
audio_output {
type "fifo"
name "Visualizer feed"
path "/tmp/mpd.fifo"
format "44100:16:2"
}
bind_to_address "127.0.0.1"
'';
musicDirectory = "~/mus/music_data";
};
programs.ncmpcpp = {
enable = true;
package = (pkgs.ncmpcpp.override { visualizerSupport = true; });
mpdMusicDir = "~/mus/music_data";
settings = {
mpd_host = "127.0.0.1";
mpd_port = "6600";
visualizer_data_source = "/tmp/mpd.fifo";
visualizer_output_name = "Visualizer Feed";
visualizer_in_stereo = "yes";
visualizer_type = "spectrum";
visualizer_fps = "60";
visualizer_autoscale = "no";
visualizer_look = "";
visualizer_color = "169, 170, 169, 135, 134, 133, 129, 128, 127, 126, 125, 124";
visualizer_spectrum_smooth_look = "yes";
visualizer_spectrum_dft_size = "3";
};
};
}

View File

@ -0,0 +1,17 @@
{
home.file.".config/picom/picom.conf" = {
recursive = true;
text = ''
vsync = true;
backend = "xrender";
shadow = true;
shadow-radius = 10;
shadow-offset-x = -5;
shadow-offset-y = -5;
fading = true;
fade-in-step = 0.2;
fade-out-step = 0.2;
fade-delta = 50;
'';
};
}

View File

@ -0,0 +1,12 @@
{ pkgs, ... }:
{
home.packages = [
(pkgs.writeShellScriptBin "aichat-wrapper" ''
#!/usr/bin/env bash
model=$(${pkgs.aichat}/bin/aichat --list-models | ${pkgs.fzf}/bin/fzf)
${pkgs.aichat}/bin/aichat --model "$model"
'')
];
}

View File

@ -0,0 +1,54 @@
{ pkgs, ... }:
{
home.packages = [
(pkgs.writeShellScriptBin "battery-status" ''
# Get the current power consumption of the laptop battery
power=$(cat /sys/class/power_supply/BAT0/power_now)
power_watts=$(${pkgs.bc}/bin/bc <<< "scale=3; $power / 1000000")
# Get the current battery charge capacity
energy=$(cat /sys/class/power_supply/BAT0/energy_now)
# Get the current battery status (charging or discharging)
battery_status=$(cat /sys/class/power_supply/BAT0/status)
# Calculate the time remaining until the battery is empty or full
if [ "$battery_status" == "Charging" ]; then
# Calculate the time remaining until the battery is full
hours=$(${pkgs.bc}/bin/bc <<< "scale=2; $power / $energy")
hours_int=$(${pkgs.bc}/bin/bc <<< "scale=0; $hours / 1")
minutes=$(${pkgs.bc}/bin/bc <<< "scale=0; 60 * ($hours - $hours_int)/1")
if [ "$hours_int" -gt "0" ]; then
# Show hours and minutes if time remaining is greater than or equal to 1 hour
echo "Full in: $hours_int hours $minutes minutes"
else
# Show minutes if time remaining is less than 1 hour
echo "Full in: $minutes minutes"
fi
elif [ "$battery_status" == "Discharging" ]; then
# Calculate the time remaining until the battery is empty
hours=$(${pkgs.bc}/bin/bc <<< "scale=2; $energy / $power")
hours_int=$(${pkgs.bc}/bin/bc <<< "scale=0; $hours / 1")
minutes=$(${pkgs.bc}/bin/bc <<< "scale=0; 60 * ($hours - $hours_int)/1")
if [ "$hours_int" -gt "0" ]; then
# Show hours and minutes if time remaining is greater than or equal to 1 hour
echo "Empty in: $hours_int hours $minutes minutes"
else
# Show minutes if time remaining is less than 1 hour
echo "Empty in: $minutes minutes"
fi
elif [ "$battery_status" == "Full" ]; then
echo "Battery full"
elif [ "$battery_status" == "Not charging" ]; then
echo "Battery full - not charging"
fi
echo "Power consumption: $power_watts W"
'')
];
}

View File

@ -0,0 +1,87 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellScriptBin "clipboard-text-recall" ''
# Function to convert seconds to days, hours, minutes or seconds
clipboard_dir="/tmp/clipboard/text/*"
function format_time() {
local diff=$1
if ((diff<60)); then
echo "''${diff} seconds"
elif ((diff<3600)); then
echo "''$((diff/60)) minutes"
elif ((diff<86400)); then
echo "''$((diff/3600)) hours"
else
echo "''$((diff/86400)) days"
fi
}
# Function to get file info and sort it by modification time in reverse order
function get_files_info() {
now=$(date +%s)
# Sort files by modification time before the for loop
sorted_files=( $(ls -t $clipboard_dir) )
for file in "''${sorted_files[@]}"; do
mtime=$(stat -c %Y "$file")
diff=$((now-mtime))
# Get the number of lines in the file
num_lines=$(wc -l <"$file")
# Get the first non-empty line of the file and truncate it to 40 characters
first_line=$(grep . "$file" | head -n 1 | cut -c -60)
echo "$file ($num_lines lines) $(format_time $diff) ago, - '$first_line'..."
done
}
# Usage: get_files_info *
get_files_info $clipboard_dir | ${fzf}/bin/fzf --ansi \
--height 100% \
--color "hl:-1:underline,hl+:-1:underline:reverse" \
--preview '${bat}/bin/bat --style=numbers --color=always {1}' \
--preview-window 'up,70%,+{2}+3/3,~3' \
--bind 'enter:become(cat {1} | nohup xclip -loops 0 -i -selection CLIPBOARD >/dev/null 2>&1 && touch {1})'
exit
'')
(writeShellScriptBin "clipboard-image-recall" ''
# Script to view and select and output images in image clipboard dir to clipboard.
monitor_name=$(get-focused-monitor)
monitor_info=$(xrandr | grep "$monitor_name")
width=$(echo $monitor_info | grep -oP '\d+x\d+' | cut -dx -f1)
height=$(echo $monitor_info | grep -oP '\d+x\d+' | cut -dx -f2)
scale_width=$(( $width/4 + $width/2 ))
scale_height=$(( $height/4 + $height/2 ))
if [ "$1" == "" ] || [ -f "$1" ]; then
notify-send -t 1000 "Clipboard Recall" "Directory not specified or missing."
exit 1
fi
filesdir="$(find $1 -type f -printf '%T@ %p\n' | sort -rn | cut -d ' ' -f 2-)"
[ "$filesdir" == "" ] && notify-send -t 1000 "Clipboard Recall" "No images in directory" && exit 1
output="$(echo "$filesdir" | ${nsxiv}/bin/nsxiv -tioq -g "$scale_width"x"$scale_height" -N nsxiv-float )"
num_lines=$( echo "$output" | wc -l)
if [ "$num_lines" -gt 1 ]; then
echo "More than one image selected, outputting list to clipboard as text"
echo "$output" | ${xclip}/bin/xclip -i -selection CLIPBOARD && ${libnotify}/bin/notify-send "Image to Clipboard" "Paths:\n$output\ncopied to clipboard" -t 5000
elif [ -z "$output" ]; then
echo "Nothing selected"
exit 1
else
echo "Outputted to clipboard"
${xclip}/bin/xclip -selection clipboard -t image/png -i "$output" && ${libnotify}/bin/notify-send "Image to Clipboard" "$output copied to clipboard" -t 5000
fi
'')
];
}

View File

@ -0,0 +1,37 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellScriptBin "clipboard-save" ''
# Script to automatically save copied images and text in specified directories
while ${clipnotify}/bin/clipnotify
do
image_location="/tmp/clipboard/images"
text_location="/tmp/clipboard/text"
[[ -d $image_location ]] || mkdir -p $image_location
[[ -d $text_location ]] || mkdir -p $text_location
case "$(xclip -selection clipboard -t TARGETS -o)" in
*image*)
echo "$(${xclip}/bin/xclip -selection clipboard -t TARGETS -o)"
filename=$(${xclip}/bin/xclip -selection clipboard -t image/png -o | ${openssl}/bin/openssl sha1 | cut -b 49-)
file_exists=$(ls $image_location | grep $filename | sed "s/\..*//")
[[ $filename != "$file_exists" ]] &&
xclip -selection clipboard -t image/png -o > "$image_location/$filename.png" &&
notify-send -t 5000 "Image Copied" "$image_location/$filename.png"
;;
*UTF8_STRING*)
echo "$(${xclip}/bin/xclip -selection clipboard -t TARGETS -o)"
filename=$(${xclip}/bin/xclip -selection clipboard -t UTF8_STRING -o | ${openssl}/bin/openssl sha1 | cut -b 49-)
file_exists=$(ls "$text_location" | grep "$filename" | sed "s/\..*//")
echo "$filename" "$file_exists"
[[ "$filename" != "$file_exists" ]] &&
xclip -selection clipboard -t UTF8_STRING -o > "$text_location/$filename"
echo "$text_location/$filename"
touch "$text_location/$filename"
;;
esac
done
'')
];
}

View File

@ -0,0 +1,51 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellScriptBin "dmenu-wifi" ''
nmcli dev wifi rescan
ssid_list=$(nmcli -f in-use,bssid,ssid,mode,chan,freq,rate,signal,bars,security dev wifi)
available_connections=$(echo "$ssid_list" | sed '/--.*Infra/d')
connection=$( echo "$available_connections" | dmenu -l 20)
bssid=$(echo "$connection" | sed 's/^.\s*//;s/\s\s.*$//')
ssid=$(echo "$connection" | sed 's/^.\s*[0-9;A-Z;:]*\s\s//;s/\s*Infra\s*[0-9].*$//')
[[ "$connection" = "" ]] && notify-send -t 5000 "Wifi Connect" "Cancelled" && exit 0
[[ $( echo "$connection" | grep "IN-USE" -o) = "IN-USE" ]] && notify-send -t 5000 "Wifi Connect" "Please select valid network" && exit 0
[[ -n "$(echo "$connection" | grep '\*')" ]] && notify-send -t 5000 "Wifi Connect" "Already Connected to: $(echo "$ssid")" && exit 0
notify-send -t 5000 "Network Manager" "Attempting to connect to $ssid..."
nmcli connection modify "$ssid" 802-11-wireless.bssid "$bssid"
nmcli device wifi connect "$bssid"
return_code=$?
if [ $return_code == 4 ];
then
notify-send -t 5000 "Wifi Connect" "Please enter password for '$ssid'..."
prompt="Enter Password for '$ssid'"
pwd=$(echo "" | dmenu -p "$prompt")
nmcli device wifi connect "$bssid" password "$pwd"
return_code=$?
fi
case "$return_code" in
0) notify-send -t 5000 "Wifi Connect" "Successfully connected to: $ssid!"
pkill -RTMIN+12 dwmblocks
exit 0
;;
3) notify-send -t 5000 "Wifi Connect" "Connection to $ssid failed. Timeout expired?"
pkill -RTMIN+12 dwmblocks
exit 1
;;
4)
notify-send -t 5000 "Wifi Connect" "Connection to $ssid failed. Possibly wrong password?"
nmcli connection delete id "$ssid"
pkill -RTMIN+12 dwmblocks
exit 1
;;
*) notify-send -t 5000 "Wifi Connect" "Connection to $ssid failed. Error code $?"
echo "Failed. Exiting"
pkill -RTMIN+12 dwmblocks
exit 1
esac
'')
];
}

View File

@ -0,0 +1,9 @@
{ pkgs, ... }:
{
home.packages = [
(pkgs.writeShellScriptBin "dunstify-battery-notification" ''
msgTag="battery-notify"
${pkgs.dunst}/bin/dunstify -a "batteryNotify" -u critical -i battery-notify -h string:x-dunst-stack-tag:$msgTag "Battery Status" "$(battery-status)" -t 5000
'')
];
}

View File

@ -0,0 +1,30 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellScriptBin "dunstify-volume-notification" ''
mute_test=$(${pamixer}/bin/pamixer --get-mute)
mic_mute_test=$(${pamixer}/bin/pamixer --default-source --get-mute)
mute=""
if [ "$mute_test" == true ];
then
mute="(Speakers Muted)"
fi
if [ "$mic_mute_test" == true ];
then
mute="(Mic Muted)"
fi
if [ "$mute_test" == true ] && [ "$mic_mute_test" == true ];
then
mute="(Speakers Muted & Mic Muted)"
fi
volume=$(${pamixer}/bin/pamixer --get-volume)
msgTag="volume-notify"
${dunst}/bin/dunstify -a "changeVolume" -u low -i audio-volume-high -h string:x-dunst-stack-tag:$msgTag "Volume" "''${volume} ''${mute}" -t 2000
'')
];
}

View File

@ -0,0 +1,34 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellScriptBin "emoji-picker" ''
# Define variables
symbols_dir="$HOME/.local/share/symbols"
emoji_file="$symbols_dir/emoji"
nerdfont_file="$symbols_dir/nerdfont"
recent="$symbols_dir/recent"
remote="https://git.bitlab21.com/sam/symbols.git"
# Check if emoji files are installed, if not pull from remote
if [ ! -f "$emoji_file" ] || [ ! -f "$nerdfont_file" ]; then
notify-send -t 5000 "Emoji Picker" "Symbol files not found. Fetching from: '$remote'..."
mkdir -p "$symbols_dir"
git clone "$remote" "$symbols_dir"
[ "$?" != 0 ] && notify-send -t 2000 "Emoji Picker" "Error fetching from: $remote" && exit 1
fi
# Concat all emoji files and pipe into dmenu. Remove empty rows with sed. Exit if invalid selection.
emoji_row=$(cat "$recent" "$emoji_file" "$nerdfont_file" | sed '/^$/d' | dmenu -l 20)
[ "$emoji_row" == "" ] && notify-send -t 1000 "Emoji Picker" "Cancelled" && exit 0
[ "$emoji_row" == "**** Recent ****" ] || [ "$emoji_row" == "****************" ] && notify-send -t 1000 "Emoji Picker" "Invalid selection." && exit 1
# Add selected emoji to recent.
sed -i "/$emoji_row/d" "$recent" && sed -i "2s/^/$emoji_row\n/" "$recent"
# Copy to clipboard
emoji=$(echo "$emoji_row" | sed 's/\s.*//g')
echo "$emoji" | xclip -i -r -selection CLIPBOARD
notify-send -t 5000 "Emoji Picker" "$emoji_row copied to clipboard"
'')
];
}

View File

@ -0,0 +1,25 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellScriptBin "get-focused-monitor" ''
# get the current cursor location into X and Y variables
eval $(xdotool getmouselocation --shell)
# compare mouse location to monitor coordinates
while IFS= read -r line; do
if [[ $line =~ " connected" ]]; then
display=$(echo "$line" | awk '{print $1}')
coords=$(echo "$line" | grep -oP "\d+x\d+" | tr 'x+' ' ')
read width height x_offset y_offset <<< $coords
if (( X >= x_offset && X <= width + x_offset )) && (( Y >= y_offset && Y <= height + y_offset )); then
echo "$display"
break
fi
fi
done < <(xrandr)
'')
];
}

View File

@ -0,0 +1,98 @@
{ pkgs, ... }:
{
home.packages = [
(pkgs.writers.writePython3Bin
"tiktoken-cli"
{ libraries = [ pkgs.python3Packages.tiktoken ]; }
''
import os
import sys
import tiktoken
content = sys.stdin.read()
default = "gpt-3.5-turbo-0301"
model = os.getenv('TIKTOKEN_MODEL', default)
try:
encoding = tiktoken.encoding_for_model(model)
except KeyError:
encoding = tiktoken.get_encoding(default)
print(len(encoding.encode(content)))
'')
(pkgs.writeShellScriptBin "git-commit-ai" ''
# This bash script performs the following tasks:
# 1. Takes a git diff of modifications made to a repo.
# 2. Passes this diff to an LLM (Large Language Model) that generates a commit
# message.
#
# Usage: ./git-commit-ai --git-diff-commands --model
#
#
diff=$(git diff "$@" )
[ -z "$diff" ] && echo "No diff provided. Did you stage the changes?" && exit 1
tokens=$(echo "$diff" | tiktoken-cli)
echo -e "\n\nEstimated tokens: $tokens\n\n"
choose_model() {
models=$(${pkgs.aichat}/bin/aichat --list-models)
model=$(echo "$models" | fzf)
}
choose_model
git config commit.template ".git/gitmessage"
redo=""
while true
do
[ -z "$redo" ] && echo "Using model: $model" && commit_message=$(${pkgs.aichat}/bin/aichat --model "$model" --role "git_commit" "$diff")
echo ""
echo "Message:"
echo "---------------------------------------------"
echo ""
echo "$commit_message"
echo ""
echo "---------------------------------------------"
echo "What would you like to do?"
echo ""
echo "Copy to clipboard (c)"
echo "Git commit in editor (g)"
echo "Open in editor (e)"
echo "Show diff (d)"
echo "Choose different model (m)"
echo "Exit and do nothing (q)"
read -r -p "Action: (c|g|e|q) " input
case "$input" in
"c") echo "$commit_message" | ${pkgs.xclip}/bin/xclip -i -selection CLIPBOARD &&
${pkgs.libnotify}/bin/notify-send "AI Buddy" "Copied to clipboard"
exit 0
;;
"g") echo "$commit_message" > ".git/gitmessage" &&
git commit -e
cat /dev/null > ".git/gitmessage" # clear the template
exit 0
;;
"d") echo -e "Current commit message:\n\n$commit_message\n\nDiff file:\n\n$diff" | less
redo=true
shift
;;
"e") echo "$commit_message" | nvim -
exit 0
;;
"m") choose_model && shift
;;
"q") exit 0
;;
*) exit 0
esac
done
'')
];
}

View File

@ -0,0 +1,37 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellScriptBin "sb-battery" ''
BAT=/sys/class/power_supply/BAT0/capacity
# Exit script if no battery detected
[ ! -f "$BAT" ] && exit
STATUS=$(cat /sys/class/power_supply/BAT0/uevent | grep "POWER_SUPPLY_STATUS" | sed "s/^.*=//")
capacity=$(cat "$BAT")
if [ "$STATUS" == "Charging" ] || [ "$STATUS" == "Not charging" ]; then
echo "[󰂄 $capacity%] "
else
case $capacity in
100) echo "[󰁹 $capacity%] ";;
9[0-9]) echo "[󰂂 $capacity%] ";;
8[0-9]) echo "[󰂁 $capacity%] ";;
7[0-9]) echo "[󰂀 $capacity%] ";;
6[0-9]) echo "[󰁿 $capacity%] ";;
5[0-9]) echo "[󰁾 $capacity%] ";;
4[0-9]) echo "[󰁽 $capacity%] ";;
3[0-9]) echo "[󰁼 $capacity%] ";;
2[0-9]) echo "[󰁻 $capacity%] ";;
1[0-9]) echo "[󰁺 $capacity%] ";;
[6-9]) echo "[󰁺 $capacity%] ";;
[0-5]) echo "[󰂃 $capacity%] ";;
esac
fi
if [[ $capacity -le 20 && $STATUS != "Charging" ]]; then
dunstify-battery-notification
fi
'')
];
}

View File

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellScriptBin "sb-cpu-pct" ''
echo "[󰻠 $(top -bn 1 |grep "Cpu(s)" | awk '{print $2+$6 "%"}' | sed "s/\..//g")] "
'')
];
}

View File

@ -0,0 +1,9 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellScriptBin "sb-mem-pct" ''
# Gets current ram percent utilisation
echo "[󰍛 $(free | awk '/^Mem/ {print "100*" $3 " / " $2 }' | ${bc}/bin/bc | awk '{print $1"%"}')] "
'')
];
}

View File

@ -0,0 +1,52 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellScriptBin "sb-network-status" ''
# Nerd Font Symbols
wifi_symbol=" "
lan_symbol="󰌗 "
disconnected_symbol="󰲜 "
vpn_symbol="󰖂 "
internet="󰞉 "
internet_disconnected="󰪎 "
# Get the network status
DEFAULT_INTERFACE=$(ip route | grep '^default' | awk '{print $5}' | uniq)
IP_ADDRESS=$(ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p')
if [ -z "$DEFAULT_INTERFACE" ]; then
network_symbol="$disconnected_symbol"
else
# Check if it is a wireless interface (wlan*)
if [[ $DEFAULT_INTERFACE == wl* ]]; then
network_symbol="$wifi_symbol"
else
network_symbol="$lan_symbol"
fi
fi
# Check internet connectivity
if ! ping -c 1 8.8.8.8 &> /dev/null;
then
network_symbol="$network_symbol $internet_disconnected"
else
network_symbol="$network_symbol $internet"
fi
if ip addr show tun0 > /dev/null 2>&1; then
network_symbol="$network_symbol $vpn_symbol"
else
network_symbol="$network_symbol"
fi
if [ -z "$IP_ADDRESS" ];
then
printf "$network_symbol"
else
printf "[$network_symbol|$IP_ADDRESS] "
fi
'')
];
}

View File

@ -0,0 +1,14 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellScriptBin "sb-updates" ''
# Gets number of flake inputs that are ready for update
# Checks every 60 minutes
# inputs=$(cd /etc/nixos &&
# nix flake update --output-lock-file <(cat flake.nix) 2> /tmp/update &&
# cat /tmp/update | grep -c Update)
# printf "[ $inputs] "
'')
];
}

View File

@ -0,0 +1,35 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellScriptBin "sb-volume" ''
# Prints the current volume or 婢 if muted.
get_mic_status=$(${pamixer}/bin/pamixer --default-source --get-mute)
vol="$(${pamixer}/bin/pamixer --get-volume)"
if [ $get_mic_status == false ]; then
mic_status=""
else
mic_status=""
fi
if [ "$vol" -gt "90" ]; then
icon="󰕾"
elif [ "$vol" -gt "50" ]; then
icon="󰖀"
elif [ "$vol" -gt "0" ]; then
icon="󰕿"
else
icon="󰝟"
fi
if [ $(${pamixer}/bin/pamixer --get-mute) = true ]; then
icon="󰸈"
vol="0"
fi
print_string="$mic_status $icon $vol%"
printf '%s' "[''${print_string}] "
'')
];
}

View File

@ -0,0 +1,31 @@
{
# TODO: add emoji and dmenu-dict scripts
home.file.".config/sxhkd/sxhkdrc" = {
recursive = true;
text = ''
XF86AudioRaiseVolume
pamixer --set-limit 150 --allow-boost -i 5 && dunstify-volume-notification && pkill -RTMIN+10 dwmblocks && exit 1
XF86AudioLowerVolume
pamixer --set-limit 150 --allow-boost -d 5 && dunstify-volume-notification && pkill -RTMIN+10 dwmblocks && exit 1
XF86AudioMute
pamixer --toggle-mute && dunstify-volume-notification && pkill -RTMIN+10 dwmblocks && exit 1
XF86AudioMicMute
pamixer --default-source --toggle-mute && dunstify-volume-notification && pkill -RTMIN+10 dwmblocks && exit 1
XF86Messenger
dunstify-battery-notification
control + F8
clipboard-image-recall /tmp/clipboard/images/
Print
env QT_AUTO_SCREEN_SCALE_FACTOR=1.5 QT_SCREEN_SCALE_FACTORS="" flameshot gui
control + F7
emoji-picker
'';
};
}

View File

@ -0,0 +1,31 @@
{pkgs, ...}: {
# TODO: configure x11 to look in .config/x11
home.file.".xinitrc" = {
recursive = true;
text = ''
picom -b --config ~/.config/picom/picom.conf
xrdb -merge ~/.Xresources
autostart="clipboard-save dwmblocks feh-wallpaper-changer sxhkd"
for program in $autostart; do
pidof -sx "$program" || "$program" &
done >/dev/null 2>&1
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval $(dbus-launch --exit-with-session --sh-syntax)
fi
systemctl --user import-environment DISPLAY XAUTHORITY
if command -v dbus-update-activation-environment >/dev/null 2>&1; then
dbus-update-activation-environment DISPLAY XAUTHORITY
fi
export XSESSION_PID="$$"
exec dwm
'';
};
}

View File

@ -1,12 +1,12 @@
{
lib,
config,
pkgs,
...
{ lib
, config
, ...
}: {
imports = [
../wallpaper-changer/swww-wallpaper-changer
../common
../common/wayland
./pyprland.nix
];
wayland.windowManager.hyprland = {
enable = true;
@ -19,13 +19,17 @@
"systemctl --user start hyprland-session.target"
];
};
extraConfig = let
monitor = "${toString (builtins.map (m: "monitor=${ m.name },${ toString(m.width) }x${ toString(m.height) }@60,auto,1") config.monitors)}";
in ''
extraConfig =
let
monitor = "${toString (builtins.map (m: "monitor=${ m.name },${ toString( m.width ) }x${ toString( m.height ) }@${ toString( m.refreshRate ) },${ toString( m.x ) }x${ toString( m.y ) },${ toString( m.scale ) }\n") config.monitors)}";
active = "rgba(${config.colorScheme.colors.base08}ee)";
inactive = "rgba(${config.colorScheme.colors.base0C}ee)";
in
''
${monitor}
$terminal = kitty
$fileManager = dolphin
$terminal = alacritty
$fileManager = thunar
$menu = wofi --show drun
env = XCURSOR_SIZE,24
@ -34,11 +38,10 @@
kb_layout = gb
kb_variant =
kb_model =
kb_options = caps:swapescape
kb_rules =
repeat_delay = 280
repeat_rate = 60
follow_mouse = 1
touchpad {
natural_scroll = no
}
@ -47,20 +50,18 @@
general {
gaps_in = 5
gaps_out = 20
gaps_in = 10
gaps_out = 10
border_size = 2
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
col.inactive_border = rgba(595959aa)
col.active_border = ${active}
col.inactive_border = ${inactive}
layout = dwindle
allow_tearing = false
}
decoration {
rounding = 10
rounding = 5
blur {
enabled = true
@ -107,22 +108,25 @@
sensitivity = -0.5
}
windowrulev2 = float, class:floating
$mainMod = SUPER
bind = $mainMod, Q, exec, $terminal
bind = $mainMod, C, killactive,
bind = $mainMod, RETURN, exec, $terminal
bind = $mainMod, Q, killactive,
bind = $mainMod, M, exit,
bind = $mainMod, E, exec, $fileManager
bind = $mainMod, V, togglefloating,
bind = $mainMod, R, exec, $menu
bind = $mainMod, S, exec, rofi -show drun -show-icons
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
bind = $mainMod, y, exec, pypr toggle termy
bind = $mainMod, u, exec, pypr toggle termu
bind = $mainMod, i, exec, pypr toggle termi
bind = $mainMod, h, movefocus, l
bind = $mainMod, l, movefocus, r
bind = $mainMod, k, movefocus, u
bind = $mainMod, j, movefocus, d
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
@ -155,7 +159,7 @@
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
exec-once=bash ~/.config/hypr/start.sh
exec-once=swww-wallpaper-changer & pypr
'';
};
}

View File

@ -0,0 +1,33 @@
{ ... }:
{
home.file.".config/hypr/pyprland.toml".text = ''
[pyprland]
plugins = [
"scratchpads"
]
[scratchpads.termy]
animation = "fromTop"
command = "$TERMINAL --class $TERMINAL-dropterm-y --title 'Scratchpad(y)'"
class = "$TERMINAL-dropterm-y"
size = "80% 80%"
[scratchpads.termu]
animation = "fromTop"
command = "$TERMINAL --class $TERMINAL-dropterm-u --title 'Scratchpad(u)'"
class = "$TERMINAL-dropterm-u"
size = "80% 80%"
[scratchpads.termi]
animation = "fromTop"
command = "$TERMINAL --class $TERMINAL-dropterm-i --title 'Scratchpad(i)'"
class = "$TERMINAL-dropterm-i"
size = "80% 80%"
[scratchpads.volume]
animation = "fromTop"
command = "pavucontrol --class floating"
class = "org.pulseaudio.pavucontrol"
size = "75% 60%"
'';
}

View File

@ -1,4 +1,4 @@
{ pkgs, lib, config, ... }:
{ pkgs, ... }:
{
programs.git = {
enable = true;

View File

@ -0,0 +1,18 @@
{ pkgs, config, lib, ... }:
let
user = config.home.username;
in
{
home.activation.get-notes = lib.hm.dag.entryAfter [ "installPackages" ] ''
notes_dir=/home/${user}/.local/share/notes
remote=git@git.bitlab21.com:sam/notes
if [ -d "$notes_dir" ];
then
cd "$notes_dir"
[ ! -d .git ] && PATH="${pkgs.git}/bin:${pkgs.openssh}/bin:$PATH" git clone "$remote" "$notes_dir"
else
mkdir -p "$notes_dir" && PATH="${pkgs.git}/bin:${pkgs.openssh}/bin:$PATH" git clone "$remote" "$notes_dir"
fi
exit 0
'';
}

View File

@ -0,0 +1,28 @@
{ inputs, config, ... }:
let
secretsDirectory = builtins.toString inputs.nix-secrets;
secretsFile = "${secretsDirectory}/secrets.yaml";
homeDirectory = config.home.homeDirectory;
username = config.home.username;
in
{
imports = [
inputs.sops-nix.homeManagerModules.sops
];
sops = {
age = {
sshKeyPaths = [ "${homeDirectory}/.ssh/id_ed25519" ];
generateKey = true;
keyFile = "/home/${username}/.config/sops/age/keys.txt";
};
defaultSopsFile = "${secretsFile}";
validateSopsFiles = false;
secrets = {
"ssh_keys/deploy_key/id_ed25519" = {
path = "/home/${username}/.ssh/deploy_key-ssh-ed25519";
};
};
};
}

View File

@ -0,0 +1,11 @@
{ config, ... }:
let
user = config.home.username;
in
{
services = {
syncthing = {
enable = true;
};
};
}

View File

@ -0,0 +1,120 @@
{ pkgs, ... }:
{
programs.yazi = {
enable = true;
package = pkgs.yazi;
enableBashIntegration = true;
enableZshIntegration = true;
settings = {
log = {
enabled = true;
};
manager = {
show_hidden = false;
sort_by = "modified";
sort_dir_first = true;
sort_reverse = true;
};
};
theme = {
manager = {
marker_copied = { fg = "#98bb6c"; bg = "#98bb6c"; };
marker_cut = { fg = "#e46876"; bg = "#e46876"; };
marker_marked = { fg = "#957fb8"; bg = "#957fb8"; };
marker_selected = { fg = "#ffa066"; bg = "#ffa066"; };
cwd = { fg = "#e6c384"; };
hovered = { reversed = true; };
preview_hovered = { reversed = true; };
tab_active = { reversed = true; };
tab_inactive = { };
tab_width = 1;
count_copied = { fg = "#1f1f28"; bg = "#98bb6c"; };
count_cut = { fg = "#1f1f28"; bg = "#e46876"; };
count_selected = { fg = "#1f1f28"; bg = "#e6c384"; };
border_symbol = "";
border_style = { fg = "#dcd7ba"; };
};
status = {
separator_open = "";
separator_close = "";
separator_style = { fg = "reset"; bg = "#363646"; };
mode_normal = { fg = "#1f1f28"; bg = "#85a6ea"; bold = true; };
mode_select = { fg = "#1f1f28"; bg = "#957fb8"; bold = true; };
mode_unset = { fg = "#1f1f28"; bg = "#e6c384"; bold = true; };
progress_label = { fg = "#85a6ea"; bg = "#363646"; bold = true; };
progress_normal = { fg = "#363646"; bg = "#1f1f28"; };
progress_error = { fg = "#363646"; bg = "#1f1f28"; };
permissions_t = { fg = "#98bb6c"; };
permissions_r = { fg = "#e6c384"; };
permissions_w = { fg = "#e82424"; };
permissions_x = { fg = "#7aa89f"; };
permissions_s = { fg = "#938aa9"; };
};
select = {
border = { fg = "#7fb4ca"; };
active = { fg = "#938aa9"; bold = true; };
inactive = { };
};
input = {
border = { fg = "#7fb4ca"; };
title = { };
value = { };
selected = { reversed = true; };
};
completion = {
border = { fg = "#7fb4ca"; };
active = { reversed = true; };
inactive = { };
};
tasks = {
border = { fg = "#7fb4ca"; };
title = { };
hovered = { fg = "#938aa9"; };
};
which = {
cols = 2;
separator = " - ";
separator_style = { fg = "#727169"; };
mask = { bg = "#16161d"; };
rest = { fg = "#727169"; };
cand = { fg = "#85a6ea"; };
desc = { fg = "#565666"; };
};
help = {
on = { fg = "#7aa89f"; };
run = { fg = "#938aa9"; };
desc = { };
hovered = { reversed = true; bold = true; };
footer = { fg = "#090618"; bg = "#dcd7ba"; };
};
notify = {
title_info = { fg = "#98bb6c"; };
title_warn = { fg = "#e6c384"; };
title_error = { fg = "#e82424"; };
};
filetype = {
rules = [
{ mime = "image/*"; fg = "#e6c384"; }
{ mime = "{audio,video}/*"; fg = "#957fb8"; }
{ mime = "application/{,g}zip"; fg = "#e46876"; }
{ mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}"; fg = "#e46876"; }
{ mime = "application/{pdf,doc,rtf,vnd.*}"; fg = "#6a9589"; }
{ name = "*"; is = "orphan"; fg = "#e46876"; }
{ name = "*"; is = "exec"; fg = "#957fb8"; }
{ name = "*/"; fg = "#85a6ea"; }
];
};
};
};
}

14
home/fileserver.nix Normal file
View File

@ -0,0 +1,14 @@
{ ...
}: {
imports = [
# Import users
./users/admin
./common/core
./common/optional/sops.nix
# Import optional
./common/optional/git.nix
];
}

13
home/nebula.nix Normal file
View File

@ -0,0 +1,13 @@
{ ...
}: {
imports = [
# Import users
./users/admin
./common/core
# Import optional
./common/optional/git.nix
];
}

View File

@ -1,13 +1,16 @@
{
pkgs,
config,
lib,
...
{ ...
}: {
imports = [
# Import users
./users/sam
./common/core
./common/optional/desktop/hyprland
./common/optional/desktop/waybar.nix
./common/optional/sops.nix
# Import optional
./common/optional/git.nix
];
# ------

View File

@ -1,81 +0,0 @@
{ config, pkgs, lib, outputs, ... }:
{
home.username = "sam";
home.homeDirectory = "/home/sam";
home.stateVersion = "23.11";
imports = [
./git.nix
] ++ (builtins.attrValues outputs.homeManagerModules); # import all homeManagerModules?
home.packages = [
pkgs.firefox
pkgs.neovim
pkgs.kitty
pkgs.zathura
pkgs.xfce.thunar
];
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
ll = "ls -l";
update = "sudo nixos-rebuild switch --flake $(readlink -f /etc/nixos)#nixdev";
update-home = "home-manager switch --flake $(readlink -f /etc/nixos)#sam@nixdev";
nix-home = "nvim $HOME/nixos/hosts/workmachine/home.nix";
nix-conf = "nvim $HOME/nixos/hosts/workmachine/configuration.nix";
};
history.size = 10000;
history.path = "${config.xdg.dataHome}/zsh/history";
initExtra = ''
bindkey -v
bindkey "^H" backward-delete-char
bindkey "^?" backward-delete-char
set -o vi
export TERM=xterm
'';
};
home.file = {
".icons/bibata".source = "${pkgs.bibata-cursors}/share/icons/Bibata-Modern-Classic";
};
home.sessionPath = [
"$HOME/.scripts/"
];
gtk.enable = true;
gtk.cursorTheme.package = pkgs.bibata-cursors;
gtk.cursorTheme.name = "Bibata-Modern-Ice";
gtk.theme.package = pkgs.gruvbox-gtk-theme;
gtk.theme.name = "Gruvbox-Dark-B";
gtk.iconTheme.package = pkgs.gruvbox-plus-icons;
gtk.iconTheme.name = "GruvboxPlus";
qt.enable = true;
qt.platformTheme.name = "gtk";
qt.style.name = "adwaita-dark";
qt.style.package = pkgs.adwaita-qt;
home.sessionVariables = {
EDITOR="nvim";
MUSIC="$HOME/mus/music_data/";
TERMINAL="kitty";
READER="zathura";
IMAGE_VIEWER="";
IMAGE_EDITOR="";
};
programs.home-manager.enable = true;
}

View File

@ -1,36 +0,0 @@
{
pkgs,
...
}:
{
systemd.user.services.wallpaper-changer = {
Unit = {
Description = "Script to change wallpaper using swww";
PartOf = [ "hyprland-session.target" ];
After = [ "hyprland-session.target" ]; # or "wayland.target", depending on your system setup
};
Install = {
WantedBy = [ "default.target" ];
};
Service = {
Type = [ "oneshot" ];
ExecStart = "${pkgs.writeShellScript "swww-wallpaper-changer" ''
export WAYLAND_DISPLAY="wayland-1"
wallpaper_dir="$HOME/.local/share/bg/"
# Allow some time for desktop to start
sleep 3
echo "starting daemon..."
${pkgs.swww}/bin/swww-daemon &
while true; do
find "$wallpaper_dir" -type f -follow \( -iname \*.jpg -o -iname \*.png -o -iname \*.gif -o -iname \*.bmp \) | shuf | while read -r file; do
${pkgs.swww}/bin/swww img "$file" --transition-step 10 --transition-fps 60
[ $? != 0 ] && echo "swww failed, reloading daemon" && exit 1
sleep 600
done
done
''}";
};
};
}

View File

@ -1,16 +0,0 @@
{
lib,
config,
pkgs,
...
}: {
# Let it try to start a few more times
systemd.user.services.waybar = {
Unit.StartLimitBurst = 30;
};
programs.waybar = {
enable = true;
#package = "";
systemd.enable = true;
};
}

79
home/semita.nix Normal file
View File

@ -0,0 +1,79 @@
{
pkgs,
config,
...
}: {
imports = [
# Import users
./users/sam
./common/core
# Import optional
./common/optional/git.nix
./common/optional/sops.nix
./common/optional/syncthing.nix
./common/optional/desktop/dwm
./common/optional/desktop/common/themes/standard-dark.nix
./common/optional/notes.nix
./common/optional/yazi.nix
];
colorScheme = {
slug = "serene";
name = "Serene";
author = "Bitlab21";
palette = {
base00 = "#1F1F28";
base01 = "#16161D";
base02 = "#223249";
base03 = "#363646";
base04 = "#727169";
base05 = "#DCD7BA";
base06 = "#C8C093";
base07 = "#717C7C";
base08 = "#C34043";
base09 = "#FFA066";
base0A = "#C0A36E";
base0B = "#76946A";
base0C = "#6A9589";
base0D = "#7E9CD8";
base0E = "#957FB8";
base0F = "#D27E99";
};
};
xresources.extraConfig = ''
! st
st.alpha: 0.8
St.font: monospace:pixelsize=21:antialias=true:autohint=true;
St.font2: NotoColorEmoji:pixelsize=19:antialias=true:autohint=true;
! dwm
dwm.borderpx: 3
dwm.font: monospace:size=12
dwm.col_base00: #${config.colorScheme.colors.base00}
dwm.col_base03: #${config.colorScheme.colors.base03}
dwm.col_base04: #${config.colorScheme.colors.base04}
dwm.col_base05: #${config.colorScheme.colors.base05}
dwm.col_base08: #${config.colorScheme.colors.base08}
dwm.col_base0B: #${config.colorScheme.colors.base0B}
! dmenu
dmenu.font: monospace:size=12
dmenu.font2: NotoColorEmoji:pixelsize=22:antialias=true:autohint=true
dmenu.topbar: 1
dmenu.normfgcolor: #${config.colorScheme.colors.base05}
dmenu.normbgcolor: #${config.colorScheme.colors.base03}
dmenu.selfgcolor: #${config.colorScheme.colors.base00}
dmenu.selbgcolor: #${config.colorScheme.colors.base0B}
Nsxiv.window.background: #${config.colorScheme.colors.base03}
Nsxiv.window.foreground: #${config.colorScheme.colors.base05}
Nsxiv.mark.foreground: #${config.colorScheme.colors.base08}
Nsxiv.bar.background: #${config.colorScheme.colors.base00}
Nsxiv.bar.foreground: #${config.colorScheme.colors.base05}
Nsxiv.bar.font: monospace:size=12
'';
}

18
home/sparky.nix Normal file
View File

@ -0,0 +1,18 @@
{ inputs
, ...
}: {
imports = [
# Import users
./users/media
./common/core
# Import optional
./common/optional/git.nix
./common/optional/syncthing.nix
./common/optional/desktop/cinnamon
];
colorScheme = inputs.nix-colors.colorSchemes.kanagawa;
}

View File

@ -0,0 +1,24 @@
{ config, pkgs, lib, outputs, ... }:
{
home.username = "admin";
home.homeDirectory = "/home/admin";
imports = [
] ++ (builtins.attrValues outputs.homeManagerModules); # import all homeManagerModules?
home.packages = [
];
home.file = {
};
home.sessionPath = [
];
home.sessionVariables = {
};
programs.home-manager.enable = true;
}

View File

@ -0,0 +1,48 @@
{ config, pkgs, lib, outputs, inputs, ... }:
{
home.username = "media";
home.homeDirectory = "/home/media";
imports = [
inputs.impermanence.nixosModules.home-manager.impermanence
] ++ (builtins.attrValues outputs.homeManagerModules); # import all homeManagerModules?
programs.ssh = {
enable = true;
matchBlocks = {
"git.bitlab21.com" = {
user = "git";
identitiesOnly = true;
identityFile = [ "~/.ssh/deploy_key-ssh-ed25519" ];
};
};
};
xdg.userDirs = {
enable = true;
createDirectories = true;
desktop = "/home/media/Desktop";
documents = null;
download = "/home/media/Downloads";
music = null;
pictures = null;
publicShare = null;
templates = null;
videos = null;
};
home.packages = [
];
home.file = {
};
home.sessionPath = [
];
home.sessionVariables = {
};
programs.home-manager.enable = true;
}

View File

@ -0,0 +1,41 @@
{outputs, ...}: {
home.username = "sam";
home.homeDirectory = "/home/sam";
imports =
[
]
++ (builtins.attrValues outputs.homeManagerModules); # import all homeManagerModules?
programs.ssh = {
enable = true;
matchBlocks = {
"git.bitlab21.com" = {
identitiesOnly = true;
identityFile = ["~/.ssh/id_ed25519"];
};
};
};
xdg.userDirs = {
enable = true;
createDirectories = true;
desktop = null;
documents = "/home/sam/docs";
download = "/home/sam/dl";
music = "/home/sam/mus";
pictures = "/home/sam/pics";
publicShare = "/home/sam/sync";
templates = null;
videos = "/home/sam/vids";
};
home.sessionVariables = {
EDITOR = "nvim";
TERMINAL = "st";
READER = "zathura";
IMAGE_VIEWER = "nsxiv";
IMAGE_EDITOR = "drawing";
PATH = "$PATH:$HOME/.scripts";
};
}

146
hosts/bootstrap/default.nix Normal file
View File

@ -0,0 +1,146 @@
{ inputs, config, lib, pkgs, outputs,... }:
let
pubKeys = lib.filesystem.listFilesRecursive (../common/users/keys);
secretsDirectory = builtins.toString inputs.nix-secrets;
secretsFile = "${secretsDirectory}/secrets.yaml";
sopsHashedPasswordFile = lib.optionalString (lib.hasAttr "sops-nix" inputs) config.sops.secrets."passwords/root".path;
hasOptinPersistence = config.environment.persistence ? "/persist";
# Disko setup
fsType = "btrfs";
dev = "/dev/vda";
encrypted = true;
btrfsMountDevice = if encrypted then "/dev/mapper/crypted" else "/dev/root_vg/root";
in
{
imports =
[
# Disk configuration
inputs.sops-nix.nixosModules.sops
# Disk configuration
inputs.disko.nixosModules.disko
(import ../common/disks { device = dev; fsType = fsType; encrypted = encrypted; })
# Impermanence
inputs.impermanence.nixosModules.impermanence
(import ../common/disks/btrfs-impermanence.nix { btrfsMountDevice = btrfsMountDevice; lib = lib; })
# Import core options
./hardware-configuration.nix
];
nixpkgs = {
overlays = [
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
];
config = {
allowUnfree = true;
};
};
fileSystems."/persist".neededForBoot = true;
environment.persistence."/persist" = {
hideMounts = true;
directories = [
"/etc/nixos"
];
files = [
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
];
};
i18n.defaultLocale = "en_GB.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "uk";
useXkbConfig = false;
};
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
timeout = 3;
};
};
users = {
mutableUsers = true;
extraUsers = {
root = {
hashedPasswordFile = sopsHashedPasswordFile;
openssh.authorizedKeys.keys = lib.lists.forEach pubKeys (key: builtins.readFile key);
};
};
};
networking = {
hostName = "bootstrap";
networkmanager.enable = true;
enableIPv6 = false;
};
sops = {
defaultSopsFile = "${secretsFile}";
validateSopsFiles = false;
age = {
sshKeyPaths = [ "${lib.optionalString hasOptinPersistence "/persist"}/etc/ssh/ssh_host_ed25519_key" ];
};
secrets = {
"passwords/root".neededForUsers = true;
"ssh_keys/deploy_key/id_ed25519" = {
path = "/etc/ssh/deploy_key-ssh-ed25519";
};
};
};
environment.systemPackages = [
pkgs.rsync
pkgs.curl
pkgs.just
pkgs.git
pkgs.neovim
];
services.openssh = {
enable = true;
ports = [22];
authorizedKeysFiles = lib.mkForce ["/etc/ssh/authorized_keys.d/%u"];
hostKeys = [{
path = "${lib.optionalString hasOptinPersistence "/persist"}/persist/etc/ssh/ssh_host_ed25519_key";
type = "ed25519";
}];
settings = {
PasswordAuthentication = false;
PermitRootLogin = "yes";
PubKeyAuthentication = "yes";
StreamLocalBindUnlink = "yes";
UsePAM = true;
};
};
programs.ssh.extraConfig = ''
Host git.bitlab21.com
IdentitiesOnly yes
StrictHostKeyChecking no
IdentityFile /etc/ssh/deploy_key-ssh-ed25519
'';
security.pam = {
sshAgentAuth.enable = true;
};
networking.firewall.allowedTCPPorts = [ 22 ];
services = {
qemuGuest.enable = true;
};
nix.settings.experimental-features = [ "nix-command" "flakes" ];
}

View File

@ -0,0 +1,24 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

117
hosts/citadel/default.nix Normal file
View File

@ -0,0 +1,117 @@
{
inputs,
lib,
pkgs,
config,
...
}: let
# Disko setup
fsType = "btrfs"; # one of ext4 or btrfs. Use btrfs if using impermanence
dev = "/dev/nvme0n1"; # depends on target hardware
encrypted = true; # currrently only applies to btrfs
btrfsMountDevice =
if encrypted
then "/dev/mapper/crypted"
else "/dev/root_vg/root";
user = "sam";
impermanence = true;
in {
imports = [
# Create users for this host
../common/users/${user}
# Disk configuration
inputs.disko.nixosModules.disko
(import ../common/disks {
device = dev;
impermanence = impermanence;
fsType = fsType;
encrypted = encrypted;
})
# Impermanence
(import ../common/disks/btrfs/impermanence.nix {
btrfsMountDevice = btrfsMountDevice;
lib = lib;
})
# Import core options
./hardware-configuration.nix
../common/core
# Import optional options
../common/optional/persistence.nix
../common/optional/pipewire.nix
../common/optional/openssh.nix
../common/optional/dwm.nix
../common/optional/nfs-mounts/media.nix
../common/optional/nfs-mounts/homeshare.nix
../common/optional/nfs-mounts/photos.nix
../common/optional/printing.nix
../common/optional/backlight.nix
../common/optional/xmodmap-arrow-remaps.nix
];
boot = {
blacklistedKernelModules = ["snd_hda_intel" "snd_soc_skl"];
kernelModules = ["iwlwifi"];
initrd.kernelModules = ["thinkpad-acpi" "acpi-call"];
kernelPackages = pkgs.linuxPackagesFor pkgs.linux_latest;
extraModulePackages = [
config.boot.kernelPackages.acpi_call
];
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
timeout = 3;
};
};
services = {
libinput.touchpad.accelSpeed = "0.5";
xserver = {
xkb.options = "caps:swapescape";
dpi = 196;
upscaleDefaultCursor = true;
};
};
environment.variables = {
GDK_SCALE = "2.2";
GDK_DPI_SCALE = "0.8";
_JAVA_OPTIONS = "-Dsun.java2d.uiScale=2.2";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
XCURSOR_SIZE = "64";
};
services.tlp = {
enable = true;
settings = {
CPU_SCALING_GOVERNOR_ON_AC = "ondemand";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
START_CHARGE_THRESH_BAT0 = 50;
STOP_CHARGE_THRESH_BAT0 = 95;
};
};
hardware = {
bluetooth = {
enable = true;
powerOnBoot = true;
};
enableRedistributableFirmware = true;
firmware = [
pkgs.sof-firmware
];
};
networking = {
hostName = "citadel";
networkmanager.enable = true;
enableIPv6 = false;
nameservers = ["10.0.10.60" "8.8.8.8"];
};
services.libinput.enable = true;
}

View File

@ -9,19 +9,10 @@
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/f9abe09a-de68-4913-b6c5-ad55b473a961";
fsType = "ext4";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/fe24d2ba-2fbc-4ef5-8139-a26f4fc3f3e3"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction

View File

@ -0,0 +1,49 @@
{ pkgs, lib, inputs, config, outputs, ... }:
let
sopsHashedPasswordFile = lib.optionalString (lib.hasAttr "sops-nix" inputs) config.sops.secrets."passwords/root".path;
in
{
imports = [
inputs.impermanence.nixosModules.impermanence
./sops.nix
./locale.nix
];
nixpkgs = {
overlays = [
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
inputs.nur.overlay
];
config = {
allowUnfree = true;
};
};
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
nix.settings.experimental-features = [ "nix-command" "flakes" ];
users = {
mutableUsers = true;
extraUsers = {
root = {
hashedPasswordFile = sopsHashedPasswordFile;
};
};
};
environment.systemPackages = [
pkgs.rsync
pkgs.curl
pkgs.just
pkgs.git
pkgs.vim
];
system.stateVersion = "24.05";
}

View File

@ -0,0 +1,10 @@
{
i18n.defaultLocale = "en_GB.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "uk";
useXkbConfig = false;
};
time.timeZone = "Europe/London";
}

View File

@ -0,0 +1,29 @@
{ pkgs, lib, inputs, config, ... }:
let
secretsDirectory = builtins.toString inputs.nix-secrets;
secretsFile = "${secretsDirectory}/secrets.yaml";
hasOptinPersistence = config.environment.persistence ? "/persist";
hostname = config.networking.hostName;
in
{
imports = [
inputs.sops-nix.nixosModules.sops
];
sops = {
defaultSopsFile = "${secretsFile}";
validateSopsFiles = false;
age = {
sshKeyPaths = [ "${lib.optionalString hasOptinPersistence "/persist"}/etc/ssh/ssh_host_ed25519_key" ];
};
secrets = {
"passwords/root".neededForUsers = true;
"ssh_keys/deploy_key/id_ed25519" = {
path = "/etc/ssh/deploy_key-ssh-ed25519";
};
};
};
}

View File

@ -0,0 +1,32 @@
{lib, btrfsMountDevice, ...}:
let
device = btrfsMountDevice;
in
{
boot.initrd.postDeviceCommands = lib.mkAfter ''
mkdir /btrfs_tmp
mount ${device} /btrfs_tmp
if [[ -e /btrfs_tmp/root ]]; then
mkdir -p /btrfs_tmp/old_roots
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
fi
delete_subvolume_recursively() {
IFS=$'\n'
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
delete_subvolume_recursively "/btrfs_tmp/$i"
done
btrfs subvolume delete "$1"
}
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
delete_subvolume_recursively "$i"
done
btrfs subvolume create /btrfs_tmp/root
umount /btrfs_tmp
'';
}

View File

@ -0,0 +1,25 @@
{
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"/root" = {
mountpoint = "/";
};
"/persist" = {
mountOptions = [ "subvol=persist" ];
mountpoint = "/persist";
};
"/nix" = {
mountOptions = [ "subvol=nix" "noatime" ];
mountpoint = "/nix";
};
"/swap" = {
mountOptions = [ "noatime" ];
mountpoint = "/.swapvol";
swap.swapfile.size = "8192M";
};
};
}

View File

@ -0,0 +1,21 @@
{
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/nix" = {
mountOptions = [ "subvol=nix" "noatime" ];
mountpoint = "/nix";
};
"/swap" = {
mountOptions = [ "noatime" ];
mountpoint = "/.swapvol";
swap.swapfile.size = "8192M";
};
};
}

View File

@ -0,0 +1,11 @@
{ device, fsType, encrypted, impermanence, ... }:
let
fsModule = if impermanence then ./${fsType}/persist.nix else ./${fsType}/standard.nix;
basic = import ./${fsType}/basic.nix { inherit device; };
lvm = import ./lvm.nix { inherit device; fsModule = fsModule; };
luks = import ./luks.nix { inherit device; fsModule = fsModule; };
in
if fsType == "ext4" then basic
else if fsType == "btrfs" && encrypted then luks
else if fsType == "btrfs" then lvm
else null

View File

@ -0,0 +1,29 @@
# Example to create a bios compatible gpt partition
{
disko.devices = {
disk = {
vda = {
inherit device;
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
priority = 1; # Needs to be first partition
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
};
}

View File

@ -0,0 +1,40 @@
{
device ? throw "Must define a device, e.g. /dev/sda",
fsModule ? "Must specify submodule"
}:
{
disko.devices = {
disk = {
vdb = {
type = "disk";
inherit device;
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted";
passwordFile = "/tmp/luks_secret.key"; # Interactive
content = (import "${fsModule}");
};
};
};
};
};
};
};
}

View File

@ -0,0 +1,48 @@
{
device ? throw "Must define a device, e.g. /dev/sda",
fsModule ? "Must specify submodule"
}:
{
disko.devices = {
disk.main = {
inherit device;
type = "disk";
content = {
type = "gpt";
partitions = {
ESP = {
priority = 1;
name = "ESP";
start = "1M";
end = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
name = "root";
size = "100%";
content = {
type = "lvm_pv";
vg = "root_vg";
};
};
};
};
};
lvm_vg = {
root_vg = {
type = "lvm_vg";
lvs = {
root = {
size = "100%FREE";
content = (import "${fsModule}");
};
};
};
};
};
}

View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko ./zspeed.nix

View File

@ -0,0 +1,70 @@
{
disko.devices = {
disk = {
x = {
type = "disk";
device = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zspeed";
};
};
};
};
};
y = {
type = "disk";
device = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi3";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zspeed";
};
};
};
};
};
};
zpool = {
zspeed = {
type = "zpool";
mode = "mirror";
rootFsOptions = {
"compression" = "zstd-4";
"com.sun:auto-snapshot" = "false";
"xattr" = "sa";
"atime" = "off";
};
options = {
"ashift" = "13";
};
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zspeed@blank$' || zfs snapshot zspeed@blank";
datasets = {
postgres = {
type = "zfs_volume";
size = "10G -s";
content = {
type = "filesystem";
format = "btrfs";
mountpoint = "/postgres";
};
options = {
"com.sun:auto-snapshot:daily" = "true";
"volblocksize" = "8k";
};
};
};
};
};
};
}

View File

@ -0,0 +1,7 @@
{ pkgs, ... }:
{
environment.systemPackages = [
pkgs.brightnessctl
];
services.illum.enable = true;
}

View File

@ -0,0 +1,26 @@
{ pkgs, inputs, ... }:
{
imports = [ inputs.arion.nixosModules.arion ];
environment.systemPackages = [
pkgs.arion
];
# Arion works with Docker, but for NixOS-based containers, you need Podman
# since NixOS 21.05.
virtualisation = {
podman = {
enable = true;
defaultNetwork.settings.dns_enabled = true;
};
docker = {
enable = true;
storageDriver = "btrfs";
rootless = {
enable = true;
setSocketVariable = true;
};
};
};
}

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