Compare commits

..

381 Commits

Author SHA1 Message Date
Sam 2ef417b6b1 Update NVIDIA configuration and add cpupower package
- Enable nvidiaPersistenced and add udev rules for NVIDIA devices in citadel/default.nix
- Add boot.extraModprobeConfig for NVreg_DynamicPowerManagement and NVreg_EnableGpuFirmware
- Include the cpupower package in common/core/default.nix
2024-11-13 12:09:17 +00:00
Sam 592309f30a add kodi for sparky 2024-11-12 23:07:22 +00:00
Sam c85215b5b4 add throttled to citadel 2024-11-12 21:18:21 +00:00
Sam d224d55c1a add nvidia and prime to citadel 2024-11-12 19:41:27 +00:00
Sam cdc75090ff Add keymaps and settings for nixvim plugins
- Add Conform auto-format document keymap in conform.nix
- Enable and configure Oil plugin settings in oil.nix
- Update Telescope keymaps definition in telescope.nix
2024-11-12 18:21:15 +00:00
Sam 2d78446105 Refactor Telescope keymaps to dedicated telescope plugin file
- Remove Telescope keymaps from keymaps.nix
- Add Telescope keymaps to telescope.nix
- Include new keymap for grep string under cursor and recently opened files
2024-11-12 17:03:53 +00:00
Sam d058b2cf72 Update nixvim keymaps and harpoon plugin
- Add indentation and line movement keymaps in visual mode
- Add keymap for adding files in harpoon plugin
2024-11-12 16:09:09 +00:00
Sam 86c59bb27b Add Gajim to default packages and new Prefect variable
- Add `pkgs.gajim` to the list of default packages in `default.nix`
- Introduce a new Prefect variable `wdpa_dir` in `baseddata-worker.nix`
- Set the value of `wdpa_dir` to `/media/baseddata-data/wdpa
2024-11-06 16:33:28 +00:00
Sam ac6a9d2c21 merge 2024-11-05 15:21:23 +00:00
Sam a154d2df79 Update default.nix to include R package 2024-11-05 15:20:35 +00:00
Sam a95ac4ef25 Update default.nix and dwm.nix with new packages and revisions
- Add pkgs.gimp to default.nix
- Update dwm.nix with new revision and sha256
2024-11-05 15:19:32 +00:00
Sam de5c1edf1b revert user variables removal 2024-11-04 15:57:32 +00:00
Sam ac5833c8af revert neovim to stable 2024-11-04 15:54:26 +00:00
Sam b9c0b70fc8 rm parrot.nvim 2024-11-04 15:53:53 +00:00
Sam b2f849d80b Update desktop packages and add spell-checking support
- Replace libreoffice with libreoffice-qt
- Add hunspell and hunspell dictionaries for en-gb and en_US
2024-11-04 15:33:41 +00:00
Sam 4d0335d99a Merge branch 'master' of git.bitlab21.com:sam/nixos 2024-11-03 21:27:10 +00:00
Sam ec7f879c6d Add Krita and update DWM source
- Add Krita to the default.nix package list
- Update DWM source URL and revision in dwm.nix
- Modify DWM source SHA256 checksum in dwm.nix
2024-11-03 21:27:07 +00:00
Sam 2c44487796 Add swap devices and update Prefect variables
- Add swap devices configuration to citadel and semita hosts
- Update Prefect variable for OSM directory in baseddata-worker
- Set swap device size to 32*1024 for both citadel and semita hosts
2024-11-03 21:03:12 +00:00
Sam 45ee82da0e Add glow plugin and update prefect variable
- Add 'pkgs.glow' to 'default.nix'
- Add and configure 'glow.nvim' plugin in 'plugins/default.nix'
- Update 'postgres_dbname' variable to 'baseddata' in 'baseddata-worker.nix'
2024-11-02 14:00:30 +00:00
Sam 5d0b1b9be7 Merge branch 'master' of git.bitlab21.com:sam/nixos 2024-11-01 22:17:35 +00:00
Sam 7be587d7b1 Update Postgres configuration and remove system packages
- Update Postgres configuration for dev and prod environments:
  - Change dbname from `dev_baseddata_models` to `dev_baseddata` and `baseddata_models` to `baseddata`
  - Replace host variable with `${baseddataPostgresIp}`
  - Update user and password placeholders to new paths
- Remove `environment.systemPackages` configuration
2024-11-01 22:17:24 +00:00
Sam 7e4f15496f rm flake.lock to gitignore 2024-11-01 17:38:25 +00:00
Sam 9a26bbe7c5 add flake.lock to gitignore 2024-11-01 17:37:34 +00:00
Sam d725852387 add flake.lock to gitignore 2024-11-01 17:37:23 +00:00
Sam 4bee1bffbd flake.lock 2024-11-01 17:33:29 +00:00
Sam 8561f44963 update flake.lock 2024-10-28 17:52:45 +00:00
Sam dde54c9aa7 Add lib to configuration 2024-10-28 17:52:29 +00:00
Sam 16436da1e4 Update nixvim configuration to use unstable Neovim package 2024-10-28 17:51:42 +00:00
Sam 13dad7b532 Update: Add Mistral API key and Parrot.nvim plugin
- Introduce Mistral API key
- Add Parrot.nvim plugin
- Implement a function to read the API key from a secrets file
- Set up Parrot.nvim with Mistral provider and custom hooks for code assistance and git commit generation
2024-10-28 17:46:09 +00:00
Sam a9f321a847 update flake 2024-10-28 13:45:55 +00:00
Sam 7cffeffca9 Add bitcoind configuration and prefect variables
- Add bitcoind IP and port configuration variables
- Update prefect variables for bitcoind ip and port
- Maintain existing configurations for other services
2024-10-25 10:31:52 +01:00
Sam 70a788f588 Add bitcoind RPC credentials and update prefect variables
- Add bitcoind RPC username and password to secrets and environment variables
- Update prefect variables to include bitcoin RPC username and password
- Add new read-only host paths for bitcoind RPC username and password
2024-10-25 10:18:15 +01:00
Sam 4e6f1f6f01 update flake 2024-10-24 15:22:35 +01:00
Sam 8242c29cf7 Refactor flake.nix and add key remaps script
- Refactor `flake.nix` to simplify the `outputs` section and remove redundant configurations
- Update `lsp.nix` to use hostname for NixOS and Home Manager configurations.
- Add `key-remaps.nix` script to `dwm` configuration and update `xinitrc.nix` to include it in autostart.
- Comment out non-functional `displayManager.sessionCommands` in `citadel/default.nix`.
2024-10-24 15:14:34 +01:00
Sam bd3f24056e modify nixvim
- add config for nixd
- fix luasnip call func in cmp
- enable autocomplete in cmp- cmdline
- add cmp-cmdline mapping
2024-10-23 22:34:35 +01:00
Sam 71ac9901dd disable tlp for citadel 2024-10-23 19:06:08 +01:00
Sam b106d1cb6e add nix-ld for citadel and semita 2024-10-19 13:33:51 +01:00
Sam ca9dff8442 modify baseddata-worker variables 2024-10-19 13:27:30 +01:00
Sam 2516f9de21 removed unused hosts 2024-10-14 18:54:48 +01:00
Sam a9fc820d61 brave 2024-10-14 18:46:13 +01:00
Sam c255cdbb2c chromium, kemaps, cli commands 2024-10-14 16:57:01 +01:00
Sam 6f4187b95e new postgres connection dbui 2024-10-14 09:48:33 +01:00
Sam 89141ff555 dwm-taglabels 2024-10-12 16:26:10 +01:00
Sam e6c3917942 small changes and updates 2024-10-12 00:19:40 +01:00
Sam 2793c3cfe0 small modification to postgres container 2024-10-12 00:19:24 +01:00
Sam 2005bc293f rm worker container 2024-10-12 00:19:07 +01:00
Sam d9fce8a1c9 new containers for mongodb and bd-worker 2024-10-12 00:18:37 +01:00
Sam 37768683d7 minor modifications to containers 2024-10-10 01:37:37 +01:00
Sam 3092630c08 add firefox bookmarks 2024-10-10 01:37:18 +01:00
Sam dbd3dd5584 update flake secrets 2024-10-10 01:37:05 +01:00
Sam 92fb9f5519 non-Nix Python Packages with Binaries on NixOS 2024-10-10 01:36:50 +01:00
Sam 00d5c7db47 install libreoffice on desktops 2024-10-10 01:36:08 +01:00
Sam 8eeea08472 add script runner container called worker 2024-10-10 01:35:45 +01:00
Sam 5430e70bd4 add vars networking.addresses from nix-secrets 2024-10-07 14:19:27 +01:00
Sam 62a3630a5c modify jellyfin & nix-bitcoin containers 2024-10-07 09:35:22 +01:00
Sam 51320794e6 intel gpu hardware firmware 2024-10-06 17:26:39 +01:00
Sam bd3924fda3 add podman group to sam 2024-10-06 17:26:20 +01:00
Sam e0093f134b change docker to podman for arion compatibility 2024-10-06 17:25:52 +01:00
Sam f57afcc50c add postgres and jellyfin nixos-containers 2024-10-06 17:25:27 +01:00
Sam 9096d69f9a remove postgres arion 2024-10-06 17:25:02 +01:00
Sam 74a2c3f930 update flake secrets 2024-10-06 17:23:54 +01:00
Sam 2533603b65 update nix-bitcoin and use network bridge for semita 2024-10-05 16:42:16 +01:00
Sam 25dfe2cf37 Update flake 2024-10-05 16:41:56 +01:00
Sam 37901f3937 working implementation of bitcoind 2024-10-04 17:53:32 +01:00
Sam 4c857eded4 set static ip for semita and add /srv to persistance 2024-10-04 09:30:34 +01:00
Sam 2e90b1ae46 set static ip for semita 2024-10-03 14:55:42 +01:00
Sam 0038dbf8ce add transmission-daemon 2024-09-30 09:37:25 +01:00
Sam 612affe2fd change sql formatter back to sqlfmt 2024-09-30 08:49:49 +01:00
Sam 53d2343f04 install docker and compose 2024-09-21 22:19:00 +01:00
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
149 changed files with 6260 additions and 922 deletions

0
.gitignore vendored Normal file
View File

View File

@ -1,5 +1,64 @@
{ {
"nodes": { "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": 1728330715,
"narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=",
"owner": "numtide",
"repo": "devshell",
"rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"disko": { "disko": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -7,19 +66,243 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1716431128, "lastModified": 1715070411,
"narHash": "sha256-t3T8HlX3udO6f4ilLcN+j5eC3m2gqsouzSGiriKK6vk=", "narHash": "sha256-5CNvkH0Nf7yMwgKhjUNg/lUK40C7DXB4zKOuA2jVO90=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "7ffc4354dfeb37c8c725ae1465f04a9b45ec8606", "rev": "4677f6c53482a8b01ee93957e3bdd569d51261d6",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "v1.6.1",
"repo": "disko", "repo": "disko",
"type": "github" "type": "github"
} }
}, },
"extra-container": {
"inputs": {
"flake-utils": [
"nix-bitcoin",
"flake-utils"
],
"nixpkgs": [
"nix-bitcoin",
"nixpkgs"
]
},
"locked": {
"lastModified": 1722175938,
"narHash": "sha256-HKyB4HD+NdX3T233bY31hm76v3/tdQBNeLLvopKbZeY=",
"owner": "erikarvstedt",
"repo": "extra-container",
"rev": "37e7207ac9f857eedb58b208b9dc91cd6b24e651",
"type": "github"
},
"original": {
"owner": "erikarvstedt",
"repo": "extra-container",
"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": 1727826117,
"narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat_2",
"gitignore": "gitignore",
"nixpkgs": [
"nixvim",
"nixpkgs"
],
"nixpkgs-stable": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729104314,
"narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6",
"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": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -27,26 +310,49 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1716448020, "lastModified": 1726989464,
"narHash": "sha256-u1ddoBOILtLVX4NYzqSZ9Qaqusql1M4reLd1fs554hY=", "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "25dedb0d52c20448f6a63cc346df1adbd6ef417e", "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-24.05",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1726989464,
"narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.05",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
}, },
"impermanence": { "impermanence": {
"locked": { "locked": {
"lastModified": 1708968331, "lastModified": 1730403150,
"narHash": "sha256-VUXLaPusCBvwM3zhGbRIJVeYluh2uWuqtj4WirQ1L9Y=", "narHash": "sha256-W1FH5aJ/GpRCOA7DXT/sJHFpa5r8sq2qAUncWwRZ3Gg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "impermanence", "repo": "impermanence",
"rev": "a33ef102a02ce77d3e39c25197664b7a636f9c30", "rev": "0d09341beeaa2367bac5d718df1404bf2ce45e6f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -55,14 +361,77 @@
"type": "github" "type": "github"
} }
}, },
"nix-secrets": { "nix-bitcoin": {
"flake": false, "inputs": {
"extra-container": "extra-container",
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-unstable": "nixpkgs-unstable"
},
"locked": { "locked": {
"lastModified": 1716456952, "lastModified": 1727247704,
"narHash": "sha256-fd57j4M++Fte1hrRZkDIqGbYbimqPNmERlFr/Fbh1Ek=", "narHash": "sha256-Jl1CYXNIdJ4Ac0MK15e8+vflFOgPxZZNw24CKfLC6QY=",
"owner": "fort-nix",
"repo": "nix-bitcoin",
"rev": "a0d36d59248ac54f1b42a668326346a77640c7f5",
"type": "github"
},
"original": {
"owner": "fort-nix",
"ref": "nixos-24.05",
"repo": "nix-bitcoin",
"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": 1729826725,
"narHash": "sha256-w3WNlYxqWYsuzm/jgFPyhncduoDNjot28aC8j39TW0U=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "7840909b00fbd5a183008a6eb251ea307fe4a76e",
"type": "github"
},
"original": {
"owner": "lnl7",
"repo": "nix-darwin",
"type": "github"
}
},
"nix-secrets": {
"locked": {
"lastModified": 1730130467,
"narHash": "sha256-mcyG1iu8hNmkDjgDEdFQyCZ3bBxBHFKd4nxT8NreMmY=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "f5abdf254dbee888be5f65c96a4a571f2a91da91", "rev": "c82ff6f7e995503acabb9cf2478e5b4e401968ce",
"revCount": 28, "revCount": 188,
"type": "git", "type": "git",
"url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git" "url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git"
}, },
@ -73,39 +442,74 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 0, "lastModified": 1720031269,
"narHash": "sha256-UlRZtrCnhPFSJlDQE7M0eyhgvuuHBTe1eJ9N9AQlJQ0=", "narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=",
"path": "/nix/store/3pif36ks3f56py4wb1dkq6sh0nkf3ygj-source",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1716061101,
"narHash": "sha256-H0eCta7ahEgloGIwE/ihkyGstOGu+kQwAiHvwVoXaA0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "e7cc61784ddf51c81487637b3031a6dd2d6673a2", "rev": "9f4128e00b0ae8ec65918efeba59db998750ead6",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "release-23.11", "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": 1729973466,
"narHash": "sha256-knnVBGfTCZlQgxY1SgH0vn2OyehH9ykfF8geZgS95bk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "cd3e8833d70618c4eea8df06f95b364b016d4950",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-24.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1716330097, "lastModified": 1726871744,
"narHash": "sha256-8BO3B7e3BiyIDsaKA0tY8O88rClYRTjvAp66y+VBUeU=", "narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a1d92660c6b3b7c26fb883500a80ea9d33321be2",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable_2": {
"locked": {
"lastModified": 1730200266,
"narHash": "sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2", "rev": "807e9154dcb16384b1b765ebe9cd2bba2ac287fd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -115,14 +519,78 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1730481737,
"narHash": "sha256-HaUCfqLIFX/4wiSKkKKSTwUNmZd1EMy+lGB+faadQXU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "f18ab3b08f56abc54bcc2ef9bbca627d45926fee",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "release-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": 1729945968,
"narHash": "sha256-4u+nbBSMuXWGCtXxUPPEflRm54+y/HLIbhIep9do8Ew=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "c05ac01070425ed0797b1ff678dc690c333cea74",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "nixos-24.05",
"repo": "nixvim",
"type": "github"
}
},
"nur": {
"locked": {
"lastModified": 1730472538,
"narHash": "sha256-3m4OVGKsbPzMlnS0gVptIZBRlxgqQz+WhfwT+rT823Y=",
"owner": "nix-community",
"repo": "NUR",
"rev": "52c21ec8fde46366b1a5555e18d854ee18012ac8",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"arion": "arion",
"disko": "disko", "disko": "disko",
"home-manager": "home-manager", "home-manager": "home-manager",
"impermanence": "impermanence", "impermanence": "impermanence",
"nix-bitcoin": "nix-bitcoin",
"nix-colors": "nix-colors",
"nix-secrets": "nix-secrets", "nix-secrets": "nix-secrets",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable_2",
"nixvim": "nixvim",
"nur": "nur",
"sops-nix": "sops-nix" "sops-nix": "sops-nix"
} }
}, },
@ -134,11 +602,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1716400300, "lastModified": 1729999681,
"narHash": "sha256-0lMkIk9h3AzOHs1dCL9RXvvN4PM8VBKb+cyGsqOKa4c=", "narHash": "sha256-qm0uCtM9bg97LeJTKQ8dqV/FvqRN+ompyW4GIJruLuw=",
"owner": "mic92", "owner": "mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "b549832718b8946e875c016a4785d204fcfc2e53", "rev": "1666d16426abe79af5c47b7c0efa82fd31bf4c56",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -146,6 +614,42 @@
"repo": "sops-nix", "repo": "sops-nix",
"type": "github" "type": "github"
} }
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729613947,
"narHash": "sha256-XGOvuIPW1XRfPgHtGYXd5MAmJzZtOuwlfKDgxX5KT3s=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "aac86347fb5063960eccb19493e0cadcdb4205ca",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

119
flake.nix
View File

@ -3,17 +3,41 @@
inputs = { inputs = {
# Nixpkgs # Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/release-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# NUR
nur.url = "github:nix-community/NUR";
# Home manager # Home manager
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# Nixvim
nixvim = {
url = "github:nix-community/nixvim/nixos-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
# Arion for docker
arion = {
url = "github:hercules-ci/arion/236f9dd82d6ef6a2d9987c7a7df3e75f1bc8b318";
};
# nix-bitcoin
nix-bitcoin = {
url = "github:fort-nix/nix-bitcoin/nixos-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
# Nix colors
nix-colors.url = "github:misterio77/nix-colors";
# Declarative partitioning and formatting # Declarative partitioning and formatting
disko = { disko = {
url = "github:nix-community/disko"; url = "github:nix-community/disko/v1.6.1";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
@ -29,7 +53,7 @@
nix-secrets = { nix-secrets = {
url = "git+ssh://git@git.bitlab21.com/sam/nix-secrets.git"; url = "git+ssh://git@git.bitlab21.com/sam/nix-secrets.git";
flake = false; inputs = {};
}; };
}; };
@ -37,44 +61,30 @@
self, self,
nixpkgs, nixpkgs,
home-manager, home-manager,
disko,
#impermanence,
... ...
} @ inputs: } @ inputs: let
let
inherit (self) outputs; inherit (self) outputs;
systems = [ systems = [
"x86_64-linux" "x86_64-linux"
]; ];
forAllSystems = nixpkgs.lib.genAttrs systems; forAllSystems = nixpkgs.lib.genAttrs systems;
specialArgs = { inherit inputs outputs; }; inherit (nixpkgs) lib;
configVars = import ./vars {inherit inputs lib;};
specialArgs = {
inherit
inputs
outputs
configVars
;
};
in { in {
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
overlays = import ./overlays {inherit inputs;}; overlays = import ./overlays {inherit inputs;};
nixosModules = import ./modules/nixos; nixosModules = import ./modules/nixos;
homeManagerModules = import ./modules/home-manager; homeManagerModules = import ./modules/home-manager;
# System level configs # System level configs
nixosConfigurations = { nixosConfigurations = {
nixdev = nixpkgs.lib.nixosSystem {
inherit specialArgs;
modules = [
./hosts/nixdev
home-manager.nixosModules.home-manager{
home-manager.extraSpecialArgs = specialArgs;
}
];
};
fileserver = nixpkgs.lib.nixosSystem {
inherit specialArgs;
modules = [
./hosts/fileserver
home-manager.nixosModules.home-manager{
home-manager.extraSpecialArgs = specialArgs;
}
];
};
bootstrap = nixpkgs.lib.nixosSystem { bootstrap = nixpkgs.lib.nixosSystem {
inherit specialArgs; inherit specialArgs;
modules = [ modules = [
@ -85,33 +95,42 @@
inherit specialArgs; inherit specialArgs;
modules = [ modules = [
./hosts/sparky ./hosts/sparky
home-manager.nixosModules.home-manager{ 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;
}
];
};
merlin = 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; 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 ;};
# modules = [
# # > Our main home-manager configuration file <
# ./home/nixdev.nix
# ];
# };
# "admin@fileserver" = home-manager.lib.homeManagerConfiguration {
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
# extraSpecialArgs = {inherit inputs outputs ;};
# modules = [
# # > Our main home-manager configuration file <
# ./home/nixdev.nix
# ];
# };
# };
}; };
} }

84
home/citadel.nix Normal file
View File

@ -0,0 +1,84 @@
{config, pkgs, ...}: {
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
];
home.packages = [
pkgs.qgis
];
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

@ -1,6 +1,35 @@
{ config, lib, pkgs, outputs, ... }: { pkgs, inputs, outputs, lib, ... }:
{ {
imports = [ imports = [
inputs.nix-colors.homeManagerModules.default
./zsh.nix ./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
bat
killall
pciutils
tree
jq
coreutils
btop
htop
postgresql_16
libqalculate
tmux
;
};
home.stateVersion = "24.05";
} }

View File

@ -0,0 +1,65 @@
{
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
pkgs.glow
];
programs.nixvim = {
enable = true;
package = pkgs.neovim-unwrapped;
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,114 @@
{
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;};
}
# 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;};
}
# indent line in or out
{
mode = ["v"];
key = "<";
action = "<gv";
options = {noremap = true;};
}
{
mode = ["v"];
key = ">";
action = ">gv";
options = {noremap = true;};
}
# move selected line up or down
{
mode = ["v"];
key = "J";
action = ":m '>+1<CR>gv=gv";
options = {noremap = true;};
}
{
mode = ["v"];
key = "K";
action = ":m '<-2<CR>gv=gv";
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,109 @@
{
programs.nixvim.plugins = {
cmp-emoji = { enable = true; };
cmp = {
enable = true;
cmdline = {};
settings = {
autoEnableSources = true;
experimental = { ghost_text = true; };
performance = {
debounce = 60;
fetchingTimeout = 200;
maxViewEntries = 30;
};
snippet = { expand = "function(args) require('luasnip').lsp_expand(args.body) end"; };
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'})";
"<S-Tab>" = "cmp.mapping.select_prev_item()";
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<CR>" = "cmp.mapping.confirm({ 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 = true; }; # 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({'/', "?" }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.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,53 @@
{
programs.nixvim.plugins.conform-nvim = {
enable = true;
notifyOnError = true;
logLevel = "debug";
formattersByFt = {
html = ["prettierd"];
css = ["prettierd"];
javascript = ["prettierd"];
python = ["black"];
lua = ["stylua"];
nix = ["alejandra"];
markdown = ["prettierd"];
yaml = ["yamlfmt"];
sql = ["sqlfmt"];
#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
}
'';
programs.nixvim.keymaps = [
# format document with Conform
{
mode = ["n"];
key = "<leader>cf";
action = "<CMD>Format<CR>";
options = {
silent = true;
desc = "Conform auto-format document";
};
}
];
}

View File

@ -0,0 +1,162 @@
{
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 = "glow.nvim";
src = pkgs.fetchFromGitHub {
owner = "ellisonleao";
repo = "glow.nvim";
rev = "238070a";
sha256 = "sha256-GsNcASzVvY0066kak2nvUY5luzanoBclqcUOsODww8g=";
};
})
(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 = ''
-- function to read api key from secrets file
local function read_api_key(file_path)
local file = io.open(file_path, "r")
if file then
local api_key = file:read("*all")
file:close()
return api_key
else
error("Failed to open file: " .. file_path)
end
end
-- 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",
}
)
require('glow').setup({
border = "shadow",
style = "dark",
pager = false,
width = 80,
height = 100,
width_ratio = 0.7,
height_ratio = 0.7,
})
-- 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,9 @@
{
programs.nixvim.plugins.harpoon = {
enable = true;
keymaps = {
toggleQuickMenu = "<leader>h";
addFile = "<leader>a";
};
};
}

View File

@ -0,0 +1,74 @@
{ osConfig , ... }:
let
hostname = osConfig.networking.hostName;
in
{
programs.nixvim.plugins = {
lsp = {
enable = true;
servers = {
lua-ls = {enable = true;};
nixd = {
enable = true;
cmd = ["nixd"];
settings = {
nixpkgs.expr = "import <nixpkgs> { }";
options = {
nixos.expr = "(builtins.getFlake \"/etc/nixos\").nixosConfigurations.${hostname}.options";
# TODO get home-manager options working when hm imported as submodule
# home_manager.expr = "(builtins.getFlake \"github:nix-community/home-manager\").homeConfigurations.${hostname}.options";
};
};
};
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,9 @@
{
programs.nixvim.plugins.oil = {
enable = true;
settings = {
columns = ["icon"];
view_options.show_hidden = true;
};
};
}

View File

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

View File

@ -0,0 +1,50 @@
{
programs.nixvim.plugins.telescope = {
enable = true;
extensions.fzy-native.enable = true;
};
programs.nixvim.keymaps = [
{
# 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;};
}
{
# grep string under cursor
mode = ["n"];
key = "<Leader>fs";
action = "<cmd>Telescope string_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;};
}
{
# show recently opened files
mode = ["n"];
key = "<Leader>fo";
action = "<cmd>Telescope oldfiles<CR>";
options = {noremap = 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;
};
};
}

View File

@ -1,4 +1,4 @@
{ pkgs, config, ... }: { { config, ... }: {
programs.zsh = { programs.zsh = {
enable = true; enable = true;
@ -8,6 +8,10 @@
shellAliases = { shellAliases = {
ll = "ls -l"; ll = "ls -l";
src = "cd ~/.local/share/src";
no = "cd /etc/nixos";
cat = "bat --decorations=never";
ls = "eza";
}; };
history.size = 10000; history.size = 10000;
history.path = "${config.xdg.dataHome}/zsh/history"; history.path = "${config.xdg.dataHome}/zsh/history";
@ -17,7 +21,88 @@
bindkey "^H" backward-delete-char bindkey "^H" backward-delete-char
bindkey "^?" backward-delete-char bindkey "^?" backward-delete-char
set -o vi set -o vi
export TERM=xterm 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,34 @@
{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.mpv
pkgs.gnome.simple-scan
pkgs.pandoc
pkgs.texlive.combined.scheme-small
pkgs.libreoffice-fresh
pkgs.hunspell
pkgs.hunspellDicts.en-gb-large
pkgs.hunspellDicts.en-gb-large
pkgs.hunspellDicts.en_US
pkgs.set_wm_class
pkgs.xorg.xkill
pkgs.krita
pkgs.R
pkgs.gimp
pkgs.gajim
];
}

View File

@ -0,0 +1,101 @@
{
pkgs,
config,
configVars,
...
}: let
user = config.home.username;
jellyfinIp = configVars.networking.addresses.jellyfin.ip;
jellyfinPort = configVars.networking.addresses.jellyfin.port;
bitcoinNodeIp = configVars.networking.addresses.bitcoin-node.ip;
mempoolPort = configVars.networking.addresses.bitcoin-node.services.mempool.port;
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 = "toolbar";
toolbar = true;
bookmarks = [
{
name = "Jellyfin";
url = "http://${jellyfinIp}:${jellyfinPort}";
}
{
name = "Mempool";
url = "http://${bitcoinNodeIp}:${toString mempoolPort}";
}
{
name = "Nixos Package Search";
url = "https://search.nixos.org/packages";
}
];
}
];
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,13 @@
{
pkgs,
...
}: {
programs.kodi = {
enable = true;
package = pkgs.kodi.withPackages (kodiPkgs:
with kodiPkgs; [
netflix
jellycon
]);
};
}

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,19 @@
{ pkgs, ... }:
{
imports = [
./scripts/feh-wallpaper-changer.nix
];
home.packages = [
pkgs.flameshot
pkgs.st
pkgs.xclip
pkgs.feh
];
programs.chromium = {
enable = true;
package = pkgs.brave;
};
}

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,48 @@
{ 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
./scripts/dmenu-set-wm-class.nix
./scripts/key-remaps.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,65 @@
{ 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"
}
'';
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,13 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellScriptBin "dmenu-set-wm-class" ''
${libnotify}/bin/notify-send "Set Window Class" "Select window..."
winid=$(${xorg.xwininfo}/bin/xwininfo | grep "Window id:" | grep -o "0x[0-9a-fA-F]*")
class=$(${xorg.xprop}/bin/xprop -id "$winid" WM_CLASS | grep -o "\".*\"$")
new_class=$( echo "" | ${dmenu}/bin/dmenu -p "Selected: $class. Set class name of window:")
[ -z "$new_class" ] && ${libnotify}/bin/notify-send "Set Window Class" "Nothing set, exiting" && exit
${set_wm_class}/bin/set_wm_class "$winid" "$new_class"
'')
];
}

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,11 @@
{pkgs, ...}: {
home.packages = with pkgs; [
(writeShellScriptBin "key-remaps" ''
${xorg.xmodmap}/bin/xmodmap -e "keycode 64 = Mode_switch"
${xorg.xmodmap}/bin/xmodmap -e "keycode 43 = h H Left H"
${xorg.xmodmap}/bin/xmodmap -e "keycode 44 = j J Down J"
${xorg.xmodmap}/bin/xmodmap -e "keycode 45 = k K Up K"
${xorg.xmodmap}/bin/xmodmap -e "keycode 46 = l L Right L"
'')
];
}

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,34 @@
{
# 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
control + F4
dmenu-set-wm-class
'';
};
}

View File

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

View File

@ -1,10 +1,13 @@
{ pkgs, lib, config, ... }: { pkgs, configVars, ... }:
let
email = configVars.email.user;
in
{ {
programs.git = { programs.git = {
enable = true; enable = true;
package = pkgs.gitAndTools.gitFull; package = pkgs.gitAndTools.gitFull;
userName = "Sam"; userName = "Sam";
userEmail = "samual.shop@proton.me"; userEmail = "${email}";
aliases = { }; aliases = { };
extraConfig = { extraConfig = {
pull.rebase = false; pull.rebase = false;

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

@ -1,10 +1,9 @@
{ inputs, config, osConfig, ... }: { inputs, config, ... }:
let let
secretsDirectory = builtins.toString inputs.nix-secrets; secretsDirectory = builtins.toString inputs.nix-secrets;
secretsFile = "${secretsDirectory}/secrets.yaml"; secretsFile = "${secretsDirectory}/secrets.yaml";
homeDirectory = config.home.homeDirectory; homeDirectory = config.home.homeDirectory;
username = config.home.username; username = config.home.username;
hostname = osConfig.networking.hostName;
in in
{ {
imports = [ imports = [
@ -12,10 +11,18 @@ in
]; ];
sops = { sops = {
age.sshKeyPaths = ["${homeDirectory}/.ssh/id_ed25519"]; age = {
sshKeyPaths = [ "${homeDirectory}/.ssh/id_ed25519" ];
generateKey = true;
keyFile = "/home/${username}/.config/sops/age/keys.txt";
};
defaultSopsFile = "${secretsFile}"; defaultSopsFile = "${secretsFile}";
validateSopsFiles = false; 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,53 @@
{
config,
pkgs,
...
}: let
in {
systemd.user.services.transmission-daemon = {
Unit = {
Description = "Transmission Bittorrent Daemon";
Wants = "network-online.target";
After = "network-online.target";
Documentation = "man:transmission-daemon(1)";
};
Install = {
WantedBy = ["multi-user.target"];
};
Service = {
User = "transmission";
Type = "notify";
ExecStart = "${pkgs.transmission}/bin/transmission-daemon -f --log-level=error";
ExecReload = "${pkgs.coreutils}/bin/kill -s HUP $MAINPID";
CapabilityBoundingSet = "";
DevicePolicy = "closed";
KeyringMode = "private";
LockPersonality = "true";
NoNewPrivileges = "true";
MemoryDenyWriteExecute = "true";
PrivateTmp = "true";
PrivateDevices = "true";
ProtectClock = "true";
ProtectKernelLogs = "true";
ProtectControlGroups = "true";
ProtectKernelModules = "true";
ProtectSystem = "true";
ProtectHostname = "true";
ProtectKernelTunables = "true";
ProtectProc = "invisible";
RestrictNamespaces = "true";
RestrictSUIDSGID = "true";
RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
RestrictRealtime = "true";
SystemCallFilter = "@system - service";
SystemCallArchitectures = "native";
SystemCallErrorNumber = "EPERM";
};
};
# home.file.".config/transmission-daemon/settings.json" = {
# recursive = true;
# text = ''
#
# '';
# };
}

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"; }
];
};
};
};
}

View File

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

View File

@ -1,33 +0,0 @@
{
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
];
# ------
# | DP-1
# ------
monitors = [
{
name = "Virtual-1";
width = 2048;
height = 1152;
x = 0;
workspace = "1";
primary = true;
}
];
}

84
home/semita.nix Normal file
View File

@ -0,0 +1,84 @@
{
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
./common/optional/transmission.nix
];
home.packages = [
pkgs.qgis
];
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
'';
}

View File

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

View File

@ -3,7 +3,6 @@
{ {
home.username = "admin"; home.username = "admin";
home.homeDirectory = "/home/admin"; home.homeDirectory = "/home/admin";
home.stateVersion = "23.11";
imports = [ imports = [
] ++ (builtins.attrValues outputs.homeManagerModules); # import all homeManagerModules? ] ++ (builtins.attrValues outputs.homeManagerModules); # import all homeManagerModules?

View File

@ -3,18 +3,28 @@
{ {
home.username = "media"; home.username = "media";
home.homeDirectory = "/home/media"; home.homeDirectory = "/home/media";
home.stateVersion = "23.11";
imports = [ imports = [
inputs.impermanence.nixosModules.home-manager.impermanence inputs.impermanence.nixosModules.home-manager.impermanence
] ++ (builtins.attrValues outputs.homeManagerModules); # import all homeManagerModules? ] ++ (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 = { xdg.userDirs = {
enable = true; enable = true;
createDirectories = false; createDirectories = true;
desktop = "/home/media/Desktop"; desktop = "/home/media/Desktop";
documents = null; documents = null;
download = null; download = "/home/media/Downloads";
music = null; music = null;
pictures = null; pictures = null;
publicShare = null; publicShare = null;
@ -36,4 +46,3 @@
programs.home-manager.enable = true; programs.home-manager.enable = true;
} }

View File

@ -1,53 +1,41 @@
{ config, pkgs, lib, outputs, ... }: {outputs, ...}: {
{
home.username = "sam"; home.username = "sam";
home.homeDirectory = "/home/sam"; home.homeDirectory = "/home/sam";
home.stateVersion = "23.11";
imports = [ imports =
] ++ (builtins.attrValues outputs.homeManagerModules); # import all homeManagerModules? [
]
++ (builtins.attrValues outputs.homeManagerModules); # import all homeManagerModules?
home.packages = [ programs.ssh = {
pkgs.firefox enable = true;
pkgs.neovim matchBlocks = {
pkgs.kitty "git.bitlab21.com" = {
pkgs.zathura identitiesOnly = true;
pkgs.xfce.thunar identityFile = ["~/.ssh/id_ed25519"];
#pkgs.age };
]; };
home.file = {
".icons/bibata".source = "${pkgs.bibata-cursors}/share/icons/Bibata-Modern-Classic";
}; };
home.sessionPath = [ xdg.userDirs = {
]; enable = true;
createDirectories = true;
gtk.enable = true; desktop = null;
documents = "/home/sam/docs";
gtk.cursorTheme.package = pkgs.bibata-cursors; download = "/home/sam/dl";
gtk.cursorTheme.name = "Bibata-Modern-Ice"; music = "/home/sam/mus";
pictures = "/home/sam/pics";
gtk.theme.package = pkgs.gruvbox-gtk-theme; publicShare = "/home/sam/sync";
gtk.theme.name = "Gruvbox-Dark-B"; templates = null;
videos = "/home/sam/vids";
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 = { home.sessionVariables = {
EDITOR = "nvim"; EDITOR = "nvim";
MUSIC="$HOME/mus/music_data/"; TERMINAL = "st";
TERMINAL="kitty";
READER = "zathura"; READER = "zathura";
IMAGE_VIEWER=""; IMAGE_VIEWER = "nsxiv";
IMAGE_EDITOR=""; IMAGE_EDITOR = "drawing";
PATH = "$PATH:$HOME/.scripts";
}; };
} }

View File

@ -1,19 +1,33 @@
{ inputs, config, lib, pkgs, outputs,... }: { inputs, config, lib, pkgs, outputs,... }:
let let
pubKeys = lib.filesystem.listFilesRecursive (../common/users/keys); 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 in
{ {
imports = imports =
[ [
# Disk configuration
inputs.sops-nix.nixosModules.sops
# Disk configuration # Disk configuration
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
(import ../common/disks/std-disk-config.nix { device = "/dev/vda"; }) (import ../common/disks { device = dev; fsType = fsType; encrypted = encrypted; })
../common/optional/btrfs-impermanence.nix
# Impermanence
inputs.impermanence.nixosModules.impermanence inputs.impermanence.nixosModules.impermanence
(import ../common/disks/btrfs-impermanence.nix { btrfsMountDevice = btrfsMountDevice; lib = lib; })
# Import core options # Import core options
./hardware-configuration.nix ./hardware-configuration.nix
../common/core
]; ];
nixpkgs = { nixpkgs = {
@ -36,10 +50,17 @@ in
files = [ files = [
"/etc/ssh/ssh_host_ed25519_key" "/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub" "/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/deploy_key-ssh-ed25519"
]; ];
}; };
i18n.defaultLocale = "en_GB.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "uk";
useXkbConfig = false;
};
boot = { boot = {
loader = { loader = {
systemd-boot.enable = true; systemd-boot.enable = true;
@ -52,7 +73,7 @@ in
mutableUsers = true; mutableUsers = true;
extraUsers = { extraUsers = {
root = { root = {
initialPassword = "1234"; hashedPasswordFile = sopsHashedPasswordFile;
openssh.authorizedKeys.keys = lib.lists.forEach pubKeys (key: builtins.readFile key); openssh.authorizedKeys.keys = lib.lists.forEach pubKeys (key: builtins.readFile key);
}; };
}; };
@ -64,12 +85,35 @@ in
enableIPv6 = false; 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 = { services.openssh = {
enable = true; enable = true;
ports = [22]; ports = [22];
authorizedKeysFiles = lib.mkForce ["/etc/ssh/authorized_keys.d/%u"]; authorizedKeysFiles = lib.mkForce ["/etc/ssh/authorized_keys.d/%u"];
hostKeys = [{ hostKeys = [{
path = "/persist/etc/ssh/ssh_host_ed25519_key"; path = "${lib.optionalString hasOptinPersistence "/persist"}/persist/etc/ssh/ssh_host_ed25519_key";
type = "ed25519"; type = "ed25519";
}]; }];
settings = { settings = {
@ -99,5 +143,4 @@ in
}; };
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
system.stateVersion = "23.11";
} }

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

@ -0,0 +1,202 @@
{
inputs,
lib,
pkgs,
config,
configVars,
...
}: 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;
pieholeIp = configVars.networking.addresses.piehole.ip;
gatewayIp = configVars.networking.addresses.gateway.ip;
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
../common/optional/nix-ld.nix
../common/optional/gaming.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;
};
};
swapDevices = [
{
device = "/.swapvol/swapfile";
size = 32 * 1024;
}
];
services = {
libinput.touchpad.accelSpeed = "0.5";
xserver = {
xkb.options = "caps:swapescape";
dpi = 196;
upscaleDefaultCursor = true;
# FIXME this doesnt work for some reason
# displayManager.sessionCommands = pkgs.writeShellScriptBin "key-remaps" ''
# ${pkgs.xorg.xmodmap}/bin/xmodmap -e "keycode 64 = Mode_switch"
# ${pkgs.xorg.xmodmap}/bin/xmodmap -e "keycode 43 = h H Left H"
# ${pkgs.xorg.xmodmap}/bin/xmodmap -e "keycode 44 = j J Down J"
# ${pkgs.xorg.xmodmap}/bin/xmodmap -e "keycode 45 = k K Up K"
# ${pkgs.xorg.xmodmap}/bin/xmodmap -e "keycode 46 = l L Right L"
# '';
};
};
# fix cpu throttling on Lenovo Thinkpad
# see: https://github.com/erpalma/throttled
services.throttled.enable = 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
];
};
# nvidia
hardware.opengl = {
enable = true;
};
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
nvidiaPersistenced = true;
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
# FIXME issue with stable nvidia driver and latest linux kernel
# use mkDriver to specify newer nvidia driver that is compatible
# see: https://github.com/NixOS/nixpkgs/issues/341844#issuecomment-2351075413
# and https://discourse.nixos.org/t/builder-for-nvidia-x11-550-78-6-10-drv-failed-with-exit-code-2/49360/32
package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
version = "555.58.02";
sha256_64bit = "sha256-xctt4TPRlOJ6r5S54h5W6PT6/3Zy2R4ASNFPu8TSHKM=";
sha256_aarch64 = "sha256-wb20isMrRg8PeQBU96lWJzBMkjfySAUaqt4EgZnhyF8=";
openSha256 = "sha256-8hyRiGB+m2hL3c9MDA/Pon+Xl6E788MZ50WrrAGUVuY=";
settingsSha256 = "sha256-ZpuVZybW6CFN/gz9rx+UJvQ715FZnAOYfHn5jt5Z2C8=";
persistencedSha256 = "sha256-a1D7ZZmcKFWfPjjH1REqPM5j/YLWKnbkP9qfRyIyxAw=";
};
};
# https://bbs.archlinux.org/viewtopic.php?id=297276 for NVreg_EnableGpuFirmware fix
# https://discourse.nixos.org/t/how-to-use-nvidia-prime-offload-to-run-the-x-server-on-the-integrated-board/9091/15
# for udev rules to disable dGPU when not in use
boot.extraModprobeConfig = ''
options nvidia NVreg_DynamicPowerManagement=0x02
options nvidia NVreg_EnableGpuFirmware=0
'';
services.udev.extraRules = ''
# Remove NVIDIA USB xHCI Host Controller devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{remove}="1"
# Remove NVIDIA USB Type-C UCSI devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{remove}="1"
# Remove NVIDIA Audio devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{remove}="1"
# Enable runtime PM for NVIDIA VGA/3D controller devices on driver bind
ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="auto"
ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="auto"
# Disable runtime PM for NVIDIA VGA/3D controller devices on driver unbind
ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="on"
ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="on"
'';
networking = {
hostName = "citadel";
networkmanager.enable = true;
enableIPv6 = false;
nameservers = ["${pieholeIp}" "${gatewayIp}" "8.8.8.8"];
};
services.libinput.enable = true;
}

View File

@ -8,18 +8,11 @@
[ (modulesPath + "/profiles/qemu-guest.nix") [ (modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk" ]; 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.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/9bed98b2-5ee2-4408-a9b1-6d40e9b68135";
fsType = "ext4";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (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 # still possible to use this option, but it's recommended to use it in conjunction

View File

@ -1,16 +1,56 @@
{ pkgs, lib, inputs, config, ...}: { pkgs, lib, inputs, config, outputs, ... }:
let
sopsHashedPasswordFile = lib.optionalString (lib.hasAttr "sops-nix" inputs) config.sops.secrets."passwords/root".path;
in
{ {
imports = [ imports = [
inputs.impermanence.nixosModules.impermanence
./sops.nix ./sops.nix
./locale.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;
};
};
};
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
environment.systemPackages = [ environment.systemPackages = [
pkgs.rsync pkgs.rsync
pkgs.curl pkgs.curl
pkgs.just pkgs.just
pkgs.git pkgs.git
pkgs.neovim pkgs.vim
pkgs.linuxKernel.packages.linux_zen.cpupower
]; ];
system.stateVersion = "24.05";
} }

View File

@ -5,4 +5,6 @@
keyMap = "uk"; keyMap = "uk";
useXkbConfig = false; useXkbConfig = false;
}; };
time.timeZone = "Europe/London";
} }

View File

@ -1,10 +1,13 @@
{ pkgs, inputs, config, username, ... }: {
lib,
let inputs,
config,
...
}: let
secretsDirectory = builtins.toString inputs.nix-secrets; secretsDirectory = builtins.toString inputs.nix-secrets;
secretsFile = "${secretsDirectory}/secrets.yaml"; secretsFile = "${secretsDirectory}/secrets.yaml";
in hasOptinPersistence = config.environment.persistence ? "/persist";
{ in {
imports = [ imports = [
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
]; ];
@ -14,7 +17,7 @@ in
validateSopsFiles = false; validateSopsFiles = false;
age = { age = {
sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; sshKeyPaths = ["${lib.optionalString hasOptinPersistence "/persist"}/etc/ssh/ssh_host_ed25519_key"];
}; };
secrets = { secrets = {
"passwords/root".neededForUsers = true; "passwords/root".neededForUsers = true;

View File

@ -1,8 +1,11 @@
{lib, ...}: {lib, btrfsMountDevice, ...}:
let
device = btrfsMountDevice;
in
{ {
boot.initrd.postDeviceCommands = lib.mkAfter '' boot.initrd.postDeviceCommands = lib.mkAfter ''
mkdir /btrfs_tmp mkdir /btrfs_tmp
mount /dev/root_vg/root /btrfs_tmp mount ${device} /btrfs_tmp
if [[ -e /btrfs_tmp/root ]]; then if [[ -e /btrfs_tmp/root ]]; then
mkdir -p /btrfs_tmp/old_roots mkdir -p /btrfs_tmp/old_roots
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S") timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")

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

@ -3,7 +3,7 @@
disko.devices = { disko.devices = {
disk = { disk = {
vda = { vda = {
device = "/dev/vda"; inherit device;
type = "disk"; type = "disk";
content = { content = {
type = "gpt"; type = "gpt";

View File

@ -1,63 +0,0 @@
{
disko.devices = {
disk = {
vdb = {
type = "disk";
device = "/dev/vdb";
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";
# disable settings.keyFile if you want to use interactive password entry
#passwordFile = "/tmp/secret.key"; # Interactive
settings = {
allowDiscards = true;
keyFile = "/tmp/secret.key";
};
additionalKeyFiles = [ "/tmp/additionalSecret.key" ];
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/swap" = {
mountpoint = "/.swapvol";
swap.swapfile.size = "20M";
};
};
};
};
};
};
};
};
};
};
}

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

@ -1,69 +0,0 @@
{device ? throw "Must define a device, e.g. /dev/sda"}:
{
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 = {
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";
};
};
};
};
};
};
};
};
}

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