diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index d44a60a..89f8045 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,29 +1,21 @@ name: "Check configuration" - on: push: pull_request: - jobs: check: runs-on: ubuntu-latest - steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Install Nix uses: cachix/install-nix-action@v24 with: extra_nix_config: | - experimental-features = nix-command flakes - + experimental-features = nix-command flakes - name: Run statix check run: nix run 'nixpkgs/nixos-unstable#statix' -- check . - - name: Run deadnix check run: nix run 'nixpkgs/nixos-unstable#deadnix' -- . - - name: Run flake check uses: DeterminateSystems/flake-checker-action@v5 - diff --git a/README.md b/README.md index 67dc19c..21d8931 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ - [Features](#-features) - [File structure](#-file-structure) - [Desktop preview](#%EF%B8%8F-desktop-preview) - - [Hyprland](#-hyprland) - - [Sway](#-sway) + - [Hyprland](#-hyprland) + - [Sway](#-sway) - [Software](#-software) - [Network topology](#-network-topology) - [Hosts description](#%EF%B8%8F-hosts-description) @@ -24,37 +24,37 @@ - [Special thanks](#%EF%B8%8F-special-thanks) - [Star history](#-star-history) -## ✨ Features +## ✨ Features -- ❄️ Flakes -- for precise dependency management of the entire system. -- 🏑 Home Manager -- to configure all used software for the user. -- πŸ’½ Disko -- for declarative disk management: luks + lvm + btrfs. -- ⚠️ Impermanence -- to remove junk files and directories that are not specified in the config. -- πŸ’ˆ Stylix -- to customize the theme for the entire system and the software you use. -- 🍎 NixDarwin -- to declaratively customize MacOS. -- πŸ” Lanzaboot -- to securely boot the system. +- ❄️ Flakes - for precise dependency management of the entire system. +- 🏑 Home Manager - to configure all used software for the user. +- πŸ’½ Disko - for declarative disk management: luks + lvm + btrfs. +- ⚠️ Impermanence - to remove junk files and directories that are not specified in the config. +- πŸ’ˆ Stylix - to customize the theme for the entire system and the software you use. +- 🍎 NixDarwin - to declaratively customize MacOS. +- πŸ” Lanzaboot - to securely boot the system. - πŸ“ Config file structure and modules with options. ## πŸ“ File structure - [❄️ flake.nix](flake.nix) configuration entry point - [🏑 home](home/default.nix) entry point for creating a home manager user - - [🧩 modules](home/modules/) home manager modules - - [♻️ overlays](home/overlays) home manager overlays - - [πŸ‘€ users](home/users) users configurations for home manager - - [🧩 modules](home/users/maxmur/modules/) home manager user modules + - [🧩 modules](home/modules/) home manager modules + - [♻️ overlays](home/overlays) home manager overlays + - [πŸ‘€ users](home/users) users configurations for home manager + - [🧩 modules](home/users/maxmur/modules/) home manager user modules - [πŸ“ƒ lib](lib/default.nix) helper functions for creating configurations - [🧩 modules](modules/default.nix) common modules for nixos/nixDarwin/home-manager - [♻️ overlays](overlays/) common overlays - [❄️parts](parts/) flake parts modules - [πŸ’€pkgs](pkgs/) self-sealed packages - [πŸ–₯️ system](system/default.nix) entry point for creating a machine - - [🏎️ machine](system/machine) machines configurations - - [πŸš€ hostname](system/machine/pcbox/) starting the configuration of a specific machine - - [🧩 modules](system/machine/pcbox/modules) machine modules - - [πŸ’Ύ hardware](system/machine/pcbox/modules/hardware) machine hardware modules - - [🧩 modules](system/modules) common modules for machines - - [♻️ overlays](system/overlays) common overlays for machines + - [🏎️ machine](system/machine) machines configurations + - [πŸš€ hostname](system/machine/pcbox/) starting the configuration of a specific machine + - [🧩 modules](system/machine/pcbox/modules) machine modules + - [πŸ’Ύ hardware](system/machine/pcbox/modules/hardware) machine hardware modules + - [🧩 nixos](system/nixos) nixos modules/overlays/etc + - [🧩 darwin](system/darwin) nixos modules/overlays/etc - [πŸ“„ templates](templates/default.nix) templates for creating configuration parts ## πŸ–ΌοΈ Desktop preview @@ -81,16 +81,16 @@ The images below may not represent the final system. Some parts may differ. ## πŸ“˜ Software - - OS - [**`NixOS`**](https://nixos.org/) - - WM - [**`Hyprland`**](https://hyprland.org/) or [**`Sway`**](https://github.com/swaywm/sway) - - Theme - [**`Nord`**](https://github.com/nordtheme/nord) - - Wallpapers - [**`Grey wave`**](assets/grey_gradient.png) - - Editor - [**`Neovim`**](https://neovim.io/) - - Bar - [**`Waybar`**](https://github.com/Alexays/Waybar) - - Terminal - [**`Foot`**](https://codeberg.org/dnkl/foot) - - Shell - [**`Fish`**](https://fishshell.com/) - - Promt - [**`Starship`**](https://starship.rs/) - - Filemanager - [**`Yazi`**](https://github.com/sxyazi/yazi) +- OS - [**`NixOS`**](https://nixos.org/) +- WM - [**`Hyprland`**](https://hyprland.org/) or [**`Sway`**](https://github.com/swaywm/sway) +- Theme - [**`Nord`**](https://github.com/nordtheme/nord) +- Wallpapers - [**`Grey wave`**](assets/grey_gradient.png) +- Editor - [**`Neovim`**](https://neovim.io/) +- Bar - [**`Waybar`**](https://github.com/Alexays/Waybar) +- Terminal - [**`Foot`**](https://codeberg.org/dnkl/foot) +- Shell - [**`Fish`**](https://fishshell.com/) +- Promt - [**`Starship`**](https://starship.rs/) +- Filemanager - [**`Yazi`**](https://github.com/sxyazi/yazi) ## πŸ‘€ Network topology @@ -102,23 +102,25 @@ These diagrams show the network topology of my home network. ## πŸ–₯️ Hosts description -| Hostname | Board | CPU | RAM | GPU | OS | State | -| --- | --- | --- | --- | --- | --- | --- | -| pcbox | X299 AORUS Ultra Gaming Pro-CF | i7-7800X | 64GB | Sapphire AMD Radeon RX 7600 XT PULSE | NixOS | OK | -| nbox | Asus ZenBook 2024 Oled | Ultra7 155h | 32GB | Integrated Intel Arc (?) | NixOS | OK | -| rasp | Raspberry Pi 4 | Broadcom BCM2711 | 4GB | Broadcom VideoCore VI | NixOS | OK | -| macbox | Mac Mini M1 | Apple Silicon M1 | 8GB | Apple M1 8-Core GPU | MacOS | ? | +| Hostname | Board | CPU | RAM | GPU | OS | State | +| -------- | ------------------------------ | ---------------- | ----- | ------------------------------------ | ----- | ----- | +| pcbox | ASRock B650 Pro RS | Ryzen 5 7500f | 32GB | Sapphire AMD Radeon RX 7600 XT PULSE | NixOS | OK | +| nbox | Asus ZenBook 2024 Oled | Ultra7 155h | 32GB | Integrated Intel Arc (?) | NixOS | OK | +| hlbox | X299 AORUS Ultra Gaming Pro-CF | i7-7800X | 128GB | GTX 1050ti | NixOS | OK | +| p8box | P8 Mini Laptop | Intel N100 | 12GB | Intel UHD Graphics | NixOS | OK | +| rasp | Raspberry Pi 4 | Broadcom BCM2711 | 4GB | Broadcom VideoCore VI | NixOS | OK | +| macbox | Mac Mini M1 | Apple Silicon M1 | 8GB | Apple M1 8-Core GPU | MacOS | OK | ## ⌨️ Keyboard -I use corne split with a modified [miryoku](https://github.com/manna-harbour/miryoku) layout. This is one of the most affordable and easy options for an ergonomic keyboard. +I use corne split with a modified [miryoku](https://github.com/manna-harbour/miryoku) layout. This is one of the most affordable and easy options for an ergonomic keyboard. - WS Heavy Tactile switches - Blank white PBT Cherry keycaps - KBDFANS switch pads - Tape mod - O-rings -- Jincomso wrist rest +- Jincomso wrist rest
Layer 0 Main @@ -174,6 +176,8 @@ I use corne split with a modified [miryoku](https://github.com/manna-harbour/mir [voronind-com](https://github.com/voronind-com) +[Corgiek](https://github.com/Corgiek) + ## ⭐ Star History @@ -183,4 +187,3 @@ I use corne split with a modified [miryoku](https://github.com/manna-harbour/mir Star History Chart - diff --git a/docs/default.nix b/docs/default.nix new file mode 100644 index 0000000..d5dce7e --- /dev/null +++ b/docs/default.nix @@ -0,0 +1,7 @@ +{ + perSystem = + { self', pkgs, ... }: + { + packages.mydocs = pkgs.callPackage ./docs.nix { self = self'; }; + }; +} diff --git a/docs/docs.nix b/docs/docs.nix new file mode 100644 index 0000000..0e38468 --- /dev/null +++ b/docs/docs.nix @@ -0,0 +1,45 @@ +/* + { pkgs + , ... + }: + + let + inherit (pkgs) stdenv mkdocs python310Packages; + options-doc = pkgs.callPackage ./options-doc.nix {}; + in stdenv.mkDerivation { + src = ./.; + name = "docs"; + + buildInput = [ options-doc ]; + + nativeBuildInputs = [ + mkdocs + python310Packages.mkdocs-material + python310Packages.pygments + ]; + + buildPhase = '' + ln -s ${options-doc} "./docs/nixos-options.md" + mkdocs build + ''; + + installPhase = '' + mv site $out + ''; + } +*/ + +{ + writeShellScriptBin, + pkgs, + self, + ... +}: + +let + options-doc = pkgs.callPackage ./options-doc.nix { inherit self; }; +in +writeShellScriptBin "gen-options-doc" '' + echo "Generating NixOS module options documentation" + cat ${options-doc} > OPTIONS.md +'' diff --git a/docs/options-doc.nix b/docs/options-doc.nix new file mode 100644 index 0000000..afc8014 --- /dev/null +++ b/docs/options-doc.nix @@ -0,0 +1,29 @@ +{ + lib, + self, + pkgs, + runCommand, + nixosOptionsDoc, +}: + +let + eval = lib.evalModules { + specialArgs = { inherit self pkgs; }; + + modules = [ + (lib.nixosSystem { + inherit (pkgs) system; + modules = [ + ../modules/default.nix + ]; + }) + ]; + }; + + optionsDoc = nixosOptionsDoc { + inherit (eval) options; + }; +in +runCommand "options-doc.md" { } '' + cat ${optionsDoc.optionsCommonMark} >> $out +'' diff --git a/flake.lock b/flake.lock index c6d5bce..512cfcd 100644 --- a/flake.lock +++ b/flake.lock @@ -57,11 +57,11 @@ "fromYaml": "fromYaml" }, "locked": { - "lastModified": 1708890466, - "narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=", + "lastModified": 1732200724, + "narHash": "sha256-+R1BH5wHhfnycySb7Sy5KbYEaTJZWm1h+LW1OtyhiTs=", "owner": "SenchoPens", "repo": "base16.nix", - "rev": "665b3c6748534eb766c777298721cece9453fdae", + "rev": "153d52373b0fb2d343592871009a286ec8837aec", "type": "github" }, "original": { @@ -89,11 +89,11 @@ "base16-helix": { "flake": false, "locked": { - "lastModified": 1725860795, - "narHash": "sha256-Z2o8VBPW3I+KKTSfe25kskz0EUj7MpUh8u355Z1nVsU=", + "lastModified": 1736852337, + "narHash": "sha256-esD42YdgLlEh7koBrSqcT7p2fsMctPAcGl/+2sYJa2o=", "owner": "tinted-theming", "repo": "base16-helix", - "rev": "7f795bf75d38e0eea9fed287264067ca187b88a9", + "rev": "03860521c40b0b9c04818f2218d9cc9efc21e7a5", "type": "github" }, "original": { @@ -105,11 +105,11 @@ "base16-vim": { "flake": false, "locked": { - "lastModified": 1716150083, - "narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=", + "lastModified": 1735953590, + "narHash": "sha256-YbQwaApLFJobn/0lbpMKcJ8N5axKlW2QIGkDS5+xoSU=", "owner": "tinted-theming", "repo": "base16-vim", - "rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d", + "rev": "c2a1232aa2c0ed27dcbf005779bcfe0e0ab5e85d", "type": "github" }, "original": { @@ -127,11 +127,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1728001451, - "narHash": "sha256-Ost5YHSZZE4ZIKBcWsXC1c7g7n3kIqaNNjs5ula/lAI=", + "lastModified": 1737216937, + "narHash": "sha256-lgIK7OsoH+KeovKlhw3aEKclK6Rb1eGHH9Mx9s0pgOg=", "owner": "chaotic-cx", "repo": "nyx", - "rev": "25f420d9cf70929455ba14642b92ae715ae8d792", + "rev": "e300abf0ef16528298be33f66a2f70b20b15d2fa", "type": "github" }, "original": { @@ -143,29 +143,17 @@ }, "crane": { "inputs": { - "flake-compat": [ - "lanzaboote", - "flake-compat" - ], - "flake-utils": [ - "lanzaboote", - "flake-utils" - ], "nixpkgs": [ "lanzaboote", "nixpkgs" - ], - "rust-overlay": [ - "lanzaboote", - "rust-overlay" ] }, "locked": { - "lastModified": 1681177078, - "narHash": "sha256-ZNIjBDou2GOabcpctiQykEQVkI8BDwk7TyvlWlI4myE=", + "lastModified": 1717535930, + "narHash": "sha256-1hZ/txnbd/RmiBPNUs7i8UQw2N89uAK3UzrGAWdnFfU=", "owner": "ipetkov", "repo": "crane", - "rev": "0c9f468ff00576577d83f5019a66c557ede5acf6", + "rev": "55e7754ec31dac78980c8be45f8a28e80e370946", "type": "github" }, "original": { @@ -174,6 +162,25 @@ "type": "github" } }, + "crane_2": { + "inputs": { + "nixpkgs": "nixpkgs_7" + }, + "locked": { + "lastModified": 1717383740, + "narHash": "sha256-559HbY4uhNeoYvK3H6AMZAtVfmR3y8plXZ1x6ON/cWU=", + "owner": "ipetkov", + "repo": "crane", + "rev": "b65673fce97d277934488a451724be94cc62499a", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "ref": "v0.17.3", + "repo": "crane", + "type": "github" + } + }, "cryptopro": { "inputs": { "dream2nix": "dream2nix", @@ -181,11 +188,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1725955099, - "narHash": "sha256-CcDATbwdZTOlm3/NLu2wJ5U//pErNCsz4sQOBpSdAQI=", + "lastModified": 1732095193, + "narHash": "sha256-GphS1owpRXYb/Khgrz2ySd0B5WdHoLbwM/5vtKk7ThY=", "owner": "SomeoneSerge", "repo": "pkgs", - "rev": "6942b3e69f4955effb7159b3af65b1ddbc88be8d", + "rev": "80b5de9f59fe00b28e6ac1338c1c6e4480e64e26", "type": "github" }, "original": { @@ -201,11 +208,11 @@ ] }, "locked": { - "lastModified": 1727999297, - "narHash": "sha256-LTJuQPCsSItZ/8TieFeP30iY+uaLoD0mT0tAj1gLeyQ=", + "lastModified": 1737162735, + "narHash": "sha256-5T+HkouTMGaRm0rh3kgD4Z1O7ONKfgjyoPQH5rSyreU=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "8c8388ade72e58efdeae71b4cbb79e872c23a56b", + "rev": "87131f51f8256952d1a306b5521cedc2dc61aa08", "type": "github" }, "original": { @@ -217,18 +224,17 @@ }, "devshell": { "inputs": { - "flake-utils": "flake-utils_3", "nixpkgs": [ "nix-topology", "nixpkgs" ] }, "locked": { - "lastModified": 1713532798, - "narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=", + "lastModified": 1728330715, + "narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=", "owner": "numtide", "repo": "devshell", - "rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40", + "rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef", "type": "github" }, "original": { @@ -244,11 +250,11 @@ ] }, "locked": { - "lastModified": 1727977578, - "narHash": "sha256-DBORKcmQ7ZjA4qE1MsnF1MmZSokOGrw4W9vTCioOv2U=", + "lastModified": 1737038063, + "narHash": "sha256-rMEuiK69MDhjz1JgbaeQ9mBDXMJ2/P8vmOYRbFndXsk=", "owner": "nix-community", "repo": "disko", - "rev": "574400001b3ffe555c7a21e0ff846230759be2ed", + "rev": "bf0abfde48f469c256f2b0f481c6281ff04a5db2", "type": "github" }, "original": { @@ -267,11 +273,11 @@ "pyproject-nix": "pyproject-nix" }, "locked": { - "lastModified": 1704534571, - "narHash": "sha256-4CqLjWFGXZn7DgLCsFIjmU6lfdTXm3tiKzh5SNj5pdc=", + "lastModified": 1728585693, + "narHash": "sha256-rhx5SYpIkPu7d+rjF9FGGBVxS0BwAEkmYIsJg2a3E20=", "owner": "nix-community", "repo": "dream2nix", - "rev": "62f9486535d98ce862c78e1525b5c90fe6715a15", + "rev": "c6935471f7e1a9e190aaa9ac9823dca34e00d92a", "type": "github" }, "original": { @@ -289,11 +295,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1727937235, - "narHash": "sha256-Ih4RD65WZZDgtla9Uh8zm6gQJ1zgkXkiU4HKtEwQjvI=", + "lastModified": 1737009074, + "narHash": "sha256-BF+OxooVz4KeSIJyLXCnX2VTMsyfGrpEsay76hGRyrI=", "owner": "nix-community", "repo": "fenix", - "rev": "381781f96b880c2ced9019a9e2406b31ccea82b4", + "rev": "fe17a42e2c306d1a8a4fb3f977b12048d8cf7471", "type": "github" }, "original": { @@ -302,14 +308,30 @@ "type": "github" } }, + "firefox-gnome-theme": { + "flake": false, + "locked": { + "lastModified": 1736899990, + "narHash": "sha256-S79Hqn2EtSxU4kp99t8tRschSifWD4p/51++0xNWUxw=", + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "rev": "91ca1f82d717b02ceb03a3f423cbe8082ebbb26d", + "type": "github" + }, + "original": { + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -337,11 +359,58 @@ "flake-compat_3": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_4": { + "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-compat_5": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_6": { + "flake": false, + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", "type": "github" }, "original": { @@ -357,11 +426,11 @@ ] }, "locked": { - "lastModified": 1727826117, - "narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=", + "lastModified": 1736143030, + "narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1", + "rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de", "type": "github" }, "original": { @@ -378,11 +447,32 @@ ] }, "locked": { - "lastModified": 1680392223, - "narHash": "sha256-n3g7QFr85lDODKt250rkZj2IFS3i4/8HBU2yKHO3tqw=", + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": [ + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "dcc36e45d054d7bb554c9cdab69093debd91a0b5", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", "type": "github" }, "original": { @@ -425,14 +515,14 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_3" + "systems": "systems_2" }, "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "owner": "numtide", "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "type": "github" }, "original": { @@ -446,11 +536,11 @@ "systems": "systems_4" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -464,11 +554,11 @@ "systems": "systems_5" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -485,11 +575,11 @@ ] }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -500,7 +590,7 @@ }, "flake-utils_6": { "inputs": { - "systems": "systems_8" + "systems": "systems_9" }, "locked": { "lastModified": 1705309234, @@ -518,11 +608,11 @@ "fromYaml": { "flake": false, "locked": { - "lastModified": 1689549921, - "narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=", + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", "owner": "SenchoPens", "repo": "fromYaml", - "rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", "type": "github" }, "original": { @@ -534,11 +624,11 @@ "fzf-zsh-completions": { "flake": false, "locked": { - "lastModified": 1727968409, - "narHash": "sha256-QIRZShypkl1c7UAQHVKJWrjvlpuKae1aaZIApjisjGg=", + "lastModified": 1732180489, + "narHash": "sha256-yCTARZMiJzmdPChGRy84Rr/hP9B0yIDt5fZ3fjKHa3s=", "owner": "chitoku-k", "repo": "fzf-zsh-completions", - "rev": "8dde1cd4f006dc6c230e994f99e621ecef006ad6", + "rev": "4093db491207cd30b8780668cc2c1cbbac3a283e", "type": "github" }, "original": { @@ -547,6 +637,57 @@ "type": "github" } }, + "ghostty": { + "inputs": { + "flake-compat": "flake-compat_2", + "nixpkgs-stable": [ + "nixpkgs" + ], + "nixpkgs-unstable": [ + "nixpkgs" + ], + "zig": "zig" + }, + "locked": { + "lastModified": 1737085478, + "narHash": "sha256-EzdUQf1ljtGIWMmscVzoW3rUxxN3UKyNXOXbzUvz3BQ=", + "owner": "ghostty-org", + "repo": "ghostty", + "rev": "72d085525b22d66468c5969a4d507a0fa68d4a04", + "type": "github" + }, + "original": { + "owner": "ghostty-org", + "repo": "ghostty", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "stylix", + "flake-compat" + ], + "gitignore": "gitignore_3", + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1735882644, + "narHash": "sha256-3FZAG+pGt3OElQjesCAWeMkQ7C/nB1oTHLRQ8ceP110=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "a5a961387e75ae44cc20f0a57ae463da5e959656", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -556,11 +697,11 @@ ] }, "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", "type": "github" }, "original": { @@ -591,19 +732,41 @@ "type": "github" } }, + "gitignore_3": { + "inputs": { + "nixpkgs": [ + "stylix", + "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" + } + }, "gnome-shell": { "flake": false, "locked": { - "lastModified": 1713702291, - "narHash": "sha256-zYP1ehjtcV8fo+c+JFfkAqktZ384Y+y779fzmR9lQAU=", + "lastModified": 1732369855, + "narHash": "sha256-JhUWbcYPjHO3Xs3x9/Z9RuqXbcp5yhPluGjwsdE2GMg=", "owner": "GNOME", "repo": "gnome-shell", - "rev": "0d0aadf013f78a7f7f1dc984d0d812971864b934", + "rev": "dadd58f630eeea41d645ee225a63f719390829dc", "type": "github" }, "original": { "owner": "GNOME", - "ref": "46.1", + "ref": "47.2", "repo": "gnome-shell", "type": "github" } @@ -616,11 +779,11 @@ ] }, "locked": { - "lastModified": 1727817100, - "narHash": "sha256-dlyV9/eiWkm/Y/t2+k4CFZ29tBvCANmJogEYaHeAOTw=", + "lastModified": 1736883540, + "narHash": "sha256-dgPgoPUSg8cGAMqbhQRkww665sZtgzpWXxWjlyqhv94=", "owner": "nix-community", "repo": "home-manager", - "rev": "437ec62009fa8ceb684eb447d455ffba25911cf9", + "rev": "0dfec9deb275854a56c97c356c40ef72e3a2e632", "type": "github" }, "original": { @@ -636,11 +799,11 @@ ] }, "locked": { - "lastModified": 1727817100, - "narHash": "sha256-dlyV9/eiWkm/Y/t2+k4CFZ29tBvCANmJogEYaHeAOTw=", + "lastModified": 1737299337, + "narHash": "sha256-0NBrY2A7buujKmeCbieopOMSbLxTu8TFcTLqAbTnQDw=", "owner": "nix-community", "repo": "home-manager", - "rev": "437ec62009fa8ceb684eb447d455ffba25911cf9", + "rev": "f8ef4541bb8a54a8b52f19b52912119e689529b3", "type": "github" }, "original": { @@ -657,11 +820,11 @@ ] }, "locked": { - "lastModified": 1724435763, - "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", + "lastModified": 1736785676, + "narHash": "sha256-TY0jUwR3EW0fnS0X5wXMAVy6h4Z7Y6a3m+Yq++C9AyE=", "owner": "nix-community", "repo": "home-manager", - "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", + "rev": "fc52a210b60f2f52c74eac41a8647c1573d2071d", "type": "github" }, "original": { @@ -707,7 +870,7 @@ "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", "nixpkgs": "nixpkgs_4", - "systems": "systems_2", + "systems": "systems_3", "xdph": "xdph" }, "locked": { @@ -810,7 +973,7 @@ }, "hyprlang_2": { "inputs": { - "nixpkgs": "nixpkgs_9" + "nixpkgs": "nixpkgs_11" }, "locked": { "lastModified": 1704287638, @@ -878,11 +1041,11 @@ }, "impermanence": { "locked": { - "lastModified": 1727649413, - "narHash": "sha256-FA53of86DjFdeQzRDVtvgWF9o52rWK70VHGx0Y8fElQ=", + "lastModified": 1736688610, + "narHash": "sha256-1Zl9xahw399UiZSJ9Vxs1W4WRFjO1SsNdVZQD4nghz0=", "owner": "nix-community", "repo": "impermanence", - "rev": "d0b38e550039a72aff896ee65b0918e975e6d48e", + "rev": "c64bed13b562fc3bb454b48773d4155023ac31b7", "type": "github" }, "original": { @@ -900,11 +1063,11 @@ ] }, "locked": { - "lastModified": 1727865565, - "narHash": "sha256-SBcqfosxb0XlKdIz6QGXCnK4W/TEVHLDZHkRHZ8Me60=", + "lastModified": 1737007397, + "narHash": "sha256-uJ7Lk0moWSn8Tr0QkUbOCWR7WrhiLeha4E00rckhl8I=", "owner": "Jovian-Experiments", "repo": "Jovian-NixOS", - "rev": "703c0ac8432f3758987e0788248ddc1a8e0bf412", + "rev": "6bbb19666e753c18ef8af35f590cbc3ba42dd0ca", "type": "github" }, "original": { @@ -916,9 +1079,9 @@ "lanzaboote": { "inputs": { "crane": "crane", - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_3", "flake-parts": "flake-parts_2", - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "nixpkgs": [ "nixpkgs" ], @@ -926,27 +1089,27 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1682802423, - "narHash": "sha256-Fb5TeRTdvUlo/5Yi2d+FC8a6KoRLk2h1VE0/peMhWPs=", + "lastModified": 1718178907, + "narHash": "sha256-eSZyrQ9uoPB9iPQ8Y5H7gAmAgAvCw3InStmU3oEjqsE=", "owner": "nix-community", "repo": "lanzaboote", - "rev": "64b903ca87d18cef2752c19c098af275c6e51d63", + "rev": "b627ccd97d0159214cee5c7db1412b75e4be6086", "type": "github" }, "original": { "owner": "nix-community", - "ref": "v0.3.0", + "ref": "v0.4.1", "repo": "lanzaboote", "type": "github" } }, "master": { "locked": { - "lastModified": 1728001490, - "narHash": "sha256-jyLDB1hREFhujapdfZNOyFGQ2+FlhsnhCBYa9YBWn+4=", + "lastModified": 1737370608, + "narHash": "sha256-hFA6SmioeqvGW/XvZa9bxniAeulksCOcj3kokdNT/YE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "52cfd83eee767c5d02089efe79c4811ffc52a046", + "rev": "300081d0cc72df578b02d914df941b8ec62240e6", "type": "github" }, "original": { @@ -965,11 +1128,11 @@ ] }, "locked": { - "lastModified": 1690328911, - "narHash": "sha256-fxtExYk+aGf2YbjeWQ8JY9/n9dwuEt+ma1eUFzF8Jeo=", + "lastModified": 1729697500, + "narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=", "owner": "zhaofengli", "repo": "nix-github-actions", - "rev": "96df4a39c52f53cb7098b923224d8ce941b64747", + "rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf", "type": "github" }, "original": { @@ -1008,11 +1171,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1725483443, - "narHash": "sha256-WzOlGMKV/51Fccn/OMHcm5yrqgbOJZrJIy1ya4pW0u8=", + "lastModified": 1737125456, + "narHash": "sha256-MHjmUcYO8VT0aDf1AdIsPdcRE7vxdo+TB1gAGpDPP1k=", "owner": "oddlama", "repo": "nix-topology", - "rev": "8738d94670265beb166954c4e3a26e432f79f68c", + "rev": "ddee77422129896886ed1a0b32f0e08b882ea99f", "type": "github" }, "original": { @@ -1038,53 +1201,83 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1678872516, - "narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=", + "lastModified": 1710695816, + "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8", + "rev": "614b4613980a522ba49f0d194531beddbb7220d3", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-22.11", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1710695816, - "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", + "lastModified": 1732981179, + "narHash": "sha256-F7thesZPvAMSwjRu0K8uFshTk3ZZSNAsXTIFvXBT+34=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "614b4613980a522ba49f0d194531beddbb7220d3", + "rev": "62c435d93bf046a5396f3016472e8f7c8e2aed65", "type": "github" }, "original": { + "id": "nixpkgs", + "ref": "nixos-24.11", + "type": "indirect" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1723637854, + "narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=", "owner": "NixOS", - "ref": "nixos-23.11", "repo": "nixpkgs", + "rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9", "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" } }, - "nixpkgs-stable_3": { + "nixpkgs_10": { "locked": { - "lastModified": 1725762081, - "narHash": "sha256-vNv+aJUW5/YurRy1ocfvs4q/48yVESwlC/yHzjkZSP8=", - "owner": "NixOS", + "lastModified": 1735554305, + "narHash": "sha256-zExSA1i/b+1NMRhGGLtNfFGXgLtgo+dcuzHzaWA6w3Q=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "dc454045f5b5d814e5862a6d057e7bb5c29edc05", + "rev": "0e82ab234249d8eee3e8c91437802b32c74bb3fd", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_11": { + "locked": { + "lastModified": 1702645756, + "narHash": "sha256-qKI6OR3TYJYQB3Q8mAZ+DG4o/BR9ptcv9UnRV2hzljc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "40c3c94c241286dd2243ea34d3aef8a488f9e4d0", "type": "github" }, "original": { "owner": "NixOS", - "ref": "release-24.05", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_10": { + "nixpkgs_12": { "locked": { "lastModified": 1708093448, "narHash": "sha256-gohEm3/NVyu7WINFhRf83yJH8UM2ie/KY9Iw3VN6fiE=", @@ -1100,11 +1293,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1727802920, - "narHash": "sha256-HP89HZOT0ReIbI7IJZJQoJgxvB2Tn28V6XS3MNKnfLs=", + "lastModified": 1737062831, + "narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "27e30d177e57d912d614c88c622dcfdb2e6e6515", + "rev": "5df43628fdf08d642be8ba5b3625a6c70731c19c", "type": "github" }, "original": { @@ -1116,11 +1309,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1704588796, - "narHash": "sha256-6WJKgbo/ozOhIrn4U5RZddHp+K6AkONDxCbeE3b0I00=", + "lastModified": 1729643269, + "narHash": "sha256-jh9t+NAFJGUDThjWiMuxz+rGz+O7sctLBIgJBfm1xQk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2c92367fc6afb7df4700782bccae881d81e02de9", + "rev": "1c9fee8711a88d5b09e2072caf331efaec6501d3", "type": "github" }, "original": { @@ -1148,11 +1341,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1715266358, - "narHash": "sha256-doPgfj+7FFe9rfzWo1siAV2mVCasW+Bh8I1cToAXEE4=", + "lastModified": 1730531603, + "narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f1010e0469db743d14519a1efd37e23f8513d714", + "rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d", "type": "github" }, "original": { @@ -1164,27 +1357,27 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1725534445, - "narHash": "sha256-Yd0FK9SkWy+ZPuNqUgmVPXokxDgMJoGuNpMEtkfcf84=", - "owner": "NixOS", + "lastModified": 1737062831, + "narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "9bb1e7571aadf31ddb4af77fc64b2d59580f9a39", + "rev": "5df43628fdf08d642be8ba5b3625a6c70731c19c", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", + "owner": "nixos", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_7": { "locked": { - "lastModified": 1725194671, - "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", + "lastModified": 1714656196, + "narHash": "sha256-kjQkA98lMcsom6Gbhw8SYzmwrSo+2nruiTcTZp5jK7o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b833ff01a0d694b910daca6e2ff4a3f26dee478c", + "rev": "94035b482d181af0a0f8f77823a790b256b7c3cc", "type": "github" }, "original": { @@ -1196,15 +1389,15 @@ }, "nixpkgs_8": { "locked": { - "lastModified": 1726871744, - "narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=", - "owner": "nixos", + "lastModified": 1731763621, + "narHash": "sha256-ddcX4lQL0X05AYkrkV2LMFgGdRvgap7Ho8kgon3iWZk=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "a1d92660c6b3b7c26fb883500a80ea9d33321be2", + "rev": "c69a9bffbecde46b4b939465422ddc59493d3e4d", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" @@ -1212,11 +1405,11 @@ }, "nixpkgs_9": { "locked": { - "lastModified": 1702645756, - "narHash": "sha256-qKI6OR3TYJYQB3Q8mAZ+DG4o/BR9ptcv9UnRV2hzljc=", - "owner": "nixos", + "lastModified": 1736798957, + "narHash": "sha256-qwpCtZhSsSNQtK4xYGzMiyEDhkNzOCz/Vfu4oL2ETsQ=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "40c3c94c241286dd2243ea34d3aef8a488f9e4d0", + "rev": "9abb87b552b7f55ac8916b6fc9e5cb486656a2f3", "type": "github" }, "original": { @@ -1227,12 +1420,17 @@ } }, "nur": { + "inputs": { + "flake-parts": "flake-parts_3", + "nixpkgs": "nixpkgs_6", + "treefmt-nix": "treefmt-nix" + }, "locked": { - "lastModified": 1727999300, - "narHash": "sha256-y18q4rFuWZ5z1OllpZnNGtYZfIWPYta8V3MI+liB+d8=", + "lastModified": 1737370937, + "narHash": "sha256-kOJzS9zWmDrUccUBBleTCia35Jqs8XqwlhkKnKXweW0=", "owner": "nix-community", "repo": "NUR", - "rev": "2eaa6a4b8f589bc82805ec76506e9264e3acec9a", + "rev": "f8569084d180fe971e75e84263e16005c26d5f6c", "type": "github" }, "original": { @@ -1244,11 +1442,11 @@ "powerlevel10k": { "flake": false, "locked": { - "lastModified": 1727947006, - "narHash": "sha256-C0QgZ/DNA6YwQAUv7HHLo+18xrx+C+pUiU9uoD2/AvQ=", + "lastModified": 1736162665, + "narHash": "sha256-6tWuayZgQd9pUrD3xKlUSmOFQCgZ96G3DB8ojgZ/a78=", "owner": "romkatv", "repo": "powerlevel10k", - "rev": "c64a13361685fc4ec38a55b41256e28494a5d567", + "rev": "3e2053a9341fe4cf5ab69909d3f39d53b1dfe772", "type": "github" }, "original": { @@ -1259,24 +1457,23 @@ }, "pre-commit-hooks": { "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": [ - "nix-topology", - "flake-utils" - ], + "flake-compat": "flake-compat_4", "gitignore": "gitignore_2", "nixpkgs": [ "nix-topology", "nixpkgs" ], - "nixpkgs-stable": "nixpkgs-stable_2" + "nixpkgs-stable": [ + "nix-topology", + "nixpkgs" + ] }, "locked": { - "lastModified": 1714478972, - "narHash": "sha256-q//cgb52vv81uOuwz1LaXElp3XAe1TqrABXODAEF6Sk=", + "lastModified": 1730797577, + "narHash": "sha256-SrID5yVpyUfknUTGWgYkTyvdr9J1LxUym4om3SVGPkg=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "2849da033884f54822af194400f8dff435ada242", + "rev": "1864030ed24a2b8b4e4d386a5eeaf0c5369e50a9", "type": "github" }, "original": { @@ -1291,10 +1488,6 @@ "lanzaboote", "flake-compat" ], - "flake-utils": [ - "lanzaboote", - "flake-utils" - ], "gitignore": "gitignore", "nixpkgs": [ "lanzaboote", @@ -1303,11 +1496,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1681413034, - "narHash": "sha256-/t7OjNQcNkeWeSq/CFLYVBfm+IEnkjoSm9iKvArnUUI=", + "lastModified": 1717664902, + "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "d3de8f69ca88fb6f8b09e5b598be5ac98d28ede5", + "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", "type": "github" }, "original": { @@ -1316,8 +1509,31 @@ "type": "github" } }, + "proxmox-nixos": { + "inputs": { + "crane": "crane_2", + "flake-compat": "flake-compat_5", + "nixpkgs-stable": "nixpkgs-stable_2", + "nixpkgs-unstable": "nixpkgs-unstable", + "utils": "utils" + }, + "locked": { + "lastModified": 1735469959, + "narHash": "sha256-knX3c5OWE1C5QRDdvup+zqlWvwCLDHiME6+i18WwKsE=", + "owner": "SaumonNet", + "repo": "proxmox-nixos", + "rev": "4ad21ba619d779b229e308b58066bafd65d5153d", + "type": "github" + }, + "original": { + "owner": "SaumonNet", + "repo": "proxmox-nixos", + "type": "github" + } + }, "purescript-overlay": { "inputs": { + "flake-compat": "flake-compat", "nixpkgs": [ "cryptopro", "dream2nix", @@ -1326,11 +1542,11 @@ "slimlock": "slimlock" }, "locked": { - "lastModified": 1696022621, - "narHash": "sha256-eMjFmsj2G1E0Q5XiibUNgFjTiSz0GxIeSSzzVdoN730=", + "lastModified": 1724504251, + "narHash": "sha256-TIw+sac0NX0FeAneud+sQZT+ql1G/WEb7/Vb436rUXM=", "owner": "thomashoneyman", "repo": "purescript-overlay", - "rev": "047c7933abd6da8aa239904422e22d190ce55ead", + "rev": "988b09676c2a0e6a46dfa3589aa6763c90476b8a", "type": "github" }, "original": { @@ -1365,6 +1581,7 @@ "disko": "disko", "flake-parts": "flake-parts", "fzf-zsh-completions": "fzf-zsh-completions", + "ghostty": "ghostty", "home-manager": "home-manager_2", "hyprland": "hyprland", "impermanence": "impermanence", @@ -1376,10 +1593,11 @@ ], "nur": "nur", "powerlevel10k": "powerlevel10k", + "proxmox-nixos": "proxmox-nixos", "sops-nix": "sops-nix", "stable": "stable", "stylix": "stylix", - "treefmt-nix": "treefmt-nix", + "treefmt-nix": "treefmt-nix_2", "unstable": "unstable", "xdghypr": "xdghypr", "yandex-music": "yandex-music", @@ -1392,11 +1610,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1727778987, - "narHash": "sha256-OTI1eKQ3WIkj6q8PROpPY1vhaxYRdiS1btSfBowQPps=", + "lastModified": 1736970696, + "narHash": "sha256-WP5yBCVkidEf5y3kCaUSjRd0udpAE6nmY3MMx3Q2aNo=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "e1a76671af2fbc74c84c18ba18fcda5e653d7531", + "rev": "7d337c7f350a163ac3a9bd4ce0c4dae2df20579b", "type": "github" }, "original": { @@ -1418,11 +1636,11 @@ ] }, "locked": { - "lastModified": 1682129965, - "narHash": "sha256-1KRPIorEL6pLpJR04FwAqqnt4Tzcm4MqD84yhlD+XSk=", + "lastModified": 1717813066, + "narHash": "sha256-wqbRwq3i7g5EHIui0bIi84mdqZ/It1AXBSLJ5tafD28=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "2c417c0460b788328220120c698630947547ee83", + "rev": "6dc3e45fe4aee36efeed24d64fc68b1f989d5465", "type": "github" }, "original": { @@ -1441,11 +1659,11 @@ ] }, "locked": { - "lastModified": 1688610262, - "narHash": "sha256-Wg0ViDotFWGWqKIQzyYCgayeH8s4U1OZcTiWTQYdAp4=", + "lastModified": 1688756706, + "narHash": "sha256-xzkkMv3neJJJ89zo3o2ojp7nFeaZc2G0fYwNXNJRFlo=", "owner": "thomashoneyman", "repo": "slimlock", - "rev": "b5c6cdcaf636ebbebd0a1f32520929394493f1a6", + "rev": "cf72723f59e2340d24881fd7bf61cb113b4c407c", "type": "github" }, "original": { @@ -1456,15 +1674,14 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_6", - "nixpkgs-stable": "nixpkgs-stable_3" + "nixpkgs": "nixpkgs_8" }, "locked": { - "lastModified": 1727734513, - "narHash": "sha256-i47LQwoGCVQq4upV2YHV0OudkauHNuFsv306ualB/Sw=", + "lastModified": 1737107480, + "narHash": "sha256-GXUE9+FgxoZU8v0p6ilBJ8NH7k8nKmZjp/7dmMrCv3o=", "owner": "Mic92", "repo": "sops-nix", - "rev": "3198a242e547939c5e659353551b0668ec150268", + "rev": "4c4fb93f18b9072c6fa1986221f9a3d7bf1fe4b6", "type": "github" }, "original": { @@ -1475,11 +1692,11 @@ }, "stable": { "locked": { - "lastModified": 1727907660, - "narHash": "sha256-QftbyPoieM5M50WKUMzQmWtBWib/ZJbHo7mhj5riQec=", + "lastModified": 1735563628, + "narHash": "sha256-OnSAY7XDSx7CtDoqNh8jwVwh4xNL/2HaJxGjryLWzX8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5966581aa04be7eff830b9e1457d56dc70a0b798", + "rev": "b134951a4c9f3c995fd7be05f3243f8ecd65d798", "type": "github" }, "original": { @@ -1495,22 +1712,25 @@ "base16-fish": "base16-fish", "base16-helix": "base16-helix", "base16-vim": "base16-vim", - "flake-compat": "flake-compat_3", + "firefox-gnome-theme": "firefox-gnome-theme", + "flake-compat": "flake-compat_6", "flake-utils": "flake-utils_5", + "git-hooks": "git-hooks", "gnome-shell": "gnome-shell", "home-manager": "home-manager_3", - "nixpkgs": "nixpkgs_7", - "systems": "systems_6", + "nixpkgs": "nixpkgs_9", + "systems": "systems_7", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", - "tinted-tmux": "tinted-tmux" + "tinted-tmux": "tinted-tmux", + "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1727723275, - "narHash": "sha256-k4HrG8TJQ0RqDS1tlDz71kvWFBNQ7qZI9T5Z0qLR85Y=", + "lastModified": 1737207873, + "narHash": "sha256-XTCuMv753lpm8DvdVf9q2mH3rhlfsKrCUYbaADPC/bA=", "owner": "danth", "repo": "stylix", - "rev": "e7e97059776da7e34b739415a7bc8f80f606b803", + "rev": "51ad2cec11e773a949bdbec88bed2524f098f49a", "type": "github" }, "original": { @@ -1535,6 +1755,21 @@ } }, "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -1549,7 +1784,7 @@ "type": "github" } }, - "systems_3": { + "systems_4": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -1564,7 +1799,7 @@ "type": "github" } }, - "systems_4": { + "systems_5": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -1579,7 +1814,7 @@ "type": "github" } }, - "systems_5": { + "systems_6": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -1594,7 +1829,7 @@ "type": "github" } }, - "systems_6": { + "systems_7": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -1609,7 +1844,7 @@ "type": "github" } }, - "systems_7": { + "systems_8": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -1624,7 +1859,7 @@ "type": "github" } }, - "systems_8": { + "systems_9": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -1642,43 +1877,45 @@ "tinted-foot": { "flake": false, "locked": { - "lastModified": 1696725948, - "narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=", + "lastModified": 1726913040, + "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", "owner": "tinted-theming", "repo": "tinted-foot", - "rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", "type": "github" }, "original": { "owner": "tinted-theming", "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", "type": "github" } }, "tinted-kitty": { "flake": false, "locked": { - "lastModified": 1665001328, - "narHash": "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=", + "lastModified": 1716423189, + "narHash": "sha256-2xF3sH7UIwegn+2gKzMpFi3pk5DlIlM18+vj17Uf82U=", "owner": "tinted-theming", "repo": "tinted-kitty", - "rev": "06bb401fa9a0ffb84365905ffbb959ae5bf40805", + "rev": "eb39e141db14baef052893285df9f266df041ff8", "type": "github" }, "original": { "owner": "tinted-theming", "repo": "tinted-kitty", + "rev": "eb39e141db14baef052893285df9f266df041ff8", "type": "github" } }, "tinted-tmux": { "flake": false, "locked": { - "lastModified": 1696725902, - "narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=", + "lastModified": 1735737224, + "narHash": "sha256-FO2hRBkZsjlIRqzNHCPc/52yxg11kHGA8MEtSun9RwE=", "owner": "tinted-theming", "repo": "tinted-tmux", - "rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7", + "rev": "aead506a9930c717ebf81cc83a2126e9ca08fa64", "type": "github" }, "original": { @@ -1687,16 +1924,53 @@ "type": "github" } }, + "tinted-zed": { + "flake": false, + "locked": { + "lastModified": 1725758778, + "narHash": "sha256-8P1b6mJWyYcu36WRlSVbuj575QWIFZALZMTg5ID/sM4=", + "owner": "tinted-theming", + "repo": "base16-zed", + "rev": "122c9e5c0e6f27211361a04fae92df97940eccf9", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-zed", + "type": "github" + } + }, "treefmt-nix": { "inputs": { - "nixpkgs": "nixpkgs_8" + "nixpkgs": [ + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733222881, + "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "49717b5af6f80172275d47a418c9719a31a78b53", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_2": { + "inputs": { + "nixpkgs": "nixpkgs_10" }, "locked": { - "lastModified": 1727984844, - "narHash": "sha256-xpRqITAoD8rHlXQafYZOLvUXCF6cnZkPfoq67ThN0Hc=", + "lastModified": 1737103437, + "narHash": "sha256-uPNWcYbhY2fjY3HOfRCR5jsfzdzemhfxLSxwjXYXqNc=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "4446c7a6fc0775df028c5a3f6727945ba8400e64", + "rev": "d1ed3b385f8130e392870cfb1dbfaff8a63a1899", "type": "github" }, "original": { @@ -1707,11 +1981,11 @@ }, "unstable": { "locked": { - "lastModified": 1727802920, - "narHash": "sha256-HP89HZOT0ReIbI7IJZJQoJgxvB2Tn28V6XS3MNKnfLs=", + "lastModified": 1737062831, + "narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "27e30d177e57d912d614c88c622dcfdb2e6e6515", + "rev": "5df43628fdf08d642be8ba5b3625a6c70731c19c", "type": "github" }, "original": { @@ -1721,6 +1995,24 @@ "type": "github" } }, + "utils": { + "inputs": { + "systems": "systems_6" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "xdghypr": { "inputs": { "hyprland-protocols": "hyprland-protocols_2", @@ -1728,7 +2020,7 @@ "nixpkgs": [ "nixpkgs" ], - "systems": "systems_7" + "systems": "systems_8" }, "locked": { "lastModified": 1704466722, @@ -1778,15 +2070,15 @@ "yandex-music": { "inputs": { "flake-utils": "flake-utils_6", - "nixpkgs": "nixpkgs_10", + "nixpkgs": "nixpkgs_12", "ymExe": "ymExe" }, "locked": { - "lastModified": 1727974068, - "narHash": "sha256-+tNKENP5wgpfjaCaEvQBXhUp1j0xf9Ygyt2/O0g/Q/w=", + "lastModified": 1737074508, + "narHash": "sha256-ddZ1AiEvGkcOw8w9/z5NEMiuzAP67l04nxJLGPQBUuc=", "owner": "cucumber-sp", "repo": "yandex-music-linux", - "rev": "4d8753bf03e9faf68ec0fd716c0a55450848e5cf", + "rev": "c73d62807032c49783f06a0341543a1c54989a0a", "type": "github" }, "original": { @@ -1798,13 +2090,38 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-PFrV8F2KlkAsxEGSf8Wg1e67dnP2M+iNLNuR5AyJGuE=", + "narHash": "sha256-ufrWW90Vj+aMfntRGIiK5eGpjSNYpJIYdtIZ26FDmGA=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.20.2.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.35.0.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.20.2.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.35.0.exe" + } + }, + "zig": { + "inputs": { + "flake-compat": [ + "ghostty" + ], + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "ghostty", + "nixpkgs-stable" + ] + }, + "locked": { + "lastModified": 1717848532, + "narHash": "sha256-d+xIUvSTreHl8pAmU1fnmkfDTGQYCn2Rb/zOwByxS2M=", + "owner": "mitchellh", + "repo": "zig-overlay", + "rev": "02fc5cc555fc14fda40c42d7c3250efa43812b43", + "type": "github" + }, + "original": { + "owner": "mitchellh", + "repo": "zig-overlay", + "type": "github" } }, "zsh-auto-notify": { @@ -1826,11 +2143,11 @@ "zsh-autosuggestions": { "flake": false, "locked": { - "lastModified": 1694098728, - "narHash": "sha256-B+Kz3B7d97CM/3ztpQyVkE6EfMipVF8Y4HJNfSRXHtU=", + "lastModified": 1732590459, + "narHash": "sha256-85aw9OM2pQPsWklXjuNOzp9El1MsNb+cIiZQVHUzBnk=", "owner": "zsh-users", "repo": "zsh-autosuggestions", - "rev": "c3d4e576c9c86eac62884bd47c01f6faed043fc5", + "rev": "0e810e5afa27acbd074398eefbe28d13005dbc15", "type": "github" }, "original": { @@ -1858,11 +2175,11 @@ "zsh-syntax-highlighting": { "flake": false, "locked": { - "lastModified": 1704566212, - "narHash": "sha256-4rW2N+ankAH4sA6Sa5mr9IKsdAg7WTgrmyqJ2V1vygQ=", + "lastModified": 1732201766, + "narHash": "sha256-KRsQEDRsJdF7LGOMTZuqfbW6xdV5S38wlgdcCM98Y/Q=", "owner": "zsh-users", "repo": "zsh-syntax-highlighting", - "rev": "e0165eaa730dd0fa321a6a6de74f092fe87630b0", + "rev": "5eb677bb0fa9a3e60f0eff031dc13926e093df92", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 47c7358..a08f578 100644 --- a/flake.nix +++ b/flake.nix @@ -90,13 +90,26 @@ url = "github:SomeoneSerge/pkgs"; }; + ghostty = { + url = "github:ghostty-org/ghostty"; + + inputs = { + nixpkgs-stable.follows = "nixpkgs"; + nixpkgs-unstable.follows = "nixpkgs"; + }; + }; + + proxmox-nixos = { + url = "github:SaumonNet/proxmox-nixos"; + }; + # Security sops-nix = { url = "github:Mic92/sops-nix"; }; lanzaboote = { - url = "github:nix-community/lanzaboote/v0.3.0"; + url = "github:nix-community/lanzaboote/v0.4.1"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -132,31 +145,32 @@ }; }; - outputs = { self, flake-parts, ... } @ inputs: - let - # Description of hosts - hosts = import ./hosts.nix; + outputs = + { self, flake-parts, ... }@inputs: + let + # Description of hosts + hosts = import ./hosts.nix; - # Import helper funcfions - libx = import ./lib { inherit self inputs; }; - in flake-parts.lib.mkFlake { inherit inputs; } { - systems = libx.forAllSystems; + # Import helper funcfions + libx = import ./lib { inherit self inputs; }; + in + flake-parts.lib.mkFlake { inherit inputs; } { + systems = libx.forAllSystems; - imports = [ - ./parts - # ./docs - ]; + imports = [ + ./parts + # ./docs + ]; - flake = { - # NixOS Hosts configuration - nixosConfigurations = libx.genNixos hosts.nixos; + flake = { + # NixOS Hosts configuration + nixosConfigurations = libx.genNixos hosts.nixos; - # MacOS Hosts configuration - darwinConfigurations = libx.genDarwin hosts.darwin; + # MacOS Hosts configuration + darwinConfigurations = libx.genDarwin hosts.darwin; - # Templates - templates = import "${self}/templates" { inherit self; }; + # Templates + templates = import "${self}/templates" { inherit self; }; + }; }; - }; } - diff --git a/home/default.nix b/home/default.nix index 95ecd9b..4882f06 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,68 +1,82 @@ -{ self -, pkgs -, lib -, inputs -, hostname -, username -, platform -, stateVersion -, homeModules -, commonModules -, isWorkstation ? false -, wm ? "" -, swayEnable ? false -, hyprlandEnable ? false -, wmEnable ? false -, ... +{ + self, + pkgs, + lib, + inputs, + hostname, + username, + platform, + hmStateVersion, + isWorkstation ? false, + wm ? "", + swayEnable ? false, + hyprlandEnable ? false, + wmEnable ? false, + allDirs, + ... }: let inherit (pkgs.stdenv) isDarwin; inherit (pkgs.stdenv) isLinux; - isRoot = username == "root"; - homeDirectory = if isDarwin then "/Users/${username}" else if isRoot then "/root" else "/home/${username}"; - userConfigurationPath = "${self}/home/users/${username}"; + stateVersion = hmStateVersion; + isRoot = username == "root"; + homeDirectory = + if isDarwin then + "/Users/${username}" + else if isRoot then + "/root" + else + "/home/${username}"; + userConfigurationPath = "${self}/home/users/${username}"; userConfigurationPathExist = builtins.pathExists userConfigurationPath; - userModulesPath = "${self}/home/users/${username}/modules"; - userModulesPathExist = builtins.pathExists userModulesPath; - sshModulePath = "${homeModules}/ssh"; - sshModuleExistPath = builtins.pathExists sshModulePath; -in { + userModulesPath = "${self}/home/users/${username}/modules"; + userModulesPathExist = builtins.pathExists userModulesPath; + sshModulePath = "${self}/home/modules/ssh"; + sshModuleExistPath = builtins.pathExists sshModulePath; +in +{ home-manager = { - useGlobalPkgs = true; + useGlobalPkgs = true; useUserPackages = true; - backupFileExtension = "backup-" + pkgs.lib.readFile "${pkgs.runCommand "timestamp" {} "echo -n `date '+%Y%m%d%H%M%S'` > $out"}"; + backupFileExtension = + "backup-" + + pkgs.lib.readFile "${pkgs.runCommand "timestamp" { } "echo -n `date '+%Y%m%d%H%M%S'` > $out"}"; - extraSpecialArgs = { - inherit - inputs - self - hostname - username - platform - stateVersion - isLinux - commonModules - homeModules + extraSpecialArgs = { + inherit + inputs + self + allDirs + hostname + username + platform + stateVersion + isLinux isWorkstation - wm - swayEnable - hyprlandEnable - wmEnable; + wm + swayEnable + hyprlandEnable + wmEnable + ; }; users.${username} = { - imports = [ - inputs.impermanence.nixosModules.home-manager.impermanence - inputs.sops-nix.homeManagerModules.sops - inputs.nur.nixosModules.nur + imports = + [ + inputs.impermanence.nixosModules.home-manager.impermanence + inputs.sops-nix.homeManagerModules.sops + inputs.nur.modules.homeManager.default - "${commonModules}" - "${homeModules}" - ] ++ lib.optional sshModuleExistPath sshModulePath + "${self}/modules" + "${self}/home/modules" + ] + ++ lib.optional sshModuleExistPath sshModulePath ++ lib.optional userConfigurationPathExist userConfigurationPath - ++ lib.optional userModulesPathExist userModulesPath; + ++ lib.optional userModulesPathExist userModulesPath; + + nixpkgs.overlays = [ inputs.nur.overlay ]; home = { inherit username; @@ -72,4 +86,3 @@ in { }; }; } - diff --git a/home/modules/alacritty/default.nix b/home/modules/alacritty/default.nix index a60520f..7e63fae 100644 --- a/home/modules/alacritty/default.nix +++ b/home/modules/alacritty/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.alacritty; -in { +in +{ options = { module.alacritty.enable = mkEnableOption "Enables Alacritty"; }; @@ -87,4 +89,3 @@ in { }; }; } - diff --git a/home/modules/btop/default.nix b/home/modules/btop/default.nix index cf39a46..0dc7d30 100644 --- a/home/modules/btop/default.nix +++ b/home/modules/btop/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.btop; -in { +in +{ options = { module.btop.enable = mkEnableOption "Enables btop"; }; @@ -18,4 +20,3 @@ in { }; }; } - diff --git a/home/modules/chrome/default.nix b/home/modules/chrome/default.nix index 59ff0d2..198272b 100644 --- a/home/modules/chrome/default.nix +++ b/home/modules/chrome/default.nix @@ -1,30 +1,67 @@ -{ pkgs -, lib -, config -, ... +{ + pkgs, + lib, + config, + ... }: with lib; let - cfg = config.module.chrome; -in { + cfg = config.module.chromium; +in +{ options = { - module.chrome.enable = mkEnableOption "Enables Google Chrome"; + module.chromium.enable = mkEnableOption "Enables Chromium"; }; config = mkIf cfg.enable { programs.chromium = { enable = true; - package = pkgs.google-chrome; + package = pkgs.ungoogled-chromium; + + extensions = [ + "ddkjiahejlhfcafbddmgiahcphecmpfh" # uBlock Origin Lite + "mnjggcdmjocbbbhaepdhchncahnbgone" # SponsorBlock + "jghecgabfgfdldnmbfkhmffcabddioke" # Volume Master + ]; commandLineArgs = [ + # Wayland "--ozone-platform=wayland" "--ozone-platform-hint=auto" + # Performance "--gtk-version=4" "--ignore-gpu-blocklist" + "--enable-gpu-rasterization" + "--enable-oop-rasterization" + "--enable-zero-copy" + "--ignore-gpu-blocklist" + # Etc + "--disk-cache=$XDG_RUNTIME_DIR/chromium-cache" + "--disable-reading-from-canvas" + "--no-first-run" + "--disable-wake-on-wifi" + "--disable-speech-api" + "--disable-speech-synthesis-api" + # Use strict extension verification + "--extension-content-verification=enforce_strict" + "--extensions-install-verification=enforce_strict" + # Disable pings + "--no-pings" + # Require HTTPS for component updater + "--component-updater=require_encryption" + # Disable crash upload + "--no-crash-upload" + # don't run things without asking + "--no-service-autorun" + # Disable sync + "--disable-sync" + # Disable autofill + "AutofillPaymentCardBenefits" + "AutofillPaymentCvcStorage" + "AutofillPaymentCardBenefits" ]; }; }; } - diff --git a/home/modules/cinnamon/dconf2nix.nix b/home/modules/cinnamon/dconf2nix.nix index 06abe4a..a6e950d 100644 --- a/home/modules/cinnamon/dconf2nix.nix +++ b/home/modules/cinnamon/dconf2nix.nix @@ -36,11 +36,45 @@ with lib.hm.gvariant; desktop-effects-unmaximize-time = 100; desktop-effects-unmaximize-transition = "easeNone"; device-aliases = [ "/org/freedesktop/UPower/devices/battery_BAT0:=Laptop" ]; - enabled-applets = [ "panel1:left:0:menu@cinnamon.org:30" "panel1:right:9:notifications@cinnamon.org:35" "panel1:right:11:network@cinnamon.org:40" "panel1:right:12:sound@cinnamon.org:41" "panel1:right:13:power@cinnamon.org:42" "panel1:right:15:calendar@cinnamon.org:43" "panel1:right:14:weather@mockturtl:95" "panel1:left:1:workspace-switcher@cinnamon.org:116" "panel1:center:1:window-list@cinnamon.org:121" "panel1:right:5:keyboard@cinnamon.org:128" "panel1:right:6:systray@cinnamon.org:130" "panel1:right:8:xapp-status@cinnamon.org:133" "panel4:left:0:menu@cinnamon.org:138" "panel4:left:1:workspace-switcher@cinnamon.org:139" "panel4:center:1:window-list@cinnamon.org:140" "panel4:right:5:weather@mockturtl:141" "panel4:right:3:keyboard@cinnamon.org:142" "panel4:right:6:calendar@cinnamon.org:144" "panel4:right:4:workspace-name@willurd:152" "panel4:center:2:spacer@cinnamon.org:154" "panel1:center:2:spacer@cinnamon.org:155" "panel4:center:0:spacer@cinnamon.org:156" "panel1:center:0:spacer@cinnamon.org:157" ]; - enabled-desklets = []; + enabled-applets = [ + "panel1:left:0:menu@cinnamon.org:30" + "panel1:right:9:notifications@cinnamon.org:35" + "panel1:right:11:network@cinnamon.org:40" + "panel1:right:12:sound@cinnamon.org:41" + "panel1:right:13:power@cinnamon.org:42" + "panel1:right:15:calendar@cinnamon.org:43" + "panel1:right:14:weather@mockturtl:95" + "panel1:left:1:workspace-switcher@cinnamon.org:116" + "panel1:center:1:window-list@cinnamon.org:121" + "panel1:right:5:keyboard@cinnamon.org:128" + "panel1:right:6:systray@cinnamon.org:130" + "panel1:right:8:xapp-status@cinnamon.org:133" + "panel4:left:0:menu@cinnamon.org:138" + "panel4:left:1:workspace-switcher@cinnamon.org:139" + "panel4:center:1:window-list@cinnamon.org:140" + "panel4:right:5:weather@mockturtl:141" + "panel4:right:3:keyboard@cinnamon.org:142" + "panel4:right:6:calendar@cinnamon.org:144" + "panel4:right:4:workspace-name@willurd:152" + "panel4:center:2:spacer@cinnamon.org:154" + "panel1:center:2:spacer@cinnamon.org:155" + "panel4:center:0:spacer@cinnamon.org:156" + "panel1:center:0:spacer@cinnamon.org:157" + ]; + enabled-desklets = [ ]; enabled-extensions = [ "horizontal-osd@berk-karaal" ]; - favorite-apps = [ "google-chrome.desktop" "cinnamon-settings.desktop" "ulauncher.desktop" "org.gnome.Terminal.desktop" ]; - hotcorner-layout = [ "expo:false:0" "desktop:false:0" "scale:false:0" "desktop:false:0" ]; + favorite-apps = [ + "google-chrome.desktop" + "cinnamon-settings.desktop" + "ulauncher.desktop" + "org.gnome.Terminal.desktop" + ]; + hotcorner-layout = [ + "expo:false:0" + "desktop:false:0" + "scale:false:0" + "desktop:false:0" + ]; next-applet-id = 158; next-desklet-id = 13; no-adjacent-panel-barriers = false; @@ -49,11 +83,36 @@ with lib.hm.gvariant; panel-zone-icon-sizes = "[{\"panelId\": 1, \"left\": 0, \"center\": 0, \"right\": 24}, {\"left\": 0, \"center\": 0, \"right\": 0, \"panelId\": 4}, {\"left\": 0, \"center\": 0, \"right\": 24, \"panelId\": 2}]"; panel-zone-symbolic-icon-sizes = "[{\"panelId\": 1, \"left\": 28, \"center\": 28, \"right\": 16}, {\"left\": 28, \"center\": 28, \"right\": 16, \"panelId\": 4}, {\"left\": 28, \"center\": 28, \"right\": 16, \"panelId\": 2}]"; panel-zone-text-sizes = "[{\"panelId\":1,\"left\":0,\"center\":0,\"right\":0},{\"left\":0,\"center\":0,\"right\":0,\"panelId\":4},{\"left\":0,\"center\":0,\"right\":0,\"panelId\":2}]"; - panels-autohide = [ "1:false" "2:false" "3:true" "4:false" ]; - panels-enabled = [ "1:0:top" "4:1:top" "4:1:top" "2:2:top" ]; - panels-height = [ "1:27" "2:27" "3:30" "4:27" ]; - panels-hide-delay = [ "1:0" "2:0" "3:0" "4:0" ]; - panels-show-delay = [ "1:0" "2:0" "3:0" "4:0" ]; + panels-autohide = [ + "1:false" + "2:false" + "3:true" + "4:false" + ]; + panels-enabled = [ + "1:0:top" + "4:1:top" + "4:1:top" + "2:2:top" + ]; + panels-height = [ + "1:27" + "2:27" + "3:30" + "4:27" + ]; + panels-hide-delay = [ + "1:0" + "2:0" + "3:0" + "4:0" + ]; + panels-show-delay = [ + "1:0" + "2:0" + "3:0" + "4:0" + ]; show-media-keys-osd = "medium"; window-effect-speed = 1; workspace-expo-view-as-grid = true; @@ -122,8 +181,13 @@ with lib.hm.gvariant; }; "org/cinnamon/desktop/keybindings" = { - custom-list = [ "__dummy__" "custom2" "custom3" "custom0" ]; - looking-glass-keybinding = []; + custom-list = [ + "__dummy__" + "custom2" + "custom3" + "custom0" + ]; + looking-glass-keybinding = [ ]; }; "org/cinnamon/desktop/keybindings/custom-keybindings/custom0" = { @@ -139,33 +203,73 @@ with lib.hm.gvariant; }; "org/cinnamon/desktop/keybindings/custom-keybindings/custom3" = { - binding = []; + binding = [ ]; command = "flameshot gui"; name = "screen-shot"; }; "org/cinnamon/desktop/keybindings/media-keys" = { area-screenshot-clip = [ "Print" ]; - screensaver = [ "l" "XF86ScreenSaver" "Cyrillic_de" ]; - screenshot = []; + screensaver = [ + "l" + "XF86ScreenSaver" + "Cyrillic_de" + ]; + screenshot = [ ]; terminal = [ "Return" ]; }; "org/cinnamon/desktop/keybindings/wm" = { close = [ "q" ]; minimize = [ "m" ]; - move-to-workspace-1 = [ "1" "exclam" ]; - move-to-workspace-10 = [ "0" "parenright" ]; - move-to-workspace-11 = [ "underscore" "minus" ]; - move-to-workspace-12 = [ "plus" "equal" ]; - move-to-workspace-2 = [ "2" "at" ]; - move-to-workspace-3 = [ "3" "numbersign" ]; - move-to-workspace-4 = [ "4" "dollar" ]; - move-to-workspace-5 = [ "5" "percent" ]; - move-to-workspace-6 = [ "6" "asciicircum" ]; - move-to-workspace-7 = [ "7" "ampersand" ]; - move-to-workspace-8 = [ "8" "asterisk" ]; - move-to-workspace-9 = [ "9" "parenleft" ]; + move-to-workspace-1 = [ + "1" + "exclam" + ]; + move-to-workspace-10 = [ + "0" + "parenright" + ]; + move-to-workspace-11 = [ + "underscore" + "minus" + ]; + move-to-workspace-12 = [ + "plus" + "equal" + ]; + move-to-workspace-2 = [ + "2" + "at" + ]; + move-to-workspace-3 = [ + "3" + "numbersign" + ]; + move-to-workspace-4 = [ + "4" + "dollar" + ]; + move-to-workspace-5 = [ + "5" + "percent" + ]; + move-to-workspace-6 = [ + "6" + "asciicircum" + ]; + move-to-workspace-7 = [ + "7" + "ampersand" + ]; + move-to-workspace-8 = [ + "8" + "asterisk" + ]; + move-to-workspace-9 = [ + "9" + "parenleft" + ]; switch-to-workspace-1 = [ "1" ]; switch-to-workspace-10 = [ "0" ]; switch-to-workspace-11 = [ "minus" ]; @@ -178,7 +282,11 @@ with lib.hm.gvariant; switch-to-workspace-7 = [ "7" ]; switch-to-workspace-8 = [ "8" ]; switch-to-workspace-9 = [ "9" ]; - switch-to-workspace-up = [ "Up" "F1" "w" ]; + switch-to-workspace-up = [ + "Up" + "F1" + "w" + ]; toggle-fullscreen = [ "f" ]; toggle-maximized = [ "f" ]; }; @@ -246,7 +354,20 @@ with lib.hm.gvariant; num-workspaces = 12; theme = "Arc-Dark"; titlebar-font = "JetBrainsMono Nerd Font 10"; - workspace-names = [ "1. Home" "2. Chats" "3. Music" "4. Notes" "5. Code" "6. Work" "7. GPT" "8. Education" "9. Media" "10. Monitoring" "11. Offtop" "12. Workspace" ]; + workspace-names = [ + "1. Home" + "2. Chats" + "3. Music" + "4. Notes" + "5. Code" + "6. Work" + "7. GPT" + "8. Education" + "9. Media" + "10. Monitoring" + "11. Offtop" + "12. Workspace" + ]; }; "org/cinnamon/gestures" = { @@ -330,4 +451,3 @@ with lib.hm.gvariant; }; }; } - diff --git a/home/modules/cinnamon/default.nix b/home/modules/cinnamon/default.nix index 52746c8..6f2d3e8 100644 --- a/home/modules/cinnamon/default.nix +++ b/home/modules/cinnamon/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.cinnamon; -in { +in +{ imports = [ # ./dconf2nix.nix ]; @@ -20,4 +22,3 @@ in { dconf.enable = true; }; } - diff --git a/home/modules/dconf/default.nix b/home/modules/dconf/default.nix index 36bcfb9..ea185c4 100644 --- a/home/modules/dconf/default.nix +++ b/home/modules/dconf/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.dconf; -in { +in +{ options = { module.dconf.enable = mkEnableOption "Enables dconf"; }; @@ -26,4 +28,3 @@ in { }; }; } - diff --git a/home/modules/default.nix b/home/modules/default.nix index 0cde260..6c86b96 100644 --- a/home/modules/default.nix +++ b/home/modules/default.nix @@ -1,12 +1,9 @@ -{ homeModules -, lib -, ... +{ + self, + allDirs, + ... }: { - # Read all directories from homeModules - imports = builtins.filter (module: lib.pathIsDirectory module) ( - map (module: "${homeModules}/${module}") (builtins.attrNames (builtins.readDir homeModules)) - ); + imports = allDirs "${self}/home/modules"; } - diff --git a/home/modules/emacs/default.nix b/home/modules/emacs/default.nix index cd56e98..ddda6c3 100644 --- a/home/modules/emacs/default.nix +++ b/home/modules/emacs/default.nix @@ -1,14 +1,16 @@ -{ config -, lib -, pkgs -, ... +{ + config, + lib, + pkgs, + ... }: with lib; let cfg = config.module.emacs; -in { +in +{ options = { module.emacs.enable = mkEnableOption "Enable emacs"; }; @@ -20,11 +22,10 @@ in { }; services.emacs = { - enable = true; - package = pkgs.emacs30-pgtk; - client.enable = true; + inherit (config.programs.emacs) package enable; + + client.enable = true; socketActivation.enable = true; }; }; } - diff --git a/home/modules/eza/default.nix b/home/modules/eza/default.nix index 4e0c5a7..b701ad5 100644 --- a/home/modules/eza/default.nix +++ b/home/modules/eza/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.eza; -in { +in +{ options = { module.eza.enable = mkEnableOption "Enables eza"; }; @@ -18,4 +20,3 @@ in { }; }; } - diff --git a/home/modules/fastfetch/default.nix b/home/modules/fastfetch/default.nix index f02770d..f04155f 100644 --- a/home/modules/fastfetch/default.nix +++ b/home/modules/fastfetch/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.fastfetch; -in { +in +{ options = { module.fastfetch = { enable = mkEnableOption "Enable fastfetch"; @@ -26,8 +28,8 @@ in { display = { color = { - keys = "blue"; - title = "blue"; + keys = "blue"; + title = "blue"; }; }; @@ -72,4 +74,3 @@ in { }; }; } - diff --git a/home/modules/firefox/default.nix b/home/modules/firefox/default.nix index 151142d..f4eaeed 100644 --- a/home/modules/firefox/default.nix +++ b/home/modules/firefox/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.firefox; -in { +in +{ options = { module.firefox.enable = mkEnableOption "Enables firefox"; }; @@ -18,4 +20,3 @@ in { }; }; } - diff --git a/home/modules/fish/default.nix b/home/modules/fish/default.nix index 1e03cd2..651808d 100644 --- a/home/modules/fish/default.nix +++ b/home/modules/fish/default.nix @@ -1,22 +1,24 @@ -{ lib -, config -, username -, pkgs -, homeModules -, ... +{ + self, + lib, + config, + username, + pkgs, + ... }: with lib; let cfg = config.module.fish; -in { +in +{ options = { module.fish.enable = mkEnableOption "Enables Fish"; }; imports = [ - "${homeModules}/fish/starship" + "${self}/home/modules/fish/starship" ]; config = mkIf cfg.enable { @@ -89,4 +91,3 @@ in { }; }; } - diff --git a/home/modules/fish/starship/default.nix b/home/modules/fish/starship/default.nix index 3ed961e..90f4f39 100644 --- a/home/modules/fish/starship/default.nix +++ b/home/modules/fish/starship/default.nix @@ -14,12 +14,12 @@ fill.symbol = " "; character = { - error_symbol = "[](bold red)"; - success_symbol = "[ο€Œ](bold green)"; - vimcmd_symbol = "[N](bold blue)"; - vimcmd_visual_symbol = "[V](bold red)"; + error_symbol = "[](bold red)"; + success_symbol = "[ο€Œ](bold green)"; + vimcmd_symbol = "[N](bold blue)"; + vimcmd_visual_symbol = "[V](bold red)"; vimcmd_replace_one_symbol = "[R](bold purple)"; - vimcmd_replace_symbol = "[R](bold purple)"; + vimcmd_replace_symbol = "[R](bold purple)"; }; username = { @@ -38,24 +38,36 @@ disabled = false; }; - nix_shell = { symbol = "οŒ“ "; }; + nix_shell = { + symbol = "οŒ“ "; + }; golang = { style = "blue"; symbol = " "; }; - lua = { symbol = " "; }; + lua = { + symbol = " "; + }; cmake = { style = "green"; symbol = "β–³ "; }; - git_branch = { symbol = " "; }; - rust = { symbol = " "; }; - nodejs = { symbol = " "; }; - docker_context = { symbol = " "; }; + git_branch = { + symbol = " "; + }; + rust = { + symbol = " "; + }; + nodejs = { + symbol = " "; + }; + docker_context = { + symbol = " "; + }; time = { format = "[$time]($style) "; @@ -84,4 +96,3 @@ }; }; } - diff --git a/home/modules/flameshot/default.nix b/home/modules/flameshot/default.nix index 849779c..6699e23 100644 --- a/home/modules/flameshot/default.nix +++ b/home/modules/flameshot/default.nix @@ -1,14 +1,16 @@ -{ lib -, config -, username -, ... +{ + lib, + config, + username, + ... }: with lib; let cfg = config.module.flameshot; -in { +in +{ options = { module.flameshot.enable = mkEnableOption "Enables Flameshot"; }; @@ -40,4 +42,3 @@ in { }; }; } - diff --git a/home/modules/foot/default.nix b/home/modules/foot/default.nix index 907623b..5e5534f 100644 --- a/home/modules/foot/default.nix +++ b/home/modules/foot/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.foot; -in { +in +{ options = { module.foot.enable = mkEnableOption "Enables Foot"; }; @@ -46,4 +48,3 @@ in { }; }; } - diff --git a/home/modules/fuzzel/default.nix b/home/modules/fuzzel/default.nix index 2d22a51..b173e23 100644 --- a/home/modules/fuzzel/default.nix +++ b/home/modules/fuzzel/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.fuzzel; -in { +in +{ options = { module.fuzzel = { enable = mkEnableOption "Enable fuzzel app runner"; @@ -20,4 +22,3 @@ in { }; }; } - diff --git a/home/modules/fzf/default.nix b/home/modules/fzf/default.nix index 755d9b0..bb803cc 100644 --- a/home/modules/fzf/default.nix +++ b/home/modules/fzf/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.fzf; -in { +in +{ options = { module.fzf.enable = mkEnableOption "Enables fzf"; }; @@ -16,8 +18,11 @@ in { programs.fzf = { enable = true; enableFishIntegration = true; - defaultOptions = ["--border" "--preview 'bat --color=always {}'" "--prompt 'Files> '"]; + defaultOptions = [ + "--border" + "--preview 'bat --color=always {}'" + "--prompt 'Files> '" + ]; }; }; } - diff --git a/home/modules/git/default.nix b/home/modules/git/default.nix index 7c83084..b97a331 100644 --- a/home/modules/git/default.nix +++ b/home/modules/git/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.git; -in { +in +{ options = { module.git.enable = mkEnableOption "Enables git"; }; @@ -33,4 +35,3 @@ in { }; }; } - diff --git a/home/modules/helix/default.nix b/home/modules/helix/default.nix index 728dcbf..5a3db79 100644 --- a/home/modules/helix/default.nix +++ b/home/modules/helix/default.nix @@ -1,14 +1,16 @@ -{ lib -, pkgs -, config -, ... +{ + lib, + pkgs, + config, + ... }: with lib; let cfg = config.module.helix; -in { +in +{ options = { module.helix.enable = mkEnableOption "Enables helix"; }; @@ -24,7 +26,7 @@ in { helm-ls nil ]; - + programs.helix = { enable = true; settings = { @@ -35,14 +37,14 @@ in { text-width = 70; bufferline = "multiple"; default-line-ending = "lf"; - rulers = [73]; + rulers = [ 73 ]; cursorline = true; auto-info = true; color-modes = true; lsp = { display-messages = true; - display-inlay-hints = true; + display-inlay-hints = true; }; soft-wrap = { @@ -57,9 +59,24 @@ in { }; statusline = { - left = ["mode" "spinner" "file-modification-indicator" "read-only-indicator"]; - center = [ "version-control" "file-name"]; - right = ["diagnostics" "selections" "position" "file-encoding" "file-line-ending" "file-type"]; + left = [ + "mode" + "spinner" + "file-modification-indicator" + "read-only-indicator" + ]; + center = [ + "version-control" + "file-name" + ]; + right = [ + "diagnostics" + "selections" + "position" + "file-encoding" + "file-line-ending" + "file-type" + ]; separator = "β”‚"; mode = { normal = "NORMAL"; @@ -83,4 +100,3 @@ in { }; }; } - diff --git a/home/modules/htop/default.nix b/home/modules/htop/default.nix index 884968b..66bb879 100644 --- a/home/modules/htop/default.nix +++ b/home/modules/htop/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.htop; -in { +in +{ options = { module.htop.enable = mkEnableOption "Enables htop"; }; @@ -18,4 +20,3 @@ in { }; }; } - diff --git a/home/modules/hypridle/default.nix b/home/modules/hypridle/default.nix index 1073359..60dbbe9 100644 --- a/home/modules/hypridle/default.nix +++ b/home/modules/hypridle/default.nix @@ -1,11 +1,12 @@ -{ config -, lib -, pkgs -, inputs -, hostname -, swayEnable -, hyprlandEnable -, ... +{ + config, + lib, + pkgs, + inputs, + hostname, + swayEnable, + hyprlandEnable, + ... }: with lib; @@ -15,31 +16,38 @@ let suspendCmd = "${pkgs.systemd}/bin/systemctl suspend"; hyprctlCmd = "${inputs.hyprland.packages.${pkgs.system}.hyprland}/bin/hyprctl"; - swaymsg = "${pkgs.sway}/bin/swaymsg"; + swaymsg = "${pkgs.sway}/bin/swaymsg"; hyprlockCmd = "${config.programs.hyprlock.package}/bin/hyprlock"; swaylockCmd = "${pkgs.swaylock}/bin/swaylock"; - lockScreen = if hyprlandEnable - then hyprlockCmd - else if swayEnable - then swaylockCmd - else ""; + lockScreen = + if hyprlandEnable then + hyprlockCmd + else if swayEnable then + swaylockCmd + else + ""; hyprlandOnScreen = "${hyprctlCmd} dispatch dpms on"; hyprlandOffScreen = "${hyprctlCmd} dispatch dpms off"; swayOnScreen = "${swaymsg} 'output * power on'"; swayOffScreen = "${swaymsg} 'output * power off'"; - screenOn = if hyprlandEnable - then hyprlandOnScreen - else if swayEnable - then swayOnScreen - else ""; - screenOff = if hyprlandEnable - then hyprlandOffScreen - else if swayEnable - then swayOffScreen - else ""; -in { + screenOn = + if hyprlandEnable then + hyprlandOnScreen + else if swayEnable then + swayOnScreen + else + ""; + screenOff = + if hyprlandEnable then + hyprlandOffScreen + else if swayEnable then + swayOffScreen + else + ""; +in +{ options = { module.hypridle.enable = mkEnableOption "Enables Hypridle"; }; @@ -58,26 +66,34 @@ in { ignore_dbus_inhibit = false; }; - listener = [ - { - timeout = 300; - on-timeout = screenOff; - on-resume = screenOn; - } - { - timeout = 600; - on-timeout = lockScreen; - on-resume = ""; - } - ] ++ lib.optionals (hostname == "nbox") [ - { - timeout = 900; - on-timeout = suspendCmd; - on-resume = ""; - } - ]; + listener = + [ + { + timeout = 300; + on-timeout = screenOff; + on-resume = screenOn; + } + { + timeout = 600; + on-timeout = lockScreen; + on-resume = ""; + } + ] + ++ lib.optionals (hostname == "nbox") [ + { + timeout = 900; + on-timeout = suspendCmd; + on-resume = ""; + } + ] + ++ lib.optionals (hostname == "pcbox") [ + { + timeout = 7200; + on-timeout = suspendCmd; + on-resume = ""; + } + ]; }; }; }; } - diff --git a/home/modules/hyprland/binds/default.nix b/home/modules/hyprland/binds/default.nix index a37a738..568eaaf 100644 --- a/home/modules/hyprland/binds/default.nix +++ b/home/modules/hyprland/binds/default.nix @@ -1,8 +1,9 @@ -{ config -, self -, lib -, pkgs -, ... +{ + config, + self, + lib, + pkgs, + ... }: with lib; @@ -10,13 +11,17 @@ with lib; let cfg = config.module.hyprland.binds; - audioControl = "${pkgs.pulseaudio}/bin/pactl"; - brightnessControl = "${pkgs.brightnessctl}/bin/brightnessctl"; - screenshotArea = "${pkgs.grimblast}/bin/grimblast --notify --freeze copy area"; - screenshotScreen = "${pkgs.grimblast}/bin/grimblast --notify --freeze copy output"; - appLauncher = "${pkgs.wofi}/bin/wofi --show drun"; - cliphist = "${pkgs.cliphist}/bin/cliphist list | ${appLauncher} -d | ${pkgs.cliphist}/bin/cliphist decode | ${pkgs.wl-clipboard}/bin/wl-copy"; -in { + terminal = config.module.defaults.terminalCmd; + appLauncher = config.module.defaults.appLauncherCmd; + audioControl = config.module.defaults.audioControlCmd; + brightnessControl = config.module.defaults.brightnessControlCmd; + clipHist = config.module.defaults.clipHistCmd; + notificationsApp = config.module.defaults.notificationsAppCmd; + + screenshotArea = "${pkgs.grimblast}/bin/grimblast --notify --freeze copy area"; + screenshotScreen = "${pkgs.grimblast}/bin/grimblast --notify --freeze copy output"; +in +{ options = { module.hyprland.binds.enable = mkEnableOption "Enables binds in Hyprland"; }; @@ -36,11 +41,9 @@ in { "[workspace 4 silent] ${pkgs.obsidian}/bin/obsidian" - "[workspace 5 silent] ${pkgs.foot}/bin/foot" - "[workspace 5 silent] ${pkgs.foot}/bin/foot" - "[workspace 5 silent] ${pkgs.foot}/bin/foot" - - # "$[workspace 5 silent] {pkgs.vscode}/bin/code" + "[workspace 5 silent] ${terminal}" + "[workspace 5 silent] ${terminal}" + "[workspace 5 silent] ${terminal}" "[workspace 6 silent] ${pkgs.firefox}/bin/firefox -P work" @@ -106,11 +109,10 @@ in { ", xf86audiomute, exec, ${audioControl} set-sink-mute @DEFAULT_SINK@ toggle" # Terminal - # "SUPER, Return, exec, ${pkgs.alacritty}/bin/alacritty" - "SUPER, Return, exec, ${pkgs.foot}/bin/foot" + "SUPER, Return, exec, ${terminal}" # Notifications - "SUPER, N, exec, ${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw" + "SUPER, N, exec, ${notificationsApp}" # Picker "SUPER, P, exec, ${screenshotArea}" @@ -120,13 +122,13 @@ in { "SHIFT, Print, exec, ${screenshotScreen}" # Launchers - "CTRL, Space, exec, ${appLauncher}" + "SUPER, d, exec, ${appLauncher}" # Cliphist - "SUPER, C, exec, ${cliphist}" + "SUPER, C, exec, ${clipHist}" # File manager - "SUPER, E, exec, ${pkgs.nemo}/bin/nemo" + "SUPER, E, exec, ${pkgs.xfce.thunar}/bin/thunar" # Fullscreen "SUPER, Z, fullscreen" @@ -144,21 +146,32 @@ in { ]; # Mouse bindings - bindm = ["SUPER, mouse:272, movewindow" "SUPER, mouse:273, resizewindow"]; + bindm = [ + "SUPER, mouse:272, movewindow" + "SUPER, mouse:273, resizewindow" + ]; # layer rules - layerrule = let - toRegex = list: let - elements = lib.concatStringsSep "|" list; - in "^(${elements})$"; - - layers = [ - "gtk-layer-shell" - "swaync-control-center" - "swaync-notification-window" - "waybar" + layerrule = + let + toRegex = + list: + let + elements = lib.concatStringsSep "|" list; + in + "^(${elements})$"; + + layers = [ + "gtk-layer-shell" + "swaync-control-center" + "swaync-notification-window" + "waybar" + ]; + in + [ + "blur, ${toRegex layers}" + "ignorealpha 0.5, ${toRegex layers}" ]; - in ["blur, ${toRegex layers}" "ignorealpha 0.5, ${toRegex layers}"]; # Window rules windowrulev2 = [ @@ -167,9 +180,6 @@ in { "size 900 500, class:^(xdg-desktop-portal-gtk)$" "dimaround, class:^(xdg-desktop-portal-gtk)$" - # Firefox - # "workspace 1, class:^(firefox)$" - # Telegram "workspace 2, class:^(org.telegram.desktop)$" "float,size 900 500,title:^(Choose Files)" @@ -177,9 +187,6 @@ in { # Obsidian "workspace 4, class:^(obsidian)$" - # VSCode - # "workspace 5, class:^(code-url-handler)$" - # Vesktop "workspace 8, class:^(vesktop)$" @@ -190,4 +197,3 @@ in { }; }; } - diff --git a/home/modules/hyprland/default.nix b/home/modules/hyprland/default.nix index 3680785..6e95ad0 100644 --- a/home/modules/hyprland/default.nix +++ b/home/modules/hyprland/default.nix @@ -1,19 +1,21 @@ -{ inputs -, config -, lib -, pkgs -, homeModules -, ... +{ + inputs, + self, + config, + lib, + pkgs, + ... }: with lib; let cfg = config.module.hyprland; -in { +in +{ imports = [ - "${homeModules}/hyprland/binds" - "${homeModules}/hyprland/monitors" + "${self}/home/modules/hyprland/binds" + "${self}/home/modules/hyprland/monitors" ]; options = { @@ -48,7 +50,10 @@ in { animations = { enabled = true; - bezier = [ "md3_decel, 0.05, 0.7, 0.1, 1" "workspace,0.17, 1.17, 0.3,1" ]; + bezier = [ + "md3_decel, 0.05, 0.7, 0.1, 1" + "workspace,0.17, 1.17, 0.3,1" + ]; animation = [ "border, 1, 2, default" @@ -111,4 +116,3 @@ in { }; }; } - diff --git a/home/modules/hyprland/monitors/default.nix b/home/modules/hyprland/monitors/default.nix index 4cdcecc..8653f1c 100644 --- a/home/modules/hyprland/monitors/default.nix +++ b/home/modules/hyprland/monitors/default.nix @@ -1,7 +1,8 @@ -{ config -, lib -, hostname -, ... +{ + config, + lib, + hostname, + ... }: with lib; @@ -9,12 +10,18 @@ with lib; let cfg = config.module.hyprland.monitors; - monitorsSettings = - if hostname == "pcbox" then ["DP-1,1920x1080@144,0x0,1" "DP-2,1920x1080@144,1920x0,1"] - else if hostname == "nbox" then ["eDP-1,2880x1800@120,0x0,1.8"] - else []; + monitorsSettings = + if hostname == "pcbox" then + [ + "DP-1,1920x1080@144,0x0,1" + "DP-2,1920x1080@144,1920x0,1" + ] + else if hostname == "nbox" then + [ "eDP-1,2880x1800@120,0x0,1.8" ] + else + [ ]; - workspacesSettings = + workspacesSettings = if hostname == "pcbox" then [ "1, monitor:DP-2, default:true" @@ -30,7 +37,7 @@ let "11, monitor:DP-1, default:true" "12, monitor:DP-1, default:true" ] - else if hostname == "nbox" then + else if hostname == "nbox" then [ "1, monitor:eDP-1, default:true" "2, monitor:eDP-1, default:true" @@ -45,8 +52,10 @@ let # "11, monitor:eDP-1, default:true" # "12, monitor:eDP-1, default:true" ] - else []; -in { + else + [ ]; +in +{ options = { module.hyprland.monitors.enable = mkEnableOption "Enables monitors in Hyprland"; }; @@ -58,4 +67,3 @@ in { }; }; } - diff --git a/home/modules/hyprlock/default.nix b/home/modules/hyprlock/default.nix index 0d85ed7..146cc4c 100644 --- a/home/modules/hyprlock/default.nix +++ b/home/modules/hyprlock/default.nix @@ -1,15 +1,17 @@ -{ self -, config -, lib -, pkgs -, ... +{ + self, + config, + lib, + pkgs, + ... }: with lib; let cfg = config.module.hyprlock; -in { +in +{ options = { module.hyprlock.enable = mkEnableOption "Enables Hyprlock"; }; @@ -121,4 +123,3 @@ in { }; }; } - diff --git a/home/modules/hyprpaper/default.nix b/home/modules/hyprpaper/default.nix index dbc0f6d..e22682f 100644 --- a/home/modules/hyprpaper/default.nix +++ b/home/modules/hyprpaper/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.hyprpaper; -in { +in +{ options = { module.hyprpaper.enable = mkEnableOption "Enables hyprpaper"; }; @@ -23,4 +25,3 @@ in { }; }; } - diff --git a/home/modules/lazygit/default.nix b/home/modules/lazygit/default.nix index 42f9995..78d154a 100644 --- a/home/modules/lazygit/default.nix +++ b/home/modules/lazygit/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.lazygit; -in { +in +{ options = { module.lazygit.enable = mkEnableOption "Enables lazygit"; }; @@ -18,4 +20,3 @@ in { }; }; } - diff --git a/home/modules/librewolf/default.nix b/home/modules/librewolf/default.nix index 85d6c0e..1d38be9 100644 --- a/home/modules/librewolf/default.nix +++ b/home/modules/librewolf/default.nix @@ -1,13 +1,16 @@ -{ lib -, config -, ... +{ + lib, + config, + pkgs, + ... }: with lib; let cfg = config.module.librewolf; -in { +in +{ options = { module.librewolf.enable = mkEnableOption "Enables librewolf"; }; @@ -16,16 +19,248 @@ in { programs.librewolf = { enable = true; + profiles = { + work = { + id = 1; + name = "Work"; + + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + ublock-origin + vimium + ]; + + search = { + force = true; + default = "Google"; + + order = [ + "Google" + "DuckDuckGo" + ]; + + engines = { + "Bing".metaData.hidden = true; + "Amazon.com".metaData.hidden = true; + }; + }; + }; + + default = { + id = 0; + name = "Default"; + isDefault = true; + + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + ublock-origin + sponsorblock + return-youtube-dislikes + foxyproxy-standard + vimium + wappalyzer + ]; + + search = { + force = true; + default = "nogoo"; + + order = [ + "Google" + "DuckDuckGo" + "4get" + "nogoo" + "Youtube" + "NixOS Options" + "Nix Packages" + "GitHub" + "Home Manager" + ]; + + engines = { + "Bing".metaData.hidden = true; + "Amazon.com".metaData.hidden = true; + + "4get" = { + updateInterval = 24 * 60 * 60 * 1000; + definedAliases = [ "@4get" ]; + urls = [ + { + template = "https://4get.bloat.cat/web"; + params = [ + { + name = "s"; + value = "{searchTerms}"; + } + ]; + } + ]; + }; + + "nogoo" = { + updateInterval = 24 * 60 * 60 * 1000; + definedAliases = [ "@nogoo" ]; + urls = [ + { + template = "https://nogoo.me/search"; + params = [ + { + name = "q"; + value = "{searchTerms}"; + } + ]; + } + ]; + }; + + "YouTube" = { + iconUpdateURL = "https://youtube.com/favicon.ico"; + updateInterval = 24 * 60 * 60 * 1000; + definedAliases = [ "@yt" ]; + urls = [ + { + template = "https://www.youtube.com/results"; + params = [ + { + name = "search_query"; + value = "{searchTerms}"; + } + ]; + } + ]; + }; + + "Nix Packages" = { + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + }; + + "NixOS Options" = { + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@no" ]; + urls = [ + { + template = "https://search.nixos.org/options"; + params = [ + { + name = "channel"; + value = "unstable"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + }; + + "GitHub" = { + iconUpdateURL = "https://github.com/favicon.ico"; + updateInterval = 24 * 60 * 60 * 1000; + definedAliases = [ "@gh" ]; + + urls = [ + { + template = "https://github.com/search"; + params = [ + { + name = "q"; + value = "{searchTerms}"; + } + ]; + } + ]; + }; + + "Home Manager" = { + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@hm" ]; + + url = [ + { + template = "https://mipmip.github.io/home-manager-option-search/"; + params = [ + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + }; + }; + }; + }; + }; + settings = { "webgl.disabled" = false; "privacy.resistFingerprinting" = false; "privacy.clearOnShutdown.history" = false; "privacy.clearOnShutdown.cookies" = false; + "privacy.clearOnShutdown_v2.cookiesAndStorage" = false; "network.cookie.lifetimePolicy" = 0; "browser.fullscreen.autohide" = false; + "ui.key.menuAccessKeyFocuses" = false; + + "browser.translations.enable" = false; + "geo.enabled" = false; + "media.ffmpeg.vaapi.enabled" = true; + "media.rdd-ffmpeg.enabled" = true; + "widget.dmabuf.force-enabled" = true; + "gfx.webrender.all" = true; + "gfx.webrender.compositor" = true; + "image.jxl.enabled" = true; + + # Disable some useless stuff + "extensions.pocket.enabled" = false; # disable pocket, save links, send tabs + "extensions.abuseReport.enabled" = false; # don't show 'report abuse' in extensions + "extensions.formautofill.creditCards.enabled" = false; # don't auto-fill credit card information + "identity.fxaccounts.enabled" = false; # disable firefox login + "identity.fxaccounts.toolbar.enabled" = false; + "identity.fxaccounts.pairing.enabled" = false; + "identity.fxaccounts.commands.enabled" = false; + "browser.contentblocking.report.lockwise.enabled" = false; # don't use firefox password manger + "browser.uitour.enabled" = false; # no tutorial please + "browser.newtabpage.activity-stream.showSponsored" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + + # Disable telemetry for privacy reasons + "toolkit.telemetry.archive.enabled" = false; + "toolkit.telemetry.enabled" = false; # enforced by nixos + "toolkit.telemetry.server" = ""; + "toolkit.telemetry.unified" = false; + "extensions.webcompat-reporter.enabled" = false; # don't report compability problems to mozilla + "datareporting.policy.dataSubmissionEnabled" = false; + "datareporting.healthreport.uploadEnabled" = false; + "browser.ping-centre.telemetry" = false; + "browser.urlbar.eventTelemetry.enabled" = false; # (default) + + # disable annoying web features + "dom.push.enabled" = false; # no notifications, really... + "dom.push.connection.enabled" = false; + "dom.battery.enabled" = false; # you don't need to see my battery... + + "extensions.autoDisableScopes" = 0; + "extensions.enabledScopes" = 15; + "browser.bookmarks.addedImportButton" = false; + "browser.toolbars.bookmarks.visibility" = "never"; }; }; }; } - diff --git a/home/modules/neofetch/default.nix b/home/modules/neofetch/default.nix index 3fa03e1..aaad0ed 100644 --- a/home/modules/neofetch/default.nix +++ b/home/modules/neofetch/default.nix @@ -1,22 +1,23 @@ -{ pkgs -, lib -, config -, homeModules -, ... +{ + self, + pkgs, + lib, + config, + ... }: with lib; let cfg = config.module.neofetch; -in { +in +{ options = { module.neofetch.enable = mkEnableOption "Enables neofetch"; }; config = mkIf cfg.enable { home.packages = [ pkgs.neofetch ]; - xdg.configFile."neofetch/config.conf".source = "${homeModules}/neofetch/neofetch.conf"; + xdg.configFile."neofetch/config.conf".source = "${self}/home/modules/neofetch/neofetch.conf"; }; } - diff --git a/home/modules/neovim/config/init.lua b/home/modules/neovim/config/init.lua index 6933571..dbc863e 100644 --- a/home/modules/neovim/config/init.lua +++ b/home/modules/neovim/config/init.lua @@ -1,2 +1 @@ -require('config') - +require("config") diff --git a/home/modules/neovim/config/lua/config/autocmds.lua b/home/modules/neovim/config/lua/config/autocmds.lua index f09261f..de5b538 100644 --- a/home/modules/neovim/config/lua/config/autocmds.lua +++ b/home/modules/neovim/config/lua/config/autocmds.lua @@ -1,7 +1,7 @@ local autocmd = vim.api.nvim_create_autocmd local function check_git_repo() - local cmd = "git rev-parse --is-inside-work-tree" + local cmd = "git rev-parse --is-inside-work-tree" if vim.fn.system(cmd) == "true\n" then vim.api.nvim_exec_autocmds("User", { pattern = "InGitRepo" }) return true @@ -14,8 +14,7 @@ autocmd({ "VimEnter", "DirChanged" }, { end, }) -autocmd({"VimLeave", "VimSuspend"}, { - pattern = "*", - command = "set guicursor=a:ver25" +autocmd({ "VimLeave", "VimSuspend" }, { + pattern = "*", + command = "set guicursor=a:ver25", }) - diff --git a/home/modules/neovim/config/lua/config/init.lua b/home/modules/neovim/config/lua/config/init.lua index 56262d2..bba220d 100644 --- a/home/modules/neovim/config/lua/config/init.lua +++ b/home/modules/neovim/config/lua/config/init.lua @@ -1,5 +1,4 @@ -require('config.options') -require('config.lazy') -require('config.keymaps') -require('config.autocmds') - +require("config.options") +require("config.lazy") +require("config.keymaps") +require("config.autocmds") diff --git a/home/modules/neovim/config/lua/config/keymaps.lua b/home/modules/neovim/config/lua/config/keymaps.lua index 8d471f4..e223a88 100644 --- a/home/modules/neovim/config/lua/config/keymaps.lua +++ b/home/modules/neovim/config/lua/config/keymaps.lua @@ -1,10 +1,10 @@ local map = vim.keymap.set local opts = { noremap = true, silent = true } -local builtin = require('telescope.builtin') +local builtin = require("telescope.builtin") local function escape(str) - local escape_chars = [[;,."|\]] - return vim.fn.escape(str, escape_chars) + local escape_chars = [[;,."|\]] + return vim.fn.escape(str, escape_chars) end -- Russian layout @@ -14,13 +14,13 @@ local en = [[`qwertyuiop[]asdfghjkl;'zxcvbnm]] local ru = [[Ρ‘ΠΉΡ†ΡƒΠΊΠ΅Π½Π³ΡˆΡ‰Π·Ρ…ΡŠΡ„Ρ‹Π²Π°ΠΏΡ€ΠΎΠ»Π΄ΠΆΡΡΡ‡ΡΠΌΠΈΡ‚ΡŒ]] vim.opt.langmap = vim.fn.join({ - escape(ru_shift) .. ';' .. escape(en_shift), - escape(ru) .. ';' .. escape(en), -}, ',') + escape(ru_shift) .. ";" .. escape(en_shift), + escape(ru) .. ";" .. escape(en), +}, ",") -- Base -- nnoremap , :nohlsearch -map('n', ',', 'nohlsearch') --, opts) +map("n", ",", "nohlsearch") --, opts) map({ "n", "x" }, "H", "^", { desc = "Go to start line" }) map({ "n", "x" }, "L", "g_", { desc = "Go to end line" }) map("n", "", "ggG", { desc = "Select All" }) @@ -29,30 +29,29 @@ map("n", "", ":wincmd h", { silent = true, desc = "Focus Right" }) map("n", "", ":wincmd l", { silent = true, desc = "Focus Left" }) map("n", "", ":wincmd j", { silent = true, desc = "Focus Bottom" }) map("n", "", ":wincmd k", { silent = true, desc = "Focus Top" }) -map("n", "gn", ":Neogit", { silent = true }) -- BarBar -- Move to previous/next -map('n', '', 'BufferPrevious', opts) -map('n', '', 'BufferNext', opts) +map("n", "", "BufferPrevious", opts) +map("n", "", "BufferNext", opts) -- Re-order to previous/next -map('n', '', 'BufferMovePrevious', opts) -map('n', '>', 'BufferMoveNext', opts) +map("n", "", "BufferMovePrevious", opts) +map("n", ">", "BufferMoveNext", opts) -- Goto buffer in position... -map('n', '', 'BufferGoto 1', opts) -map('n', '', 'BufferGoto 2', opts) -map('n', '', 'BufferGoto 3', opts) -map('n', '', 'BufferGoto 4', opts) -map('n', '', 'BufferGoto 5', opts) -map('n', '', 'BufferGoto 6', opts) -map('n', '', 'BufferGoto 7', opts) -map('n', '', 'BufferGoto 8', opts) -map('n', '', 'BufferGoto 9', opts) -map('n', '', 'BufferLast', opts) +map("n", "", "BufferGoto 1", opts) +map("n", "", "BufferGoto 2", opts) +map("n", "", "BufferGoto 3", opts) +map("n", "", "BufferGoto 4", opts) +map("n", "", "BufferGoto 5", opts) +map("n", "", "BufferGoto 6", opts) +map("n", "", "BufferGoto 7", opts) +map("n", "", "BufferGoto 8", opts) +map("n", "", "BufferGoto 9", opts) +map("n", "", "BufferLast", opts) -- Pin/unpin buffer -map('n', '', 'BufferPin', opts) +map("n", "", "BufferPin", opts) -- Close buffer -map('n', '', 'BufferClose', opts) +map("n", "", "BufferClose", opts) -- Wipeout buffer -- :BufferWipeout -- Close commands @@ -62,27 +61,26 @@ map('n', '', 'BufferClose', opts) -- :BufferCloseBuffersLeft -- :BufferCloseBuffersRight -- Magic buffer-picking mode -map('n', '', 'BufferPick', opts) +map("n", "", "BufferPick", opts) -- Sort automatically by... -map('n', 'bb', 'BufferOrderByBufferNumber', opts) -map('n', 'bn', 'BufferOrderByName', opts) -map('n', 'bd', 'BufferOrderByDirectory', opts) -map('n', 'bl', 'BufferOrderByLanguage', opts) -map('n', 'bw', 'BufferOrderByWindowNumber', opts) +map("n", "bb", "BufferOrderByBufferNumber", opts) +map("n", "bn", "BufferOrderByName", opts) +map("n", "bd", "BufferOrderByDirectory", opts) +map("n", "bl", "BufferOrderByLanguage", opts) +map("n", "bw", "BufferOrderByWindowNumber", opts) -- Other: -- :BarbarEnable - enables barbar (enabled by default) -- :BarbarDisable - very bad command, should never be used --- NeoGit -map("n", "gn", ":Neogit", { silent = true }) +-- Git +map("n", "gn", ":LazyGit", { silent = true }) -- Nvim Tree map("n", "", ":NvimTreeToggle", { silent = true }) -- Telescope -map('n', 'ff', builtin.find_files, {}) -map('n', 'fg', builtin.live_grep, {}) -map('n', 'fb', builtin.buffers, {}) -map('n', 'fh', builtin.help_tags, {}) - +map("n", "ff", builtin.find_files, {}) +map("n", "fg", builtin.live_grep, {}) +map("n", "fb", builtin.buffers, {}) +map("n", "fh", builtin.help_tags, {}) diff --git a/home/modules/neovim/config/lua/config/lazy.lua b/home/modules/neovim/config/lua/config/lazy.lua index 8c1ec71..3601f39 100644 --- a/home/modules/neovim/config/lua/config/lazy.lua +++ b/home/modules/neovim/config/lua/config/lazy.lua @@ -2,61 +2,56 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local configs = "plugins" if not (vim.uv or vim.loop).fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) end vim.opt.rtp:prepend(lazypath) -require("lazy").setup( - configs, - - { - defaults = { - lazy = true, - autocmds = true, - keymaps = true, - }, - - rocks = { - enabled = false, - }, - - ui = { - title = "Plugin Manager", - title_pos = "center", - - icons = { - cmd = "ξ―‡ ", - config = "", - event = "ξͺ†", - ft = "οƒΆ ", - init = " ", - import = " ", - keys = "ο„œ ", - lazy = "σ°‚  ", - loaded = "●", - not_loaded = "β—‹", - plugin = "ο’‡ ", - runtime = "ξŸ… ", - source = "ο„‘ ", - start = "ξ«“", - task = "βœ” ", - - list = { - "●", - "➜", - "β˜…", - "β€’", - }, - }, - }, - } -) - +require("lazy").setup(configs, { + defaults = { + lazy = true, + autocmds = true, + keymaps = true, + }, + + rocks = { + enabled = false, + }, + + ui = { + title = "Plugin Manager", + title_pos = "center", + + icons = { + cmd = "ξ―‡ ", + config = "", + event = "ξͺ†", + ft = "οƒΆ ", + init = " ", + import = " ", + keys = "ο„œ ", + lazy = "σ°‚  ", + loaded = "●", + not_loaded = "β—‹", + plugin = "ο’‡ ", + runtime = "ξŸ… ", + source = "ο„‘ ", + start = "ξ«“", + task = "βœ” ", + + list = { + "●", + "➜", + "β˜…", + "β€’", + }, + }, + }, +}) diff --git a/home/modules/neovim/config/lua/config/options.lua b/home/modules/neovim/config/lua/config/options.lua index bcd2efa..b8b2a33 100644 --- a/home/modules/neovim/config/lua/config/options.lua +++ b/home/modules/neovim/config/lua/config/options.lua @@ -1,22 +1,21 @@ local opt = vim.opt -local g = vim.g +local g = vim.g -opt.mouse = "a" -opt.colorcolumn = "79" -opt.encoding = "utf-8" -opt.clipboard = "unnamedplus" -opt.fileformat = "unix" -opt.number = true +opt.mouse = "a" +opt.colorcolumn = "79" +opt.encoding = "utf-8" +opt.clipboard = "unnamedplus" +opt.fileformat = "unix" +opt.number = true opt.relativenumber = true -opt.swapfile = false -opt.scrolloff = 7 -opt.tabstop = 2 -opt.shiftwidth = 2 -opt.softtabstop = 2 -opt.expandtab = true -opt.smartindent = true +opt.swapfile = false +opt.scrolloff = 7 +opt.tabstop = 2 +opt.shiftwidth = 2 +opt.softtabstop = 2 +opt.expandtab = true +opt.smartindent = true -g.mapleader = "," -g.editorconfig = false +g.mapleader = "," +g.editorconfig = false -- g.nord_italic = false - diff --git a/home/modules/neovim/config/lua/lsp/handlers.lua b/home/modules/neovim/config/lua/lsp/handlers.lua index 13aaedb..83e348f 100644 --- a/home/modules/neovim/config/lua/lsp/handlers.lua +++ b/home/modules/neovim/config/lua/lsp/handlers.lua @@ -21,7 +21,7 @@ M.on_attach = function(client, bufnr) end map("n", "K", vim.lsp.buf.hover) -- map("i", "", "lua vim.lsp.buf.signature_help()") - map("n", "gd", vim.lsp.buf.definition) + map("n", "gd", vim.lsp.buf.definition) map("n", "rf", vim.lsp.buf.references) map("n", "ca", vim.lsp.buf.code_action) map("n", "rn", vim.lsp.buf.rename) @@ -58,4 +58,3 @@ M.on_attach = function(client, bufnr) end return M - diff --git a/home/modules/neovim/config/lua/lsp/init.lua b/home/modules/neovim/config/lua/lsp/init.lua index 83fefca..cf744dc 100644 --- a/home/modules/neovim/config/lua/lsp/init.lua +++ b/home/modules/neovim/config/lua/lsp/init.lua @@ -1,34 +1,32 @@ local status_ok, lsp = pcall(require, "lspconfig") if not status_ok then - return + return end -- require('lsp.handlers').diagnostic() local servers = { - "gopls" - -- , "nil_ls" - , "lua_ls" - , "jsonls" - , "pyright" - , "yamlls" - , "ansiblels" - , "helm_ls" - , "dockerls" - , "docker_compose_language_service" - , "nixd" - -- , "gitlab-ci-ls" + "gopls", -- , "nil_ls" + "lua_ls", + "jsonls", + "pyright", + "yamlls", + "ansiblels", + "helm_ls", + "dockerls", + "docker_compose_language_service", + "nixd", + -- , "gitlab-ci-ls" } for _, server in pairs(servers) do - local opts = { - on_attach = require('lsp.handlers').on_attach, - capabilities = require('lsp.handlers').capabilities, - } - local has_server_opts, server_opts = pcall(require, "lsp.settings." .. server) - if has_server_opts then - opts = vim.tbl_deep_extend("force", server_opts, opts) - end - lsp[server].setup(opts) + local opts = { + on_attach = require("lsp.handlers").on_attach, + capabilities = require("lsp.handlers").capabilities, + } + local has_server_opts, server_opts = pcall(require, "lsp.settings." .. server) + if has_server_opts then + opts = vim.tbl_deep_extend("force", server_opts, opts) + end + lsp[server].setup(opts) end - diff --git a/home/modules/neovim/config/lua/lsp/settings/ansiblels.lua b/home/modules/neovim/config/lua/lsp/settings/ansiblels.lua index 9d16fa1..c20b886 100644 --- a/home/modules/neovim/config/lua/lsp/settings/ansiblels.lua +++ b/home/modules/neovim/config/lua/lsp/settings/ansiblels.lua @@ -1,22 +1,22 @@ return { - settings = { - ansible = { - ansible = { - path = "ansible" - }, - executionEnvironment = { - enabled = false - }, - python = { - interpreterPath = "python" - }, - validation = { - enabled = true, - lint = { - enabled = true, - path = "ansible-lint" - } - } - } - }, + settings = { + ansible = { + ansible = { + path = "ansible", + }, + executionEnvironment = { + enabled = false, + }, + python = { + interpreterPath = "python", + }, + validation = { + enabled = true, + lint = { + enabled = true, + path = "ansible-lint", + }, + }, + }, + }, } diff --git a/home/modules/neovim/config/lua/lsp/settings/dockerls.lua b/home/modules/neovim/config/lua/lsp/settings/dockerls.lua index 6aa641e..7af4375 100644 --- a/home/modules/neovim/config/lua/lsp/settings/dockerls.lua +++ b/home/modules/neovim/config/lua/lsp/settings/dockerls.lua @@ -1,12 +1,11 @@ return { - settings = { - docker = { - languageserver = { - formatter = { - ignoreMultilineInstructions = true, - }, - }, - }, - }, + settings = { + docker = { + languageserver = { + formatter = { + ignoreMultilineInstructions = true, + }, + }, + }, + }, } - diff --git a/home/modules/neovim/config/lua/lsp/settings/gopls.lua b/home/modules/neovim/config/lua/lsp/settings/gopls.lua index a32108d..59edbb9 100644 --- a/home/modules/neovim/config/lua/lsp/settings/gopls.lua +++ b/home/modules/neovim/config/lua/lsp/settings/gopls.lua @@ -1,20 +1,19 @@ return { - settings = { - gopls = { - hints = { - assignVariableTypes = true, - compositeLiteralFields = true, - compositeLiteralTypes = true, - constantValues = true, - functionTypeParameters = true, - parameterNames = true, - rangeVariableTypes = true, - }, - usePlaceholders = true, - completeUnimported = true, - staticcheck = true, - semanticTokens = true, - }, - }, + settings = { + gopls = { + hints = { + assignVariableTypes = true, + compositeLiteralFields = true, + compositeLiteralTypes = true, + constantValues = true, + functionTypeParameters = true, + parameterNames = true, + rangeVariableTypes = true, + }, + usePlaceholders = true, + completeUnimported = true, + staticcheck = true, + semanticTokens = true, + }, + }, } - diff --git a/home/modules/neovim/config/lua/lsp/settings/helm_ls.lua b/home/modules/neovim/config/lua/lsp/settings/helm_ls.lua index c46d4e2..d115452 100644 --- a/home/modules/neovim/config/lua/lsp/settings/helm_ls.lua +++ b/home/modules/neovim/config/lua/lsp/settings/helm_ls.lua @@ -1,10 +1,9 @@ return { - settings = { - ['helm-ls'] = { - yamlls = { - path = "yaml-language-server", - } - } - }, + settings = { + ["helm-ls"] = { + yamlls = { + path = "yaml-language-server", + }, + }, + }, } - diff --git a/home/modules/neovim/config/lua/lsp/settings/jsonls.lua b/home/modules/neovim/config/lua/lsp/settings/jsonls.lua index b428e04..5eb5a19 100644 --- a/home/modules/neovim/config/lua/lsp/settings/jsonls.lua +++ b/home/modules/neovim/config/lua/lsp/settings/jsonls.lua @@ -6,4 +6,3 @@ return { }, }, } - diff --git a/home/modules/neovim/config/lua/lsp/settings/lua_ls.lua b/home/modules/neovim/config/lua/lsp/settings/lua_ls.lua index 174f79f..4b53f97 100644 --- a/home/modules/neovim/config/lua/lsp/settings/lua_ls.lua +++ b/home/modules/neovim/config/lua/lsp/settings/lua_ls.lua @@ -13,4 +13,3 @@ return { }, }, } - diff --git a/home/modules/neovim/config/lua/lsp/settings/nil_ls.lua b/home/modules/neovim/config/lua/lsp/settings/nil_ls.lua index 3ca5647..233d4b9 100644 --- a/home/modules/neovim/config/lua/lsp/settings/nil_ls.lua +++ b/home/modules/neovim/config/lua/lsp/settings/nil_ls.lua @@ -10,4 +10,5 @@ }, }, } -]]-- +]] +-- diff --git a/home/modules/neovim/config/lua/lsp/settings/pyright.lua b/home/modules/neovim/config/lua/lsp/settings/pyright.lua index 587cf33..6a0c23c 100644 --- a/home/modules/neovim/config/lua/lsp/settings/pyright.lua +++ b/home/modules/neovim/config/lua/lsp/settings/pyright.lua @@ -10,4 +10,3 @@ return { }, }, } - diff --git a/home/modules/neovim/config/lua/lsp/settings/yamlls.lua b/home/modules/neovim/config/lua/lsp/settings/yamlls.lua index 7c8e46b..28929ce 100644 --- a/home/modules/neovim/config/lua/lsp/settings/yamlls.lua +++ b/home/modules/neovim/config/lua/lsp/settings/yamlls.lua @@ -1,10 +1,12 @@ return { - settings = { - schemas = { - ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml", - ["https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json"] = {"ci/*.yml", ".gitlab-ci.yml"}, - kubernetes = "templates/**", - }, - }, + settings = { + schemas = { + ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml", + ["https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json"] = { + "ci/*.yml", + ".gitlab-ci.yml", + }, + kubernetes = "templates/**", + }, + }, } - diff --git a/home/modules/neovim/config/lua/plugins/auto-sessions.lua b/home/modules/neovim/config/lua/plugins/auto-sessions.lua index 8060823..661348b 100644 --- a/home/modules/neovim/config/lua/plugins/auto-sessions.lua +++ b/home/modules/neovim/config/lua/plugins/auto-sessions.lua @@ -1,19 +1,18 @@ return { - { - 'rmagatti/auto-session', - enable = true, - lazy = false, + { + "rmagatti/auto-session", + enable = true, + lazy = false, - config = function() - require("auto-session").setup({ - log_level = "error", - auto_session_enabled = true, - auto_session_root_dir = vim.fn.stdpath('data').."/sessions/", - pre_save_cmds = { close_floating_windows, close_toggleterm, "NvimTreeClose", }, - post_restore_cmds = { clear_jumps, "NvimTreeOpen", }, - save_extra_cmds = { "NvimTreeOpen", }, - }) - end, - }, + config = function() + require("auto-session").setup({ + log_level = "error", + auto_session_enabled = true, + auto_session_root_dir = vim.fn.stdpath("data") .. "/sessions/", + pre_save_cmds = { close_floating_windows, close_toggleterm, "NvimTreeClose" }, + post_restore_cmds = { clear_jumps, "NvimTreeOpen" }, + save_extra_cmds = { "NvimTreeOpen" }, + }) + end, + }, } - diff --git a/home/modules/neovim/config/lua/plugins/autopairs.lua b/home/modules/neovim/config/lua/plugins/autopairs.lua index 520baa6..cb2d0a5 100644 --- a/home/modules/neovim/config/lua/plugins/autopairs.lua +++ b/home/modules/neovim/config/lua/plugins/autopairs.lua @@ -1,39 +1,38 @@ return { - { - "windwp/nvim-autopairs", - enabled = true, - event = "InsertEnter", + { + "windwp/nvim-autopairs", + enabled = true, + event = "InsertEnter", - config = function() - local autopairs = require("nvim-autopairs") - local Rule = require("nvim-autopairs.rule") + config = function() + local autopairs = require("nvim-autopairs") + local Rule = require("nvim-autopairs.rule") - autopairs.setup({ - fast_wrap = {}, - disable_filetype = {}, - disable_in_macro = false, - disable_in_visualblock = false, - ignored_next_char = [=[[%w%%%'%[%"%.]]=], - enable_moveright = true, - enable_afterquote = true, - enable_check_bracket_line = true, - enable_bracket_in_quote = true, - break_undo = true, - check_ts = true, - map_cr = true, - map_bs = true, - map_c_h = false, - map_c_w = false, - }) + autopairs.setup({ + fast_wrap = {}, + disable_filetype = {}, + disable_in_macro = false, + disable_in_visualblock = false, + ignored_next_char = [=[[%w%%%'%[%"%.]]=], + enable_moveright = true, + enable_afterquote = true, + enable_check_bracket_line = true, + enable_bracket_in_quote = true, + break_undo = true, + check_ts = true, + map_cr = true, + map_bs = true, + map_c_h = false, + map_c_w = false, + }) - autopairs.add_rules({ - Rule(" ", " "):with_pair(function(opts) - local pair = opts.line:sub(opts.col - 1, opts.col) - return vim.tbl_contains({ "()", "[]", "{}" }, pair) - end), - Rule("|", "|", "rust"), - }) - end, - }, + autopairs.add_rules({ + Rule(" ", " "):with_pair(function(opts) + local pair = opts.line:sub(opts.col - 1, opts.col) + return vim.tbl_contains({ "()", "[]", "{}" }, pair) + end), + Rule("|", "|", "rust"), + }) + end, + }, } - diff --git a/home/modules/neovim/config/lua/plugins/autosave.lua b/home/modules/neovim/config/lua/plugins/autosave.lua index ac4053b..9c84199 100644 --- a/home/modules/neovim/config/lua/plugins/autosave.lua +++ b/home/modules/neovim/config/lua/plugins/autosave.lua @@ -1,37 +1,36 @@ return { - { - "Pocco81/auto-save.nvim", - enable = true, - lazy = false, + { + "Pocco81/auto-save.nvim", + enable = true, + lazy = false, - config = function() - local autosave = require("auto-save") + config = function() + local autosave = require("auto-save") - autosave.setup({ - enabled = true, - execution_message = { - message = function() -- message to print on save - return ("AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S")) - end, + autosave.setup({ + enabled = true, + execution_message = { + message = function() -- message to print on save + return ("AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S")) + end, - dim = 0.18, -- dim the color of `message` - cleaning_interval = 1250, -- (milliseconds) automatically clean MsgArea after displaying `message`. See :h MsgArea - }, + dim = 0.18, -- dim the color of `message` + cleaning_interval = 1250, -- (milliseconds) automatically clean MsgArea after displaying `message`. See :h MsgArea + }, - events = {"InsertLeave", "TextChanged"}, - conditions = { - exists = true, - filename_is_not = {}, - filetype_is_not = {}, - modifiable = true - }, + events = { "InsertLeave", "TextChanged" }, + conditions = { + exists = true, + filename_is_not = {}, + filetype_is_not = {}, + modifiable = true, + }, - write_all_buffers = false, - on_off_commands = true, - clean_command_line_interval = 0, - debounce_delay = 135, - }) - end, - }, + write_all_buffers = false, + on_off_commands = true, + clean_command_line_interval = 0, + debounce_delay = 135, + }) + end, + }, } - diff --git a/home/modules/neovim/config/lua/plugins/barbar.lua b/home/modules/neovim/config/lua/plugins/barbar.lua index 2496749..c14deda 100644 --- a/home/modules/neovim/config/lua/plugins/barbar.lua +++ b/home/modules/neovim/config/lua/plugins/barbar.lua @@ -1,22 +1,23 @@ return { - { - 'romgrk/barbar.nvim', - enable = true, - lazy = false, + { + "romgrk/barbar.nvim", + enable = true, + lazy = false, - dependencies = { - 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status - 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons - }, + dependencies = { + "lewis6991/gitsigns.nvim", -- OPTIONAL: for git status + "nvim-tree/nvim-web-devicons", -- OPTIONAL: for file icons + }, - init = function() vim.g.barbar_auto_setup = false end, - opts = { - -- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default: - -- animation = true, - -- insert_at_start = true, - -- …etc. - }, - version = '^1.0.0', - }, + init = function() + vim.g.barbar_auto_setup = false + end, + opts = { + -- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default: + -- animation = true, + -- insert_at_start = true, + -- …etc. + }, + version = "^1.0.0", + }, } - diff --git a/home/modules/neovim/config/lua/plugins/blankline.lua b/home/modules/neovim/config/lua/plugins/blankline.lua index 7cd290e..7ab2399 100644 --- a/home/modules/neovim/config/lua/plugins/blankline.lua +++ b/home/modules/neovim/config/lua/plugins/blankline.lua @@ -1,50 +1,49 @@ return { - { - { - "lukas-reineke/indent-blankline.nvim", - event = { "BufReadPost", "BufNewFile" }, - config = function() - require("ibl").setup({ - indent = { - char = "▏", - }, - scope = { - show_start = false, - show_end = false, - }, - }) - end, - main = "ibl", - }, + { + { + "lukas-reineke/indent-blankline.nvim", + event = { "BufReadPost", "BufNewFile" }, + config = function() + require("ibl").setup({ + indent = { + char = "▏", + }, + scope = { + show_start = false, + show_end = false, + }, + }) + end, + main = "ibl", + }, - { - "echasnovski/mini.indentscope", - enabled = false, - version = false, - event = { "BufReadPre", "BufNewFile" }, - opts = { - symbol = "▏", - options = { try_as_border = true }, - }, - init = function() - vim.api.nvim_create_autocmd("FileType", { - pattern = { - "help", - "alpha", - "dashboard", - "NvimTree", - "Trouble", - "lazy", - "notify", - "toggleterm", - "lazyterm", - }, - callback = function() - vim.b.miniindentscope_disable = true - end, - }) - end, - }, - }, + { + "echasnovski/mini.indentscope", + enabled = false, + version = false, + event = { "BufReadPre", "BufNewFile" }, + opts = { + symbol = "▏", + options = { try_as_border = true }, + }, + init = function() + vim.api.nvim_create_autocmd("FileType", { + pattern = { + "help", + "alpha", + "dashboard", + "NvimTree", + "Trouble", + "lazy", + "notify", + "toggleterm", + "lazyterm", + }, + callback = function() + vim.b.miniindentscope_disable = true + end, + }) + end, + }, + }, } - diff --git a/home/modules/neovim/config/lua/plugins/cmp.lua b/home/modules/neovim/config/lua/plugins/cmp.lua index 39d2145..f963f93 100644 --- a/home/modules/neovim/config/lua/plugins/cmp.lua +++ b/home/modules/neovim/config/lua/plugins/cmp.lua @@ -156,4 +156,3 @@ return { end, }, } - diff --git a/home/modules/neovim/config/lua/plugins/comment.lua b/home/modules/neovim/config/lua/plugins/comment.lua index ecc29ac..4cf712d 100644 --- a/home/modules/neovim/config/lua/plugins/comment.lua +++ b/home/modules/neovim/config/lua/plugins/comment.lua @@ -29,4 +29,3 @@ return { end, }, } - diff --git a/home/modules/neovim/config/lua/plugins/dressing.lua b/home/modules/neovim/config/lua/plugins/dressing.lua index e9969c7..f461cb1 100644 --- a/home/modules/neovim/config/lua/plugins/dressing.lua +++ b/home/modules/neovim/config/lua/plugins/dressing.lua @@ -1,40 +1,38 @@ - return { - { - "stevearc/dressing.nvim", - event = "VeryLazy", - opts = { - input = { - title_pos = "center", - relative = "cursor", - insert_only = false, - start_in_insert = true, - win_options = { - wrap = false, - }, - }, - select = { - backend = { "builtin" }, - get_config = function(opts) - if opts.kind == "codeaction" then - return { - backend = "builtin", - builtin = { - relative = "cursor", - max_height = 0.30, - min_height = 3, - max_width = 0.40, - mappings = { ["q"] = "Close" }, - }, - } - end - end, - mappings = { - [""] = "Close", - [""] = "Confirm", - }, - }, - }, - }, + { + "stevearc/dressing.nvim", + event = "VeryLazy", + opts = { + input = { + title_pos = "center", + relative = "cursor", + insert_only = false, + start_in_insert = true, + win_options = { + wrap = false, + }, + }, + select = { + backend = { "builtin" }, + get_config = function(opts) + if opts.kind == "codeaction" then + return { + backend = "builtin", + builtin = { + relative = "cursor", + max_height = 0.30, + min_height = 3, + max_width = 0.40, + mappings = { ["q"] = "Close" }, + }, + } + end + end, + mappings = { + [""] = "Close", + [""] = "Confirm", + }, + }, + }, + }, } - diff --git a/home/modules/neovim/config/lua/plugins/git.lua b/home/modules/neovim/config/lua/plugins/git.lua index b10bfb5..385fcf2 100644 --- a/home/modules/neovim/config/lua/plugins/git.lua +++ b/home/modules/neovim/config/lua/plugins/git.lua @@ -1,33 +1,15 @@ return { - { - "NeogitOrg/neogit", - dependencies = { - { - "ruifm/gitlinker.nvim", - config = function() - require("gitlinker").setup() - end, - }, - "sindrets/diffview.nvim", - }, - event = { "User InGitRepo" }, - config = function() - require("neogit").setup({ - graph_style = "unicode", - sort_branches = "-committerdate", - kind = "replace", - popup = { - ["?"] = "HelpPopup", - ["D"] = "DiffPopup", - ["P"] = "PushPopup", - ["Z"] = "StashPopup", - ["b"] = "BranchPopup", - ["c"] = "CommitPopup", - ["l"] = "LogPopup", - ["p"] = "PullPopup", - }, - }) - end, - }, -} + "kdheepak/lazygit.nvim", + lazy = true, + cmd = { + "LazyGit", + "LazyGitConfig", + "LazyGitCurrentFile", + "LazyGitFilter", + "LazyGitFilterCurrentFile", + }, + dependencies = { + "nvim-lua/plenary.nvim", + }, +} diff --git a/home/modules/neovim/config/lua/plugins/gitsings.lua b/home/modules/neovim/config/lua/plugins/gitsings.lua index 04950d9..08ba7d8 100644 --- a/home/modules/neovim/config/lua/plugins/gitsings.lua +++ b/home/modules/neovim/config/lua/plugins/gitsings.lua @@ -46,4 +46,3 @@ return { end, }, } - diff --git a/home/modules/neovim/config/lua/plugins/lualine.lua b/home/modules/neovim/config/lua/plugins/lualine.lua index 8a7c365..1d1f0bf 100644 --- a/home/modules/neovim/config/lua/plugins/lualine.lua +++ b/home/modules/neovim/config/lua/plugins/lualine.lua @@ -1,222 +1,221 @@ return { - { - "nvim-lualine/lualine.nvim", - enable = true, - event = "VeryLazy", - config = function() - local lualine = require("lualine") - - local colors = { - bg = "#2e3440", - fg = "#3b4252", - yellow = "#f9e2af", - green = "#a6e3a1", - magenta = "#cba6f7", - lavender = "#b4befe", - blue = "#89b4fa", - red = "#f38ba8", - white = "#cdd6f4", - overlay0 = "#6c7086", - overlay1 = "#7f849c", - overlay2 = "#9399b2", - surface1 = "#45475a", - surface0 = "#313244" - } - - local conditions = { - buffer_not_empty = function() - return vim.fn.empty(vim.fn.expand("%:t")) ~= 1 - end, - hide_in_width = function() - return vim.fn.winwidth(0) > 80 - end, - check_git_workspace = function() - local filepath = vim.fn.expand("%:p:h") - local gitdir = vim.fn.finddir(".git", filepath .. ";") - return gitdir and #gitdir > 0 and #gitdir < #filepath - end, - } - - -- Config - local config = { - options = { - component_separators = "", - section_separators = "", - theme = { - normal = { c = { fg = colors.fg, bg = colors.bg } }, - inactive = { c = { fg = colors.fg, bg = colors.bg } }, - }, - }, - sections = { - -- these are to remove the defaults - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - -- These will be filled later - lualine_c = {}, - lualine_x = {}, - }, - inactive_sections = { - -- these are to remove the defaults - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - lualine_c = {}, - lualine_x = {}, - }, - } - - local function ins_left(component) - table.insert(config.sections.lualine_c, component) - end - - local function ins_right(component) - table.insert(config.sections.lualine_x, component) - end - - local mode_color = { - n = colors.blue, - i = colors.green, - v = colors.red, - [""] = colors.red, - V = colors.blue, - c = colors.yellow, - no = colors.red, - s = colors.orange, - S = colors.orange, - [""] = colors.orange, - ic = colors.yellow, - R = colors.lavender, - Rv = colors.lavender, - cv = colors.red, - ce = colors.red, - r = colors.cyan, - rm = colors.cyan, - ["r?"] = colors.cyan, - ["!"] = colors.red, - t = colors.red, - } - - ins_left({ - -- mode component - function() - local mode_icon = { - n = "NORMAL", - i = "INSERT", - v = "VISUAL", - c = "COMMAND", - t = "TERMINAL", - [""] = "V-BLOCK", - } - return mode_icon[vim.fn.mode()] - end, - color = function() - return { gui = "bold", bg = mode_color[vim.fn.mode()], fg = "#1f2228" } - end, - padding = { right = 2, left = 2 }, - }) - - ins_left({ - function() - local icon - local ok, devicons = pcall(require, "nvim-web-devicons") - if ok then - icon = devicons.get_icon(vim.fn.expand("%:t")) - if icon == nil then - icon = devicons.get_icon_by_filetype(vim.bo.filetype) - end - else - if vim.fn.exists("*WebDevIconsGetFileTypeSymbol") > 0 then - icon = vim.fn.WebDevIconsGetFileTypeSymbol() - end - end - return icon:gsub("%s+", "") - end, - color = function() - return { fg = colors.white, bg = colors.surface0 } - end, - }) - - ins_left({ - "filename", - cond = conditions.buffer_not_empty, - color = { fg = colors.white, bg = colors.surface0, gui = "bold" }, - padding = { right = 1, left = 1 }, - }) - - ins_left({ - "branch", - icon = "󰘬", - color = function() - return { fg = colors.overlay2, gui = "bold" } - end, - padding = { right = 1, left = 1 }, - }) - - ins_left({ - "diff", - symbols = { added = "οƒΎ ", modified = "󱓻 ", removed = "ο…† " }, - diff_color = { - added = { fg = colors.overlay2 }, - modified = { fg = colors.overlay2 }, - removed = { fg = colors.overlay2 }, - }, - cond = conditions.hide_in_width, - }) - - ins_right({ - "diagnostics", - sources = { "nvim_diagnostic" }, - symbols = { error = ' ', warn = ' ', info = 'οͺ ' }, - diagnostics_color = { - color_error = { fg = colors.red }, - color_warn = { fg = colors.yellow }, - color_info = { fg = colors.cyan }, - }, - }) - - ins_right({ - -- Lsp server name . - function() - local msg = "No Active Lsp" - local buf_ft = vim.api.nvim_buf_get_option(0, "filetype") - local clients = vim.lsp.get_active_clients() - if next(clients) == nil then - return msg - end - for _, client in ipairs(clients) do - local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then - return client.name - end - end - return msg - end, - icon = "ο‚… LSP ~", - color = { fg = colors.overlay2, gui = "bold" }, - }) - - ins_right({ - function() - local icon = " 󰉋 " - local name = vim.loop.cwd():match ".+[\\/](.-)$" .. " " - return (icon .. name) or "" - end, - color = { fg = colors.white, bg = colors.surface0, gui = "bold" }, - }) - - ins_right({ - "progress", - color = function() - return { bg = mode_color[vim.fn.mode()], fg = "#1f2228", gui = "bold" } - end, - padding = { left = 2, right = 2 }, - }) - - lualine.setup(config) - end, - }, + { + "nvim-lualine/lualine.nvim", + enable = true, + event = "VeryLazy", + config = function() + local lualine = require("lualine") + + local colors = { + bg = "#2e3440", + fg = "#3b4252", + yellow = "#f9e2af", + green = "#a6e3a1", + magenta = "#cba6f7", + lavender = "#b4befe", + blue = "#89b4fa", + red = "#f38ba8", + white = "#cdd6f4", + overlay0 = "#6c7086", + overlay1 = "#7f849c", + overlay2 = "#9399b2", + surface1 = "#45475a", + surface0 = "#313244", + } + + local conditions = { + buffer_not_empty = function() + return vim.fn.empty(vim.fn.expand("%:t")) ~= 1 + end, + hide_in_width = function() + return vim.fn.winwidth(0) > 80 + end, + check_git_workspace = function() + local filepath = vim.fn.expand("%:p:h") + local gitdir = vim.fn.finddir(".git", filepath .. ";") + return gitdir and #gitdir > 0 and #gitdir < #filepath + end, + } + + -- Config + local config = { + options = { + component_separators = "", + section_separators = "", + theme = { + normal = { c = { fg = colors.fg, bg = colors.bg } }, + inactive = { c = { fg = colors.fg, bg = colors.bg } }, + }, + }, + sections = { + -- these are to remove the defaults + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + -- These will be filled later + lualine_c = {}, + lualine_x = {}, + }, + inactive_sections = { + -- these are to remove the defaults + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + lualine_c = {}, + lualine_x = {}, + }, + } + + local function ins_left(component) + table.insert(config.sections.lualine_c, component) + end + + local function ins_right(component) + table.insert(config.sections.lualine_x, component) + end + + local mode_color = { + n = colors.blue, + i = colors.green, + v = colors.red, + [""] = colors.red, + V = colors.blue, + c = colors.yellow, + no = colors.red, + s = colors.orange, + S = colors.orange, + [""] = colors.orange, + ic = colors.yellow, + R = colors.lavender, + Rv = colors.lavender, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ["r?"] = colors.cyan, + ["!"] = colors.red, + t = colors.red, + } + + ins_left({ + -- mode component + function() + local mode_icon = { + n = "NORMAL", + i = "INSERT", + v = "VISUAL", + c = "COMMAND", + t = "TERMINAL", + [""] = "V-BLOCK", + } + return mode_icon[vim.fn.mode()] + end, + color = function() + return { gui = "bold", bg = mode_color[vim.fn.mode()], fg = "#1f2228" } + end, + padding = { right = 2, left = 2 }, + }) + + ins_left({ + function() + local icon + local ok, devicons = pcall(require, "nvim-web-devicons") + if ok then + icon = devicons.get_icon(vim.fn.expand("%:t")) + if icon == nil then + icon = devicons.get_icon_by_filetype(vim.bo.filetype) + end + else + if vim.fn.exists("*WebDevIconsGetFileTypeSymbol") > 0 then + icon = vim.fn.WebDevIconsGetFileTypeSymbol() + end + end + return icon:gsub("%s+", "") + end, + color = function() + return { fg = colors.white, bg = colors.surface0 } + end, + }) + + ins_left({ + "filename", + cond = conditions.buffer_not_empty, + color = { fg = colors.white, bg = colors.surface0, gui = "bold" }, + padding = { right = 1, left = 1 }, + }) + + ins_left({ + "branch", + icon = "󰘬", + color = function() + return { fg = colors.overlay2, gui = "bold" } + end, + padding = { right = 1, left = 1 }, + }) + + ins_left({ + "diff", + symbols = { added = "οƒΎ ", modified = "󱓻 ", removed = "ο…† " }, + diff_color = { + added = { fg = colors.overlay2 }, + modified = { fg = colors.overlay2 }, + removed = { fg = colors.overlay2 }, + }, + cond = conditions.hide_in_width, + }) + + ins_right({ + "diagnostics", + sources = { "nvim_diagnostic" }, + symbols = { error = " ", warn = " ", info = "οͺ " }, + diagnostics_color = { + color_error = { fg = colors.red }, + color_warn = { fg = colors.yellow }, + color_info = { fg = colors.cyan }, + }, + }) + + ins_right({ + -- Lsp server name . + function() + local msg = "No Active Lsp" + local buf_ft = vim.api.nvim_buf_get_option(0, "filetype") + local clients = vim.lsp.get_active_clients() + if next(clients) == nil then + return msg + end + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return client.name + end + end + return msg + end, + icon = "ο‚… LSP ~", + color = { fg = colors.overlay2, gui = "bold" }, + }) + + ins_right({ + function() + local icon = " 󰉋 " + local name = vim.loop.cwd():match(".+[\\/](.-)$") .. " " + return (icon .. name) or "" + end, + color = { fg = colors.white, bg = colors.surface0, gui = "bold" }, + }) + + ins_right({ + "progress", + color = function() + return { bg = mode_color[vim.fn.mode()], fg = "#1f2228", gui = "bold" } + end, + padding = { left = 2, right = 2 }, + }) + + lualine.setup(config) + end, + }, } - diff --git a/home/modules/neovim/config/lua/plugins/markdown-preview.lua b/home/modules/neovim/config/lua/plugins/markdown-preview.lua index 5d8b7b1..980a8e0 100644 --- a/home/modules/neovim/config/lua/plugins/markdown-preview.lua +++ b/home/modules/neovim/config/lua/plugins/markdown-preview.lua @@ -9,4 +9,3 @@ return { end, }, } - diff --git a/home/modules/neovim/config/lua/plugins/mini.lua b/home/modules/neovim/config/lua/plugins/mini.lua index c59d414..744374b 100644 --- a/home/modules/neovim/config/lua/plugins/mini.lua +++ b/home/modules/neovim/config/lua/plugins/mini.lua @@ -1,10 +1,9 @@ return { { - "echasnovski/mini.nvim", - event = { "BufReadPre" }, - config = function() - require('mini.align').setup() - end, + "echasnovski/mini.nvim", + event = { "BufReadPre" }, + config = function() + require("mini.align").setup() + end, }, } - diff --git a/home/modules/neovim/config/lua/plugins/mylsp.lua b/home/modules/neovim/config/lua/plugins/mylsp.lua index d45b403..9f0deed 100644 --- a/home/modules/neovim/config/lua/plugins/mylsp.lua +++ b/home/modules/neovim/config/lua/plugins/mylsp.lua @@ -2,17 +2,16 @@ return { { "neovim/nvim-lspconfig", enable = true, - lazy = false, - -- event = { "VeryLazy" }, + lazy = false, + -- event = { "VeryLazy" }, dependencies = { "b0o/schemastore.nvim", - "nvim-lua/plenary.nvim" + "nvim-lua/plenary.nvim", }, config = function() - require("lsp.init") - end, + require("lsp.init") + end, }, } - diff --git a/home/modules/neovim/config/lua/plugins/noice.lua b/home/modules/neovim/config/lua/plugins/noice.lua index e87de62..caaf1c0 100644 --- a/home/modules/neovim/config/lua/plugins/noice.lua +++ b/home/modules/neovim/config/lua/plugins/noice.lua @@ -1,47 +1,46 @@ return { - { - "folke/noice.nvim", - version = "4.4.7", - event = "VimEnter", - enabled = not vim.g.started_by_firenvim, + { + "folke/noice.nvim", + version = "4.4.7", + event = "VimEnter", + enabled = not vim.g.started_by_firenvim, - opts = { - lsp = { - signature = { - enabled = true, - }, - }, - presets = { - lsp_doc_border = true, - bottom_search = true, - command_palette = true, - long_message_to_split = true, - inc_rename = true, - }, - }, - dependencies = { - { - "rcarriga/nvim-notify", - config = function() - require("notify").setup({ - minimum_width = 50, - background_colour = "#1d2021", - stages = "static", - render = "minimal", - timeout = 1500, - }) - local notify = require("notify") - vim.notify = notify - end, - }, - { - "MunifTanjim/nui.nvim", - }, - }, - }, + opts = { + lsp = { + signature = { + enabled = true, + }, + }, + presets = { + lsp_doc_border = true, + bottom_search = true, + command_palette = true, + long_message_to_split = true, + inc_rename = true, + }, + }, + dependencies = { + { + "rcarriga/nvim-notify", + config = function() + require("notify").setup({ + minimum_width = 50, + background_colour = "#1d2021", + stages = "static", + render = "minimal", + timeout = 1500, + }) + local notify = require("notify") + vim.notify = notify + end, + }, + { + "MunifTanjim/nui.nvim", + }, + }, + }, - vim.api.nvim_set_hl(0, "NoiceCmdlineIcon", { fg = "#dcd7ba" }), - vim.api.nvim_set_hl(0, "NoiceCmdlinePopupTitle", { fg = "#dcd7ba" }), - vim.api.nvim_set_hl(0, "NoiceCmdlinePopupBorder", { fg = "#dcd7ba" }), + vim.api.nvim_set_hl(0, "NoiceCmdlineIcon", { fg = "#dcd7ba" }), + vim.api.nvim_set_hl(0, "NoiceCmdlinePopupTitle", { fg = "#dcd7ba" }), + vim.api.nvim_set_hl(0, "NoiceCmdlinePopupBorder", { fg = "#dcd7ba" }), } - diff --git a/home/modules/neovim/config/lua/plugins/nvim-ansible.lua b/home/modules/neovim/config/lua/plugins/nvim-ansible.lua index f95bdc8..8c51df1 100644 --- a/home/modules/neovim/config/lua/plugins/nvim-ansible.lua +++ b/home/modules/neovim/config/lua/plugins/nvim-ansible.lua @@ -1,8 +1,7 @@ return { - { - 'mfussenegger/nvim-ansible', - enable = true, - lazy = false, - }, + { + "mfussenegger/nvim-ansible", + enable = true, + lazy = false, + }, } - diff --git a/home/modules/neovim/config/lua/plugins/nvim-tree.lua b/home/modules/neovim/config/lua/plugins/nvim-tree.lua index 38b5777..cb7e656 100644 --- a/home/modules/neovim/config/lua/plugins/nvim-tree.lua +++ b/home/modules/neovim/config/lua/plugins/nvim-tree.lua @@ -2,96 +2,95 @@ local HEIGHT_RATIO = 0.9 local WIDTH_RATIO = 0.5 return { - { - "nvim-tree/nvim-tree.lua", - cmd = { "NvimTreeToggle", "NvimTreeOpen" }, - enabled = true, + { + "nvim-tree/nvim-tree.lua", + cmd = { "NvimTreeToggle", "NvimTreeOpen" }, + enabled = true, - config = function() - require("nvim-tree").setup({ - sync_root_with_cwd = true, - respect_buf_cwd = true, - update_focused_file = { - enable = true, - update_root = true, - }, + config = function() + require("nvim-tree").setup({ + sync_root_with_cwd = true, + respect_buf_cwd = true, + update_focused_file = { + enable = true, + update_root = true, + }, - sort_by = "case_sensitive", + sort_by = "case_sensitive", - view = { - number = false, - float = { - enable = true, - open_win_config = function() - local screen_w = vim.opt.columns:get() - local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get() - local window_w = screen_w * WIDTH_RATIO - local window_h = screen_h * HEIGHT_RATIO - local window_w_int = math.floor(window_w) - local window_h_int = math.floor(window_h) - local center_x = (screen_w - window_w) / 2 - local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get() - return { - border = "rounded", - relative = "editor", - row = center_y, - col = center_x, - width = window_w_int, - height = window_h_int, - } - end, - }, - width = function() - return math.floor(vim.opt.columns:get() * WIDTH_RATIO) - end, - }, - hijack_cursor = false, - renderer = { - group_empty = true, - full_name = true, - indent_markers = { - enable = true, - }, - icons = { - show = { - file = true, - folder = true, - folder_arrow = true, - }, - glyphs = { - default = "󰈚", - symlink = "", - folder = { - default = "", - empty = "ξͺƒ", - empty_open = "", - open = "ξ«Ά", - symlink = "ξ«­", - symlink_open = "ο’‚", - arrow_open = "ο‘Ό", - arrow_closed = "ο‘ ", - }, - git = { - untracked = "ο‘΄", - staged = "ο‘—", - deleted = "ο‘˜", - unstaged = "σ°œ€", - renamed = "ο‘š", - ignored = 'β—Œ', - unmerged = "", - }, - }, - }, - }, - filters = { - dotfiles = true, - }, - diagnostics = { - enable = true, - show_on_dirs = true, - }, - }) - end, - }, + view = { + number = false, + float = { + enable = true, + open_win_config = function() + local screen_w = vim.opt.columns:get() + local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get() + local window_w = screen_w * WIDTH_RATIO + local window_h = screen_h * HEIGHT_RATIO + local window_w_int = math.floor(window_w) + local window_h_int = math.floor(window_h) + local center_x = (screen_w - window_w) / 2 + local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get() + return { + border = "rounded", + relative = "editor", + row = center_y, + col = center_x, + width = window_w_int, + height = window_h_int, + } + end, + }, + width = function() + return math.floor(vim.opt.columns:get() * WIDTH_RATIO) + end, + }, + hijack_cursor = false, + renderer = { + group_empty = true, + full_name = true, + indent_markers = { + enable = true, + }, + icons = { + show = { + file = true, + folder = true, + folder_arrow = true, + }, + glyphs = { + default = "󰈚", + symlink = "", + folder = { + default = "", + empty = "ξͺƒ", + empty_open = "", + open = "ξ«Ά", + symlink = "ξ«­", + symlink_open = "ο’‚", + arrow_open = "ο‘Ό", + arrow_closed = "ο‘ ", + }, + git = { + untracked = "ο‘΄", + staged = "ο‘—", + deleted = "ο‘˜", + unstaged = "σ°œ€", + renamed = "ο‘š", + ignored = "β—Œ", + unmerged = "", + }, + }, + }, + }, + filters = { + dotfiles = true, + }, + diagnostics = { + enable = true, + show_on_dirs = true, + }, + }) + end, + }, } - diff --git a/home/modules/neovim/config/lua/plugins/telescope.lua b/home/modules/neovim/config/lua/plugins/telescope.lua index da9aab9..b082a4f 100644 --- a/home/modules/neovim/config/lua/plugins/telescope.lua +++ b/home/modules/neovim/config/lua/plugins/telescope.lua @@ -91,4 +91,3 @@ return { end, }, } - diff --git a/home/modules/neovim/config/lua/plugins/theme.lua b/home/modules/neovim/config/lua/plugins/theme.lua index c020b82..5398bbf 100644 --- a/home/modules/neovim/config/lua/plugins/theme.lua +++ b/home/modules/neovim/config/lua/plugins/theme.lua @@ -1,12 +1,11 @@ return { - { - "shaunsingh/nord.nvim", - enable = true, - lazy = false, + { + "shaunsingh/nord.nvim", + enable = true, + lazy = false, - config = function() - vim.cmd[[colorscheme nord]] - end, - }, + config = function() + vim.cmd([[colorscheme nord]]) + end, + }, } - diff --git a/home/modules/neovim/config/lua/plugins/treesitter.lua b/home/modules/neovim/config/lua/plugins/treesitter.lua index 25950f7..fd073e6 100644 --- a/home/modules/neovim/config/lua/plugins/treesitter.lua +++ b/home/modules/neovim/config/lua/plugins/treesitter.lua @@ -1,38 +1,37 @@ return { - { - "nvim-treesitter/nvim-treesitter", - enable = true, - lazy = false, + { + "nvim-treesitter/nvim-treesitter", + enable = true, + lazy = false, - config = function() - require("nvim-treesitter.configs").setup({ - ensure_installed = { - "c", - "go", - "tsx", - "cpp", - "lua", - "nix", - "yaml", - "json", - "cmake", - "python", - "typescript", - "javascript" - }, + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { + "c", + "go", + "tsx", + "cpp", + "lua", + "nix", + "yaml", + "json", + "cmake", + "python", + "typescript", + "javascript", + }, - ignore_install = {}, + ignore_install = {}, - highlight = { - enable = true, - disable = { "help" }, - }, + highlight = { + enable = true, + disable = { "help" }, + }, - indent = { - enable = true, - }, - }) - end, - }, + indent = { + enable = true, + }, + }) + end, + }, } - diff --git a/home/modules/neovim/config/lua/plugins/vim-helm.lua b/home/modules/neovim/config/lua/plugins/vim-helm.lua index 2866995..2a3af56 100644 --- a/home/modules/neovim/config/lua/plugins/vim-helm.lua +++ b/home/modules/neovim/config/lua/plugins/vim-helm.lua @@ -1,10 +1,9 @@ return { - { - 'towolf/vim-helm', - enable = true, - lazy = false, + { + "towolf/vim-helm", + enable = true, + lazy = false, - ft = 'helm', - }, + ft = "helm", + }, } - diff --git a/home/modules/neovim/default.nix b/home/modules/neovim/default.nix index 3ff65f2..0a71df3 100644 --- a/home/modules/neovim/default.nix +++ b/home/modules/neovim/default.nix @@ -1,22 +1,24 @@ -{ lib -, config -, pkgs -, homeModules -, ... +{ + self, + lib, + config, + pkgs, + ... }: with lib; let cfg = config.module.nvim; -in { +in +{ options = { module.nvim.enable = mkEnableOption "Enables nvim"; }; config = mkIf cfg.enable { xdg.configFile."nvim" = { - source = "${homeModules}/neovim/config"; + source = "${self}/home/modules/neovim/config"; recursive = true; }; @@ -46,4 +48,3 @@ in { }; }; } - diff --git a/home/modules/password-store/default.nix b/home/modules/password-store/default.nix index d7c3734..260911d 100644 --- a/home/modules/password-store/default.nix +++ b/home/modules/password-store/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.password-store; -in { +in +{ options = { module.password-store.enable = mkEnableOption "Enables password-store"; }; @@ -22,4 +24,3 @@ in { }; }; } - diff --git a/home/modules/ripgrep/default.nix b/home/modules/ripgrep/default.nix index 679f249..2dd864c 100644 --- a/home/modules/ripgrep/default.nix +++ b/home/modules/ripgrep/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.ripgrep; -in { +in +{ options = { module.ripgrep.enable = mkEnableOption "Enables ripgrep"; }; @@ -18,4 +20,3 @@ in { }; }; } - diff --git a/home/modules/rofi/default.nix b/home/modules/rofi/default.nix index 59b235e..a724a81 100644 --- a/home/modules/rofi/default.nix +++ b/home/modules/rofi/default.nix @@ -1,14 +1,16 @@ -{ config -, lib -, pkgs -, ... +{ + config, + lib, + pkgs, + ... }: with lib; let cfg = config.module.rofi; -in { +in +{ options = { module.rofi.enable = mkEnableOption "Enables rofi"; }; @@ -33,81 +35,85 @@ in { drun-display-format = "{name}"; }; - theme = let - inherit (config.lib.formats.rasi) mkLiteral; - in { - "*" = { - width = 500; + theme = + let + inherit (config.lib.formats.rasi) mkLiteral; + in + { + "*" = { + width = 500; + }; + + "window" = { + height = mkLiteral "550px"; + border = mkLiteral "3px"; + }; + + "inputbar" = { + children = map mkLiteral [ + "prompt" + "entry" + ]; + border-radius = mkLiteral "5px"; + padding = mkLiteral "2px"; + }; + + "prompt" = { + padding = mkLiteral "6px"; + border-radius = mkLiteral "3px"; + margin = mkLiteral "20px 0px 0px 20px"; + }; + + "textbox-prompt-colon" = { + expand = "false"; + str = ":"; + }; + + "entry" = { + padding = mkLiteral "6px"; + border-radius = mkLiteral "3px"; + margin = mkLiteral "20px 10px 0px 10px"; + }; + + "listview" = { + border = mkLiteral "0px 0px 0px"; + padding = mkLiteral "6px 0px 0px"; + margin = mkLiteral "10px 15px 0px 20px"; + columns = "2"; + lines = "8"; + }; + + "element" = { + padding = mkLiteral "5px"; + }; + + "element-icon" = { + size = mkLiteral "25px"; + }; + + "element selected" = { + border-radius = mkLiteral "3px"; + }; + + "button" = { + padding = mkLiteral "10px"; + vertical-align = mkLiteral "0.5"; + horizontal-align = mkLiteral "0.5"; + }; + + "textbox" = { + vertical-align = mkLiteral "0.5"; + horizontal-align = mkLiteral "0.0"; + blink = true; + markup = true; + }; + + "error-message" = { + padding = mkLiteral "10px"; + border = mkLiteral "0px solid"; + border-radius = mkLiteral "0px"; + }; }; - - "window" = { - height = mkLiteral "550px"; - border = mkLiteral "3px"; - }; - - "inputbar" = { - children = map mkLiteral ["prompt" "entry"]; - border-radius = mkLiteral "5px"; - padding = mkLiteral "2px"; - }; - - "prompt" = { - padding = mkLiteral "6px"; - border-radius = mkLiteral "3px"; - margin = mkLiteral "20px 0px 0px 20px"; - }; - - "textbox-prompt-colon" = { - expand = "false"; - str = ":"; - }; - - "entry" = { - padding = mkLiteral "6px"; - border-radius = mkLiteral "3px"; - margin = mkLiteral "20px 10px 0px 10px"; - }; - - "listview" = { - border = mkLiteral "0px 0px 0px"; - padding = mkLiteral "6px 0px 0px"; - margin = mkLiteral "10px 15px 0px 20px"; - columns = "2"; - lines = "8"; - }; - - "element" = { - padding = mkLiteral "5px"; - }; - - "element-icon" = { - size = mkLiteral "25px"; - }; - - "element selected" = { - border-radius = mkLiteral "3px"; - }; - - "button" = { - padding = mkLiteral "10px"; - vertical-align = mkLiteral "0.5"; - horizontal-align = mkLiteral "0.5"; - }; - - "textbox" = { - vertical-align = mkLiteral "0.5"; - horizontal-align = mkLiteral "0.0"; - blink = true; - markup = true; - }; - - "error-message" = { - padding = mkLiteral "10px"; - border = mkLiteral "0px solid"; - border-radius = mkLiteral "0px"; - }; - }; }; }; } - diff --git a/home/modules/sway/default.nix b/home/modules/sway/default.nix index 9c56418..e27b675 100644 --- a/home/modules/sway/default.nix +++ b/home/modules/sway/default.nix @@ -1,18 +1,20 @@ -{ config -, lib -, pkgs -, homeModules -, ... +{ + self, + config, + lib, + pkgs, + ... }: with lib; let cfg = config.module.sway; -in { +in +{ imports = [ - "${homeModules}/sway/keybinds" - "${homeModules}/sway/outputs" + "${self}/home/modules/sway/keybinds" + "${self}/home/modules/sway/outputs" ]; options.module.sway = { @@ -22,13 +24,13 @@ in { config = mkIf cfg.enable { module.sway = { keybindings.enable = cfg.enable; - outputs.enable = cfg.enable; + outputs.enable = cfg.enable; }; home.sessionVariables = { XDG_CURRENT_DESKTOP = "sway"; XDG_SESSION_DESKTOP = "sway"; - GTK_CSD = 0; + GTK_CSD = 0; }; gtk = { @@ -40,12 +42,6 @@ in { wayland.windowManager.sway = { enable = true; package = pkgs.sway; - checkConfig = false; - - # Swayfx settings - /* extraConfig = '' - corner_radius 3 - ''; */ config = { focus.mouseWarping = "container"; @@ -74,7 +70,7 @@ in { inner = 7; }; - bars = [ ]; + bars = [ ]; window = { titlebar = false; @@ -85,16 +81,18 @@ in { { command = "${pkgs.wl-clipboard}/bin/wl-paste --type text --watch cliphist store"; } { command = "${pkgs.wl-clipboard}/bin/wl-paste --type image --watch cliphist store"; } { command = "${pkgs.sway}/bin/swaymsg 'workspace 1; exec ${pkgs.librewolf}/bin/librewolf'"; } - { command = "${pkgs.sway}/bin/swaymsg 'workspace 2; exec ${pkgs.telegram-desktop}/bin/telegram-desktop'"; } + { + command = "${pkgs.sway}/bin/swaymsg 'workspace 2; exec ${pkgs.telegram-desktop}/bin/telegram-desktop'"; + } { command = "${pkgs.sway}/bin/swaymsg 'workspace 4; exec ${pkgs.obsidian}/bin/obsidian'"; } { command = "${pkgs.sway}/bin/swaymsg 'workspace 5; exec ${pkgs.foot}/bin/foot'"; } { command = "${pkgs.sway}/bin/swaymsg 'workspace 5; exec ${pkgs.foot}/bin/foot'"; } { command = "${pkgs.sway}/bin/swaymsg 'workspace 5; exec ${pkgs.foot}/bin/foot'"; } - { command = "${pkgs.sway}/bin/swaymsg 'workspace 6; exec ${pkgs.librewolf}/bin/librewolf -P work'"; } - { command = "${pkgs.sway}/bin/swaymsg 'workspace 8; exec ${pkgs.vesktop}/bin/vesktop'"; } + { + command = "${pkgs.sway}/bin/swaymsg 'workspace 6; exec ${pkgs.librewolf}/bin/librewolf -P Work'"; + } ]; }; }; }; } - diff --git a/home/modules/sway/keybinds/default.nix b/home/modules/sway/keybinds/default.nix index 1b33e40..0b9bce9 100644 --- a/home/modules/sway/keybinds/default.nix +++ b/home/modules/sway/keybinds/default.nix @@ -1,7 +1,8 @@ -{ config -, lib -, pkgs -, ... +{ + config, + lib, + pkgs, + ... }: with lib; @@ -10,32 +11,33 @@ let cfg = config.module.sway.keybindings; super = "Mod4"; - workspace1 = "workspace number 1"; - workspace2 = "workspace number 2"; - workspace3 = "workspace number 3"; - workspace4 = "workspace number 4"; - workspace5 = "workspace number 5"; - workspace6 = "workspace number 6"; - workspace7 = "workspace number 7"; - workspace8 = "workspace number 8"; - workspace9 = "workspace number 9"; + workspace1 = "workspace number 1"; + workspace2 = "workspace number 2"; + workspace3 = "workspace number 3"; + workspace4 = "workspace number 4"; + workspace5 = "workspace number 5"; + workspace6 = "workspace number 6"; + workspace7 = "workspace number 7"; + workspace8 = "workspace number 8"; + workspace9 = "workspace number 9"; workspace10 = "workspace number 10"; workspace11 = "workspace number 11"; workspace12 = "workspace number 12"; - terminal = "${pkgs.foot}/bin/foot"; - screenshotArea = "${pkgs.slurp}/bin/slurp | ${pkgs.grim}/bin/grim -g - - | ${pkgs.wl-clipboard}/bin/wl-copy "; - screenshotScreen = "${pkgs.grim}/bin/grim -o $(swaymsg -t get_outputs | ${pkgs.jq}/bin/jq -r '.[] | select(.focused) | .name') - | ${pkgs.wl-clipboard}/bin/wl-copy"; - appLauncher = "${pkgs.wofi}/bin/wofi --show drun"; - audioControl = "${pkgs.pulseaudio}/bin/pactl"; - brightnessControl = "${pkgs.brightnessctl}/bin/brightnessctl"; - clipHist = "${pkgs.cliphist}/bin/cliphist list | ${appLauncher} -d | ${pkgs.cliphist}/bin/cliphist decode | ${pkgs.wl-clipboard}/bin/wl-copy"; - notificationsApp = "${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw"; + terminal = config.module.defaults.terminalCmd; + appLauncher = config.module.defaults.appLauncherCmd; + audioControl = config.module.defaults.audioControlCmd; + brightnessControl = config.module.defaults.brightnessControlCmd; + clipHist = config.module.defaults.clipHistCmd; + notificationsApp = config.module.defaults.notificationsAppCmd; + + screenshotArea = "${pkgs.slurp}/bin/slurp | ${pkgs.grim}/bin/grim -g - - | ${pkgs.wl-clipboard}/bin/wl-copy"; + screenshotScreen = "${pkgs.grim}/bin/grim -o $(swaymsg -t get_outputs | ${pkgs.jq}/bin/jq -r '.[] | select(.focused) | .name') - | ${pkgs.wl-clipboard}/bin/wl-copy"; powerMenu = pkgs.writeShellScriptBin "powerMenu.sh" '' #!/usr/bin/env bash - op=$(echo -e " Poweroff\nοƒœ Reboot\n Suspend\nο€£ Lock\nο‚‹ Logout" | ${pkgs.wofi}/bin/wofi -i --dmenu | ${pkgs.gawk}/bin/awk '{print tolower($2)}') + op=$(echo -e " Poweroff\nοƒœ Reboot\n Suspend\nο€£ Lock\nο‚‹ Logout" | ${pkgs.rofi-wayland}/bin/rofi -i -dmenu | ${pkgs.gawk}/bin/awk '{print tolower($2)}') case $op in poweroff) @@ -53,7 +55,8 @@ let ;; esac ''; -in { +in +{ options.module.sway.keybindings = { enable = mkEnableOption "Enable sway keybindings"; }; @@ -62,6 +65,7 @@ in { wayland.windowManager.sway.config = { inherit terminal; modifier = super; + bindkeysToCode = true; assigns = { "2" = [ { app_id = "org.telegram.desktop"; } ]; @@ -71,109 +75,109 @@ in { keybindings = { # Terminal - "--to-code ${super}+Return" = "exec ${terminal}"; + "${super}+Return" = "exec ${terminal}"; # Kill active window - "--to-code ${super}+q" = "kill"; + "${super}+q" = "kill"; # PowerMenu - "--to-code ${super}+p" = "exec ${powerMenu}/bin/powerMenu.sh"; + "${super}+p" = "exec ${powerMenu}/bin/powerMenu.sh"; # Change focus # Vim like - "--to-code ${super}+h" = "focus left"; - "--to-code ${super}+j" = "focus down"; - "--to-code ${super}+k" = "focus up"; - "--to-code ${super}+l" = "focus right"; + "${super}+h" = "focus left"; + "${super}+j" = "focus down"; + "${super}+k" = "focus up"; + "${super}+l" = "focus right"; # With arrows - "--to-code ${super}+Left" = "focus left"; - "--to-code ${super}+Down" = "focus down"; - "--to-code ${super}+Up" = "focus up"; - "--to-code ${super}+Right" = "focus right"; + "${super}+Left" = "focus left"; + "${super}+Down" = "focus down"; + "${super}+Up" = "focus up"; + "${super}+Right" = "focus right"; # Move focused window # Vim like - "--to-code ${super}+Shift+h" = "move left"; - "--to-code ${super}+Shift+j" = "move down"; - "--to-code ${super}+Shift+k" = "move up"; - "--to-code ${super}+Shift+l" = "move right"; + "${super}+Shift+h" = "move left"; + "${super}+Shift+j" = "move down"; + "${super}+Shift+k" = "move up"; + "${super}+Shift+l" = "move right"; # With arrows - "--to-code ${super}+Shift+Left" = "move left"; - "--to-code ${super}+Shift+Down" = "move down"; - "--to-code ${super}+Shift+Up" = "move up"; - "--to-code ${super}+Shift+Right" = "move right"; + "${super}+Shift+Left" = "move left"; + "${super}+Shift+Down" = "move down"; + "${super}+Shift+Up" = "move up"; + "${super}+Shift+Right" = "move right"; # Application launcher - "--to-code Ctrl+Space" = "exec ${appLauncher}"; - "--to-code ${super}+c" = "exec ${clipHist}"; + "${super}+d" = "exec ${appLauncher}"; + "${super}+c" = "exec ${clipHist}"; # Multimedia keys - "--to-code xf86audioraisevolume" = "exec ${audioControl} set-sink-volume @DEFAULT_SINK@ +5%"; - "--to-code xf86audiolowervolume" = "exec ${audioControl} set-sink-volume @DEFAULT_SINK@ -5%"; - "--to-code xf86audiomute" = "exec ${audioControl} set-sink-mute @DEFAULT_SINK@ toggle"; - "--to-code XF86MonBrightnessDown" = "exec ${brightnessControl} set 5%-"; - "--to-code XF86MonBrightnessUp" = "exec ${brightnessControl} set +5%"; + "xf86audioraisevolume" = "exec ${audioControl} set-sink-volume @DEFAULT_SINK@ +5%"; + "xf86audiolowervolume" = "exec ${audioControl} set-sink-volume @DEFAULT_SINK@ -5%"; + "xf86audiomute" = "exec ${audioControl} set-sink-mute @DEFAULT_SINK@ toggle"; + "XF86MonBrightnessDown" = "exec ${brightnessControl} set 5%-"; + "XF86MonBrightnessUp" = "exec ${brightnessControl} set +5%"; # Notifications - "--to-code ${super}+n" = "exec ${notificationsApp}"; + "${super}+n" = "exec ${notificationsApp}"; # Screenshot - "--to-code Print" = "exec ${screenshotArea}"; - "--to-code Shift+Print" = "exec ${screenshotScreen}"; + "Print" = "exec ${screenshotArea}"; + "Shift+Print" = "exec ${screenshotScreen}"; # Reload the configuration file - "--to-code ${super}+Shift+r" = "reload"; + "${super}+Shift+r" = "reload"; # Fullscreen mode - "--to-code ${super}+f" = "fullscreen"; + "${super}+f" = "fullscreen"; # Float mode - "--to-code ${super}+Space" = "floating toggle"; + "${super}+Space" = "floating toggle"; # Resize mode - "--to-code ${super}+r" = "mode resize"; + "${super}+r" = "mode resize"; # Layouts - "--to-code ${super}+v" = "splitv"; - "--to-code ${super}+b" = "splith"; - "--to-code ${super}+s" = "layout toggle split"; - "--to-code ${super}+t" = "layout tabbed"; + "${super}+v" = "splitv"; + "${super}+b" = "splith"; + "${super}+t" = "layout toggle split tabbed"; + "${super}+a" = "focus parent"; # Switch to workspace using number row - "--to-code ${super}+1" = "${workspace1}"; - "--to-code ${super}+2" = "${workspace2}"; - "--to-code ${super}+3" = "${workspace3}"; - "--to-code ${super}+4" = "${workspace4}"; - "--to-code ${super}+5" = "${workspace5}"; - "--to-code ${super}+6" = "${workspace6}"; - "--to-code ${super}+7" = "${workspace7}"; - "--to-code ${super}+8" = "${workspace8}"; - "--to-code ${super}+9" = "${workspace9}"; - "--to-code ${super}+0" = "${workspace10}"; - "--to-code ${super}+minus" = "${workspace11}"; - "--to-code ${super}+equal" = "${workspace12}"; + "${super}+1" = "${workspace1}"; + "${super}+2" = "${workspace2}"; + "${super}+3" = "${workspace3}"; + "${super}+4" = "${workspace4}"; + "${super}+5" = "${workspace5}"; + "${super}+6" = "${workspace6}"; + "${super}+7" = "${workspace7}"; + "${super}+8" = "${workspace8}"; + "${super}+9" = "${workspace9}"; + "${super}+0" = "${workspace10}"; + "${super}+minus" = "${workspace11}"; + "${super}+equal" = "${workspace12}"; # Switch to scratchpad - "--to-code ${super}+z" = "scratchpad show"; + "${super}+z" = "scratchpad show"; # Move window to workspace using number row - "--to-code ${super}+Shift+1" = "move container to ${workspace1}"; - "--to-code ${super}+Shift+2" = "move container to ${workspace2}"; - "--to-code ${super}+Shift+3" = "move container to ${workspace3}"; - "--to-code ${super}+Shift+4" = "move container to ${workspace4}"; - "--to-code ${super}+Shift+5" = "move container to ${workspace5}"; - "--to-code ${super}+Shift+6" = "move container to ${workspace6}"; - "--to-code ${super}+Shift+7" = "move container to ${workspace7}"; - "--to-code ${super}+Shift+8" = "move container to ${workspace8}"; - "--to-code ${super}+Shift+9" = "move container to ${workspace9}"; - "--to-code ${super}+Shift+0" = "move container to ${workspace10}"; - "--to-code ${super}+Shift+minus" = "move container to ${workspace11}"; - "--to-code ${super}+Shift+equal" = "move container to ${workspace12}"; + "${super}+Shift+1" = "move container to ${workspace1}"; + "${super}+Shift+2" = "move container to ${workspace2}"; + "${super}+Shift+3" = "move container to ${workspace3}"; + "${super}+Shift+4" = "move container to ${workspace4}"; + "${super}+Shift+5" = "move container to ${workspace5}"; + "${super}+Shift+6" = "move container to ${workspace6}"; + "${super}+Shift+7" = "move container to ${workspace7}"; + "${super}+Shift+8" = "move container to ${workspace8}"; + "${super}+Shift+9" = "move container to ${workspace9}"; + "${super}+Shift+0" = "move container to ${workspace10}"; + "${super}+Shift+minus" = "move container to ${workspace11}"; + "${super}+Shift+equal" = "move container to ${workspace12}"; # Move window to scratchpad - "--to-code ${super}+Shift+z" = "move scratchpad"; + "${super}+Shift+z" = "move scratchpad"; }; modes = { @@ -185,9 +189,9 @@ in { "l" = "resize shrink width 10px"; # Arrows - "Left" = "resize shrink width 10px"; - "Down" = "resize shrink height 10px"; - "Up" = "resize shrink height 10px"; + "Left" = "resize shrink width 10px"; + "Down" = "resize shrink height 10px"; + "Up" = "resize shrink height 10px"; "Right" = "resize shrink width 10px"; # Vim like binds @@ -197,9 +201,9 @@ in { "Shift+l" = "resize grow width 10px"; # Arrows - "Shift+Left" = "resize grow width 10px"; - "Shift+Down" = "resize grow height 10px"; - "Shift+Up" = "resize grow height 10px"; + "Shift+Left" = "resize grow width 10px"; + "Shift+Down" = "resize grow height 10px"; + "Shift+Up" = "resize grow height 10px"; "Shift+Right" = "resize grow width 10px"; # Return to normal mode @@ -210,4 +214,3 @@ in { }; }; } - diff --git a/home/modules/sway/outputs/default.nix b/home/modules/sway/outputs/default.nix index 14ddc34..2a38f53 100644 --- a/home/modules/sway/outputs/default.nix +++ b/home/modules/sway/outputs/default.nix @@ -1,7 +1,8 @@ -{ config -, lib -, hostname -, ... +{ + config, + lib, + hostname, + ... }: with lib; @@ -10,14 +11,14 @@ let cfg = config.module.sway.outputs; outputs = { - default = { }; + default = { }; pcbox = { - DP-1 = { + DP-1 = { resolution = "1920x1080@144Hz"; position = "0 0"; }; - + DP-2 = { resolution = "1920x1080@144Hz"; position = "1920 0"; @@ -30,36 +31,125 @@ let position = "0 0"; }; }; + + p8box = { + DSI-1 = { + resolution = "800x1280@60Hz"; + position = "0 0"; + }; + }; }; workspaces = { - default = [ ]; + default = [ ]; pcbox = [ - { workspace = "1"; output = "DP-2"; } - { workspace = "2"; output = "DP-2"; } - { workspace = "3"; output = "DP-2"; } - { workspace = "4"; output = "DP-2"; } - { workspace = "5"; output = "DP-2"; } - { workspace = "6"; output = "DP-2"; } - { workspace = "7"; output = "DP-1"; } - { workspace = "8"; output = "DP-1"; } - { workspace = "9"; output = "DP-1"; } - { workspace = "10"; output = "DP-1"; } - { workspace = "11"; output = "DP-1"; } - { workspace = "12"; output = "DP-1"; } + { + workspace = "1"; + output = "DP-2"; + } + { + workspace = "2"; + output = "DP-2"; + } + { + workspace = "3"; + output = "DP-2"; + } + { + workspace = "4"; + output = "DP-2"; + } + { + workspace = "5"; + output = "DP-2"; + } + { + workspace = "6"; + output = "DP-2"; + } + { + workspace = "7"; + output = "DP-1"; + } + { + workspace = "8"; + output = "DP-1"; + } + { + workspace = "9"; + output = "DP-1"; + } + { + workspace = "10"; + output = "DP-1"; + } + { + workspace = "11"; + output = "DP-1"; + } + { + workspace = "12"; + output = "DP-1"; + } ]; nbox = [ - { workspace = "1"; output = "eDP-1"; } - { workspace = "2"; output = "eDP-1"; } - { workspace = "3"; output = "eDP-1"; } - { workspace = "4"; output = "eDP-1"; } - { workspace = "5"; output = "eDP-1"; } - { workspace = "6"; output = "eDP-1"; } + { + workspace = "1"; + output = "eDP-1"; + } + { + workspace = "2"; + output = "eDP-1"; + } + { + workspace = "3"; + output = "eDP-1"; + } + { + workspace = "4"; + output = "eDP-1"; + } + { + workspace = "5"; + output = "eDP-1"; + } + { + workspace = "6"; + output = "eDP-1"; + } + ]; + + p8box = [ + { + workspace = "1"; + output = "eDP-1"; + } + { + workspace = "2"; + output = "eDP-1"; + } + { + workspace = "3"; + output = "eDP-1"; + } + { + workspace = "4"; + output = "eDP-1"; + } + { + workspace = "5"; + output = "eDP-1"; + } + { + workspace = "6"; + output = "eDP-1"; + } ]; }; -in { +in +{ options.module.sway.outputs = { enable = mkEnableOption "Enable sway outputs"; }; @@ -72,4 +162,3 @@ in { }; }; } - diff --git a/home/modules/swaylock/default.nix b/home/modules/swaylock/default.nix index 2c356ee..4e0fc8d 100644 --- a/home/modules/swaylock/default.nix +++ b/home/modules/swaylock/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.swaylock; -in { +in +{ options = { module.swaylock = { enable = mkEnableOption "Enable swaylock"; @@ -20,4 +22,3 @@ in { }; }; } - diff --git a/home/modules/swaync/default.nix b/home/modules/swaync/default.nix index e03ced2..b32e521 100644 --- a/home/modules/swaync/default.nix +++ b/home/modules/swaync/default.nix @@ -1,16 +1,18 @@ -{ lib -, config -, homeModules -, ... +{ + self, + lib, + config, + ... }: with lib; let cfg = config.module.swaync; -in { - options = { - module.swaync.enable = mkEnableOption "Enables swaync"; +in +{ + options = { + module.swaync.enable = mkEnableOption "Enables swaync"; }; config = mkIf cfg.enable { @@ -58,7 +60,12 @@ in { hide-on-clear = false; # Widget settings - widgets = ["title" "dnd" "notifications" "mpris"]; + widgets = [ + "title" + "dnd" + "notifications" + "mpris" + ]; # Widget config widget-config = { @@ -67,7 +74,9 @@ in { clear-all-button = true; button-text = "Clear All"; }; - dnd = {text = "Do Not Disturb";}; + dnd = { + text = "Do Not Disturb"; + }; mpris = { image-size = 96; image-radius = 12; @@ -77,9 +86,7 @@ in { }; # Custom style - # style = builtins.readFile (./. + "/style.css"); - style = builtins.readFile "${homeModules}/swaync/style.css"; + style = builtins.readFile "${self}/home/modules/swaync/style.css"; }; }; } - diff --git a/home/modules/swaync/style.css b/home/modules/swaync/style.css index c672273..4f85944 100644 --- a/home/modules/swaync/style.css +++ b/home/modules/swaync/style.css @@ -1,186 +1,27 @@ -@define-color base00 #2e3440; @define-color base01 #3b4252; @define-color base02 #434c5e; @define-color base03 #4c566a; -@define-color base04 #d8dee9; @define-color base05 #e5e9f0; @define-color base06 #eceff4; @define-color base07 #8fbcbb; - -@define-color base08 #bf616a; @define-color base09 #d08770; @define-color base0A #ebcb8b; @define-color base0B #a3be8c; -@define-color base0C #88c0d0; @define-color base0D #81a1c1; @define-color base0E #b48ead; @define-color base0F #5e81ac; - -@define-color background rgba(17, 17, 27, 0.85); -@define-color background-alt rgba(137, 180, 250, 0.05); -@define-color background-focus rgba(255, 255, 255, 0.1); -@define-color border rgba(255, 255, 255, 0.1); -@define-color red rgb( 243, 139, 168); -@define-color orange rgb( 250, 179, 135); -@define-color yellow rgb( 249, 226, 175 ); -@define-color green rgb( 166, 227, 161 ); -@define-color blue rgb( 137, 180, 250 ); -@define-color gray rgb( 108, 112, 134 ); -@define-color black rgb( 49, 50, 68 ); -@define-color white rgb( 205, 214, 244 ); - -* { - all: unset; - font: - 12pt JetBrainsMono Nerd Font; - transition: 200ms; -} - /*** Global ***/ progress, progressbar, trough { - border: 1px solid @base0D; border-radius: 16px; } -trough { - background: @base01; -} - -.notification.low, -.notification.normal { - border: 1px solid @base0D; -} - -.notification.low progress, -.notification.normal progress { - background: @base0F; -} - -.notification.critical { - border: 1px solid @red; -} - -.notification.critical progress { - background: @red; -} - -.summary { - color: @base05; -} - -.body { - color: alpha(@white, 0.7); -} - -.time { - color: alpha(@white, 0.7); -} - .app-icon, .image { -gtk-icon-effect: none; - margin: 0.25rem; } .notification-action { - color: @base05; - background: @base01; - border: 1px solid @base0D; border-radius: 5px; margin: 0.5rem; } -.notification-action:hover { - background: @background-focus; - color: @base05; -} - -.notification-action:active { - background: @base0F; - color: @base05; -} - .close-button { margin: 0.5rem; padding: 0.25rem; border-radius: 5px; - color: @black; - background: @red; -} - -.close-button:hover { - background: lighter(@red); - color: lighter(@black); -} - -.close-button:active { - background: @red; - color: @base00; } /*** Notifications ***/ -.floating-notifications.background .notification-row .notification-background { - background: @base00; - border-radius: 5px; - color: @base05; - margin: 0.25rem; - padding: 0; -} - -.floating-notifications.background - .notification-row - .notification-background - .notification { - padding: 0.5rem; - border-radius: 5px; -} - -.floating-notifications.background - .notification-row - .notification-background - .notification - .notification-content { - margin: 0.5rem; -} - -/*** Notifications Group ***/ -.notification-group { - /* Styling only for Grouped Notifications */ -} - -.notification-group.low { - /* Low Priority Group */ -} - -.notification-group.normal { - /* Low Priority Group */ -} - -.notification-group.critical { - /* Low Priority Group */ -} - -.notification-group .notification-group-buttons, -.notification-group .notification-group-headers { - margin: 0.5rem; - color: @base05; -} - -.notification-group .notification-group-headers { - /* Notification Group Headers */ -} - -.notification-group .notification-group-headers .notification-group-icon { - color: @base05; -} - -.notification-group .notification-group-headers .notification-group-header { - color: @base05; -} - -.notification-group .notification-group-buttons { - /* Notification Group Buttons */ -} - -.notification-group.collapsed .notification-row .notification { - background: @base01; -} - -.notification-group.collapsed .notification-row:not(:last-child) { - /* Top notification in stack */ - /* Set lower stacked notifications opacity to 0 */ -} - .notification-group.collapsed .notification-row:not(:last-child) .notification-action, @@ -190,68 +31,19 @@ trough { opacity: 0; } -.notification-group.collapsed:hover - .notification-row:not(:only-child) - .notification { - background: @background-focus; -} - /*** Control Center ***/ .control-center { - background: @base00; - border: 1px solid @base0D; border-radius: 8px; - color: @base05; - padding: 1rem; + padding: 2rem; } .control-center-list { background: transparent; } -.control-center .notification-row .notification-background { - background: @base01; - border-radius: 8px; - color: @base05; - margin: 0.5rem; -} - -.control-center .notification-row .notification-background .notification { - border-radius: 8px; - padding: 0.5rem; -} - -.control-center - .notification-row - .notification-background - .notification - .notification-content { - margin: 0.5rem; -} - -.control-center - .notification-row - .notification-background - .notification - .notification-content - .time { - margin-right: 0.75rem; -} - -.control-center .notification-row .notification-background:hover { - background: @background-focus; - color: @base05; -} - -.control-center .notification-row .notification-background:active { - background: @base0F; - color: @base05; -} - /*** Widgets ***/ /* Title widget */ .widget-title { - color: @base05; margin: 0.5rem; } @@ -260,20 +52,12 @@ trough { } .widget-title > button { - background: @base01; - border: 1px solid @base0D; border-radius: 8px; - color: @base05; padding: 0.5rem; } -.widget-title > button:hover { - background: @background-focus; -} - /* DND Widget */ .widget-dnd { - color: @base05; margin: 0.5rem; } @@ -282,42 +66,21 @@ trough { } .widget-dnd > switch { - background: @base01; - border: 1px solid @base0D; border-radius: 8px; } -.widget-dnd > switch:hover { - background: @background-focus; -} - -.widget-dnd > switch:checked { - background: @base0F; -} - .widget-dnd > switch slider { - background: @background-focus; border-radius: 8px; padding: 0.25rem; } /* Mpris widget */ -.widget-mpris { - color: @base05; -} - .widget-mpris .widget-mpris-player { - background: @base01; - border: 1px solid @base0D; border-radius: 8px; margin: 0.5rem; padding: 0.5rem; } -.widget-mpris .widget-mpris-player button:hover { - background: @background-focus; -} - .widget-mpris .widget-mpris-player .widget-mpris-album-art { border-radius: 16px; } @@ -335,17 +98,3 @@ trough { border-radius: 8px; padding: 0.25rem; } - -.widget-mpris .widget-mpris-player > box > button:hover { - background: @background-focus; - border: 1px solid @base0D; -} - -.widget-mpris > box > button { - /* Change player side buttons */ -} - -.widget-mpris > box > button:disabled { - /* Change player side buttons insensitive */ -} - diff --git a/home/modules/thunderbird/default.nix b/home/modules/thunderbird/default.nix index 6e37ffa..99f04a9 100644 --- a/home/modules/thunderbird/default.nix +++ b/home/modules/thunderbird/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.thunderbird; -in { +in +{ options = { module.thunderbird.enable = mkEnableOption "Enables thunderbird"; }; @@ -30,4 +32,3 @@ in { }; }; } - diff --git a/home/modules/vscode/default.nix b/home/modules/vscode/default.nix index e4f5c5a..c0e7b3b 100644 --- a/home/modules/vscode/default.nix +++ b/home/modules/vscode/default.nix @@ -1,18 +1,20 @@ -{ lib -, config -, homeModules -, ... +{ + self, + lib, + config, + ... }: with lib; let cfg = config.module.vscode; -in { +in +{ imports = [ - "${homeModules}/vscode/keybindings" - "${homeModules}/vscode/extentions" - "${homeModules}/vscode/settings" + "${self}/home/modules/vscode/keybindings" + "${self}/home/modules/vscode/extentions" + "${self}/home/modules/vscode/settings" ]; options = { @@ -26,4 +28,3 @@ in { }; }; } - diff --git a/home/modules/vscode/extentions/default.nix b/home/modules/vscode/extentions/default.nix index 5cd7dc7..59c0fa3 100644 --- a/home/modules/vscode/extentions/default.nix +++ b/home/modules/vscode/extentions/default.nix @@ -1,5 +1,6 @@ -{ pkgs -, ... +{ + pkgs, + ... }: { @@ -57,4 +58,3 @@ redhat.vscode-yaml ]; } - diff --git a/home/modules/vscode/keybindings/default.nix b/home/modules/vscode/keybindings/default.nix index 3dfcc05..f603e50 100644 --- a/home/modules/vscode/keybindings/default.nix +++ b/home/modules/vscode/keybindings/default.nix @@ -1,8 +1,9 @@ -{ homeModules -, ... +{ + self, + ... }: { - home.file.".config/Code/User/keybindings.json".source = "${homeModules}/vscode/keybindings/keybindings.json"; + home.file.".config/Code/User/keybindings.json".source = + "${self}/home/modules/vscode/keybindings/keybindings.json"; } - diff --git a/home/modules/vscode/settings/default.nix b/home/modules/vscode/settings/default.nix index e0dc465..acecf26 100644 --- a/home/modules/vscode/settings/default.nix +++ b/home/modules/vscode/settings/default.nix @@ -5,8 +5,8 @@ _: "workbench.startupEditor" = "newUntitledFile"; "workbench.colorCustomizations" = { "[Oceanic Next (dimmed bg)]" = { - "sideBar.background" = "#1D2225"; - "editor.background" = "#262626"; + "sideBar.background" = "#1D2225"; + "editor.background" = "#262626"; }; }; "editor.rulers" = [ 80 ]; @@ -24,14 +24,14 @@ _: "go.toolsManagement.autoUpdate" = true; "explorer.confirmDelete" = false; "workbench.editorAssociations" = { - "*.ipynb" = "jupyter-notebook"; - "*.drawio" = "hediet.vscode-drawio-text"; + "*.ipynb" = "jupyter-notebook"; + "*.drawio" = "hediet.vscode-drawio-text"; }; "python.showStartPage" = false; "docker.showStartPage" = false; "notebook.cellToolbarLocation" = { - "default" = "right"; - "jupyter-notebook" = "left"; + "default" = "right"; + "jupyter-notebook" = "left"; }; "explorer.confirmDragAndDrop" = false; "editor.suggestSelection" = "first"; @@ -40,31 +40,31 @@ _: "editor.unicodeHighlight.ambiguousCharacters" = false; "python.defaultInterpreterPath" = "/usr/bin/python3"; "yaml.customTags" = [ - "!reference sequence" - "!vault" + "!reference sequence" + "!vault" ]; "editor.renderWhitespace" = "all"; "liveServer.settings.donotShowInfoMsg" = true; "terminal.integrated.defaultProfile.linux" = "zsh"; "terminal.integrated.gpuAcceleration" = "canvas"; "[python]" = { - "editor.formatOnType" = true; + "editor.formatOnType" = true; }; "editor.minimap.enabled" = false; "gitlens.blame.highlight.locations" = [ - "gutter" - "line" - "overview" + "gutter" + "line" + "overview" ]; "gitlens.changes.locations" = [ - "gutter" - "line" - "overview" + "gutter" + "line" + "overview" ]; "gitlens.heatmap.locations" = [ - "gutter" - "line" - "overview" + "gutter" + "line" + "overview" ]; "gitlens.codeLens.recentChange.enabled" = false; "gitlens.codeLens.authors.enabled" = false; @@ -85,4 +85,3 @@ _: "sops-edit.onlyUseButtons" = true; }; } - diff --git a/home/modules/waybar/default.nix b/home/modules/waybar/default.nix index d370afb..a77186b 100644 --- a/home/modules/waybar/default.nix +++ b/home/modules/waybar/default.nix @@ -1,17 +1,18 @@ -{ self -, pkgs -, config -, lib -, homeModules -, wm -, ... +{ + self, + pkgs, + config, + lib, + wm, + ... }: with lib; let cfg = config.module.waybar; -in { +in +{ options = { module.waybar.enable = mkEnableOption "Enables waybar"; }; @@ -48,6 +49,7 @@ in { "${wm}/language" "tray" "pulseaudio" + "privacy" "cpu" "memory" "network" @@ -59,13 +61,13 @@ in { "custom/nixlogo" = { format = "οŒ“"; tooltip = false; - on-click = "${pkgs.wofi}/bin/wofi --show drun"; + on-click = config.module.defaults.appLauncherCmd; }; "image#nixlogo" = { path = "${self}/assets/Nix_Logo.svg"; tooltip = false; - on-click = "${pkgs.wofi}/bin/wofi --show drun"; + on-click = config.module.defaults.appLauncherCmd; }; # Workspaces @@ -75,7 +77,9 @@ in { disable-scroll = true; all-outputs = true; show-special = true; - persistent-workspaces = {"*" = 6;}; + persistent-workspaces = { + "*" = 6; + }; }; "sway/workspaces" = { @@ -140,7 +144,13 @@ in { format-source = "󰍬"; format-source-muted = "󰍭"; format-muted = "󰖁 / {format_source}"; - format-icons = {default = ["σ°•Ώ" "σ°–€" "σ°•Ύ"];}; + format-icons = { + default = [ + "σ°•Ώ" + "σ°–€" + "σ°•Ύ" + ]; + }; on-click = "${pkgs.pavucontrol}/bin/pavucontrol"; on-click-right = "${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle"; on-scroll-up = "${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +1%"; @@ -152,7 +162,13 @@ in { battery = { format = "{icon} {capacity}%"; format-charging = "{icon} {capacity}%"; - format-icons = ["" "" "" "" ""]; + format-icons = [ + "" + "" + "" + "" + "" + ]; format-plugged = " {power} W"; interval = 5; tooltip-format = "{timeTo}, {capacity}%\n {power} W"; @@ -190,7 +206,13 @@ in { # Network network = { - format-icons = ["σ°€―" "󰀟" "σ°€’" "σ°€₯" "󰀨"]; + format-icons = [ + "σ°€―" + "󰀟" + "σ°€’" + "σ°€₯" + "󰀨" + ]; format-wifi = "{icon}"; format-ethernet = "σ°ˆ€"; # 󰈁 format-disconnected = "⚠"; @@ -200,13 +222,17 @@ in { on-click = "${pkgs.networkmanagerapplet}/bin/nm-connection-editor"; interval = 5; }; + + # Privacy + privacy = { + icon-size = 15; + }; } ]; style = mkAfter '' - ${builtins.readFile "${homeModules}/waybar/style.css"} + ${builtins.readFile "${self}/home/modules/waybar/style.css"} ''; }; }; } - diff --git a/home/modules/waybar/style.css b/home/modules/waybar/style.css index 92740c2..fc0bfe0 100644 --- a/home/modules/waybar/style.css +++ b/home/modules/waybar/style.css @@ -51,8 +51,9 @@ window#waybar { #battery, #custom-notification, #workspaces button, -#custom-nixlogo, +#custom-nixlogo, #image, +#privacy, #clock { color: @base05; background: @base01; @@ -62,6 +63,10 @@ window#waybar { padding: 0.2rem 0.6rem 0.2rem 0.6rem; } +#privacy { + background: @base0B; +} + .modules-left #workspaces button { border-bottom: 1px solid @base03; } @@ -201,4 +206,3 @@ menu menuitem:only-child { color: @base05; } } - diff --git a/home/modules/wofi/default.nix b/home/modules/wofi/default.nix index 0aff498..844ddfe 100644 --- a/home/modules/wofi/default.nix +++ b/home/modules/wofi/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.wofi; -in { +in +{ options = { module.wofi = { enable = mkEnableOption "Enable wofi app runner"; @@ -20,10 +22,9 @@ in { settings = { allow_images = true; - insensitive = true; - width = "30%"; + insensitive = true; + width = "30%"; }; }; }; } - diff --git a/home/modules/yazi/default.nix b/home/modules/yazi/default.nix index 385b68d..817d642 100644 --- a/home/modules/yazi/default.nix +++ b/home/modules/yazi/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.yazi; -in { +in +{ options = { module.yazi.enable = mkEnableOption "Enables yazi"; }; @@ -19,4 +21,3 @@ in { }; }; } - diff --git a/home/modules/zathura/default.nix b/home/modules/zathura/default.nix index 6239546..269f556 100644 --- a/home/modules/zathura/default.nix +++ b/home/modules/zathura/default.nix @@ -1,13 +1,15 @@ -{ config -, lib -, ... +{ + config, + lib, + ... }: with lib; let cfg = config.module.zathura; -in { +in +{ options = { module.zathura.enable = mkEnableOption "Enables zathura"; }; @@ -18,4 +20,3 @@ in { }; }; } - diff --git a/home/modules/zoxide/default.nix b/home/modules/zoxide/default.nix index 3ff5bd2..619e27f 100644 --- a/home/modules/zoxide/default.nix +++ b/home/modules/zoxide/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.zoxide; -in { +in +{ options = { module.zoxide.enable = mkEnableOption "Enables zoxide"; }; @@ -19,4 +21,3 @@ in { }; }; } - diff --git a/home/modules/zsh/default.nix b/home/modules/zsh/default.nix index 0f5254d..e54d1b1 100644 --- a/home/modules/zsh/default.nix +++ b/home/modules/zsh/default.nix @@ -1,23 +1,25 @@ -{ inputs -, lib -, username -, config -, homeModules -, ... +{ + inputs, + self, + lib, + username, + config, + ... }: with lib; let cfg = config.module.zsh; -in { +in +{ options = { module.zsh.enable = mkEnableOption "Enables zsh"; }; config = mkIf cfg.enable { - home.file.".p10k.zsh".source = "${homeModules}/zsh/p10k.zsh"; - home.file.".helmrc".source = "${homeModules}/zsh/helmrc"; + home.file.".p10k.zsh".source = "${self}/home/modules/zsh/p10k.zsh"; + home.file.".helmrc".source = "${self}/home/modules/zsh/helmrc"; programs.zsh = { enable = true; @@ -50,22 +52,24 @@ in { } ]; - oh-my-zsh = { - enable = true; - - plugins = [ - "git" - "vagrant" - "docker" - "python" - "pass" - "kubectl" - ]; - - extraConfig = '' - zstyle ':omz:update' mode disabled - ''; - }; + /* + oh-my-zsh = { + enable = true; + + plugins = [ + "git" + "vagrant" + "docker" + "python" + "pass" + "kubectl" + ]; + + extraConfig = '' + zstyle ':omz:update' mode disabled + ''; + }; + */ shellAliases = { # System @@ -125,4 +129,3 @@ in { }; }; } - diff --git a/home/overlays/chrome/default.nix b/home/overlays/chrome/default.nix index 3417ef7..0207fd1 100644 --- a/home/overlays/chrome/default.nix +++ b/home/overlays/chrome/default.nix @@ -3,4 +3,3 @@ _: prev: { commandLineArgs = "--force-dark-mode"; }; } - diff --git a/home/overlays/rofi-calc/default.nix b/home/overlays/rofi-calc/default.nix index 23473c6..5ef009d 100644 --- a/home/overlays/rofi-calc/default.nix +++ b/home/overlays/rofi-calc/default.nix @@ -3,4 +3,3 @@ _: prev: { rofi-unwrapped = prev.rofi-wayland-unwrapped; }; } - diff --git a/home/overlays/rofi-emoji/default.nix b/home/overlays/rofi-emoji/default.nix index 43476ca..f0f04fe 100644 --- a/home/overlays/rofi-emoji/default.nix +++ b/home/overlays/rofi-emoji/default.nix @@ -3,4 +3,3 @@ _: prev: { rofi-unwrapped = prev.rofi-wayland-unwrapped; }; } - diff --git a/home/overlays/waybar/default.nix b/home/overlays/waybar/default.nix index 08a6cd1..1cca86b 100644 --- a/home/overlays/waybar/default.nix +++ b/home/overlays/waybar/default.nix @@ -3,4 +3,3 @@ _: prev: { wireplumberSupport = false; }; } - diff --git a/home/users/maxmur/default.nix b/home/users/maxmur/default.nix index b629a4d..32db143 100644 --- a/home/users/maxmur/default.nix +++ b/home/users/maxmur/default.nix @@ -1,13 +1,14 @@ -{ isWorkstation -, isLinux -, hyprlandEnable ? false -, swayEnable ? false -, wmEnable ? false -, ... +{ + isWorkstation, + isLinux, + hyprlandEnable ? false, + swayEnable ? false, + wmEnable ? false, + ... }: { - nixpkgs.overlays = [ ]; + nixpkgs.overlays = [ ]; stylix.targets = { vscode.enable = false; @@ -16,53 +17,51 @@ module = { alacritty.enable = isWorkstation; - vscode.enable = isWorkstation; - emacs.enable = isWorkstation; - zathura.enable = isWorkstation; - stylix.enable = isWorkstation; + vscode.enable = isWorkstation; + emacs.enable = isWorkstation; + zathura.enable = isWorkstation; + stylix.enable = isWorkstation; - chrome.enable = isLinux && isWorkstation; - firefox.enable = isLinux && isWorkstation; - librewolf.enable = isLinux && isWorkstation; + chromium.enable = isLinux && isWorkstation; + firefox.enable = isLinux && isWorkstation; + librewolf.enable = isLinux && isWorkstation; thunderbird.enable = isLinux && isWorkstation; - foot.enable = isLinux && isWorkstation; - ssh.enable = isLinux && isWorkstation; + foot.enable = isLinux && isWorkstation; + ssh.enable = isLinux && isWorkstation; hyprland.enable = hyprlandEnable && isLinux && isWorkstation; hyprlock.enable = hyprlandEnable && isLinux && isWorkstation; - sway.enable = swayEnable && isLinux && isWorkstation; + sway.enable = swayEnable && isLinux && isWorkstation; swaylock.enable = swayEnable && isLinux && isWorkstation; hypridle.enable = wmEnable && isLinux && isWorkstation; - waybar.enable = wmEnable && isLinux && isWorkstation; - fuzzel.enable = wmEnable && isLinux && isWorkstation; - wofi.enable = wmEnable && isLinux && isWorkstation; - swaync.enable = wmEnable && isLinux && isWorkstation; + waybar.enable = wmEnable && isLinux && isWorkstation; + rofi.enable = wmEnable && isLinux && isWorkstation; + swaync.enable = wmEnable && isLinux && isWorkstation; - btop.enable = true; - eza.enable = true; - git.enable = true; - fzf.enable = true; - htop.enable = true; - ripgrep.enable = true; - lazygit.enable = true; - neofetch.enable = true; - fastfetch.enable = true; - nvim.enable = true; - helix.enable = true; + btop.enable = true; + eza.enable = true; + git.enable = true; + fzf.enable = true; + htop.enable = true; + ripgrep.enable = true; + lazygit.enable = true; + neofetch.enable = true; + fastfetch.enable = true; + nvim.enable = true; + helix.enable = true; password-store.enable = true; - zsh.enable = true; - fish.enable = true; - zoxide.enable = true; - yazi.enable = true; + zsh.enable = true; + fish.enable = true; + zoxide.enable = true; + yazi.enable = true; user = { impermanence.enable = isLinux && isWorkstation; - xdg.enable = isLinux && isWorkstation; + xdg.enable = isLinux && isWorkstation; packages.enable = true; }; }; } - diff --git a/home/users/maxmur/modules/default.nix b/home/users/maxmur/modules/default.nix index ffa0d9e..ef34673 100644 --- a/home/users/maxmur/modules/default.nix +++ b/home/users/maxmur/modules/default.nix @@ -1,14 +1,13 @@ -{ self -, lib -, username -, ... +{ + self, + username, + allDirs, + ... }: let userModules = "${self}/home/users/${username}/modules"; -in { - imports = builtins.filter (module: lib.pathIsDirectory module) ( - map (module: "${userModules}/${module}") (builtins.attrNames (builtins.readDir userModules)) - ); +in +{ + imports = allDirs userModules; } - diff --git a/home/users/maxmur/modules/impermanence/default.nix b/home/users/maxmur/modules/impermanence/default.nix index cda0f40..68cd522 100644 --- a/home/users/maxmur/modules/impermanence/default.nix +++ b/home/users/maxmur/modules/impermanence/default.nix @@ -1,14 +1,16 @@ -{ lib -, config -, username -, ... +{ + lib, + config, + username, + ... }: with lib; let - cfg = config.module.user.impermanence; -in { + cfg = config.module.user.impermanence; +in +{ options = { module.user.impermanence.enable = mkEnableOption "Enables home impermanence"; }; @@ -58,6 +60,7 @@ in { ".config/htop" ".config/nvim" ".config/syncthing" + ".config/obs-studio" ".config/pulse" ".local/share/chat.fluffy.fluffychat" ".local/share/zoxide" @@ -88,4 +91,3 @@ in { }; }; } - diff --git a/home/users/maxmur/modules/packages/default.nix b/home/users/maxmur/modules/packages/default.nix index 0a70ef7..3d1e945 100644 --- a/home/users/maxmur/modules/packages/default.nix +++ b/home/users/maxmur/modules/packages/default.nix @@ -1,10 +1,11 @@ -{ config -, lib -, pkgs -, inputs -, isWorkstation -, wmEnable -, ... +{ + config, + lib, + pkgs, + inputs, + isWorkstation, + wmEnable, + ... }: with lib; @@ -12,7 +13,8 @@ with lib; let inherit (pkgs.stdenv) isLinux; cfg = config.module.user.packages; -in { +in +{ options.module.user.packages = { enable = mkEnableOption "Enable user packages"; }; @@ -20,79 +22,82 @@ in { config = mkIf cfg.enable { fonts.fontconfig.enable = true; - home.packages = with pkgs; [ - # Utils - bat - tokei - shellcheck - pre-commit - deadnix - statix - ffmpeg - inputs.any-nix-shell + home.packages = + with pkgs; + [ + # Utils + bat + tokei + shellcheck + pre-commit + deadnix + statix + ffmpeg + inputs.any-nix-shell - # Security - age - sops - ] ++ lib.optionals isWorkstation [ - # Chats - discord + # Security + age + sops + ] + ++ lib.optionals isWorkstation [ + # Text Editors + obsidian - # Text Editors - obsidian + # Fonts + nerd-fonts.jetbrains-mono + nerd-fonts.ubuntu-mono + nerd-fonts.iosevka + corefonts + ] + ++ lib.optionals (isLinux && isWorkstation) [ + inputs.ghostty.packages.x86_64-linux.default + # Programming + go + python3 - # Fonts - (nerdfonts.override { fonts = [ "JetBrainsMono" "UbuntuMono" "Iosevka" ]; }) - corefonts - ] ++ lib.optionals (isLinux && isWorkstation) [ - # Programming - go - python3 + # DevOps Utils + docker-compose + kubectl + kubernetes-helm + ansible + ansible-lint - # DevOps Utils - docker-compose - kubectl - kubernetes-helm - ansible - ansible-lint + # Chats + telegram-desktop + fluffychat + vesktop - # Chats - telegram-desktop - fluffychat - vesktop + # Office + onlyoffice-bin - # Office - onlyoffice-bin - - # Misc - obs-studio - dconf2nix - via - gpick - gat - vlc - eog - ] ++ lib.optionals wmEnable [ - imagemagick - grim - slurp - wl-clipboard - wf-recorder - hyprpicker - waypaper - cliphist - imv - gtk3 - dbus - glib - swww - xdg-utils - pavucontrol - nemo - eww - networkmanagerapplet - brightnessctl - ]; + # Misc + obs-studio + dconf2nix + via + gat + vlc + eog + ] + ++ lib.optionals wmEnable [ + imagemagick + grim + slurp + wl-clipboard + wf-recorder + hyprpicker + waypaper + cliphist + imv + gtk3 + dbus + glib + swww + xdg-utils + pavucontrol + xfce.thunar + eww + networkmanagerapplet + brightnessctl + ]; }; } - diff --git a/home/users/maxmur/modules/xdg/default.nix b/home/users/maxmur/modules/xdg/default.nix index 8b79754..98d996a 100644 --- a/home/users/maxmur/modules/xdg/default.nix +++ b/home/users/maxmur/modules/xdg/default.nix @@ -1,13 +1,15 @@ -{ config -, lib -, ... +{ + config, + lib, + ... }: with lib; let cfg = config.module.user.xdg; -in { +in +{ options = { module.user.xdg.enable = mkEnableOption "Enables xdg"; }; @@ -35,4 +37,3 @@ in { }; }; } - diff --git a/home/users/root/default.nix b/home/users/root/default.nix index 33628df..d81b280 100644 --- a/home/users/root/default.nix +++ b/home/users/root/default.nix @@ -1,6 +1,7 @@ -{ pkgs -, inputs -, ... +{ + pkgs, + inputs, + ... }: { @@ -30,4 +31,3 @@ }; }; } - diff --git a/home/users/test/default.nix b/home/users/test/default.nix index b011752..c61ecf9 100644 --- a/home/users/test/default.nix +++ b/home/users/test/default.nix @@ -1,6 +1,7 @@ -{ pkgs -, inputs -, ... +{ + pkgs, + inputs, + ... }: { @@ -17,4 +18,3 @@ ]; }; } - diff --git a/home/users/test/nbox/default.nix b/home/users/test/nbox/default.nix index 463c643..d05970a 100644 --- a/home/users/test/nbox/default.nix +++ b/home/users/test/nbox/default.nix @@ -1,6 +1,7 @@ -{ inputs -, pkgs -, ... +{ + inputs, + pkgs, + ... }: { @@ -31,4 +32,3 @@ ../../../modules/git ]; } - diff --git a/hosts.nix b/hosts.nix index 025819f..4ac78a8 100644 --- a/hosts.nix +++ b/hosts.nix @@ -1,36 +1,50 @@ { nixos = { pcbox = { - username = "maxmur"; - platform = "x86_64-linux"; - stateVersion = "24.11"; + username = "maxmur"; + platform = "x86_64-linux"; + stateVersion = "25.05"; isWorkstation = true; - wm = "sway"; + wm = "sway"; }; nbox = { - username = "maxmur"; - platform = "x86_64-linux"; - stateVersion = "24.11"; + username = "maxmur"; + platform = "x86_64-linux"; + stateVersion = "25.05"; isWorkstation = true; - wm = "sway"; + wm = "sway"; }; rasp = { - username = "maxmur"; - platform = "aarch64-linux"; - stateVersion = "24.11"; + username = "maxmur"; + platform = "aarch64-linux"; + stateVersion = "25.05"; isWorkstation = false; }; + + hlbox = { + username = "maxmur"; + platform = "x86_64-linux"; + stateVersion = "25.05"; + isWorkstation = false; + }; + + p8box = { + username = "maxmur"; + platform = "x86_64-linux"; + stateVersion = "25.05"; + isWorkstation = true; + wm = "sway"; + }; }; darwin = { macbox = { - username = "maxmur"; - platform = "aarch64-darwin"; - stateVersion = 6; + username = "maxmur"; + platform = "aarch64-darwin"; + stateVersion = 5; isWorkstation = true; }; }; } - diff --git a/lib/default.nix b/lib/default.nix index 26da2ad..0fd9875 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,95 +1,134 @@ -{ self -, inputs -, ... +{ + self, + inputs, + ... }: let - homeConfiguration = "${self}/home"; - systemConfiguration = "${self}/system"; + defaultStateVersion = "24.11"; - homeModules = "${homeConfiguration}/modules"; - systemModules = "${systemConfiguration}/modules"; - commonModules = "${self}/modules"; + constructors = [ + "${self}/home" + "${self}/system" + ]; + + allDirs = + dirName: + builtins.filter ( + module: ((builtins.pathExists module) && ((builtins.readFileType module) == "directory")) + ) (map (module: "${dirName}/${module}") (builtins.attrNames (builtins.readDir dirName))); # Helper function for generating host configs - mkHost = machineDir: - { username ? "user" - , stateVersion ? "24.05" - , platform ? "x86_64-linux" - , hostname ? machineDir - , isWorkstation ? false - , wm ? null + mkHost = + machineDir: + { + username ? "user", + stateVersion ? defaultStateVersion, + hmStateVersion ? stateVersion, + platform ? "x86_64-linux", + hostname ? machineDir, + isWorkstation ? false, + wm ? null, + hostType ? "nixos", }: let - machineConfigurationPath = "${self}/system/machine/${machineDir}"; - machineConfigurationPathExist = builtins.pathExists machineConfigurationPath; - machineModulesPath = "${self}/system/machine/${machineDir}/modules"; - machineModulesPathExist = builtins.pathExists machineModulesPath; - - swayEnable = wm == "sway"; + swayEnable = wm == "sway"; hyprlandEnable = wm == "hyprland"; - wmEnable = hyprlandEnable || swayEnable; - in inputs.nixpkgs.lib.nixosSystem { + wmEnable = hyprlandEnable || swayEnable; + in + inputs.nixpkgs.lib.nixosSystem { specialArgs = { - inherit + inherit inputs self + allDirs hostname username stateVersion + hmStateVersion platform machineDir isWorkstation wm - homeModules - commonModules - systemModules - machineConfigurationPath - machineConfigurationPathExist - machineModulesPath - machineModulesPathExist hyprlandEnable swayEnable - wmEnable; + wmEnable + hostType + ; }; - modules = [ - "${systemConfiguration}" - "${homeConfiguration}" - ]; + modules = + with inputs; + [ + home-manager.nixosModules.home-manager + stylix.nixosModules.stylix + impermanence.nixosModules.impermanence + disko.nixosModules.disko + lanzaboote.nixosModules.lanzaboote + chaotic.nixosModules.default + nix-topology.nixosModules.default + nur.modules.nixos.default + proxmox-nixos.nixosModules.proxmox-ve + sops-nix.nixosModules.sops + nur.modules.nixos.default + ] + ++ constructors; }; # Helper function for generating darwin host configs - mkHostDarwin = hostname: - { username ? "user" - , stateVersion ? 6 - , platform ? "aarch64-darwin" + mkHostDarwin = + machineDir: + { + username ? "user", + stateVersion ? 6, + hmStateVersion ? defaultStateVersion, + hostname ? machineDir, + platform ? "aarch64-darwin", + isWorkstation ? false, + wm ? null, + hostType ? "darwin", }: + let + swayEnable = wm == "sway"; + hyprlandEnable = wm == "hyprland"; + wmEnable = hyprlandEnable || swayEnable; + in inputs.darwin.lib.darwinSystem { specialArgs = { - inherit + inherit inputs self + allDirs hostname username platform + isWorkstation + machineDir stateVersion - systemModules - commonModules; + hmStateVersion + wm + hyprlandEnable + swayEnable + wmEnable + hostType + ; }; - modules = [ - "${systemConfiguration}" - "${homeConfiguration}" - ]; + modules = + with inputs; + [ + home-manager.darwinModules.home-manager + stylix.darwinModules.stylix + ] + ++ constructors; }; -in { +in +{ forAllSystems = inputs.nixpkgs.lib.systems.flakeExposed; # This function just add mkHost or mkHostDarwin before hosts attrset # ex: pcbox = { username = "test"; stateVersion = "24.11"; }; -> # pcbox = mkHost { username = "test"; stateVersion = "24.11"; }; - genNixos = builtins.mapAttrs mkHost; + genNixos = builtins.mapAttrs mkHost; genDarwin = builtins.mapAttrs mkHostDarwin; } - diff --git a/modules/default.nix b/modules/default.nix index 03c0f55..8cfa1f9 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,11 +1,9 @@ -{ lib -, commonModules -, ... +{ + self, + allDirs, + ... }: { - imports = builtins.filter (module: lib.pathIsDirectory module) ( - map (module: "${commonModules}/${module}") (builtins.attrNames (builtins.readDir commonModules)) - ); + imports = allDirs "${self}/modules"; } - diff --git a/modules/defaults/default.nix b/modules/defaults/default.nix new file mode 100644 index 0000000..f85a92c --- /dev/null +++ b/modules/defaults/default.nix @@ -0,0 +1,134 @@ +{ + lib, + config, + pkgs, + ... +}: + +with lib; + +let + cfg = config.module.defaults; +in +{ + options.module.defaults = { + # Defaults + terminal = mkOption { + type = types.enum [ + "foot" + "alacritty" + ]; + + default = "foot"; + }; + + appLauncher = mkOption { + type = types.enum [ + "wofi" + "rofi" + "rofi-wayland" + "fuzzel" + ]; + + default = "rofi-wayland"; + }; + + browser = mkOption { + type = types.enum [ + "librewolf" + "firefox" + "chromium" + ]; + + default = "librewolf"; + }; + + # Defaults cmds + terminalCmd = mkOption { + type = types.str; + default = "${pkgs.${cfg.terminal}}/bin/${cfg.terminal}"; + }; + + browserCmd = + + let + browserExecs = { + librewolf = "${pkgs.librewolf}/bin/librewolf"; + firefox = "${pkgs.firefox}/bin/firefox"; + chromium = "${pkgs.ungoogled-chromium}/bin/chromium"; + }; + in + mkOption { + type = types.str; + default = browserExecs.${cfg.browser}; + }; + + appLauncherCmd = + let + appLauncherExecs = { + rofi = "${pkgs.rofi}/bin/rofi -show drun"; + rofi-wayland = "${pkgs.rofi-wayland}/bin/rofi -show drun"; + wofi = "${pkgs.wofi}/wofi --show drun"; + fuzzel = "${pkgs.fuzzel}/fuzzel --show drun"; + }; + in + mkOption { + type = types.str; + default = appLauncherExecs.${cfg.appLauncher}; + }; + + audioControlCmd = mkOption { + type = types.str; + default = "${pkgs.pulseaudio}/bin/pactl"; + }; + + brightnessControlCmd = mkOption { + type = types.str; + default = "${pkgs.brightnessctl}/bin/brightnessctl"; + }; + + clipHistCmd = mkOption { + type = types.str; + default = "${pkgs.cliphist}/bin/cliphist list | ${cfg.appLauncherCmd} -d | ${pkgs.cliphist}/bin/cliphist decode | ${pkgs.wl-clipboard}/bin/wl-copy"; + }; + + notificationsAppCmd = mkOption { + type = types.str; + default = "${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw"; + }; + + ssh = { + pubKeys = mkOption { + type = types.listOf types.str; + default = [ ]; + }; + }; + + network = { + iface = mkOption { + type = types.str; + default = ""; + }; + + ip = mkOption { + type = types.str; + default = ""; + }; + + gw = mkOption { + type = types.str; + default = ""; + }; + + mask = mkOption { + type = types.str; + default = ""; + }; + + cidr = mkOption { + type = types.str; + default = ""; + }; + }; + }; +} diff --git a/modules/nix/default.nix b/modules/nix/default.nix index 3c0298b..bb890cc 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -1,15 +1,17 @@ -{ inputs -, lib -, config -, pkgs -, ... +{ + inputs, + lib, + config, + pkgs, + ... }: with lib; let cfg = config.module.nix-config; -in { +in +{ options = { module.nix-config = { enable = mkEnableOption "Enables nix-config"; @@ -31,36 +33,36 @@ in { "electron-27.3.11" "electron-25.9.0" "electron-19.1.9" - "fluffychat-linux-1.20.0" + "fluffychat-linux-1.23.0" "olm-3.2.16" ]; }; # Nix package manager settings nix = { - package = pkgs.nixVersions.latest; + package = pkgs.lix; registry.s.flake = inputs.self; settings = { - experimental-features = [ "nix-command" "flakes" ]; - auto-optimise-store = true; + experimental-features = [ + "nix-command" + "flakes" + ]; substituters = [ "https://hyprland.cachix.org" "https://nyx.chaotic.cx" + "https://ghostty.cachix.org" + "https://cache.saumon.network/proxmox-nixos" ]; trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8=" + "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" + "proxmox-nixos:nveXDuVVhFDRFx8Dn19f1WDEaNRJjPrF2CPD2D+m1ys=" ]; }; - - gc = { - automatic = true; - options = "--delete-older-than 14d"; - }; }; }; } - diff --git a/modules/stylix/default.nix b/modules/stylix/default.nix index b8819cd..462e25b 100644 --- a/modules/stylix/default.nix +++ b/modules/stylix/default.nix @@ -1,10 +1,11 @@ -{ pkgs -, lib -, self -, config -, hostname -, ... -}: +{ + pkgs, + lib, + self, + config, + hostname, + ... +}: with lib; @@ -14,56 +15,66 @@ let theme = "${pkgs.base16-schemes}/share/themes/nord.yaml"; wallpaper = "${self}/assets/grey_gradient.png"; cursorSize = if hostname == "nbox" then 24 else 14; -in { +in +{ options = { - module.stylix.enable = mkEnableOption "Enables stylix"; + module.stylix = { + enable = mkEnableOption "Enables stylix"; + + useCursor = mkOption { + type = types.bool; + default = true; + description = "Enable cursor settings"; + }; + }; }; config = mkIf cfg.enable { - stylix = { - enable = true; - image = wallpaper; - autoEnable = true; - polarity = "dark"; + stylix = + { + enable = true; + image = wallpaper; + autoEnable = true; + polarity = "dark"; - base16Scheme = theme; + base16Scheme = theme; - opacity = { - applications = 1.0; - terminal = 1.0; - popups = 1.0; - desktop = 1.0; - }; + opacity = { + applications = 1.0; + terminal = 1.0; + popups = 1.0; + desktop = 1.0; + }; - cursor = { - name = "Vimix-cursors"; - package = pkgs.vimix-cursors; - size = cursorSize; - }; + fonts = { + sizes = { + applications = 11; + terminal = 11; + popups = 12; + desktop = 11; + }; - fonts = { - sizes = { - applications = 11; - terminal = 11; - popups = 12; - desktop = 11; - }; + serif = { + package = pkgs.nerd-fonts.iosevka; + name = "Iosevka Nerd Font Mono"; + }; - serif = { - package = pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" "Iosevka" ]; }; - name = "Iosevka Nerd Font Mono"; - }; + sansSerif = config.stylix.fonts.serif; - sansSerif = config.stylix.fonts.serif; + monospace = { + inherit (config.stylix.fonts.serif) package; + name = "Iosevka Nerd Font Mono"; + }; - monospace = { - inherit (config.stylix.fonts.serif) package; - name = "Iosevka Nerd Font Mono"; + emoji = config.stylix.fonts.serif; + }; + } + // optionalAttrs cfg.useCursor { + cursor = { + name = "Vimix-cursors"; + package = pkgs.vimix-cursors; + size = cursorSize; }; - - emoji = config.stylix.fonts.serif; }; - }; }; } - diff --git a/overlays/nixpkgs/default.nix b/overlays/nixpkgs/default.nix index 964ea7c..7c8d402 100644 --- a/overlays/nixpkgs/default.nix +++ b/overlays/nixpkgs/default.nix @@ -1,14 +1,34 @@ -{ self -, lib -, ... +{ + inputs, + ... }: let - overlaysPath = "${self}/overlays/nixpkgs"; -in { - # Read all directories from systemModules - imports = builtins.filter (module: lib.pathIsDirectory module) ( - map (module: "${overlaysPath}/${module}") (builtins.attrNames (builtins.readDir overlaysPath)) - ); -} + baseSettings = { + config = { + allowBroken = true; + }; + }; + + permittedInsecurePackages = [ ]; + unfreeSettings = baseSettings // { + config = baseSettings.config // { + inherit permittedInsecurePackages; + allowUnfree = true; + }; + }; +in +{ + nixpkgs.overlays = [ + (final: _prev: { + stable = import inputs.stable { inherit (final) system; } // baseSettings; + stable-unfree = import inputs.stable { inherit (final) system; } // unfreeSettings; + unstable = import inputs.unstable { inherit (final) system; } // baseSettings; + unstable-unfree = import inputs.unstable { inherit (final) system; } // unfreeSettings; + + master = import inputs.master { inherit (final) system; } // baseSettings; + master-unfree = import inputs.master { inherit (final) system; } // unfreeSettings; + }) + ]; +} diff --git a/overlays/nixpkgs/master/default.nix b/overlays/nixpkgs/master/default.nix deleted file mode 100644 index 6763c64..0000000 --- a/overlays/nixpkgs/master/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ inputs -, ... -}: - -{ - nixpkgs.overlays = [ - # Default master - (final: _prev: { - master = import inputs.master { - inherit (final) system; - }; - }) - - # Unfree master - (final: _prev: { - master-unfree = import inputs.master { - inherit (final) system; - config.allowUnfree = true; - }; - }) - ]; -} - diff --git a/overlays/nixpkgs/stable/default.nix b/overlays/nixpkgs/stable/default.nix deleted file mode 100644 index b98ff2c..0000000 --- a/overlays/nixpkgs/stable/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ inputs -, ... -}: - -{ - nixpkgs.overlays = [ - # Default stable - (final: _prev: { - stable = import inputs.stable { - inherit (final) system; - }; - }) - - # Unfree stable - (final: _prev: { - stable-unfree = import inputs.stable { - inherit (final) system; - config.allowUnfree = true; - }; - }) - ]; -} - diff --git a/overlays/nixpkgs/unstable/default.nix b/overlays/nixpkgs/unstable/default.nix deleted file mode 100644 index 744e9a1..0000000 --- a/overlays/nixpkgs/unstable/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ inputs -, ... -}: - -{ - nixpkgs.overlays = [ - # Default unstable - (final: _prev: { - unstable = import inputs.unstable { - inherit (final) system; - }; - }) - - # Unfree unstable - (final: _prev: { - unstable-unfree = import inputs.unstable { - inherit (final) system; - config.allowUnfree = true; - }; - }) - ]; -} - diff --git a/parts/default.nix b/parts/default.nix index 8aafb98..82aa76f 100644 --- a/parts/default.nix +++ b/parts/default.nix @@ -1,10 +1,12 @@ -{ lib -, ... +{ + lib, + ... }: { imports = builtins.filter (module: lib.pathIsDirectory module) ( - map (module: builtins.toString ./. + "/${module}") (builtins.attrNames (builtins.readDir (builtins.toString ./.))) + map (module: builtins.toString ./. + "/${module}") ( + builtins.attrNames (builtins.readDir (builtins.toString ./.)) + ) ); } - diff --git a/parts/devshell/default.nix b/parts/devshell/default.nix index ff64b49..f5775d5 100644 --- a/parts/devshell/default.nix +++ b/parts/devshell/default.nix @@ -1,31 +1,32 @@ { - perSystem = { pkgs, ... }: { - # For nix develop - devShells.default = pkgs.mkShell { - name = "flake-template"; - meta.description = "DevShell for Flake"; + perSystem = + { pkgs, ... }: + { + # For nix develop + devShells.default = pkgs.mkShell { + name = "flake-template"; + meta.description = "DevShell for Flake"; - # Env - EDITOR = "${pkgs.helix}/bin/hx"; + # Env + EDITOR = "${pkgs.helix}/bin/hx"; - shellHook = '' - exec fish - ''; + shellHook = '' + exec fish + ''; - packages = with pkgs; [ - yazi - git - curl - helix - fish - tmux - lynx - ripgrep - htop - disko - fzf - ]; + packages = with pkgs; [ + yazi + git + curl + helix + fish + tmux + lynx + ripgrep + htop + disko + fzf + ]; + }; }; - }; } - diff --git a/parts/topology/default.nix b/parts/topology/default.nix index fbd2d18..5d5096b 100644 --- a/parts/topology/default.nix +++ b/parts/topology/default.nix @@ -1,6 +1,7 @@ -{ inputs -, self -, ... +{ + inputs, + self, + ... }: { @@ -13,23 +14,25 @@ perSystem = _: { # For nix topology topology.modules = [ - ({ config, ... }: - let - inherit - (config.lib.topology) - mkInternet - mkConnection; - in { - inherit (self) nixosConfigurations; + ( + { config, ... }: + let + inherit (config.lib.topology) + mkInternet + mkConnection + ; + in + { + inherit (self) nixosConfigurations; - nodes.internet = mkInternet { - connections = [ - (mkConnection "mgts-bridge-router" "wan1") - (mkConnection "timeweb-router" "wan1") - ]; - }; - }) + nodes.internet = mkInternet { + connections = [ + (mkConnection "mgts-bridge-router" "wan1") + (mkConnection "timeweb-router" "wan1") + ]; + }; + } + ) ]; }; } - diff --git a/parts/topology/home/default.nix b/parts/topology/home/default.nix index 3f92a1f..3e30f28 100644 --- a/parts/topology/home/default.nix +++ b/parts/topology/home/default.nix @@ -1,140 +1,152 @@ -{ self -, ... +{ + self, + ... }: { perSystem = _: { # For nix topology topology.modules = [ - ({ config, ... }: - let - inherit - (config.lib.topology) - mkRouter - mkSwitch - mkDevice - mkConnection; - in { - inherit (self) nixosConfigurations; - - networks = { - mgts-bridge = { - name = "MGTS bridge network"; - cidrv4 = "192.168.0.0/24"; - }; - - home-maxmur = { - name = "Home maxmur"; - cidrv4 = "192.168.1.0/24"; - }; - }; - - nodes = { - mgts-bridge-router = mkRouter "Bridge router" { - info = "MGTS Innbox G84"; - image = ../images/Innbox_G84.png; - - interfaceGroups = [ - [ "eth1" ] - [ "wan1" ] - ]; - - interfaces = { - eth1 = { - addresses = [ "192.168.0.1" ]; - network = "mgts-bridge"; - }; + ( + { config, ... }: + let + inherit (config.lib.topology) + mkRouter + mkSwitch + mkDevice + mkConnection + ; + in + { + inherit (self) nixosConfigurations; + + networks = { + mgts-bridge = { + name = "MGTS bridge network"; + cidrv4 = "192.168.0.0/24"; }; - connections = { - eth1 = mkConnection "main-router" "wan1"; + home-maxmur = { + name = "Home maxmur"; + cidrv4 = "192.168.1.0/24"; }; }; - main-router = mkRouter "Main Router" { - info = "Keenetic Giga"; - image = ../images/keenetic-giga.png; - - interfaceGroups = [ - [ "eth1" "wifi" ] - [ "wan1" ] - ]; + nodes = { + mgts-bridge-router = mkRouter "Bridge router" { + info = "MGTS Innbox G84"; + image = ../images/Innbox_G84.png; + + interfaceGroups = [ + [ "eth1" ] + [ "wan1" ] + ]; + + interfaces = { + eth1 = { + addresses = [ "192.168.0.1" ]; + network = "mgts-bridge"; + }; + }; - interfaces = { - eth1 = { - addresses = [ "192.168.1.1" ]; - network = "home-maxmur"; + connections = { + eth1 = mkConnection "main-router" "wan1"; }; + }; - wifi = { - addresses = [ "192.168.1.1" ]; - network = "home-maxmur"; + main-router = mkRouter "Main Router" { + info = "Keenetic Giga"; + image = ../images/keenetic-giga.png; + + interfaceGroups = [ + [ + "eth1" + "wifi" + ] + [ "wan1" ] + ]; + + interfaces = { + eth1 = { + addresses = [ "192.168.1.1" ]; + network = "home-maxmur"; + }; + + wifi = { + addresses = [ "192.168.1.1" ]; + network = "home-maxmur"; + }; + + wan1 = { + addresses = [ "192.168.0.2" ]; + network = "mgts-bridge"; + }; }; - wan1 = { - addresses = [ "192.168.0.2" ]; - network = "mgts-bridge"; + connections = { + wifi = mkConnection "nbox" "wlp3s0"; }; }; - connections = { - wifi = mkConnection "nbox" "wlp3s0"; + switch-main = mkSwitch "Main Switch" { + info = "TP-Link TL-SG1016D"; + image = ../images/TL-SG1016D.png; + + interfaceGroups = [ + [ + "eth1" + "eth2" + "eth3" + "eth4" + "eth5" + ] + ]; + + connections = { + eth1 = mkConnection "main-router" "eth1"; + eth2 = mkConnection "pcbox" "eth0"; + eth3 = mkConnection "rasp" "eth0"; + eth4 = mkConnection "macbox" "eth0"; + eth5 = mkConnection "mbox" "eth0"; + }; }; - }; - switch-main = mkSwitch "Main Switch" { - info = "TP-Link TL-SG1016D"; - image = ../images/TL-SG1016D.png; + macbox = mkDevice "macbox" { + deviceType = "device"; + hardware.info = "Mac Mini"; + deviceIcon = ../images/apple.png; - interfaceGroups = [ - [ "eth1" "eth2" "eth3" "eth4" "eth5" ] - ]; + interfaces = { + eth0 = { + addresses = [ "192.168.1.75" ]; + network = "home-maxmur"; + }; + }; - connections = { - eth1 = mkConnection "main-router" "eth1"; - eth2 = mkConnection "pcbox" "eth0"; - eth3 = mkConnection "rasp" "eth0"; - eth4 = mkConnection "macbox" "eth0"; - eth5 = mkConnection "mbox" "eth0"; + interfaceGroups = [ + [ "eth0" ] + ]; }; - }; - macbox = mkDevice "macbox" { - deviceType = "device"; - hardware.info = "Mac Mini"; - deviceIcon = ../images/apple.png; + mbox = mkDevice "mbox" { + deviceType = "device"; + hardware.info = "Mint box"; + deviceIcon = ../images/linux-mint.png; - interfaces = { - eth0 = { - addresses = [ "192.168.1.75" ]; - network = "home-maxmur"; + interfaces = { + eth0 = { + addresses = [ "192.168.1.80" ]; + network = "home-maxmur"; + }; }; - }; - - interfaceGroups = [ - [ "eth0" ] - ]; - }; - mbox = mkDevice "mbox" { - deviceType = "device"; - hardware.info = "Mint box"; - deviceIcon = ../images/linux-mint.png; - - interfaces = { - eth0 = { - addresses = [ "192.168.1.80" ]; - network = "home-maxmur"; - }; + interfaceGroups = [ + [ "eth0" ] + ]; }; - - interfaceGroups = [ - [ "eth0" ] - ]; }; - }; - }) + } + ) ]; }; } - diff --git a/parts/topology/timeweb/default.nix b/parts/topology/timeweb/default.nix index 52bfd33..3448116 100644 --- a/parts/topology/timeweb/default.nix +++ b/parts/topology/timeweb/default.nix @@ -1,131 +1,144 @@ -{ self -, ... +{ + self, + ... }: { perSystem = _: { # For nix topology topology.modules = [ - ({ config, ... }: - let - inherit - (config.lib.topology) - mkRouter - mkDevice - mkConnection; - in { - inherit (self) nixosConfigurations; - - networks = { - timeweb-private = { - name = "Timeweb private"; - cidrv4 = "10.20.0.0/16"; - }; - - wireguard-private = { - name = "Wireguard private"; - cidrv4 = "10.200.100.0/24"; - }; - }; - - nodes = { - timeweb-router = mkRouter "Timeweb router" { - info = "Timeweb internal router"; - interfaceGroups = [ - [ "eth1" ] - [ "wan1" ] - ]; - - interfaces = { - eth1 = { - addresses = [ "10.20.0.1" ]; - network = "timeweb-private"; - }; + ( + { config, ... }: + let + inherit (config.lib.topology) + mkRouter + mkDevice + mkConnection + ; + in + { + inherit (self) nixosConfigurations; + + networks = { + timeweb-private = { + name = "Timeweb private"; + cidrv4 = "10.20.0.0/16"; }; - connections = { - eth1 = [ - (mkConnection "site" "eth0") - (mkConnection "services" "eth0") - ]; + wireguard-private = { + name = "Wireguard private"; + cidrv4 = "10.200.100.0/24"; }; }; - site = mkDevice "site" { - deviceType = "device"; - hardware.info = "Site hosting"; - deviceIcon = ../images/timeweb.png; + nodes = { + timeweb-router = mkRouter "Timeweb router" { + info = "Timeweb internal router"; + interfaceGroups = [ + [ "eth1" ] + [ "wan1" ] + ]; - interfaces = { - eth0 = { - addresses = [ "10.20.0.4" ]; - network = "timeweb-private"; + interfaces = { + eth1 = { + addresses = [ "10.20.0.1" ]; + network = "timeweb-private"; + }; }; - wg0 = { - addresses = [ "10.200.100.1" ]; - network = "wireguard-private"; - renderer.hidePhysicalConnections = false; - virtual = true; - type = "wireguard"; + connections = { + eth1 = [ + (mkConnection "site" "eth0") + (mkConnection "services" "eth0") + ]; }; }; - interfaceGroups = [ - [ "eth0" ] - [ "wg0" ] - ]; - - services = { - nginx = { - name = "NGINX"; - icon = "services.nginx"; - details = { - "http" = { text = "0.0.0.0:80"; }; - "https" = { text = "0.0.0.0:443"; }; + site = mkDevice "site" { + deviceType = "device"; + hardware.info = "Site hosting"; + deviceIcon = ../images/timeweb.png; + + interfaces = { + eth0 = { + addresses = [ "10.20.0.4" ]; + network = "timeweb-private"; + }; + + wg0 = { + addresses = [ "10.200.100.1" ]; + network = "wireguard-private"; + renderer.hidePhysicalConnections = false; + virtual = true; + type = "wireguard"; }; }; - }; - }; - services = mkDevice "services" { - deviceType = "device"; - hardware.info = "Services hosting"; - deviceIcon = ../images/timeweb.png; + interfaceGroups = [ + [ "eth0" ] + [ "wg0" ] + ]; - interfaces = { - eth0 = { - addresses = [ "10.20.0.5" ]; - network = "timeweb-private"; + services = { + nginx = { + name = "NGINX"; + icon = "services.nginx"; + details = { + "http" = { + text = "0.0.0.0:80"; + }; + "https" = { + text = "0.0.0.0:443"; + }; + }; + }; }; }; - interfaceGroups = [ - [ "eth0" ] - ]; - - services = { - nginx = { - name = "NGINX"; - icon = "services.nginx"; - details = { - "http" = { text = "0.0.0.0:80"; }; - "https" = { text = "0.0.0.0:443"; }; + services = mkDevice "services" { + deviceType = "device"; + hardware.info = "Services hosting"; + deviceIcon = ../images/timeweb.png; + + interfaces = { + eth0 = { + addresses = [ "10.20.0.5" ]; + network = "timeweb-private"; }; }; - gitlab = { - name = "Gitlab"; - icon = ../images/services/gitlab.png; - details = { - "ssh" = { text = "0.0.0.0:4224"; }; + interfaceGroups = [ + [ "eth0" ] + ]; + + services = { + nginx = { + name = "NGINX"; + icon = "services.nginx"; + details = { + "http" = { + text = "0.0.0.0:80"; + }; + "https" = { + text = "0.0.0.0:443"; + }; + }; + }; + + gitlab = { + name = "Gitlab"; + icon = ../images/services/gitlab.png; + details = { + "ssh" = { + text = "0.0.0.0:4224"; + }; + }; }; }; }; }; - }; - }) + } + ) ]; }; } - diff --git a/parts/treefmt/default.nix b/parts/treefmt/default.nix index 52824f3..20c207d 100644 --- a/parts/treefmt/default.nix +++ b/parts/treefmt/default.nix @@ -1,5 +1,6 @@ -{ inputs -, ... +{ + inputs, + ... }: { @@ -7,16 +8,37 @@ inputs.treefmt-nix.flakeModule ]; - perSystem = { config, ... }: { + perSystem = _: { # For nix fmt treefmt.config = { projectRootFile = "flake.nix"; + settings = { + global.excludes = [ + "LICENSE" + ".gitattributes" + + "*.png" + "*.svg" + "*.bp" + "*.conf" + "*.zsh" + "**/*rc" + "**/.gitkeep" + + "secrets/**" + ]; + }; programs = { deadnix.enable = true; statix.enable = true; + shellcheck.enable = true; + prettier.enable = true; + + nixfmt.enable = true; + stylua.enable = true; + yamlfmt.enable = true; }; }; }; } - diff --git a/pkgs/ufetch/default.nix b/pkgs/ufetch/default.nix index 2f5f1ba..b10586d 100644 --- a/pkgs/ufetch/default.nix +++ b/pkgs/ufetch/default.nix @@ -1,4 +1,10 @@ -{ lib, stdenv, fetchFromGitLab, makeWrapper, bash }: +{ + lib, + stdenv, + fetchFromGitLab, + makeWrapper, + bash, +}: stdenv.mkDerivation rec { pname = "ufetch"; @@ -28,4 +34,3 @@ stdenv.mkDerivation rec { # mainProgram = "any-nix-shell"; }; } - diff --git a/system/darwin/modules/.gitkeep b/system/darwin/modules/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/system/darwin/modules/default.nix b/system/darwin/modules/default.nix new file mode 100644 index 0000000..d0c1951 --- /dev/null +++ b/system/darwin/modules/default.nix @@ -0,0 +1,4 @@ +_: + +{ +} diff --git a/system/darwin/overlays/.gitkeep b/system/darwin/overlays/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/system/default.nix b/system/default.nix index 641b3de..a598c08 100644 --- a/system/default.nix +++ b/system/default.nix @@ -1,46 +1,39 @@ -{ lib -, inputs -, self -, commonModules -, systemModules -, machineConfigurationPath -, machineConfigurationPathExist -, machineModulesPath -, machineModulesPathExist -, platform ? null -, stateVersion ? null -, ... +{ + self, + lib, + inputs, + machineDir, + hostType, + platform ? null, + stateVersion ? null, + ... }: +let + machineConfigurationPath = "${self}/system/machine/${machineDir}"; + machineConfigurationPathExist = builtins.pathExists machineConfigurationPath; + machineModulesPath = "${self}/system/machine/${machineDir}/modules"; + machineModulesPathExist = builtins.pathExists machineModulesPath; +in { - imports = [ - inputs.home-manager.nixosModules.home-manager - inputs.stylix.nixosModules.stylix - inputs.impermanence.nixosModules.impermanence - inputs.disko.nixosModules.disko - inputs.lanzaboote.nixosModules.lanzaboote - inputs.chaotic.nixosModules.default - inputs.nix-topology.nixosModules.default - inputs.nur.nixosModules.nur - - "${commonModules}" - "${systemModules}" - "${self}/overlays/nixpkgs" - ] - ++ lib.optional machineConfigurationPathExist machineConfigurationPath - ++ lib.optional machineModulesPathExist machineModulesPath; + imports = + [ + "${self}/modules" + "${self}/overlays/nixpkgs" + "${self}/system/${hostType}/modules" + ] + ++ lib.optional machineConfigurationPathExist machineConfigurationPath + ++ lib.optional machineModulesPathExist machineModulesPath; module.nix-config.enable = true; - - # System version system = { inherit stateVersion; }; - # HostPlatform + nixpkgs = { + hostPlatform = platform; + overlays = [ inputs.nix-topology.overlays.default + inputs.proxmox-nixos.overlays.${platform} ]; - - hostPlatform = platform; }; } - diff --git a/system/machine/hlbox/default.nix b/system/machine/hlbox/default.nix new file mode 100644 index 0000000..bfb5025 --- /dev/null +++ b/system/machine/hlbox/default.nix @@ -0,0 +1,67 @@ +{ + config, + ... +}: + +{ + module = { + boot.enable = true; + timedate.enable = true; + locales.enable = true; + users.enable = true; + network.enable = true; + variables.enable = true; + stylix.enable = true; + nixos-ng.enable = true; + plymouth.enable = true; + minimal.enable = true; + + programs = { + gnupg.enable = true; + fish.enable = true; + zsh.enable = true; + systemPackages.enable = true; + }; + + security = { + enable = true; + enableBootOptions = true; + }; + + defaults = { + network = { + iface = "enp0s31f6"; + ip = "192.168.1.10"; + gw = "192.168.1.1"; + mask = "255.255.255.0"; + cidr = "24"; + }; + + ssh.pubKeys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIXByEG3SJJOMxKEAl8azfR/fNMuvXfNcCaEFrdIdn91" + ]; + }; + + services = { + proxmox-ve = { + enable = true; + ipAddress = config.module.defaults.network.ip; + }; + + ssh = { + enable = true; + listenAddresses = [ + { + addr = config.module.defaults.network.ip; + port = 45631; + } + ]; + }; + }; + }; + + nix.settings.trusted-users = [ + "maxmur" + "root" + ]; +} diff --git a/system/machine/hlbox/modules/default.nix b/system/machine/hlbox/modules/default.nix new file mode 100644 index 0000000..ed0fd43 --- /dev/null +++ b/system/machine/hlbox/modules/default.nix @@ -0,0 +1,13 @@ +{ + self, + machineDir, + allDirs, + ... +}: + +let + modules = "${self}/system/machine/${machineDir}/modules"; +in +{ + imports = allDirs modules; +} diff --git a/system/machine/hlbox/modules/hardware/default.nix b/system/machine/hlbox/modules/hardware/default.nix new file mode 100644 index 0000000..7b45ccc --- /dev/null +++ b/system/machine/hlbox/modules/hardware/default.nix @@ -0,0 +1,13 @@ +{ + self, + machineDir, + allDirs, + ... +}: + +let + hardwareModulesPath = "${self}/system/machine/${machineDir}/modules/hardware"; +in +{ + imports = allDirs hardwareModulesPath; +} diff --git a/system/machine/hlbox/modules/hardware/disks/default.nix b/system/machine/hlbox/modules/hardware/disks/default.nix new file mode 100644 index 0000000..cacdedb --- /dev/null +++ b/system/machine/hlbox/modules/hardware/disks/default.nix @@ -0,0 +1,40 @@ +_: + +{ + swapDevices = [ ]; + + boot.zfs.extraPools = [ + "zmirror" + "zpool1" + "zpool2" + ]; + + fileSystems = { + "/" = { + device = "zpool/root"; + fsType = "zfs"; + options = [ "zfsutil" ]; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/2D7C-60DB"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + "/home" = { + device = "zpool/home"; + fsType = "zfs"; + options = [ "zfsutil" ]; + }; + + "/nix" = { + device = "zpool/nix"; + fsType = "zfs"; + options = [ "zfsutil" ]; + }; + }; +} diff --git a/system/machine/hlbox/modules/hardware/extra-hardware/default.nix b/system/machine/hlbox/modules/hardware/extra-hardware/default.nix new file mode 100644 index 0000000..40e58b2 --- /dev/null +++ b/system/machine/hlbox/modules/hardware/extra-hardware/default.nix @@ -0,0 +1,16 @@ +{ + pkgs, + ... +}: + +{ + hardware = { + enableAllFirmware = true; + cpu.intel.updateMicrocode = true; + enableRedistributableFirmware = true; + + firmware = with pkgs; [ + linux-firmware + ]; + }; +} diff --git a/system/machine/hlbox/modules/hardware/graphics-card/default.nix b/system/machine/hlbox/modules/hardware/graphics-card/default.nix new file mode 100644 index 0000000..757f43a --- /dev/null +++ b/system/machine/hlbox/modules/hardware/graphics-card/default.nix @@ -0,0 +1,8 @@ +_: + +{ + hardware = { + graphics.enable = true; + nvidia.open = true; + }; +} diff --git a/system/machine/hlbox/modules/hardware/kernel/default.nix b/system/machine/hlbox/modules/hardware/kernel/default.nix new file mode 100644 index 0000000..9912af3 --- /dev/null +++ b/system/machine/hlbox/modules/hardware/kernel/default.nix @@ -0,0 +1,47 @@ +{ + config, + ... +}: + +let + ipKernelParam = with config.module.defaults.network; [ + "ip=${ip}::${gw}:${mask}::${iface}:none" + ]; +in +{ + boot = { + kernelModules = [ + "kvm-intel" + "r8169" + ]; + extraModulePackages = [ ]; + kernelParams = [ + "zfs.zfs_arc_max=2147483648" + ] ++ ipKernelParam; + + initrd = { + availableKernelModules = [ + "ath10k_pci" + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + "r8169" + ]; + kernelModules = [ ]; + + network = { + enable = true; + + ssh = { + enable = true; + port = 2222; + hostKeys = [ /etc/secrets/initrd/ssh_host_ed25519_key ]; + authorizedKeys = config.module.defaults.ssh.pubKeys; + }; + }; + }; + }; +} diff --git a/system/machine/hlbox/modules/hardware/network/default.nix b/system/machine/hlbox/modules/hardware/network/default.nix new file mode 100644 index 0000000..06e0bc0 --- /dev/null +++ b/system/machine/hlbox/modules/hardware/network/default.nix @@ -0,0 +1,44 @@ +{ + config, + username, + ... +}: + +{ + users.users.${username}.openssh.authorizedKeys.keys = config.module.defaults.ssh.pubKeys; + + networking = { + hostId = "1ac5a44c"; + }; + + systemd.network = { + netdevs."vmbr0" = { + netdevConfig = { + Name = "vmbr0"; + Kind = "bridge"; + }; + }; + + networks = { + "10-lan" = { + matchConfig.Name = [ config.module.defaults.network.iface ]; + networkConfig = { + Bridge = "vmbr0"; + }; + }; + + "10-lan-bridge" = { + matchConfig.Name = "vmbr0"; + linkConfig.RequiredForOnline = "routable"; + + address = [ + "${config.module.defaults.network.ip}/${config.module.defaults.network.cidr}" + ]; + + routes = [ + { Gateway = config.module.defaults.network.gw; } + ]; + }; + }; + }; +} diff --git a/system/machine/macbox/default.nix b/system/machine/macbox/default.nix index 2b1b0b1..a2ce064 100644 --- a/system/machine/macbox/default.nix +++ b/system/machine/macbox/default.nix @@ -1,17 +1,34 @@ -{ inputs -, pkgs -, ... -}: +{ + inputs, + pkgs, + username, + ... +}: { - environment.systemPackages = with pkgs; [ + module = { + stylix = { + enable = true; + useCursor = false; + }; + }; + + environment.systemPackages = with pkgs; [ vim neovim home-manager - nerdfonts + nerd-fonts.jetbrains-mono + nerd-fonts.ubuntu-mono + nerd-fonts.iosevka alacritty ]; + users.users.${username} = { + name = username; + home = "/Users/${username}"; + description = username; + }; + services.nix-daemon.enable = true; # nix.package = pkgs.nix; @@ -20,4 +37,3 @@ system.configurationRevision = inputs.rev or inputs.dirtyRev or null; } - diff --git a/system/machine/macbox/modules/default.nix b/system/machine/macbox/modules/default.nix new file mode 100644 index 0000000..d0c1951 --- /dev/null +++ b/system/machine/macbox/modules/default.nix @@ -0,0 +1,4 @@ +_: + +{ +} diff --git a/system/machine/nbox/default.nix b/system/machine/nbox/default.nix index 724082d..404e86e 100644 --- a/system/machine/nbox/default.nix +++ b/system/machine/nbox/default.nix @@ -2,57 +2,56 @@ _: { module = { - sound.enable = true; - lanzaboote.enable = true; - bluetooth.enable = true; - locales.enable = true; - network.enable = true; - timedate.enable = true; - users.enable = true; - variables.enable = true; + sound.enable = true; + lanzaboote.enable = true; + bluetooth.enable = true; + locales.enable = true; + network.enable = true; + timedate.enable = true; + users.enable = true; + variables.enable = true; virtualisation.enable = true; - stylix.enable = true; - minimal.enable = true; - nixos-ng.enable = true; - plymouth.enable = true; - - chaotic = { - enable = true; - schedulerType = "scx_bpfland"; - }; + stylix.enable = true; + minimal.enable = true; + nixos-ng.enable = true; + plymouth.enable = true; + binfmt.enable = true; security = { - enable = true; + enable = true; enableBootOptions = true; - disableIPV6 = true; }; services = { - bolt.enable = true; - cpu-autofreq.enable = true; - fwupd.enable = true; - polkit.enable = true; - printing.enable = true; - syncthing.enable = true; - udev.enable = true; - zram.enable = true; - greetd.enable = true; - ollama.enable = true; - netbird.enable = true; + bolt.enable = true; + tlp.enable = true; + fwupd.enable = true; + polkit.enable = true; + printing.enable = true; + syncthing.enable = true; + udev.enable = true; + zram.enable = true; + greetd.enable = true; + ollama.enable = true; + netbird.enable = true; + + scx = { + enable = true; + schedulerType = "scx_bpfland"; + }; }; programs = { - dconf.enable = true; - gnupg.enable = true; - hm.enable = true; - nh.enable = true; - kdeconnect.enable = true; - mtr.enable = true; - xdg-portal.enable = true; - zsh.enable = true; - fish.enable = true; + dconf.enable = true; + gnupg.enable = true; + hm.enable = true; + nh.enable = true; + kdeconnect.enable = true; + mtr.enable = true; + xdg-portal.enable = true; + zsh.enable = true; + fish.enable = true; systemPackages.enable = true; }; }; } - diff --git a/system/machine/nbox/modules/default.nix b/system/machine/nbox/modules/default.nix index 9084898..ed0fd43 100644 --- a/system/machine/nbox/modules/default.nix +++ b/system/machine/nbox/modules/default.nix @@ -1,11 +1,13 @@ -{ lib -, machineModulesPath -, ... +{ + self, + machineDir, + allDirs, + ... }: +let + modules = "${self}/system/machine/${machineDir}/modules"; +in { - imports = builtins.filter (module: lib.pathIsDirectory module) ( - map (module: "${machineModulesPath}/${module}") (builtins.attrNames (builtins.readDir machineModulesPath)) - ); + imports = allDirs modules; } - diff --git a/system/machine/nbox/modules/hardware/default.nix b/system/machine/nbox/modules/hardware/default.nix index d1c7aa5..7b45ccc 100644 --- a/system/machine/nbox/modules/hardware/default.nix +++ b/system/machine/nbox/modules/hardware/default.nix @@ -1,13 +1,13 @@ -{ lib -, machineModulesPath -, ... +{ + self, + machineDir, + allDirs, + ... }: let - hardwareModulesPath = "${machineModulesPath}/hardware"; -in { - imports = builtins.filter (module: lib.pathIsDirectory module) ( - map (module: "${hardwareModulesPath}/${module}") (builtins.attrNames (builtins.readDir hardwareModulesPath)) - ); + hardwareModulesPath = "${self}/system/machine/${machineDir}/modules/hardware"; +in +{ + imports = allDirs hardwareModulesPath; } - diff --git a/system/machine/nbox/modules/hardware/disks/default.nix b/system/machine/nbox/modules/hardware/disks/default.nix index cb7db54..71b7e28 100644 --- a/system/machine/nbox/modules/hardware/disks/default.nix +++ b/system/machine/nbox/modules/hardware/disks/default.nix @@ -63,7 +63,10 @@ _: format = "vfat"; mountpoint = "/boot"; - mountOptions = [ "defaults" "umask=0077" ]; + mountOptions = [ + "defaults" + "umask=0077" + ]; }; }; @@ -76,7 +79,7 @@ _: content = { type = "lvm_pv"; - vg = "pool"; + vg = "pool"; }; }; }; @@ -103,13 +106,21 @@ _: }; "/persist" = { - mountpoint = "/persist"; - mountOptions = [ "compress=zstd" "subvol=persist" "noatime" ]; + mountpoint = "/persist"; + mountOptions = [ + "compress=zstd" + "subvol=persist" + "noatime" + ]; }; "/nix" = { - mountpoint = "/nix"; - mountOptions = [ "compress=zstd" "subvol=nix" "noatime" ]; + mountpoint = "/nix"; + mountOptions = [ + "compress=zstd" + "subvol=nix" + "noatime" + ]; }; }; }; @@ -119,4 +130,3 @@ _: }; }; } - diff --git a/system/machine/nbox/modules/hardware/extra-hardware/default.nix b/system/machine/nbox/modules/hardware/extra-hardware/default.nix index 1fce5f3..065c07e 100644 --- a/system/machine/nbox/modules/hardware/extra-hardware/default.nix +++ b/system/machine/nbox/modules/hardware/extra-hardware/default.nix @@ -1,7 +1,8 @@ -{ lib -, pkgs -, config -, ... +{ + lib, + pkgs, + config, + ... }: { @@ -22,4 +23,3 @@ }; }; } - diff --git a/system/machine/nbox/modules/hardware/graphics-card/default.nix b/system/machine/nbox/modules/hardware/graphics-card/default.nix index 2e71b6d..f684e86 100644 --- a/system/machine/nbox/modules/hardware/graphics-card/default.nix +++ b/system/machine/nbox/modules/hardware/graphics-card/default.nix @@ -1,11 +1,13 @@ -{ pkgs -, ... +{ + pkgs, + self, + ... }: { # Graphics card settings nixpkgs.overlays = [ - (import ../../../../../overlays/vaapiIntel) + (import "${self}/system/nixos/overlays/vaapiIntel") ]; hardware.graphics = { @@ -21,4 +23,3 @@ ]; }; } - diff --git a/system/machine/nbox/modules/hardware/impermanence/default.nix b/system/machine/nbox/modules/hardware/impermanence/default.nix index 781fc7c..6e94223 100644 --- a/system/machine/nbox/modules/hardware/impermanence/default.nix +++ b/system/machine/nbox/modules/hardware/impermanence/default.nix @@ -38,4 +38,3 @@ _: }; }; } - diff --git a/system/machine/nbox/modules/hardware/kernel/default.nix b/system/machine/nbox/modules/hardware/kernel/default.nix index 8666a1f..cb955fb 100644 --- a/system/machine/nbox/modules/hardware/kernel/default.nix +++ b/system/machine/nbox/modules/hardware/kernel/default.nix @@ -1,5 +1,6 @@ -{ pkgs -, ... +{ + pkgs, + ... }: { @@ -17,13 +18,13 @@ "i915" ]; - kernelParams = [ + kernelParams = [ # Video driver settings "i915.enable_guc=1" "pci=assign-busses,hpbussize=0x33,realloc" ]; - initrd.availableKernelModules = [ + initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" @@ -33,4 +34,3 @@ ]; }; } - diff --git a/system/machine/nbox/modules/hardware/network/default.nix b/system/machine/nbox/modules/hardware/network/default.nix index 85bf955..9e2d347 100644 --- a/system/machine/nbox/modules/hardware/network/default.nix +++ b/system/machine/nbox/modules/hardware/network/default.nix @@ -11,11 +11,6 @@ _: }; networking = { - nameservers = [ - "8.8.8.8" - "8.8.4.4" - ]; - firewall = { enable = true; @@ -30,13 +25,18 @@ _: ]; allowedTCPPortRanges = [ - { from = 1714; to = 1764; } # KDE Connect + { + from = 1714; + to = 1764; + } # KDE Connect ]; - + allowedUDPPortRanges = [ - { from = 1714; to = 1764; } # KDE Connect + { + from = 1714; + to = 1764; + } # KDE Connect ]; }; }; } - diff --git a/system/machine/p8box/default.nix b/system/machine/p8box/default.nix new file mode 100644 index 0000000..9833348 --- /dev/null +++ b/system/machine/p8box/default.nix @@ -0,0 +1,52 @@ +_: + +{ + module = { + sound.enable = true; + boot.enable = true; + locales.enable = true; + network.enable = true; + timedate.enable = true; + users.enable = true; + variables.enable = true; + stylix.enable = true; + minimal.enable = true; + nixos-ng.enable = true; + plymouth.enable = true; + + security = { + enable = true; + enableBootOptions = true; + }; + + services = { + tlp.enable = true; + fwupd.enable = true; + polkit.enable = true; + printing.enable = true; + syncthing.enable = true; + udev.enable = true; + zram.enable = true; + greetd.enable = true; + netbird.enable = true; + + scx = { + enable = true; + schedulerType = "scx_bpfland"; + }; + }; + + programs = { + dconf.enable = true; + gnupg.enable = true; + hm.enable = true; + nh.enable = true; + kdeconnect.enable = true; + mtr.enable = true; + xdg-portal.enable = true; + zsh.enable = true; + fish.enable = true; + systemPackages.enable = true; + }; + }; +} diff --git a/system/machine/p8box/modules/default.nix b/system/machine/p8box/modules/default.nix new file mode 100644 index 0000000..ed0fd43 --- /dev/null +++ b/system/machine/p8box/modules/default.nix @@ -0,0 +1,13 @@ +{ + self, + machineDir, + allDirs, + ... +}: + +let + modules = "${self}/system/machine/${machineDir}/modules"; +in +{ + imports = allDirs modules; +} diff --git a/system/machine/p8box/modules/hardware/default.nix b/system/machine/p8box/modules/hardware/default.nix new file mode 100644 index 0000000..7b45ccc --- /dev/null +++ b/system/machine/p8box/modules/hardware/default.nix @@ -0,0 +1,13 @@ +{ + self, + machineDir, + allDirs, + ... +}: + +let + hardwareModulesPath = "${self}/system/machine/${machineDir}/modules/hardware"; +in +{ + imports = allDirs hardwareModulesPath; +} diff --git a/system/machine/p8box/modules/hardware/disks/default.nix b/system/machine/p8box/modules/hardware/disks/default.nix new file mode 100644 index 0000000..cdc9d21 --- /dev/null +++ b/system/machine/p8box/modules/hardware/disks/default.nix @@ -0,0 +1,136 @@ +_: + +let + label = "Nixos-Main"; +in +{ + # For impermanence + boot.initrd.systemd.services.rollback = { + description = "Rollback BTRFS root subvolume to a pristine state"; + unitConfig.DefaultDependencies = "no"; + serviceConfig.Type = "oneshot"; + wantedBy = [ "initrd.target" ]; + after = [ "systemd-cryptsetup@crypted.service" ]; + before = [ "sysroot.mount" ]; + + script = '' + vgchange -ay pool + mkdir -p /btrfs_tmp + mount /dev/pool/root /btrfs_tmp + + if [[ -e /btrfs_tmp/root ]]; then + mkdir -p /btrfs_tmp/old_roots + timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S") + mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp" + fi + + delete_subvolume_recursively() { + IFS=$'\n' + for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do + delete_subvolume_recursively "/btrfs_tmp/$i" + done + btrfs subvolume delete "$1" + } + + for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do + delete_subvolume_recursively "$i" + done + + btrfs subvolume create /btrfs_tmp/root + umount /btrfs_tmp + ''; + }; + + fileSystems = { + "/persist" = { + neededForBoot = true; + }; + }; + + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/disk/by-label/${label}"; + + content = { + type = "gpt"; + + partitions = { + esp = { + size = "2G"; + type = "EF00"; + + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + + mountOptions = [ + "defaults" + "umask=0077" + ]; + }; + }; + + luks = { + size = "100%"; + + content = { + type = "luks"; + name = "crypted"; + extraFormatArgs = [ "--label=${label}" ]; + + content = { + type = "lvm_pv"; + vg = "pool"; + }; + }; + }; + }; + }; + }; + }; + + lvm_vg = { + pool = { + type = "lvm_vg"; + + lvs = { + root = { + size = "100%FREE"; + + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + + subvolumes = { + "/root" = { + mountpoint = "/"; + }; + + "/persist" = { + mountpoint = "/persist"; + mountOptions = [ + "compress=zstd" + "subvol=persist" + "noatime" + ]; + }; + + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ + "compress=zstd" + "subvol=nix" + "noatime" + ]; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/system/machine/p8box/modules/hardware/extra-hardware/default.nix b/system/machine/p8box/modules/hardware/extra-hardware/default.nix new file mode 100644 index 0000000..6d1f4dd --- /dev/null +++ b/system/machine/p8box/modules/hardware/extra-hardware/default.nix @@ -0,0 +1,12 @@ +{ + lib, + config, + ... +}: + +{ + hardware = { + enableRedistributableFirmware = true; + cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + }; +} diff --git a/system/machine/p8box/modules/hardware/impermanence/default.nix b/system/machine/p8box/modules/hardware/impermanence/default.nix new file mode 100644 index 0000000..6e94223 --- /dev/null +++ b/system/machine/p8box/modules/hardware/impermanence/default.nix @@ -0,0 +1,40 @@ +_: + +{ + programs.fuse.userAllowOther = true; + + environment.persistence = { + "/persist" = { + hideMounts = true; + + directories = [ + "/etc/nixos" + "/etc/NetworkManager/system-connections" + "/etc/wireguard" + "/etc/secureboot" + "/var/lib/bluetooth" + "/var/lib/nixos" + "/var/log" + "/var/lib/docker" + "/var/lib/netbird" + "/var/lib/containers" + "/var/lib/qemu" + "/var/lib/private" + "/var/db" + "/var/lib/NetworkManager" + "/var/lib/chrony" + "/var/lib/iwd" + "/var/lib/libvirt" + "/var/lib/systemd" + ]; + + files = [ + "/etc/machine-id" + "/etc/ssh/ssh_host_ed25519_key" + "/etc/ssh/ssh_host_ed25519_key.pub" + "/etc/ssh/ssh_host_rsa_key" + "/etc/ssh/ssh_host_rsa_key.pub" + ]; + }; + }; +} diff --git a/system/machine/p8box/modules/hardware/kernel/default.nix b/system/machine/p8box/modules/hardware/kernel/default.nix new file mode 100644 index 0000000..c82b8ba --- /dev/null +++ b/system/machine/p8box/modules/hardware/kernel/default.nix @@ -0,0 +1,34 @@ +{ + pkgs, + ... +}: + +{ + boot = { + kernelPackages = pkgs.linuxPackages_latest; + + kernelModules = [ + "kvm-intel" + ]; + + kernelParams = [ + "fbcon=rotate:1" + "video=DSI-1:panel_orientation=right_side_up" + ]; + + extraModulePackages = [ ]; + + initrd = { + availableKernelModules = [ + "xhci_pci" + "ahci" + + "xhci_pci" + "nvme" + "usb_storage" + "sd_mod" + "uas" + ]; + }; + }; +} diff --git a/system/machine/p8box/modules/hardware/network/default.nix b/system/machine/p8box/modules/hardware/network/default.nix new file mode 100644 index 0000000..1f967ee --- /dev/null +++ b/system/machine/p8box/modules/hardware/network/default.nix @@ -0,0 +1,29 @@ +_: + +{ + systemd.network = { + enable = true; + }; + + networking = { + firewall = { + enable = true; + + allowedTCPPorts = [ + 8384 + 22000 + ]; + + allowedUDPPorts = [ + 22000 + 21027 + ]; + + allowedTCPPortRanges = [ + ]; + + allowedUDPPortRanges = [ + ]; + }; + }; +} diff --git a/system/machine/pcbox/default.nix b/system/machine/pcbox/default.nix index 3086a77..27417c0 100644 --- a/system/machine/pcbox/default.nix +++ b/system/machine/pcbox/default.nix @@ -1,63 +1,65 @@ -{ config -, ... +{ + config, + ... }: { module = { - sound.enable = true; - boot.enable = true; - bluetooth.enable = true; - locales.enable = true; - network.enable = true; - timedate.enable = true; - users.enable = true; - variables.enable = true; + sound.enable = true; + boot.enable = true; + bluetooth.enable = true; + locales.enable = true; + network.enable = true; + timedate.enable = true; + users.enable = true; + variables.enable = true; virtualisation.enable = true; - stylix.enable = true; - minimal.enable = true; - nixos-ng.enable = true; - plymouth.enable = true; - - chaotic = { - enable = true; - schedulerType = "scx_bpfland"; - }; + stylix.enable = true; + minimal.enable = true; + nixos-ng.enable = true; + plymouth.enable = true; + binfmt.enable = true; security = { - enable = true; + enable = true; enableBootOptions = true; - disableIPV6 = true; }; services = { - bolt.enable = true; - fwupd.enable = true; - polkit.enable = true; - printing.enable = true; - syncthing.enable = true; - udev.enable = true; - greetd.enable = true; - qmk.enable = true; - netbird.enable = true; + bolt.enable = true; + fwupd.enable = true; + polkit.enable = true; + printing.enable = true; + syncthing.enable = true; + udev.enable = true; + greetd.enable = true; + qmk.enable = true; + netbird.enable = true; + yggdrasil.enable = true; + zram.enable = true; + + scx = { + enable = true; + schedulerType = "scx_bpfland"; + }; ollama = { - enable = true; + enable = true; gpuSupport.enable = config.services.ollama.enable; }; }; programs = { - dconf.enable = true; - gnupg.enable = true; - hm.enable = true; - nh.enable = true; - kdeconnect.enable = true; - mtr.enable = true; - xdg-portal.enable = true; - zsh.enable = true; - fish.enable = true; + dconf.enable = true; + gnupg.enable = true; + hm.enable = true; + nh.enable = true; + kdeconnect.enable = true; + mtr.enable = true; + xdg-portal.enable = true; + zsh.enable = true; + fish.enable = true; systemPackages.enable = true; }; }; } - diff --git a/system/machine/pcbox/modules/default.nix b/system/machine/pcbox/modules/default.nix index 9084898..ed0fd43 100644 --- a/system/machine/pcbox/modules/default.nix +++ b/system/machine/pcbox/modules/default.nix @@ -1,11 +1,13 @@ -{ lib -, machineModulesPath -, ... +{ + self, + machineDir, + allDirs, + ... }: +let + modules = "${self}/system/machine/${machineDir}/modules"; +in { - imports = builtins.filter (module: lib.pathIsDirectory module) ( - map (module: "${machineModulesPath}/${module}") (builtins.attrNames (builtins.readDir machineModulesPath)) - ); + imports = allDirs modules; } - diff --git a/system/machine/pcbox/modules/hardware/default.nix b/system/machine/pcbox/modules/hardware/default.nix index d1c7aa5..7b45ccc 100644 --- a/system/machine/pcbox/modules/hardware/default.nix +++ b/system/machine/pcbox/modules/hardware/default.nix @@ -1,13 +1,13 @@ -{ lib -, machineModulesPath -, ... +{ + self, + machineDir, + allDirs, + ... }: let - hardwareModulesPath = "${machineModulesPath}/hardware"; -in { - imports = builtins.filter (module: lib.pathIsDirectory module) ( - map (module: "${hardwareModulesPath}/${module}") (builtins.attrNames (builtins.readDir hardwareModulesPath)) - ); + hardwareModulesPath = "${self}/system/machine/${machineDir}/modules/hardware"; +in +{ + imports = allDirs hardwareModulesPath; } - diff --git a/system/machine/pcbox/modules/hardware/disks/default.nix b/system/machine/pcbox/modules/hardware/disks/default.nix index 657bfa9..7a5a4fd 100644 --- a/system/machine/pcbox/modules/hardware/disks/default.nix +++ b/system/machine/pcbox/modules/hardware/disks/default.nix @@ -63,7 +63,10 @@ _: format = "vfat"; mountpoint = "/boot"; - mountOptions = [ "defaults" "umask=0077" ]; + mountOptions = [ + "defaults" + "umask=0077" + ]; }; }; @@ -76,7 +79,7 @@ _: content = { type = "lvm_pv"; - vg = "pool"; + vg = "pool"; }; }; }; @@ -103,13 +106,21 @@ _: }; "/persist" = { - mountpoint = "/persist"; - mountOptions = [ "compress=zstd" "subvol=persist" "noatime" ]; + mountpoint = "/persist"; + mountOptions = [ + "compress=zstd" + "subvol=persist" + "noatime" + ]; }; "/nix" = { - mountpoint = "/nix"; - mountOptions = [ "compress=zstd" "subvol=nix" "noatime" ]; + mountpoint = "/nix"; + mountOptions = [ + "compress=zstd" + "subvol=nix" + "noatime" + ]; }; }; }; @@ -119,4 +130,3 @@ _: }; }; } - diff --git a/system/machine/pcbox/modules/hardware/extra-hardware/default.nix b/system/machine/pcbox/modules/hardware/extra-hardware/default.nix index 898b50b..10cf5b4 100644 --- a/system/machine/pcbox/modules/hardware/extra-hardware/default.nix +++ b/system/machine/pcbox/modules/hardware/extra-hardware/default.nix @@ -1,16 +1,13 @@ -{ lib -, pkgs -, config -, ... +{ + pkgs, + ... }: { - # Extra drivers settings hardware = { enableAllFirmware = true; cpu.amd.updateMicrocode = true; enableRedistributableFirmware = true; - cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; firmware = with pkgs; [ linux-firmware @@ -22,4 +19,3 @@ }; }; } - diff --git a/system/machine/pcbox/modules/hardware/graphics-card/default.nix b/system/machine/pcbox/modules/hardware/graphics-card/default.nix index 17ced36..5e50da1 100644 --- a/system/machine/pcbox/modules/hardware/graphics-card/default.nix +++ b/system/machine/pcbox/modules/hardware/graphics-card/default.nix @@ -1,5 +1,6 @@ -{ pkgs -, ... +{ + pkgs, + ... }: { @@ -24,4 +25,3 @@ "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" ]; } - diff --git a/system/machine/pcbox/modules/hardware/impermanence/default.nix b/system/machine/pcbox/modules/hardware/impermanence/default.nix index 781fc7c..4d6a9c9 100644 --- a/system/machine/pcbox/modules/hardware/impermanence/default.nix +++ b/system/machine/pcbox/modules/hardware/impermanence/default.nix @@ -26,6 +26,7 @@ _: "/var/lib/iwd" "/var/lib/libvirt" "/var/lib/systemd" + "/var/lib/private/yggdrasil" ]; files = [ @@ -38,4 +39,3 @@ _: }; }; } - diff --git a/system/machine/pcbox/modules/hardware/kernel/default.nix b/system/machine/pcbox/modules/hardware/kernel/default.nix index 92b536e..77938fd 100644 --- a/system/machine/pcbox/modules/hardware/kernel/default.nix +++ b/system/machine/pcbox/modules/hardware/kernel/default.nix @@ -1,5 +1,7 @@ -{ pkgs -, ... +{ + pkgs, + config, + ... }: { @@ -10,9 +12,12 @@ "amdgpu" "kvm-amd" "kvm-intel" + "zenpower" ]; - extraModulePackages = [ ]; + extraModulePackages = [ + config.boot.kernelPackages.zenpower + ]; kernelParams = [ "drm_kms_helper.poll=0" @@ -34,4 +39,3 @@ }; }; } - diff --git a/system/machine/pcbox/modules/hardware/network/default.nix b/system/machine/pcbox/modules/hardware/network/default.nix index f066169..e121e28 100644 --- a/system/machine/pcbox/modules/hardware/network/default.nix +++ b/system/machine/pcbox/modules/hardware/network/default.nix @@ -5,7 +5,6 @@ _: enable = true; networks.eth0 = { - matchConfig.Name = "enp0s31f6"; address = [ "192.168.1.50/24" ]; dns = [ "192.168.1.8" ]; }; @@ -26,13 +25,18 @@ _: ]; allowedTCPPortRanges = [ - { from = 1714; to = 1764; } # KDE Connect + { + from = 1714; + to = 1764; + } # KDE Connect ]; - + allowedUDPPortRanges = [ - { from = 1714; to = 1764; } # KDE Connect + { + from = 1714; + to = 1764; + } # KDE Connect ]; }; }; } - diff --git a/system/machine/pcbox/modules/ollama/default.nix b/system/machine/pcbox/modules/ollama/default.nix index 29e76bb..3998851 100644 --- a/system/machine/pcbox/modules/ollama/default.nix +++ b/system/machine/pcbox/modules/ollama/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.services.ollama.gpuSupport; -in { +in +{ options = { module.services.ollama.gpuSupport.enable = mkEnableOption "Enable gpuSupport for ollama"; }; @@ -23,4 +25,3 @@ in { }; }; } - diff --git a/system/machine/rasp/default.nix b/system/machine/rasp/default.nix index 65b6ff5..e7a8715 100644 --- a/system/machine/rasp/default.nix +++ b/system/machine/rasp/default.nix @@ -1,25 +1,41 @@ -_: +{ + config, + ... +}: { module = { - locales.enable = true; - network.enable = true; + locales.enable = true; + network.enable = true; security.enable = true; timedate.enable = true; - users.enable = true; - # pihole.enable = true; - + users.enable = true; + programs = { - gnupg.enable = true; - hm.enable = true; - nh.enable = true; - mtr.enable = true; - zsh.enable = true; - fish.enable = true; - dconf.enable = true; + gnupg.enable = true; + hm.enable = true; + nh.enable = true; + mtr.enable = true; + zsh.enable = true; + fish.enable = true; + dconf.enable = true; systemPackages.enable = true; }; - + + defaults = { + network = { + iface = "end0"; + ip = "192.168.1.8"; + gw = "192.168.1.1"; + mask = "255.255.255.0"; + cidr = "24"; + }; + + ssh.pubKeys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIdsRbzlFB23BdrUzzuBdcDmlkCrdU/620MlH1jdi6vx" + ]; + }; + services = { unbound.enable = true; @@ -33,10 +49,22 @@ _: ]; dnsRewrites = [ - { domain = "gitlab.maxmur.info"; anwser = "192.168.1.8"; } + { + domain = "gitlab.maxmur.info"; + anwser = "192.168.1.8"; + } + ]; + }; + + ssh = { + enable = true; + listenAddresses = [ + { + addr = config.module.defaults.network.ip; + port = 34561; + } ]; }; }; }; } - diff --git a/system/machine/rasp/modules/default.nix b/system/machine/rasp/modules/default.nix index 9084898..ed0fd43 100644 --- a/system/machine/rasp/modules/default.nix +++ b/system/machine/rasp/modules/default.nix @@ -1,11 +1,13 @@ -{ lib -, machineModulesPath -, ... +{ + self, + machineDir, + allDirs, + ... }: +let + modules = "${self}/system/machine/${machineDir}/modules"; +in { - imports = builtins.filter (module: lib.pathIsDirectory module) ( - map (module: "${machineModulesPath}/${module}") (builtins.attrNames (builtins.readDir machineModulesPath)) - ); + imports = allDirs modules; } - diff --git a/system/machine/rasp/modules/hardware/default.nix b/system/machine/rasp/modules/hardware/default.nix index f173a87..8f0609c 100644 --- a/system/machine/rasp/modules/hardware/default.nix +++ b/system/machine/rasp/modules/hardware/default.nix @@ -1,20 +1,24 @@ -{ self -, lib -, hostname -, pkgs -, ... +{ + self, + machineDir, + pkgs, + allDirs, + ... }: let - machineHardwareModulesPath = "${self}/system/machine/${hostname}/modules/hardware"; -in { - imports = builtins.filter (module: lib.pathIsDirectory module) ( - map (module: "${machineHardwareModulesPath}/${module}") (builtins.attrNames (builtins.readDir machineHardwareModulesPath)) - ); + machineHardwareModulesPath = "${self}/system/machine/${machineDir}/modules/hardware"; +in +{ + imports = allDirs machineHardwareModulesPath; boot = { kernelPackages = pkgs.linuxKernel.packages.linux_rpi4; - initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ]; + initrd.availableKernelModules = [ + "xhci_pci" + "usbhid" + "usb_storage" + ]; loader = { grub.enable = false; @@ -34,10 +38,9 @@ in { libraspberrypi ]; - services.openssh = { - enable = true; - }; - hardware.enableRedistributableFirmware = true; + nix.settings.trusted-users = [ + "maxmur" + "root" + ]; } - diff --git a/system/machine/rasp/modules/hardware/network/default.nix b/system/machine/rasp/modules/hardware/network/default.nix index bfa1cea..a7bbb2b 100644 --- a/system/machine/rasp/modules/hardware/network/default.nix +++ b/system/machine/rasp/modules/hardware/network/default.nix @@ -1,8 +1,12 @@ -{ config -, ... +{ + config, + username, + ... }: { + users.users.${username}.openssh.authorizedKeys.keys = config.module.defaults.ssh.pubKeys; + systemd.network = { enable = true; @@ -30,6 +34,7 @@ 5335 8053 8384 + 34561 ]; allowedUDPPorts = [ @@ -42,13 +47,21 @@ topology.self = { services = { nginx.details = { - "https" = { text = "0.0.0.0:443"; }; - "gitlab ssh" = { text = "0.0.0.0:4224"; }; - "syncthing web" = { text = "0.0.0.0:8384"; }; + "https" = { + text = "0.0.0.0:443"; + }; + "gitlab ssh" = { + text = "0.0.0.0:4224"; + }; + "syncthing web" = { + text = "0.0.0.0:8384"; + }; }; adguardhome.details = { - "dns" = { text = "192.168.1.8:53"; }; + "dns" = { + text = "192.168.1.8:53"; + }; }; }; @@ -63,4 +76,3 @@ }; }; } - diff --git a/system/machine/rasp/modules/nginx/default.nix b/system/machine/rasp/modules/nginx/default.nix index 263a2f2..f88d85a 100644 --- a/system/machine/rasp/modules/nginx/default.nix +++ b/system/machine/rasp/modules/nginx/default.nix @@ -36,4 +36,3 @@ _: ''; }; } - diff --git a/system/machine/rasp/modules/temp-control/default.nix b/system/machine/rasp/modules/temp-control/default.nix index db1eda2..885e7cf 100644 --- a/system/machine/rasp/modules/temp-control/default.nix +++ b/system/machine/rasp/modules/temp-control/default.nix @@ -1,13 +1,16 @@ -{ pkgs -, ... +{ + pkgs, + ... }: { - environment.systemPackages = (with pkgs; [ - python312 - ]) ++ (with pkgs.python312Packages; [ - rpi-gpio - ]); + environment.systemPackages = + (with pkgs; [ + python312 + ]) + ++ (with pkgs.python312Packages; [ + rpi-gpio + ]); systemd.services.temp-control = { enable = true; @@ -103,4 +106,3 @@ }; }; } - diff --git a/system/modules/chaotic/default.nix b/system/modules/chaotic/default.nix deleted file mode 100644 index 27056c2..0000000 --- a/system/modules/chaotic/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ lib -, config -, ... -}: - -with lib; - -let - cfg = config.module.chaotic; -in { - options = { - module.chaotic = { - enable = mkEnableOption "Enables chaotic module"; - - schedulerType = mkOption { - type = types.str; - default = "scx_rustland"; - }; - }; - }; - - config = mkIf cfg.enable { - chaotic.scx.enable = true; - chaotic.scx.scheduler = cfg.schedulerType; - }; -} - diff --git a/system/modules/default.nix b/system/modules/default.nix deleted file mode 100644 index 15d4a0b..0000000 --- a/system/modules/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ systemModules -, lib -, ... -}: - -{ - # Read all directories from systemModules - imports = builtins.filter (module: lib.pathIsDirectory module) ( - map (module: "${systemModules}/${module}") (builtins.attrNames (builtins.readDir systemModules)) - ); -} - diff --git a/system/modules/programs/default.nix b/system/modules/programs/default.nix deleted file mode 100644 index 3f147ca..0000000 --- a/system/modules/programs/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ systemModules -, lib -, ... -}: - -let - hostProgramModulesPath = "${systemModules}/programs"; -in { - # Import all program modules - imports = builtins.filter (module: lib.pathIsDirectory module) ( - map (module: "${hostProgramModulesPath}/${module}") (builtins.attrNames (builtins.readDir hostProgramModulesPath)) - ); -} - diff --git a/system/modules/programs/systemPackages/default.nix b/system/modules/programs/systemPackages/default.nix deleted file mode 100644 index 9a9385e..0000000 --- a/system/modules/programs/systemPackages/default.nix +++ /dev/null @@ -1,79 +0,0 @@ -{ pkgs -, lib -, config -, isWorkstation -, ... -}: - -with lib; - -let - cfg = config.module.programs.systemPackages; -in { - options = { - module.programs.systemPackages.enable = mkEnableOption "Enable System Software"; - }; - - config = mkIf cfg.enable { - fonts.packages = with pkgs; [ - (nerdfonts.override { fonts = [ "JetBrainsMono" "UbuntuMono" ]; }) - corefonts - ]; - - environment.systemPackages = with pkgs; [ - # Utils - git - nvd - nix-output-monitor - curl - wget - tree - file - zip - unzip - killall - jq - - # Hardware utils - glxinfo - pciutils - usbutils - powertop - lm_sensors - strace - ltrace - lsof - sysstat - cpufetch - sbctl - - # Network - inetutils - wireguard-tools - dig - nmap - dnsutils - iperf3 - mtr - ipcalc - cacert - ] ++ optionals isWorkstation [ - # Themes - tela-circle-icon-theme - - # Hardware - microcodeIntel - libGL - - # Hardware utils - libva-utils - intel-gpu-tools - fwupd - fwupd-efi - - # Utils - dconf-editor - ]; - }; -} - diff --git a/system/modules/security/default.nix b/system/modules/security/default.nix deleted file mode 100644 index e641e14..0000000 --- a/system/modules/security/default.nix +++ /dev/null @@ -1,118 +0,0 @@ -{ lib -, config -, ... -}: - -with lib; - -let - cfg = config.module.security; -in { - options = { - module.security = { - enable = mkEnableOption "Enables security"; - enableBootOptions = mkEnableOption "Enables boot options"; - disableIPV6 = mkEnableOption "Disable ipv6"; - }; - }; - - config = mkIf cfg.enable { - security = { - sudo.enable = false; - - pam.services = { - gtklock = {}; - swaylock = {}; - hyprlock = {}; - }; - - sudo-rs = { - enable = true; - execWheelOnly = true; - wheelNeedsPassword = true; - }; - }; - - boot = optionalAttrs cfg.enableBootOptions { - kernelParams = [ - # Security settings - "debugfs=off" - "page_alloc.shuffle=1" - "page_poison=1" - "slab_nomerge" - ] ++ optionals cfg.disableIPV6 [ - # Disable ipv6 - "ipv6.disable=1" - ]; - - blacklistedKernelModules = [ - # Obscure network protocols - "ax25" - "netrom" - "rose" - - # Old or rare or insufficiently audited filesystems - "adfs" - "affs" - "bfs" - "befs" - "cramfs" - "efs" - "erofs" - "exofs" - "freevxfs" - "f2fs" - "hfs" - "hpfs" - "jfs" - "minix" - "nilfs2" - "ntfs" - "omfs" - "qnx4" - "qnx6" - "sysv" - "ufs" - ]; - - kernel.sysctl = { - # Hide kptrs even for processes with CAP_SYSLOG` - "kernel.kptr_restrict" = 2; - - # Disable ftrace debugging - "kernel.ftrace_enabled" = false; - - # Enable strict reverse path filtering (that is, do not attempt to route - # packets that "obviously" do not belong to the iface's network; dropped - # packets are logged as martians). - "net.ipv4.conf.all.log_martians" = true; - "net.ipv4.conf.all.rp_filter" = "1"; - "net.ipv4.conf.default.log_martians" = true; - "net.ipv4.conf.default.rp_filter" = "1"; - - # Ignore broadcast ICMP (mitigate SMURF) - "net.ipv4.icmp_echo_ignore_broadcasts" = true; - - # Ignore incoming ICMP redirects (note: default is needed to ensure that the - # setting is applied to interfaces added after the sysctls are set) - "net.ipv4.conf.all.accept_redirects" = false; - "net.ipv4.conf.all.secure_redirects" = false; - "net.ipv4.conf.default.accept_redirects" = false; - "net.ipv4.conf.default.secure_redirects" = false; - "net.ipv6.conf.all.accept_redirects" = false; - "net.ipv6.conf.default.accept_redirects" = false; - - # Ignore outgoing ICMP redirects (this is ipv4 only) - "net.ipv4.conf.all.send_redirects" = false; - "net.ipv4.conf.default.send_redirects" = false; - } // optionalAttrs cfg.disableIPV6 { - # Disable ipv6 - "net.ipv6.conf.all.disable_ipv6" = true; - "net.ipv6.conf.default.disable_ipv6" = true; - "net.ipv6.conf.lo.disable_ipv6" = true; - "net.ipv6.conf.tun0.disable_ipv6" = true; - }; - }; - }; -} - diff --git a/system/modules/services/default.nix b/system/modules/services/default.nix deleted file mode 100644 index 7d5e1d9..0000000 --- a/system/modules/services/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ systemModules -, lib -, ... -}: - -let - hostServicesModulesPath = "${systemModules}/services"; -in { - imports = builtins.filter (module: lib.pathIsDirectory module) ( - map (module: "${hostServicesModulesPath}/${module}") (builtins.attrNames (builtins.readDir hostServicesModulesPath)) - ); -} - diff --git a/system/modules/services/homepage-dashboard/default.nix b/system/modules/services/homepage-dashboard/default.nix deleted file mode 100644 index f406c39..0000000 --- a/system/modules/services/homepage-dashboard/default.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ pkgs -, lib -, config -, ... -}: - -with lib; - -let - cfg = config.module.services.homepage-dashboard; -in -{ - options = { - module.services.homepage-dashboard = { - enable = mkEnableOption "Enables homepage-dashboard"; - }; - }; - - config = mkIf cfg.enable { - services.homepage-dashboard = { - enable = true; - package = pkgs.homepage-dashboard; - }; - - /* - systemd.services.homepage-dashboard.environment.HOMEPAGE_CONFIG_DIR = let - configDir = pkgs.linkFarm "homepage-dashboard-config" { - "settings.yaml" = yaml.generate "settings.yaml" { - title = "Germond Homelab"; - background = "https://images.unsplash.com/photo-1502790671504-542ad42d5189?auto=format&fit=crop&w=2560&q=80"; - cardBlur = "sm"; - theme = "dark"; - color = "zinc"; - iconStyle = "theme"; - statusStyle = "dot"; - - language = "fr"; - - target = "_blank"; # open links in new tabs - - hideVersion = true; - disableCollapse = true; - - logpath = pkgs.linkFarm "homepage-dashboard-null-logs" { - "logs/homepage.log" = "/dev/null"; - }; - }; - "services.yaml" = yaml.generate "services.yaml" []; - "widgets.yaml" = yaml.generate "widgets.yaml" []; - "bookmarks.yaml" = yaml.generate "bookmarks.yaml" []; - "docker.yaml" = yaml.generate "docker.yaml" {}; - "kubernetes.yaml" = yaml.generate "kubernetes.yaml" { - mode = "disabled"; - }; - "custom.css" = pkgs.writeText "custom.css" ''''; - "custom.js" = pkgs.writeText "custom.js" ''''; - }; - in - lib.mkForce "${configDir}"; - */ - }; -} - diff --git a/system/modules/variables/default.nix b/system/modules/variables/default.nix deleted file mode 100644 index 0b11637..0000000 --- a/system/modules/variables/default.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ lib -, config -, username -, ... -}: - -with lib; - -let - cfg = config.module.variables; -in { - options = { - module.variables.enable = mkEnableOption "Enables variables"; - }; - - config = mkIf cfg.enable { - environment.variables = { - QT_QPA_PLATFORM = "wayland"; - SDL_VIDEODRIVER = "wayland"; - CLUTTER_BACKEND = "wayland"; - GDK_BACKEND = "wayland"; - NIXPKGS_ALLOW_UNFREE = "1"; - NIXPKGS_ALLOW_INSECURE = "1"; - MOZ_ENABLE_WAYLAND = "1"; - XDG_SESSION_TYPE = "wayland"; - NIXOS_OZONE_WL = "1"; - }; - - environment.sessionVariables = { - MOZ_LEGACY_PROFILES = "1"; - FLAKE = "/home/${username}/Code/nixos-configuration"; - QT_QPA_PLATFORMTHEME = "gtk3"; - TDESKTOP_I_KNOW_ABOUT_GTK_INCOMPATIBILITY = "1"; - }; - }; -} - diff --git a/system/nixos/modules/binfmt/default.nix b/system/nixos/modules/binfmt/default.nix new file mode 100644 index 0000000..554a4cb --- /dev/null +++ b/system/nixos/modules/binfmt/default.nix @@ -0,0 +1,20 @@ +{ + config, + lib, + ... +}: + +with lib; + +let + cfg = config.module.binfmt; +in +{ + options.module.binfmt = { + enable = mkEnableOption "Enable module binfmt"; + }; + + config = mkIf cfg.enable { + boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; + }; +} diff --git a/system/modules/bluetooth/default.nix b/system/nixos/modules/bluetooth/default.nix similarity index 91% rename from system/modules/bluetooth/default.nix rename to system/nixos/modules/bluetooth/default.nix index b1985bd..7b765bd 100644 --- a/system/modules/bluetooth/default.nix +++ b/system/nixos/modules/bluetooth/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.bluetooth; -in { +in +{ options = { module.bluetooth = { enable = mkEnableOption "Enables bluetooth"; @@ -23,4 +25,3 @@ in { }; }; } - diff --git a/system/modules/boot/default.nix b/system/nixos/modules/boot/default.nix similarity index 90% rename from system/modules/boot/default.nix rename to system/nixos/modules/boot/default.nix index dc2e270..1554a5a 100644 --- a/system/modules/boot/default.nix +++ b/system/nixos/modules/boot/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.boot; -in { +in +{ options = { module.boot = { enable = mkEnableOption "Enables Bootloader"; @@ -21,4 +23,3 @@ in { }; }; } - diff --git a/system/nixos/modules/default.nix b/system/nixos/modules/default.nix new file mode 100644 index 0000000..1889cfc --- /dev/null +++ b/system/nixos/modules/default.nix @@ -0,0 +1,12 @@ +{ + self, + allDirs, + ... +}: + +let + modules = "${self}/system/nixos/modules"; +in +{ + imports = allDirs modules; +} diff --git a/system/modules/lanzaboot/default.nix b/system/nixos/modules/lanzaboot/default.nix similarity index 80% rename from system/modules/lanzaboot/default.nix rename to system/nixos/modules/lanzaboot/default.nix index a0e4065..28d65ee 100644 --- a/system/modules/lanzaboot/default.nix +++ b/system/nixos/modules/lanzaboot/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.lanzaboote; -in { +in +{ options = { module.lanzaboote = { enable = mkEnableOption "Enables lanzaboote"; @@ -21,10 +23,9 @@ in { loader.efi.canTouchEfiVariables = true; lanzaboote = { - enable = true; - pkiBundle = "/etc/secureboot"; + enable = true; + pkiBundle = "/etc/secureboot"; }; }; }; } - diff --git a/system/modules/locales/default.nix b/system/nixos/modules/locales/default.nix similarity index 90% rename from system/modules/locales/default.nix rename to system/nixos/modules/locales/default.nix index 99193e9..4c7d3a6 100644 --- a/system/modules/locales/default.nix +++ b/system/nixos/modules/locales/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.locales; -in { +in +{ options = { module.locales.enable = mkEnableOption "Enables locales"; }; @@ -20,4 +22,3 @@ in { }; }; } - diff --git a/system/modules/minimal/default.nix b/system/nixos/modules/minimal/default.nix similarity index 94% rename from system/modules/minimal/default.nix rename to system/nixos/modules/minimal/default.nix index b77a093..90777d3 100644 --- a/system/modules/minimal/default.nix +++ b/system/nixos/modules/minimal/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.minimal; -in { +in +{ options = { module.minimal = { enable = mkEnableOption "Enables minimal"; @@ -28,4 +30,3 @@ in { programs.command-not-found.enable = mkDefault false; }; } - diff --git a/system/modules/network/default.nix b/system/nixos/modules/network/default.nix similarity index 56% rename from system/modules/network/default.nix rename to system/nixos/modules/network/default.nix index 1f373b6..5f09169 100644 --- a/system/modules/network/default.nix +++ b/system/nixos/modules/network/default.nix @@ -1,23 +1,37 @@ -{ lib -, config -, hostname -, ... +{ + lib, + config, + hostname, + ... }: with lib; let cfg = config.module.network; -in { +in +{ options = { - module.network.enable = mkEnableOption "Enables network"; + module.network = { + enable = mkEnableOption "Enables network"; + }; }; config = mkIf cfg.enable { - systemd.services.NetworkManager-wait-online.enable = false; - systemd.services.systemd-networkd-wait-online.enable = mkForce false; + systemd = { + network.enable = true; + + services = { + NetworkManager-wait-online.enable = false; + systemd-networkd-wait-online.enable = mkForce false; + }; + }; networking = { + firewall = { + enable = true; + }; + networkmanager = { enable = true; wifi.macAddress = "random"; @@ -39,4 +53,3 @@ in { }; }; } - diff --git a/system/nixos/modules/nix/default.nix b/system/nixos/modules/nix/default.nix new file mode 100644 index 0000000..4d14ec4 --- /dev/null +++ b/system/nixos/modules/nix/default.nix @@ -0,0 +1,13 @@ +{ + config, + ... +}: + +{ + nix = { + gc = { + automatic = !config.programs.nh.enable; + options = "--delete-older-than 14d"; + }; + }; +} diff --git a/system/modules/nixos-ng/default.nix b/system/nixos/modules/nixos-ng/default.nix similarity index 70% rename from system/modules/nixos-ng/default.nix rename to system/nixos/modules/nixos-ng/default.nix index 345f5cc..09df45a 100644 --- a/system/modules/nixos-ng/default.nix +++ b/system/nixos/modules/nixos-ng/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.nixos-ng; -in { +in +{ options = { module.nixos-ng = { enable = mkEnableOption "Enables nixos-ng"; @@ -18,7 +20,7 @@ in { boot.initrd.systemd.enable = true; services = { - userborn.enable = true; + userborn.enable = true; dbus.implementation = "broker"; }; @@ -28,11 +30,12 @@ in { enableNg = true; }; - /* etc.overlay = { - enable = true; - mutable = true; - }; */ + /* + etc.overlay = { + enable = true; + mutable = true; + }; + */ }; }; } - diff --git a/system/modules/pihole/default.nix b/system/nixos/modules/pihole/default.nix similarity index 97% rename from system/modules/pihole/default.nix rename to system/nixos/modules/pihole/default.nix index f5c290a..1a09ca7 100644 --- a/system/modules/pihole/default.nix +++ b/system/nixos/modules/pihole/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.pihole; -in { +in +{ options = { module.pihole.enable = mkEnableOption "Enables pihole"; }; @@ -57,4 +59,3 @@ in { }; }; } - diff --git a/system/modules/plymouth/default.nix b/system/nixos/modules/plymouth/default.nix similarity index 88% rename from system/modules/plymouth/default.nix rename to system/nixos/modules/plymouth/default.nix index 044efb6..2bd496c 100644 --- a/system/modules/plymouth/default.nix +++ b/system/nixos/modules/plymouth/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.plymouth; -in { +in +{ options = { module.plymouth = { enable = mkEnableOption "Enables plymouth"; @@ -20,4 +22,3 @@ in { }; }; } - diff --git a/system/modules/programs/dconf/default.nix b/system/nixos/modules/programs/dconf/default.nix similarity index 87% rename from system/modules/programs/dconf/default.nix rename to system/nixos/modules/programs/dconf/default.nix index 332ba73..28d8e18 100644 --- a/system/modules/programs/dconf/default.nix +++ b/system/nixos/modules/programs/dconf/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.programs.dconf; -in { +in +{ options = { module.programs.dconf.enable = mkEnableOption "Enable dconf"; }; @@ -16,4 +18,3 @@ in { programs.dconf.enable = true; }; } - diff --git a/system/nixos/modules/programs/default.nix b/system/nixos/modules/programs/default.nix new file mode 100644 index 0000000..405fcda --- /dev/null +++ b/system/nixos/modules/programs/default.nix @@ -0,0 +1,12 @@ +{ + self, + allDirs, + ... +}: + +let + hostProgramModulesPath = "${self}/system/nixos/modules/programs"; +in +{ + imports = allDirs hostProgramModulesPath; +} diff --git a/system/modules/programs/fish/default.nix b/system/nixos/modules/programs/fish/default.nix similarity index 87% rename from system/modules/programs/fish/default.nix rename to system/nixos/modules/programs/fish/default.nix index d62d3d0..3c0e83a 100644 --- a/system/modules/programs/fish/default.nix +++ b/system/nixos/modules/programs/fish/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.programs.fish; -in { +in +{ options = { module.programs.fish.enable = mkEnableOption "Enable fish"; }; @@ -16,4 +18,3 @@ in { programs.fish.enable = true; }; } - diff --git a/system/modules/programs/gnupg/default.nix b/system/nixos/modules/programs/gnupg/default.nix similarity index 89% rename from system/modules/programs/gnupg/default.nix rename to system/nixos/modules/programs/gnupg/default.nix index 6f9fdff..ed28985 100644 --- a/system/modules/programs/gnupg/default.nix +++ b/system/nixos/modules/programs/gnupg/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.programs.gnupg; -in { +in +{ options = { module.programs.gnupg.enable = mkEnableOption "Enables GnuPG"; }; @@ -19,4 +21,3 @@ in { }; }; } - diff --git a/system/modules/programs/home-manager/default.nix b/system/nixos/modules/programs/home-manager/default.nix similarity index 80% rename from system/modules/programs/home-manager/default.nix rename to system/nixos/modules/programs/home-manager/default.nix index e1fd927..ec4c314 100644 --- a/system/modules/programs/home-manager/default.nix +++ b/system/nixos/modules/programs/home-manager/default.nix @@ -1,14 +1,16 @@ -{ inputs -, lib -, config -, ... +{ + inputs, + lib, + config, + ... }: with lib; let cfg = config.module.programs.hm; -in { +in +{ options = { module.programs.hm.enable = mkEnableOption "Enable Home Manager"; }; @@ -16,11 +18,10 @@ in { config = mkIf cfg.enable { home-manager = { useGlobalPkgs = true; - useUserPackages = true; + useUserPackages = true; extraSpecialArgs = { inherit inputs; }; }; }; } - diff --git a/system/modules/programs/kdeconnect/default.nix b/system/nixos/modules/programs/kdeconnect/default.nix similarity index 88% rename from system/modules/programs/kdeconnect/default.nix rename to system/nixos/modules/programs/kdeconnect/default.nix index 036fa73..65d5187 100644 --- a/system/modules/programs/kdeconnect/default.nix +++ b/system/nixos/modules/programs/kdeconnect/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.programs.kdeconnect; -in { +in +{ options = { module.programs.kdeconnect.enable = mkEnableOption "Enable kdeconnect"; }; @@ -16,4 +18,3 @@ in { programs.kdeconnect.enable = true; }; } - diff --git a/system/modules/programs/mtr/default.nix b/system/nixos/modules/programs/mtr/default.nix similarity index 87% rename from system/modules/programs/mtr/default.nix rename to system/nixos/modules/programs/mtr/default.nix index 482d295..b565f7d 100644 --- a/system/modules/programs/mtr/default.nix +++ b/system/nixos/modules/programs/mtr/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.programs.mtr; -in { +in +{ options = { module.programs.mtr.enable = mkEnableOption "Enable mtr"; }; @@ -16,4 +18,3 @@ in { programs.mtr.enable = true; }; } - diff --git a/system/modules/programs/nix-helper/default.nix b/system/nixos/modules/programs/nix-helper/default.nix similarity index 90% rename from system/modules/programs/nix-helper/default.nix rename to system/nixos/modules/programs/nix-helper/default.nix index 1b11f96..b03aef6 100644 --- a/system/modules/programs/nix-helper/default.nix +++ b/system/nixos/modules/programs/nix-helper/default.nix @@ -1,14 +1,16 @@ -{ lib -, config -, username -, ... +{ + lib, + config, + username, + ... }: with lib; let cfg = config.module.programs.nh; -in { +in +{ options = { module.programs.nh.enable = mkEnableOption "Enable Nix Helper"; }; @@ -25,4 +27,3 @@ in { }; }; } - diff --git a/system/nixos/modules/programs/systemPackages/default.nix b/system/nixos/modules/programs/systemPackages/default.nix new file mode 100644 index 0000000..84329bc --- /dev/null +++ b/system/nixos/modules/programs/systemPackages/default.nix @@ -0,0 +1,85 @@ +{ + pkgs, + lib, + config, + isWorkstation, + ... +}: + +with lib; + +let + cfg = config.module.programs.systemPackages; +in +{ + options = { + module.programs.systemPackages.enable = mkEnableOption "Enable System Software"; + }; + + config = mkIf cfg.enable { + fonts.packages = with pkgs; [ + nerd-fonts.jetbrains-mono + nerd-fonts.ubuntu-mono + nerd-fonts.iosevka + corefonts + ]; + + environment.systemPackages = + with pkgs; + [ + # Utils + git + nvd + nix-output-monitor + curl + wget + tree + file + zip + unzip + killall + jq + + # Hardware utils + glxinfo + pciutils + usbutils + powertop + lm_sensors + strace + ltrace + lsof + sysstat + cpufetch + sbctl + + # Network + inetutils + wireguard-tools + dig + nmap + dnsutils + iperf3 + mtr + ipcalc + cacert + ] + ++ optionals isWorkstation [ + # Themes + tela-circle-icon-theme + + # Hardware + microcodeIntel + libGL + + # Hardware utils + libva-utils + intel-gpu-tools + fwupd + fwupd-efi + + # Utils + dconf-editor + ]; + }; +} diff --git a/system/modules/programs/xdg-portal/default.nix b/system/nixos/modules/programs/xdg-portal/default.nix similarity index 93% rename from system/modules/programs/xdg-portal/default.nix rename to system/nixos/modules/programs/xdg-portal/default.nix index f181d29..2a626af 100644 --- a/system/modules/programs/xdg-portal/default.nix +++ b/system/nixos/modules/programs/xdg-portal/default.nix @@ -1,15 +1,17 @@ -{ pkgs -, lib -, config -, wm -, ... +{ + pkgs, + lib, + config, + wm, + ... }: with lib; let cfg = config.module.programs.xdg-portal; -in { +in +{ options = { module.programs.xdg-portal.enable = mkEnableOption "Enable xdg-portal"; }; @@ -36,4 +38,3 @@ in { }; }; } - diff --git a/system/modules/programs/zsh/default.nix b/system/nixos/modules/programs/zsh/default.nix similarity index 87% rename from system/modules/programs/zsh/default.nix rename to system/nixos/modules/programs/zsh/default.nix index 190e534..b94f316 100644 --- a/system/modules/programs/zsh/default.nix +++ b/system/nixos/modules/programs/zsh/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.programs.zsh; -in { +in +{ options = { module.programs.zsh.enable = mkEnableOption "Enable zsh"; }; @@ -16,4 +18,3 @@ in { programs.zsh.enable = true; }; } - diff --git a/system/nixos/modules/security/default.nix b/system/nixos/modules/security/default.nix new file mode 100644 index 0000000..8a22704 --- /dev/null +++ b/system/nixos/modules/security/default.nix @@ -0,0 +1,123 @@ +{ + lib, + config, + ... +}: + +with lib; + +let + cfg = config.module.security; +in +{ + options = { + module.security = { + enable = mkEnableOption "Enables security"; + enableBootOptions = mkEnableOption "Enables boot options"; + disableIPV6 = mkEnableOption "Disable ipv6"; + }; + }; + + config = mkIf cfg.enable { + security = { + sudo.enable = false; + + pam.services = { + gtklock = { }; + swaylock = { }; + hyprlock = { }; + }; + + sudo-rs = { + enable = true; + execWheelOnly = true; + wheelNeedsPassword = true; + }; + }; + + boot = optionalAttrs cfg.enableBootOptions { + kernelParams = + [ + # Security settings + "debugfs=off" + "page_alloc.shuffle=1" + "page_poison=1" + "slab_nomerge" + ] + ++ optionals cfg.disableIPV6 [ + # Disable ipv6 + "ipv6.disable=1" + ]; + + blacklistedKernelModules = [ + # Obscure network protocols + "ax25" + "netrom" + "rose" + + # Old or rare or insufficiently audited filesystems + "adfs" + "affs" + "bfs" + "befs" + "cramfs" + "efs" + "erofs" + "exofs" + "freevxfs" + "f2fs" + "hfs" + "hpfs" + "jfs" + "minix" + "nilfs2" + "ntfs" + "omfs" + "qnx4" + "qnx6" + "sysv" + "ufs" + ]; + + kernel.sysctl = + { + # Hide kptrs even for processes with CAP_SYSLOG` + "kernel.kptr_restrict" = 2; + + # Disable ftrace debugging + "kernel.ftrace_enabled" = false; + + # Enable strict reverse path filtering (that is, do not attempt to route + # packets that "obviously" do not belong to the iface's network; dropped + # packets are logged as martians). + "net.ipv4.conf.all.log_martians" = true; + "net.ipv4.conf.all.rp_filter" = "1"; + "net.ipv4.conf.default.log_martians" = true; + "net.ipv4.conf.default.rp_filter" = "1"; + + # Ignore broadcast ICMP (mitigate SMURF) + "net.ipv4.icmp_echo_ignore_broadcasts" = true; + + # Ignore incoming ICMP redirects (note: default is needed to ensure that the + # setting is applied to interfaces added after the sysctls are set) + "net.ipv4.conf.all.accept_redirects" = false; + "net.ipv4.conf.all.secure_redirects" = false; + "net.ipv4.conf.default.accept_redirects" = false; + "net.ipv4.conf.default.secure_redirects" = false; + "net.ipv6.conf.all.accept_redirects" = false; + "net.ipv6.conf.default.accept_redirects" = false; + + # Ignore outgoing ICMP redirects (this is ipv4 only) + "net.ipv4.conf.all.send_redirects" = false; + "net.ipv4.conf.default.send_redirects" = false; + } + // optionalAttrs cfg.disableIPV6 { + # Disable ipv6 + "net.ipv6.conf.all.disable_ipv6" = true; + "net.ipv6.conf.default.disable_ipv6" = true; + "net.ipv6.conf.lo.disable_ipv6" = true; + "net.ipv6.conf.tun0.disable_ipv6" = true; + }; + }; + }; +} diff --git a/system/modules/services/adguard-home/default.nix b/system/nixos/modules/services/adguard-home/default.nix similarity index 94% rename from system/modules/services/adguard-home/default.nix rename to system/nixos/modules/services/adguard-home/default.nix index e141b20..9973c52 100644 --- a/system/modules/services/adguard-home/default.nix +++ b/system/nixos/modules/services/adguard-home/default.nix @@ -1,17 +1,19 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.services.adguard-home; -in { +in +{ options = { module.services.adguard-home = { enable = mkEnableOption "Enables adguard-home"; - + httpAddress = mkOption { type = types.str; default = "0.0.0.0"; @@ -24,7 +26,7 @@ in { dnsRewrites = mkOption { type = types.listOf types.attrs; - default = [ ]; + default = [ ]; }; }; }; @@ -34,7 +36,7 @@ in { enable = true; port = 3000; mutableSettings = true; - + settings = { auth_attempts = 3; block_auth_min = 5; @@ -65,4 +67,3 @@ in { }; }; } - diff --git a/system/modules/services/bolt/default.nix b/system/nixos/modules/services/bolt/default.nix similarity index 87% rename from system/modules/services/bolt/default.nix rename to system/nixos/modules/services/bolt/default.nix index f7f09ea..24fc692 100644 --- a/system/modules/services/bolt/default.nix +++ b/system/nixos/modules/services/bolt/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.services.bolt; -in { +in +{ options = { module.services.bolt.enable = mkEnableOption "Enable bolt"; }; @@ -16,4 +18,3 @@ in { services.hardware.bolt.enable = true; }; } - diff --git a/system/modules/services/cpu-autofreq/default.nix b/system/nixos/modules/services/cpu-autofreq/default.nix similarity index 95% rename from system/modules/services/cpu-autofreq/default.nix rename to system/nixos/modules/services/cpu-autofreq/default.nix index 36439ad..9714a13 100644 --- a/system/modules/services/cpu-autofreq/default.nix +++ b/system/nixos/modules/services/cpu-autofreq/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.services.cpu-autofreq; -in { +in +{ options = { module.services.cpu-autofreq.enable = mkEnableOption "Enable cpu-autofreq"; }; @@ -35,4 +37,3 @@ in { }; }; } - diff --git a/system/nixos/modules/services/default.nix b/system/nixos/modules/services/default.nix new file mode 100644 index 0000000..66cc166 --- /dev/null +++ b/system/nixos/modules/services/default.nix @@ -0,0 +1,12 @@ +{ + self, + allDirs, + ... +}: + +let + hostServicesModulesPath = "${self}/system/nixos/modules/services"; +in +{ + imports = allDirs hostServicesModulesPath; +} diff --git a/system/modules/services/fwupd/default.nix b/system/nixos/modules/services/fwupd/default.nix similarity index 87% rename from system/modules/services/fwupd/default.nix rename to system/nixos/modules/services/fwupd/default.nix index 48b9ea8..28934df 100644 --- a/system/modules/services/fwupd/default.nix +++ b/system/nixos/modules/services/fwupd/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.services.fwupd; -in { +in +{ options = { module.services.fwupd.enable = mkEnableOption "Enable fwupd"; }; @@ -16,4 +18,3 @@ in { services.fwupd.enable = true; }; } - diff --git a/system/modules/services/greetd/default.nix b/system/nixos/modules/services/greetd/default.nix similarity index 68% rename from system/modules/services/greetd/default.nix rename to system/nixos/modules/services/greetd/default.nix index f780e09..9d39341 100644 --- a/system/modules/services/greetd/default.nix +++ b/system/nixos/modules/services/greetd/default.nix @@ -1,10 +1,11 @@ -{ pkgs -, lib -, config -, username -, inputs -, wm -, ... +{ + pkgs, + lib, + config, + username, + inputs, + wm, + ... }: with lib; @@ -12,12 +13,14 @@ with lib; let cfg = config.module.services.greetd; - cmd = if wm == "hyprland" - then "${inputs.hyprland.packages.${pkgs.system}.hyprland}/bin/Hyprland" - else if wm == "sway" - then "${pkgs.sway}/bin/sway" - else ""; -in { + wms = { + hyprland = "${inputs.hyprland.packages.${pkgs.system}.hyprland}/bin/Hyprland"; + sway = "${pkgs.sway}/bin/sway"; + }; + + wmCmd = wms.${wm}; +in +{ options = { module.services.greetd = { enable = mkEnableOption "Enable greetd"; @@ -31,7 +34,11 @@ in { programs.regreet = { enable = true; - cageArgs = [ "-s" "-m" "last" ]; + cageArgs = [ + "-s" + "-m" + "last" + ]; }; services.greetd = { @@ -47,11 +54,10 @@ in { "--asterisks" "--remember" "--time" - "--cmd ${cmd}" + "--cmd ${wmCmd}" ]; }; }; }; }; } - diff --git a/system/nixos/modules/services/homepage-dashboard/default.nix b/system/nixos/modules/services/homepage-dashboard/default.nix new file mode 100644 index 0000000..4672d05 --- /dev/null +++ b/system/nixos/modules/services/homepage-dashboard/default.nix @@ -0,0 +1,63 @@ +{ + pkgs, + lib, + config, + ... +}: + +with lib; + +let + cfg = config.module.services.homepage-dashboard; +in +{ + options = { + module.services.homepage-dashboard = { + enable = mkEnableOption "Enables homepage-dashboard"; + }; + }; + + config = mkIf cfg.enable { + services.homepage-dashboard = { + enable = true; + package = pkgs.homepage-dashboard; + }; + + /* + systemd.services.homepage-dashboard.environment.HOMEPAGE_CONFIG_DIR = let + configDir = pkgs.linkFarm "homepage-dashboard-config" { + "settings.yaml" = yaml.generate "settings.yaml" { + title = "Germond Homelab"; + background = "https://images.unsplash.com/photo-1502790671504-542ad42d5189?auto=format&fit=crop&w=2560&q=80"; + cardBlur = "sm"; + theme = "dark"; + color = "zinc"; + iconStyle = "theme"; + statusStyle = "dot"; + + language = "fr"; + + target = "_blank"; # open links in new tabs + + hideVersion = true; + disableCollapse = true; + + logpath = pkgs.linkFarm "homepage-dashboard-null-logs" { + "logs/homepage.log" = "/dev/null"; + }; + }; + "services.yaml" = yaml.generate "services.yaml" []; + "widgets.yaml" = yaml.generate "widgets.yaml" []; + "bookmarks.yaml" = yaml.generate "bookmarks.yaml" []; + "docker.yaml" = yaml.generate "docker.yaml" {}; + "kubernetes.yaml" = yaml.generate "kubernetes.yaml" { + mode = "disabled"; + }; + "custom.css" = pkgs.writeText "custom.css" ''''; + "custom.js" = pkgs.writeText "custom.js" ''''; + }; + in + lib.mkForce "${configDir}"; + */ + }; +} diff --git a/system/modules/services/hyprland/default.nix b/system/nixos/modules/services/hyprland/default.nix similarity index 86% rename from system/modules/services/hyprland/default.nix rename to system/nixos/modules/services/hyprland/default.nix index 89039a4..a87b895 100644 --- a/system/modules/services/hyprland/default.nix +++ b/system/nixos/modules/services/hyprland/default.nix @@ -1,15 +1,17 @@ -{ inputs -, pkgs -, lib -, config -, ... +{ + inputs, + pkgs, + lib, + config, + ... }: with lib; let cfg = config.module.services.hyprland; -in { +in +{ options = { module.services.hyprland.enable = mkEnableOption "Enables hyprland"; }; @@ -21,4 +23,3 @@ in { }; }; } - diff --git a/system/modules/services/netbird/default.nix b/system/nixos/modules/services/netbird/default.nix similarity index 88% rename from system/modules/services/netbird/default.nix rename to system/nixos/modules/services/netbird/default.nix index d64937a..7f52dc6 100644 --- a/system/modules/services/netbird/default.nix +++ b/system/nixos/modules/services/netbird/default.nix @@ -1,14 +1,16 @@ -{ lib -, config -, pkgs -, ... +{ + lib, + config, + pkgs, + ... }: with lib; let cfg = config.module.services.netbird; -in { +in +{ options = { module.services.netbird = { enable = mkEnableOption "Enables netbird"; @@ -20,4 +22,3 @@ in { environment.systemPackages = [ pkgs.netbird-ui ]; }; } - diff --git a/system/modules/services/ollama/default.nix b/system/nixos/modules/services/ollama/default.nix similarity index 88% rename from system/modules/services/ollama/default.nix rename to system/nixos/modules/services/ollama/default.nix index f22fd15..1a140a7 100644 --- a/system/modules/services/ollama/default.nix +++ b/system/nixos/modules/services/ollama/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.services.ollama; -in { +in +{ options = { module.services.ollama.enable = mkEnableOption "Enables ollama"; }; @@ -18,4 +20,3 @@ in { }; }; } - diff --git a/system/modules/services/polkit/default.nix b/system/nixos/modules/services/polkit/default.nix similarity index 96% rename from system/modules/services/polkit/default.nix rename to system/nixos/modules/services/polkit/default.nix index 8002f2f..acbb2a3 100644 --- a/system/modules/services/polkit/default.nix +++ b/system/nixos/modules/services/polkit/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.services.polkit; -in { +in +{ options = { module.services.polkit.enable = mkEnableOption "Enable polkit"; }; @@ -33,4 +35,3 @@ in { ''; }; } - diff --git a/system/modules/services/printing/default.nix b/system/nixos/modules/services/printing/default.nix similarity index 88% rename from system/modules/services/printing/default.nix rename to system/nixos/modules/services/printing/default.nix index 903551d..992edbd 100644 --- a/system/modules/services/printing/default.nix +++ b/system/nixos/modules/services/printing/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.services.printing; -in { +in +{ options = { module.services.printing.enable = mkEnableOption "Enable printing"; }; @@ -16,4 +18,3 @@ in { services.printing.enable = true; }; } - diff --git a/system/nixos/modules/services/proxmox-ve/default.nix b/system/nixos/modules/services/proxmox-ve/default.nix new file mode 100644 index 0000000..982f6bc --- /dev/null +++ b/system/nixos/modules/services/proxmox-ve/default.nix @@ -0,0 +1,29 @@ +{ + config, + lib, + ... +}: + +with lib; + +let + cfg = config.module.services.proxmox-ve; +in +{ + options.module.services.proxmox-ve = { + enable = mkEnableOption "Enable module proxmox-ve"; + + ipAddress = mkOption { + type = types.str; + default = ""; + description = "IP address for proxmox"; + }; + }; + + config = mkIf cfg.enable { + services.proxmox-ve = { + enable = true; + inherit (cfg) ipAddress; + }; + }; +} diff --git a/system/modules/services/qmk/default.nix b/system/nixos/modules/services/qmk/default.nix similarity index 90% rename from system/modules/services/qmk/default.nix rename to system/nixos/modules/services/qmk/default.nix index e5e03c8..cdb24ba 100644 --- a/system/modules/services/qmk/default.nix +++ b/system/nixos/modules/services/qmk/default.nix @@ -1,14 +1,16 @@ -{ lib -, pkgs -, config -, ... +{ + lib, + pkgs, + config, + ... }: with lib; let cfg = config.module.services.qmk; -in { +in +{ options = { module.services.qmk.enable = mkEnableOption "Enables qmk"; }; @@ -25,4 +27,3 @@ in { hardware.keyboard.qmk.enable = true; }; } - diff --git a/system/nixos/modules/services/scx/default.nix b/system/nixos/modules/services/scx/default.nix new file mode 100644 index 0000000..74ae100 --- /dev/null +++ b/system/nixos/modules/services/scx/default.nix @@ -0,0 +1,30 @@ +{ + lib, + config, + ... +}: + +with lib; + +let + cfg = config.module.services.scx; +in +{ + options = { + module.services.scx = { + enable = mkEnableOption "Enables scx module"; + + schedulerType = mkOption { + type = types.str; + default = "scx_rustland"; + }; + }; + }; + + config = mkIf cfg.enable { + services.scx = { + enable = true; + scheduler = cfg.schedulerType; + }; + }; +} diff --git a/system/nixos/modules/services/ssh/default.nix b/system/nixos/modules/services/ssh/default.nix new file mode 100644 index 0000000..09bdef3 --- /dev/null +++ b/system/nixos/modules/services/ssh/default.nix @@ -0,0 +1,50 @@ +{ + config, + lib, + ... +}: + +with lib; + +let + cfg = config.module.services.ssh; +in +{ + options.module.services.ssh = { + enable = mkEnableOption "Enable module"; + + listenAddresses = lib.mkOption { + type = lib.types.listOf lib.types.attrs; + default = [ + { + addr = "0.0.0.0"; + port = 2222; + } + ]; + description = '' + Specifies on which ports and addreses the SSH daemon listens. + ''; + }; + }; + + config = mkIf cfg.enable { + networking.firewall.allowedTCPPorts = [ + 22 + ] ++ (lib.zipAttrs cfg.listenAddresses).port; + + services.endlessh-go = { + enable = true; + port = 22; + }; + + services.openssh = { + inherit (cfg) listenAddresses; + enable = true; + + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = true; + }; + }; + }; +} diff --git a/system/modules/services/syncthing/default.nix b/system/nixos/modules/services/syncthing/default.nix similarity index 90% rename from system/modules/services/syncthing/default.nix rename to system/nixos/modules/services/syncthing/default.nix index 440861e..efc81f0 100644 --- a/system/modules/services/syncthing/default.nix +++ b/system/nixos/modules/services/syncthing/default.nix @@ -1,14 +1,16 @@ -{ lib -, config -, username -, ... +{ + lib, + config, + username, + ... }: with lib; let cfg = config.module.services.syncthing; -in { +in +{ options = { module.services.syncthing.enable = mkEnableOption "Enable syncthing"; }; @@ -22,4 +24,3 @@ in { }; }; } - diff --git a/system/modules/services/tlp/default.nix b/system/nixos/modules/services/tlp/default.nix similarity index 67% rename from system/modules/services/tlp/default.nix rename to system/nixos/modules/services/tlp/default.nix index ed73aaa..585c6c8 100644 --- a/system/modules/services/tlp/default.nix +++ b/system/nixos/modules/services/tlp/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.services.tlp; -in { +in +{ options = { module.services.tlp.enable = mkEnableOption "Enable tlp"; }; @@ -15,21 +17,13 @@ in { config = mkIf cfg.enable { services.tlp = { enable = true; - - settings = { - /* - CPU_SCALING_GOVERNOR_ON_AC = "performance"; - CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; - - CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; - CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; - */ + settings = { PLATFORM_PROFILE_ON_AC = "performance"; PLATFORM_PROFILE_ON_BAT = "balanced"; CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; - CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_performance"; + CPU_ENERGY_PERF_POLICY_ON_BAT = "balanced"; CPU_BOOST_ON_AC = 1; CPU_BOOST_ON_BAT = 0; @@ -45,4 +39,3 @@ in { }; }; } - diff --git a/system/modules/services/udev/default.nix b/system/nixos/modules/services/udev/default.nix similarity index 92% rename from system/modules/services/udev/default.nix rename to system/nixos/modules/services/udev/default.nix index 40bc04f..5c3d8b5 100644 --- a/system/modules/services/udev/default.nix +++ b/system/nixos/modules/services/udev/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.services.udev; -in { +in +{ options = { module.services.udev.enable = mkEnableOption "Enable udev"; }; @@ -19,4 +21,3 @@ in { ''; }; } - diff --git a/system/modules/services/unbound/default.nix b/system/nixos/modules/services/unbound/default.nix similarity index 94% rename from system/modules/services/unbound/default.nix rename to system/nixos/modules/services/unbound/default.nix index 992d100..0c3153b 100644 --- a/system/modules/services/unbound/default.nix +++ b/system/nixos/modules/services/unbound/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.services.unbound; -in { +in +{ options = { module.services.unbound = { enable = mkEnableOption "Enables unbound"; @@ -31,7 +33,7 @@ in { prefer-ip6 = "no"; harden-glue = "yes"; harden-dnssec-stripped = "yes"; - use-caps-for-id = "no"; + use-caps-for-id = "no"; edns-buffer-size = "1232"; prefetch = "yes"; num-threads = "1"; @@ -55,4 +57,3 @@ in { }; }; } - diff --git a/system/modules/services/xserver/default.nix b/system/nixos/modules/services/xserver/default.nix similarity index 96% rename from system/modules/services/xserver/default.nix rename to system/nixos/modules/services/xserver/default.nix index bd90a76..c826c51 100644 --- a/system/modules/services/xserver/default.nix +++ b/system/nixos/modules/services/xserver/default.nix @@ -1,14 +1,16 @@ -{ pkgs -, lib -, config -, ... +{ + pkgs, + lib, + config, + ... }: with lib; let cfg = config.module.services.xserver; -in { +in +{ options = { module.services.xserver.enable = mkEnableOption "Enable xserver"; }; @@ -45,4 +47,3 @@ in { }; }; } - diff --git a/system/nixos/modules/services/yggdrasil/default.nix b/system/nixos/modules/services/yggdrasil/default.nix new file mode 100644 index 0000000..c5437b7 --- /dev/null +++ b/system/nixos/modules/services/yggdrasil/default.nix @@ -0,0 +1,32 @@ +{ + config, + lib, + ... +}: + +with lib; + +let + cfg = config.module.services.yggdrasil; +in +{ + options.module.services.yggdrasil = { + enable = mkEnableOption "Enable module yggdrasil"; + }; + + config = mkIf cfg.enable { + services.yggdrasil = { + enable = true; + persistentKeys = true; + + settings = { + IfName = "ygg0"; + Peers = [ + "tls://188.225.9.167:18227" + "tls://45.147.200.202:443" + "tls://45.95.202.21:443" + ]; + }; + }; + }; +} diff --git a/system/modules/services/zram/default.nix b/system/nixos/modules/services/zram/default.nix similarity index 91% rename from system/modules/services/zram/default.nix rename to system/nixos/modules/services/zram/default.nix index fec381c..3439709 100644 --- a/system/modules/services/zram/default.nix +++ b/system/nixos/modules/services/zram/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.services.zram; -in { +in +{ options = { module.services.zram.enable = mkEnableOption "Enable zram"; }; @@ -22,4 +24,3 @@ in { }; }; } - diff --git a/system/modules/sound/default.nix b/system/nixos/modules/sound/default.nix similarity index 92% rename from system/modules/sound/default.nix rename to system/nixos/modules/sound/default.nix index 73f91b6..52e46c0 100644 --- a/system/modules/sound/default.nix +++ b/system/nixos/modules/sound/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.sound; -in { +in +{ options = { module.sound.enable = mkEnableOption "Enables sound in your system"; }; @@ -15,7 +17,7 @@ in { config = mkIf cfg.enable { # Sound settings security.rtkit.enable = true; - + services.pipewire = { enable = true; alsa.enable = true; @@ -24,4 +26,3 @@ in { }; }; } - diff --git a/system/modules/timedate/default.nix b/system/nixos/modules/timedate/default.nix similarity index 89% rename from system/modules/timedate/default.nix rename to system/nixos/modules/timedate/default.nix index f5ec5ac..5e67ed0 100644 --- a/system/modules/timedate/default.nix +++ b/system/nixos/modules/timedate/default.nix @@ -1,13 +1,15 @@ -{ lib -, config -, ... +{ + lib, + config, + ... }: with lib; let cfg = config.module.timedate; -in { +in +{ options = { module.timedate.enable = mkEnableOption "Enables timedate"; }; @@ -18,4 +20,3 @@ in { services.chrony.enable = true; }; } - diff --git a/system/modules/users/default.nix b/system/nixos/modules/users/default.nix similarity index 65% rename from system/modules/users/default.nix rename to system/nixos/modules/users/default.nix index d7468ef..f36136f 100644 --- a/system/modules/users/default.nix +++ b/system/nixos/modules/users/default.nix @@ -1,16 +1,18 @@ -{ self -, pkgs -, lib -, config -, username -, ... +{ + self, + pkgs, + lib, + config, + username, + ... }: with lib; let cfg = config.module.users; -in { +in +{ options = { module.users.enable = mkEnableOption "Enables users"; }; @@ -19,7 +21,7 @@ in { users = { mutableUsers = false; - groups = { + groups = { ${username} = { gid = 1000; }; @@ -27,13 +29,13 @@ in { users = { ${username} = { - uid = 1000; - home = "/home/${username}"; - shell = pkgs.fish; - group = "${username}"; - createHome = true; - description = "${username}"; - isSystemUser = true; + uid = 1000; + home = "/home/${username}"; + shell = pkgs.fish; + group = "${username}"; + createHome = true; + description = "${username}"; + isSystemUser = true; hashedPasswordFile = "${self}/secrets/hashes/${username}.hash"; extraGroups = [ @@ -42,6 +44,7 @@ in { "wheel" "docker" "libvirtd" + "yggdrasil" ]; }; @@ -53,4 +56,3 @@ in { }; }; } - diff --git a/system/nixos/modules/variables/default.nix b/system/nixos/modules/variables/default.nix new file mode 100644 index 0000000..41ccc24 --- /dev/null +++ b/system/nixos/modules/variables/default.nix @@ -0,0 +1,38 @@ +{ + lib, + config, + username, + ... +}: + +with lib; + +let + cfg = config.module.variables; +in +{ + options = { + module.variables.enable = mkEnableOption "Enables variables"; + }; + + config = mkIf cfg.enable { + environment.variables = { + QT_QPA_PLATFORM = "wayland"; + SDL_VIDEODRIVER = "wayland"; + CLUTTER_BACKEND = "wayland"; + GDK_BACKEND = "wayland"; + NIXPKGS_ALLOW_UNFREE = "1"; + NIXPKGS_ALLOW_INSECURE = "1"; + MOZ_ENABLE_WAYLAND = "1"; + XDG_SESSION_TYPE = "wayland"; + NIXOS_OZONE_WL = "1"; + }; + + environment.sessionVariables = { + MOZ_LEGACY_PROFILES = "1"; + FLAKE = "/home/${username}/Code/nixos-configuration"; + QT_QPA_PLATFORMTHEME = "gtk3"; + TDESKTOP_I_KNOW_ABOUT_GTK_INCOMPATIBILITY = "1"; + }; + }; +} diff --git a/system/modules/virtualization/default.nix b/system/nixos/modules/virtualization/default.nix similarity index 91% rename from system/modules/virtualization/default.nix rename to system/nixos/modules/virtualization/default.nix index 6699c0b..62622a6 100644 --- a/system/modules/virtualization/default.nix +++ b/system/nixos/modules/virtualization/default.nix @@ -1,15 +1,17 @@ -{ lib -, config -, username -, pkgs -, ... +{ + lib, + config, + username, + pkgs, + ... }: with lib; let cfg = config.module.virtualisation; -in { +in +{ options = { module.virtualisation = { enable = mkEnableOption "Enables virtualisation"; @@ -32,4 +34,3 @@ in { }; }; } - diff --git a/system/modules/zapret/default.nix b/system/nixos/modules/zapret/default.nix similarity index 97% rename from system/modules/zapret/default.nix rename to system/nixos/modules/zapret/default.nix index ab66391..dd753c1 100644 --- a/system/modules/zapret/default.nix +++ b/system/nixos/modules/zapret/default.nix @@ -1,14 +1,16 @@ -{ lib -, config -, pkgs -, ... +{ + lib, + config, + pkgs, + ... }: with lib; let cfg = config.module.zapret; -in { +in +{ options = { module.zapret = { enable = mkEnableOption "Enables zapret"; @@ -61,4 +63,3 @@ in { }; }; } - diff --git a/system/nixos/overlays/vaapiIntel/default.nix b/system/nixos/overlays/vaapiIntel/default.nix new file mode 100644 index 0000000..68d8e01 --- /dev/null +++ b/system/nixos/overlays/vaapiIntel/default.nix @@ -0,0 +1,5 @@ +_: prev: { + vaapiIntel = prev.vaapiIntel.override { + enableHybridCodec = true; + }; +} diff --git a/system/overlays/vaapiIntel/default.nix b/system/overlays/vaapiIntel/default.nix deleted file mode 100644 index dd245ce..0000000 --- a/system/overlays/vaapiIntel/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -_: prev: { - vaapiIntel = prev.vaapiIntel.override { - enableHybridCodec = true; - }; -} - diff --git a/templates/default.nix b/templates/default.nix index b193e9c..7283630 100644 --- a/templates/default.nix +++ b/templates/default.nix @@ -1,5 +1,6 @@ -{ self -, ... +{ + self, + ... }: { @@ -18,4 +19,3 @@ path = "${self}/templates/overlay"; }; } - diff --git a/templates/devshell/flake.nix b/templates/devshell/flake.nix index 8702151..30bd741 100644 --- a/templates/devshell/flake.nix +++ b/templates/devshell/flake.nix @@ -6,8 +6,10 @@ flake-utils.url = "github:numtide/flake-utils"; }; - outputs = { nixpkgs, flake-utils, ... }: - flake-utils.lib.eachDefaultSystem (system: + outputs = + { nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem ( + system: let pkgs = import nixpkgs { inherit system; @@ -16,11 +18,13 @@ allowUnfree = true; }; }; - in { - devShell = with pkgs; mkShell { - buildInputs = [ ]; - }; + in + { + devShell = + with pkgs; + mkShell { + buildInputs = [ ]; + }; } ); } - diff --git a/templates/module/default.nix b/templates/module/default.nix index 5aca62d..e5ab574 100644 --- a/templates/module/default.nix +++ b/templates/module/default.nix @@ -1,18 +1,19 @@ -{ config -, lib -, ... +{ + config, + lib, + ... }: with lib; let - cfg = config.module; -in { - options.module = { + cfg = config.module.""; +in +{ + options.module."" = { enable = mkEnableOption "Enable module"; }; config = mkIf cfg.enable { }; } - diff --git a/templates/overlay/default.nix b/templates/overlay/default.nix index 9e38914..ecfb435 100644 --- a/templates/overlay/default.nix +++ b/templates/overlay/default.nix @@ -1,4 +1,3 @@ _: prev: { - package = prev.package.override {}; + package = prev.package.override { }; } -