diff --git a/assets/keyboard/layer-0.png b/assets/keyboard/layer-0.png index 2116e50..71191d0 100644 Binary files a/assets/keyboard/layer-0.png and b/assets/keyboard/layer-0.png differ diff --git a/assets/keyboard/layer-1.png b/assets/keyboard/layer-1.png index dc0b9c1..8593ce3 100644 Binary files a/assets/keyboard/layer-1.png and b/assets/keyboard/layer-1.png differ diff --git a/assets/keyboard/layer-2.png b/assets/keyboard/layer-2.png index b7cf7a9..107d980 100644 Binary files a/assets/keyboard/layer-2.png and b/assets/keyboard/layer-2.png differ diff --git a/assets/keyboard/layer-3.png b/assets/keyboard/layer-3.png index 51d453d..8ea2a41 100644 Binary files a/assets/keyboard/layer-3.png and b/assets/keyboard/layer-3.png differ diff --git a/assets/keyboard/layer-4.png b/assets/keyboard/layer-4.png index 61ecc91..120655d 100644 Binary files a/assets/keyboard/layer-4.png and b/assets/keyboard/layer-4.png differ diff --git a/assets/keyboard/layer-5.png b/assets/keyboard/layer-5.png index 84372bb..d1cdf5f 100644 Binary files a/assets/keyboard/layer-5.png and b/assets/keyboard/layer-5.png differ diff --git a/assets/keyboard/layer-6.png b/assets/keyboard/layer-6.png index 01c263c..4159a73 100644 Binary files a/assets/keyboard/layer-6.png and b/assets/keyboard/layer-6.png differ diff --git a/assets/network/main.svg b/assets/network/main.svg index e063590..9271109 100644 --- a/assets/network/main.svg +++ b/assets/network/main.svg @@ -1 +1 @@ -Networks OverviewHome maxmurCIDRv4192.168.1.0/24MGTS bridge networkCIDRv4192.168.0.0/24Timeweb privateCIDRv410.20.0.0/16Wireguard privateCIDRv410.200.100.0/24Services OverviewAdGuard HomeraspNGINXraspGitlabservicesNGINXservicesNGINXsiteInternet*macboxMac Minieth0eth0192.168.1.75Main RouterKeenetic Gigaeth1192.168.1.1wan1192.168.0.2wifi192.168.1.1mboxMint boxeth0eth0192.168.1.80Bridge routerMGTS Innbox G84eth1192.168.0.1wan1nboxvboxnet0wlp3s0vboxnet0192.168.56.1wlp3s0192.168.1.111pcboxeth0vboxnet0eth0192.168.1.50vboxnet0192.168.56.1raspeth0wg0AdGuard Homedns192.168.1.8:53NGINXgitlab ssh0.0.0.0:4224https0.0.0.0:443syncthing web0.0.0.0:8384eth0192.168.1.8wg010.200.100.3servicesServices hostingeth0Gitlabssh0.0.0.0:4224NGINXhttp0.0.0.0:80https0.0.0.0:443eth010.20.0.5siteSite hostingeth0wg0NGINXhttp0.0.0.0:80https0.0.0.0:443eth010.20.0.4wg010.200.100.1Main SwitchTP-Link TL-SG1016Deth1eth2eth3eth4eth5Timeweb routerTimeweb internal routereth1wan1eth110.20.0.1wan1 \ No newline at end of file +Networks OverviewHome maxmurCIDRv4192.168.1.0/24MGTS bridge networkCIDRv4192.168.0.0/24Timeweb privateCIDRv410.20.0.0/16Wireguard privateCIDRv410.200.100.0/24Services OverviewOllamanboxOllamapcboxAdGuard HomeraspNGINXraspGitlabservicesNGINXservicesNGINXsitehlboxenp0s31f6vmbr0enp0s31f6vmbr0192.168.1.10Internet*macboxMac Minieth0eth0192.168.1.75Main RouterKeenetic Gigaeth1192.168.1.1wan1192.168.0.2wifi192.168.1.1Bridge routerMGTS Innbox G84eth1192.168.0.1wan1nboxvboxnet0wlp3s0Ollamavboxnet0192.168.56.1wlp3s0192.168.1.111p8boxwlp3s0wlp3s0192.168.1.102pcboxeth0vboxnet0Ollamaeth0192.168.1.50vboxnet0192.168.56.1raspeth0wg0AdGuard Homedns192.168.1.8:53listen0.0.0.0:3000NGINXgitlab ssh0.0.0.0:4224https0.0.0.0:443syncthing web0.0.0.0:8384eth0192.168.1.8wg010.200.100.3servicesServices hostingeth0Gitlabssh0.0.0.0:4224NGINXhttp0.0.0.0:80https0.0.0.0:443eth010.20.0.5siteSite hostingeth0wg0NGINXhttp0.0.0.0:80https0.0.0.0:443eth010.20.0.4wg010.200.100.1Main SwitchTP-Link TL-SG1016Deth1eth2eth3eth4eth5Timeweb routerTimeweb internal routereth1wan1eth110.20.0.1wan1 \ No newline at end of file diff --git a/assets/network/network.svg b/assets/network/network.svg index 79bc4c0..ed83e06 100644 --- a/assets/network/network.svg +++ b/assets/network/network.svg @@ -1 +1 @@ -Home maxmurCIDRv4192.168.1.0/24*MGTS bridge networkCIDRv4192.168.0.0/24*Timeweb privateCIDRv410.20.0.0/16*Wireguard privateCIDRv410.200.100.0/24*Internet*macboxMac Minieth0192.168.1.75Main RouterKeenetic Gigaeth1192.168.1.1wan1192.168.0.2wifi192.168.1.1mboxMint boxeth0192.168.1.80Bridge routerMGTS Innbox G84eth1192.168.0.1wan1nboxvboxnet0192.168.56.1wlp3s0192.168.1.111pcboxeth0192.168.1.50vboxnet0192.168.56.1raspeth0192.168.1.8wg010.200.100.3servicesServices hostingeth010.20.0.5siteSite hostingeth010.20.0.4wg010.200.100.1Main SwitchTP-Link TL-SG1016Deth1eth2eth3eth4eth5Timeweb routerTimeweb internal routereth110.20.0.1wan1 \ No newline at end of file +Home maxmurCIDRv4192.168.1.0/24*MGTS bridge networkCIDRv4192.168.0.0/24*Timeweb privateCIDRv410.20.0.0/16*Wireguard privateCIDRv410.200.100.0/24*hlboxenp0s31f6vmbr0192.168.1.10Internet*macboxMac Minieth0192.168.1.75Main RouterKeenetic Gigaeth1192.168.1.1wan1192.168.0.2wifi192.168.1.1Bridge routerMGTS Innbox G84eth1192.168.0.1wan1nboxvboxnet0192.168.56.1wlp3s0192.168.1.111p8boxwlp3s0192.168.1.102pcboxeth0192.168.1.50vboxnet0192.168.56.1raspeth0192.168.1.8wg010.200.100.3servicesServices hostingeth010.20.0.5siteSite hostingeth010.20.0.4wg010.200.100.1Main SwitchTP-Link TL-SG1016Deth1eth2eth3eth4eth5Timeweb routerTimeweb internal routereth110.20.0.1wan1 \ No newline at end of file diff --git a/docs/default.nix b/docs/default.nix index d5dce7e..66766bd 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -1,7 +1,9 @@ { - perSystem = - { self', pkgs, ... }: - { - packages.mydocs = pkgs.callPackage ./docs.nix { self = self'; }; - }; + perSystem = { + self', + pkgs, + ... + }: { + packages.mydocs = pkgs.callPackage ./docs.nix {self = self';}; + }; } diff --git a/docs/docs.nix b/docs/docs.nix index 0e38468..4015e25 100644 --- a/docs/docs.nix +++ b/docs/docs.nix @@ -1,45 +1,42 @@ /* - { pkgs - , ... - }: +{ pkgs +, ... +}: - let - inherit (pkgs) stdenv mkdocs python310Packages; - options-doc = pkgs.callPackage ./options-doc.nix {}; - in stdenv.mkDerivation { - src = ./.; - name = "docs"; +let + inherit (pkgs) stdenv mkdocs python310Packages; + options-doc = pkgs.callPackage ./options-doc.nix {}; +in stdenv.mkDerivation { + src = ./.; + name = "docs"; - buildInput = [ options-doc ]; + buildInput = [ options-doc ]; - nativeBuildInputs = [ - mkdocs - python310Packages.mkdocs-material - python310Packages.pygments - ]; + nativeBuildInputs = [ + mkdocs + python310Packages.mkdocs-material + python310Packages.pygments + ]; - buildPhase = '' - ln -s ${options-doc} "./docs/nixos-options.md" - mkdocs build - ''; + buildPhase = '' + ln -s ${options-doc} "./docs/nixos-options.md" + mkdocs build + ''; - installPhase = '' - mv site $out - ''; - } + installPhase = '' + mv site $out + ''; + } */ - { writeShellScriptBin, pkgs, self, ... -}: - -let - options-doc = pkgs.callPackage ./options-doc.nix { inherit 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 -'' + 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 index afc8014..aa66e5a 100644 --- a/docs/options-doc.nix +++ b/docs/options-doc.nix @@ -4,11 +4,9 @@ pkgs, runCommand, nixosOptionsDoc, -}: - -let +}: let eval = lib.evalModules { - specialArgs = { inherit self pkgs; }; + specialArgs = {inherit self pkgs;}; modules = [ (lib.nixosSystem { @@ -24,6 +22,6 @@ let inherit (eval) options; }; in -runCommand "options-doc.md" { } '' - cat ${optionsDoc.optionsCommonMark} >> $out -'' + runCommand "options-doc.md" {} '' + cat ${optionsDoc.optionsCommonMark} >> $out + '' diff --git a/flake.lock b/flake.lock index 512cfcd..149f787 100644 --- a/flake.lock +++ b/flake.lock @@ -105,16 +105,17 @@ "base16-vim": { "flake": false, "locked": { - "lastModified": 1735953590, - "narHash": "sha256-YbQwaApLFJobn/0lbpMKcJ8N5axKlW2QIGkDS5+xoSU=", + "lastModified": 1732806396, + "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", "owner": "tinted-theming", "repo": "base16-vim", - "rev": "c2a1232aa2c0ed27dcbf005779bcfe0e0ab5e85d", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", "type": "github" }, "original": { "owner": "tinted-theming", "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", "type": "github" } }, @@ -127,11 +128,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1737216937, - "narHash": "sha256-lgIK7OsoH+KeovKlhw3aEKclK6Rb1eGHH9Mx9s0pgOg=", + "lastModified": 1741284766, + "narHash": "sha256-zN21lGNyFOM5RNesQsppycjEmjEzukdSwcze3jM4xNw=", "owner": "chaotic-cx", "repo": "nyx", - "rev": "e300abf0ef16528298be33f66a2f70b20b15d2fa", + "rev": "5290334087dad0897a0ebe3999fa53f9c42b9623", "type": "github" }, "original": { @@ -188,11 +189,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1732095193, - "narHash": "sha256-GphS1owpRXYb/Khgrz2ySd0B5WdHoLbwM/5vtKk7ThY=", + "lastModified": 1738322565, + "narHash": "sha256-RcAs+V7uNVt2jgmPbDxgMHQ+Y1yFwX06dfeKAqGNBk0=", "owner": "SomeoneSerge", "repo": "pkgs", - "rev": "80b5de9f59fe00b28e6ac1338c1c6e4480e64e26", + "rev": "c6decc045180f363f81e03748809b50e68f08791", "type": "github" }, "original": { @@ -208,11 +209,11 @@ ] }, "locked": { - "lastModified": 1737162735, - "narHash": "sha256-5T+HkouTMGaRm0rh3kgD4Z1O7ONKfgjyoPQH5rSyreU=", + "lastModified": 1741229100, + "narHash": "sha256-0HwrTDXp9buEwal/1ymK9uQmzUD5ozIA7CJGqnT/gLs=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "87131f51f8256952d1a306b5521cedc2dc61aa08", + "rev": "adf5c88ba1fe21af5c083b4d655004431f20c5ab", "type": "github" }, "original": { @@ -250,11 +251,11 @@ ] }, "locked": { - "lastModified": 1737038063, - "narHash": "sha256-rMEuiK69MDhjz1JgbaeQ9mBDXMJ2/P8vmOYRbFndXsk=", + "lastModified": 1740485968, + "narHash": "sha256-WK+PZHbfDjLyveXAxpnrfagiFgZWaTJglewBWniTn2Y=", "owner": "nix-community", "repo": "disko", - "rev": "bf0abfde48f469c256f2b0f481c6281ff04a5db2", + "rev": "19c1140419c4f1cdf88ad4c1cfb6605597628940", "type": "github" }, "original": { @@ -295,11 +296,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1737009074, - "narHash": "sha256-BF+OxooVz4KeSIJyLXCnX2VTMsyfGrpEsay76hGRyrI=", + "lastModified": 1741156584, + "narHash": "sha256-Xju6PhR09gR8cSS1s4FOHw4AhUUmrFDUs9Wj/9KFoGY=", "owner": "nix-community", "repo": "fenix", - "rev": "fe17a42e2c306d1a8a4fb3f977b12048d8cf7471", + "rev": "1271797d7c0537b4e5bdd4061a2954b846f2c29c", "type": "github" }, "original": { @@ -311,11 +312,11 @@ "firefox-gnome-theme": { "flake": false, "locked": { - "lastModified": 1736899990, - "narHash": "sha256-S79Hqn2EtSxU4kp99t8tRschSifWD4p/51++0xNWUxw=", + "lastModified": 1739223196, + "narHash": "sha256-vAxN2f3rvl5q62gQQjZGVSvF93nAsOxntuFz+e/655w=", "owner": "rafaelmardojai", "repo": "firefox-gnome-theme", - "rev": "91ca1f82d717b02ceb03a3f423cbe8082ebbb26d", + "rev": "a89108e6272426f4eddd93ba17d0ea101c34fb21", "type": "github" }, "original": { @@ -343,11 +344,11 @@ "flake-compat_2": { "flake": false, "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", "owner": "edolstra", "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", "type": "github" }, "original": { @@ -404,7 +405,6 @@ } }, "flake-compat_6": { - "flake": false, "locked": { "lastModified": 1733328505, "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", @@ -426,11 +426,11 @@ ] }, "locked": { - "lastModified": 1736143030, - "narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=", + "lastModified": 1740872218, + "narHash": "sha256-ZaMw0pdoUKigLpv9HiNDH2Pjnosg7NBYMJlHTIsHEUo=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de", + "rev": "3876f6b87db82f33775b1ef5ea343986105db764", "type": "github" }, "original": { @@ -481,6 +481,46 @@ "type": "github" } }, + "flake-parts_4": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1738453229, + "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_5": { + "inputs": { + "nixpkgs-lib": [ + "stylix", + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-schemas": { "locked": { "lastModified": 1721999734, @@ -518,11 +558,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -568,6 +608,24 @@ } }, "flake-utils_5": { + "inputs": { + "systems": "systems_6" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_6": { "inputs": { "systems": [ "stylix", @@ -588,9 +646,9 @@ "type": "github" } }, - "flake-utils_6": { + "flake-utils_7": { "inputs": { - "systems": "systems_9" + "systems": "systems_11" }, "locked": { "lastModified": 1705309234, @@ -640,20 +698,22 @@ "ghostty": { "inputs": { "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_2", "nixpkgs-stable": [ "nixpkgs" ], "nixpkgs-unstable": [ "nixpkgs" ], - "zig": "zig" + "zig": "zig", + "zig2nix": "zig2nix" }, "locked": { - "lastModified": 1737085478, - "narHash": "sha256-EzdUQf1ljtGIWMmscVzoW3rUxxN3UKyNXOXbzUvz3BQ=", + "lastModified": 1741213203, + "narHash": "sha256-3/z39Y2AuLIm2OKWDAR1iPi1uo+LZju1XwW2NAxKUcY=", "owner": "ghostty-org", "repo": "ghostty", - "rev": "72d085525b22d66468c5969a4d507a0fa68d4a04", + "rev": "e07b6fdf6ba342eb1fc4321c26fe5a6475be5133", "type": "github" }, "original": { @@ -675,11 +735,11 @@ ] }, "locked": { - "lastModified": 1735882644, - "narHash": "sha256-3FZAG+pGt3OElQjesCAWeMkQ7C/nB1oTHLRQ8ceP110=", + "lastModified": 1737465171, + "narHash": "sha256-R10v2hoJRLq8jcL4syVFag7nIGE7m13qO48wRIukWNg=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "a5a961387e75ae44cc20f0a57ae463da5e959656", + "rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17", "type": "github" }, "original": { @@ -779,11 +839,11 @@ ] }, "locked": { - "lastModified": 1736883540, - "narHash": "sha256-dgPgoPUSg8cGAMqbhQRkww665sZtgzpWXxWjlyqhv94=", + "lastModified": 1741217763, + "narHash": "sha256-g/TrltIjFHIjtzKY5CJpoPANfHQWDD43G5U1a/v5oVg=", "owner": "nix-community", "repo": "home-manager", - "rev": "0dfec9deb275854a56c97c356c40ef72e3a2e632", + "rev": "486b066025dccd8af7fbe5dd2cc79e46b88c80da", "type": "github" }, "original": { @@ -799,11 +859,11 @@ ] }, "locked": { - "lastModified": 1737299337, - "narHash": "sha256-0NBrY2A7buujKmeCbieopOMSbLxTu8TFcTLqAbTnQDw=", + "lastModified": 1741217763, + "narHash": "sha256-g/TrltIjFHIjtzKY5CJpoPANfHQWDD43G5U1a/v5oVg=", "owner": "nix-community", "repo": "home-manager", - "rev": "f8ef4541bb8a54a8b52f19b52912119e689529b3", + "rev": "486b066025dccd8af7fbe5dd2cc79e46b88c80da", "type": "github" }, "original": { @@ -820,11 +880,11 @@ ] }, "locked": { - "lastModified": 1736785676, - "narHash": "sha256-TY0jUwR3EW0fnS0X5wXMAVy6h4Z7Y6a3m+Yq++C9AyE=", + "lastModified": 1740347597, + "narHash": "sha256-st5q9egkPGz8TUcVVlIQX7y6G3AzHob+6M963bwVq74=", "owner": "nix-community", "repo": "home-manager", - "rev": "fc52a210b60f2f52c74eac41a8647c1573d2071d", + "rev": "12e26a74e5eb1a31e13daaa08858689e25ebd449", "type": "github" }, "original": { @@ -876,7 +936,6 @@ "locked": { "lastModified": 1723824059, "narHash": "sha256-3AebH/B40viTNVJpgiQkfptVe4aRTfyffa8rjUNB0pU=", - "ref": "refs/heads/main", "rev": "c5feee1e357f3c3c59ebe406630601c627807963", "revCount": 5098, "submodules": true, @@ -1041,11 +1100,11 @@ }, "impermanence": { "locked": { - "lastModified": 1736688610, - "narHash": "sha256-1Zl9xahw399UiZSJ9Vxs1W4WRFjO1SsNdVZQD4nghz0=", + "lastModified": 1737831083, + "narHash": "sha256-LJggUHbpyeDvNagTUrdhe/pRVp4pnS6wVKALS782gRI=", "owner": "nix-community", "repo": "impermanence", - "rev": "c64bed13b562fc3bb454b48773d4155023ac31b7", + "rev": "4b3e914cdf97a5b536a889e939fb2fd2b043a170", "type": "github" }, "original": { @@ -1063,11 +1122,11 @@ ] }, "locked": { - "lastModified": 1737007397, - "narHash": "sha256-uJ7Lk0moWSn8Tr0QkUbOCWR7WrhiLeha4E00rckhl8I=", + "lastModified": 1741119770, + "narHash": "sha256-8AsMJdZENVLQVpxwu5BL5HftVQYyAsI9nlQ5fezzJWY=", "owner": "Jovian-Experiments", "repo": "Jovian-NixOS", - "rev": "6bbb19666e753c18ef8af35f590cbc3ba42dd0ca", + "rev": "7634e1f091586438191c7924aa486e04416abc25", "type": "github" }, "original": { @@ -1105,11 +1164,11 @@ }, "master": { "locked": { - "lastModified": 1737370608, - "narHash": "sha256-hFA6SmioeqvGW/XvZa9bxniAeulksCOcj3kokdNT/YE=", + "lastModified": 1741331998, + "narHash": "sha256-VX8YuPgCLSBVdZext0YQwRO++xxw3S4G+ShU6ei9n44=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "300081d0cc72df578b02d914df941b8ec62240e6", + "rev": "94d0b41dd97f8e3c9331cf8b2750d582a89475ee", "type": "github" }, "original": { @@ -1119,6 +1178,47 @@ "type": "github" } }, + "mnw": { + "locked": { + "lastModified": 1738852285, + "narHash": "sha256-8Y1uyE6gGHxdU0Vcx2CMg/dAmDSxJw19aAl3TKbbo54=", + "owner": "Gerg-L", + "repo": "mnw", + "rev": "6ae73dc9cb72cea17bcc2e3d4670825f483e80e8", + "type": "github" + }, + "original": { + "owner": "Gerg-L", + "repo": "mnw", + "type": "github" + } + }, + "nil": { + "inputs": { + "flake-utils": [ + "nvf", + "flake-utils" + ], + "nixpkgs": [ + "nvf", + "nixpkgs" + ], + "rust-overlay": "rust-overlay_2" + }, + "locked": { + "lastModified": 1732053863, + "narHash": "sha256-DCIVdlb81Fct2uwzbtnawLBC/U03U2hqx8trqTJB7WA=", + "owner": "oxalica", + "repo": "nil", + "rev": "2e24c9834e3bb5aa2a3701d3713b43a6fb106362", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "nil", + "type": "github" + } + }, "nix-github-actions": { "inputs": { "nixpkgs": [ @@ -1171,11 +1271,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1737125456, - "narHash": "sha256-MHjmUcYO8VT0aDf1AdIsPdcRE7vxdo+TB1gAGpDPP1k=", + "lastModified": 1738246091, + "narHash": "sha256-2+KkZsRO+XlOFbXbRgMZbRtlqn5MBNYj4HNmZ/2Tojg=", "owner": "oddlama", "repo": "nix-topology", - "rev": "ddee77422129896886ed1a0b32f0e08b882ea99f", + "rev": "5526269fa3eedf4f4bc00c0bf7a03db31d24b029", "type": "github" }, "original": { @@ -1199,6 +1299,18 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1738452942, + "narHash": "sha256-vJzFZGaCpnmo7I6i416HaBLpC+hvcURh/BQwROcGIp8=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz" + } + }, "nixpkgs-stable": { "locked": { "lastModified": 1710695816, @@ -1293,11 +1405,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1737062831, - "narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=", + "lastModified": 1741173522, + "narHash": "sha256-k7VSqvv0r1r53nUI/IfPHCppkUAddeXn843YlAC5DR0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5df43628fdf08d642be8ba5b3625a6c70731c19c", + "rev": "d69ab0d71b22fa1ce3dbeff666e6deb4917db049", "type": "github" }, "original": { @@ -1357,11 +1469,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1737062831, - "narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=", + "lastModified": 1741246872, + "narHash": "sha256-Q6pMP4a9ed636qilcYX8XUguvKl/0/LGXhHcRI91p0U=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5df43628fdf08d642be8ba5b3625a6c70731c19c", + "rev": "10069ef4cf863633f57238f179a0297de84bd8d3", "type": "github" }, "original": { @@ -1405,11 +1517,11 @@ }, "nixpkgs_9": { "locked": { - "lastModified": 1736798957, - "narHash": "sha256-qwpCtZhSsSNQtK4xYGzMiyEDhkNzOCz/Vfu4oL2ETsQ=", + "lastModified": 1740367490, + "narHash": "sha256-WGaHVAjcrv+Cun7zPlI41SerRtfknGQap281+AakSAw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9abb87b552b7f55ac8916b6fc9e5cb486656a2f3", + "rev": "0196c0175e9191c474c26ab5548db27ef5d34b05", "type": "github" }, "original": { @@ -1419,6 +1531,22 @@ "type": "github" } }, + "nmd": { + "flake": false, + "locked": { + "lastModified": 1705050560, + "narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=", + "owner": "~rycee", + "repo": "nmd", + "rev": "66d9334933119c36f91a78d565c152a4fdc8d3d3", + "type": "sourcehut" + }, + "original": { + "owner": "~rycee", + "repo": "nmd", + "type": "sourcehut" + } + }, "nur": { "inputs": { "flake-parts": "flake-parts_3", @@ -1426,11 +1554,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1737370937, - "narHash": "sha256-kOJzS9zWmDrUccUBBleTCia35Jqs8XqwlhkKnKXweW0=", + "lastModified": 1741322153, + "narHash": "sha256-F2z9+F5Z+iRYPWkJuD5oNnxafYnlFDz3qEOALNmjaOI=", "owner": "nix-community", "repo": "NUR", - "rev": "f8569084d180fe971e75e84263e16005c26d5f6c", + "rev": "9b80b69c4e08880d70a93223f83bb46cce44afab", "type": "github" }, "original": { @@ -1439,14 +1567,63 @@ "type": "github" } }, + "nur_2": { + "inputs": { + "flake-parts": "flake-parts_5", + "nixpkgs": [ + "stylix", + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix_2" + }, + "locked": { + "lastModified": 1740408283, + "narHash": "sha256-2xECnhgF3MU9YjmvOkrRp8wRFo2OjjewgCtlfckhL5s=", + "owner": "nix-community", + "repo": "NUR", + "rev": "496a4a11162bdffb9a7b258942de138873f019f7", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "nvf": { + "inputs": { + "flake-parts": "flake-parts_4", + "flake-utils": "flake-utils_5", + "mnw": "mnw", + "nil": "nil", + "nixpkgs": [ + "nixpkgs" + ], + "nmd": "nmd", + "systems": "systems_7" + }, + "locked": { + "lastModified": 1741294413, + "narHash": "sha256-NZes+PpPz69P2fm1sK0QKH/i6KR5sVhGH9+79rFKmAo=", + "owner": "notashelf", + "repo": "nvf", + "rev": "4bf2bc9db602fb7ba6e1651e3812b751d725a967", + "type": "github" + }, + "original": { + "owner": "notashelf", + "repo": "nvf", + "type": "github" + } + }, "powerlevel10k": { "flake": false, "locked": { - "lastModified": 1736162665, - "narHash": "sha256-6tWuayZgQd9pUrD3xKlUSmOFQCgZ96G3DB8ojgZ/a78=", + "lastModified": 1738157299, + "narHash": "sha256-isxgLWpbBuNoETXCOlJ4nwGSxMwCjoVF5D0dMZWtM5s=", "owner": "romkatv", "repo": "powerlevel10k", - "rev": "3e2053a9341fe4cf5ab69909d3f39d53b1dfe772", + "rev": "8fa10f43a0f65a5e15417128be63e68e1d5b1f66", "type": "github" }, "original": { @@ -1518,11 +1695,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1735469959, - "narHash": "sha256-knX3c5OWE1C5QRDdvup+zqlWvwCLDHiME6+i18WwKsE=", + "lastModified": 1741021985, + "narHash": "sha256-p86LYKcF2E++RIbo8qrxdc3D7rPNMzElS1TB8T0/abA=", "owner": "SaumonNet", "repo": "proxmox-nixos", - "rev": "4ad21ba619d779b229e308b58066bafd65d5153d", + "rev": "ba2d9223fc146eeec8c4ba7b8413b85725d86bf1", "type": "github" }, "original": { @@ -1592,12 +1769,13 @@ "unstable" ], "nur": "nur", + "nvf": "nvf", "powerlevel10k": "powerlevel10k", "proxmox-nixos": "proxmox-nixos", "sops-nix": "sops-nix", "stable": "stable", "stylix": "stylix", - "treefmt-nix": "treefmt-nix_2", + "treefmt-nix": "treefmt-nix_3", "unstable": "unstable", "xdghypr": "xdghypr", "yandex-music": "yandex-music", @@ -1610,11 +1788,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1736970696, - "narHash": "sha256-WP5yBCVkidEf5y3kCaUSjRd0udpAE6nmY3MMx3Q2aNo=", + "lastModified": 1741011961, + "narHash": "sha256-bssSxw3Z9CUNB9+f3EHAX/2urT15e12Jy6YU8tHyWkk=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "7d337c7f350a163ac3a9bd4ce0c4dae2df20579b", + "rev": "02862f5d52c30b476a5dca909a17aa4386d1fdc5", "type": "github" }, "original": { @@ -1649,6 +1827,28 @@ "type": "github" } }, + "rust-overlay_2": { + "inputs": { + "nixpkgs": [ + "nvf", + "nil", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1731983527, + "narHash": "sha256-JECaBgC0pQ91Hq3W4unH6K9to8s2Zl2sPNu7bLOv4ek=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "71287228d96e9568e1e70c6bbfa3f992d145947b", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "slimlock": { "inputs": { "nixpkgs": [ @@ -1677,11 +1877,11 @@ "nixpkgs": "nixpkgs_8" }, "locked": { - "lastModified": 1737107480, - "narHash": "sha256-GXUE9+FgxoZU8v0p6ilBJ8NH7k8nKmZjp/7dmMrCv3o=", + "lastModified": 1741043164, + "narHash": "sha256-9lfmSZLz6eq9Ygr6cCmvQiiBEaPb54pUBcjvbEMPORc=", "owner": "Mic92", "repo": "sops-nix", - "rev": "4c4fb93f18b9072c6fa1986221f9a3d7bf1fe4b6", + "rev": "3f2412536eeece783f0d0ad3861417f347219f4d", "type": "github" }, "original": { @@ -1714,23 +1914,25 @@ "base16-vim": "base16-vim", "firefox-gnome-theme": "firefox-gnome-theme", "flake-compat": "flake-compat_6", - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_6", "git-hooks": "git-hooks", "gnome-shell": "gnome-shell", "home-manager": "home-manager_3", "nixpkgs": "nixpkgs_9", - "systems": "systems_7", + "nur": "nur_2", + "systems": "systems_9", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", + "tinted-schemes": "tinted-schemes", "tinted-tmux": "tinted-tmux", "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1737207873, - "narHash": "sha256-XTCuMv753lpm8DvdVf9q2mH3rhlfsKrCUYbaADPC/bA=", + "lastModified": 1741112087, + "narHash": "sha256-dBGwN4aHmX2QUXolZDhV+p06+WM5ZykL4wd9BD6bT7k=", "owner": "danth", "repo": "stylix", - "rev": "51ad2cec11e773a949bdbec88bed2524f098f49a", + "rev": "11780517948f214b9f93d1bf5a2d29bc181d3a33", "type": "github" }, "original": { @@ -1754,6 +1956,36 @@ "type": "github" } }, + "systems_10": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_11": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "systems_2": { "locked": { "lastModified": 1681028828, @@ -1846,16 +2078,16 @@ }, "systems_8": { "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default-linux", + "repo": "default", "type": "github" } }, @@ -1908,14 +2140,30 @@ "type": "github" } }, + "tinted-schemes": { + "flake": false, + "locked": { + "lastModified": 1740351358, + "narHash": "sha256-Hdk850xgAd3DL8KX0AbyU7tC834d3Lej1jOo3duWiOA=", + "owner": "tinted-theming", + "repo": "schemes", + "rev": "a1bc2bd89e693e7e3f5764cfe8114e2ae150e184", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "schemes", + "type": "github" + } + }, "tinted-tmux": { "flake": false, "locked": { - "lastModified": 1735737224, - "narHash": "sha256-FO2hRBkZsjlIRqzNHCPc/52yxg11kHGA8MEtSun9RwE=", + "lastModified": 1740272597, + "narHash": "sha256-/etfUV3HzAaLW3RSJVwUaW8ULbMn3v6wbTlXSKbcoWQ=", "owner": "tinted-theming", "repo": "tinted-tmux", - "rev": "aead506a9930c717ebf81cc83a2126e9ca08fa64", + "rev": "b6c7f46c8718cc484f2db8b485b06e2a98304cd0", "type": "github" }, "original": { @@ -1962,15 +2210,37 @@ } }, "treefmt-nix_2": { + "inputs": { + "nixpkgs": [ + "stylix", + "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_3": { "inputs": { "nixpkgs": "nixpkgs_10" }, "locked": { - "lastModified": 1737103437, - "narHash": "sha256-uPNWcYbhY2fjY3HOfRCR5jsfzdzemhfxLSxwjXYXqNc=", + "lastModified": 1739829690, + "narHash": "sha256-mL1szCeIsjh6Khn3nH2cYtwO5YXG6gBiTw1A30iGeDU=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "d1ed3b385f8130e392870cfb1dbfaff8a63a1899", + "rev": "3d0579f5cc93436052d94b73925b48973a104204", "type": "github" }, "original": { @@ -1981,11 +2251,11 @@ }, "unstable": { "locked": { - "lastModified": 1737062831, - "narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=", + "lastModified": 1741246872, + "narHash": "sha256-Q6pMP4a9ed636qilcYX8XUguvKl/0/LGXhHcRI91p0U=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5df43628fdf08d642be8ba5b3625a6c70731c19c", + "rev": "10069ef4cf863633f57238f179a0297de84bd8d3", "type": "github" }, "original": { @@ -1997,7 +2267,7 @@ }, "utils": { "inputs": { - "systems": "systems_6" + "systems": "systems_8" }, "locked": { "lastModified": 1710146030, @@ -2020,7 +2290,7 @@ "nixpkgs": [ "nixpkgs" ], - "systems": "systems_8" + "systems": "systems_10" }, "locked": { "lastModified": 1704466722, @@ -2069,16 +2339,16 @@ }, "yandex-music": { "inputs": { - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_7", "nixpkgs": "nixpkgs_12", "ymExe": "ymExe" }, "locked": { - "lastModified": 1737074508, - "narHash": "sha256-ddZ1AiEvGkcOw8w9/z5NEMiuzAP67l04nxJLGPQBUuc=", + "lastModified": 1741308290, + "narHash": "sha256-zQO8EJIhgFhI9wCROvJQAwN31+BHC+R0DvDAChR2Ubo=", "owner": "cucumber-sp", "repo": "yandex-music-linux", - "rev": "c73d62807032c49783f06a0341543a1c54989a0a", + "rev": "06c38462dd44b3d803b5a92b2350ae2b6c00220e", "type": "github" }, "original": { @@ -2090,13 +2360,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-ufrWW90Vj+aMfntRGIiK5eGpjSNYpJIYdtIZ26FDmGA=", + "narHash": "sha256-clEUVNkOuTqgT1meF0SLzxtTlSwLGZx27+6rGbWQKag=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.35.0.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.40.4.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.35.0.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.40.4.exe" } }, "zig": { @@ -2104,18 +2374,21 @@ "flake-compat": [ "ghostty" ], - "flake-utils": "flake-utils_2", + "flake-utils": [ + "ghostty", + "flake-utils" + ], "nixpkgs": [ "ghostty", "nixpkgs-stable" ] }, "locked": { - "lastModified": 1717848532, - "narHash": "sha256-d+xIUvSTreHl8pAmU1fnmkfDTGQYCn2Rb/zOwByxS2M=", + "lastModified": 1738239110, + "narHash": "sha256-Y5i9mQ++dyIQr+zEPNy+KIbc5wjPmfllBrag3cHZgcE=", "owner": "mitchellh", "repo": "zig-overlay", - "rev": "02fc5cc555fc14fda40c42d7c3250efa43812b43", + "rev": "1a8fb6f3a04724519436355564b95fce5e272504", "type": "github" }, "original": { @@ -2124,6 +2397,32 @@ "type": "github" } }, + "zig2nix": { + "inputs": { + "flake-utils": [ + "ghostty", + "flake-utils" + ], + "nixpkgs": [ + "ghostty", + "nixpkgs-stable" + ] + }, + "locked": { + "lastModified": 1738263917, + "narHash": "sha256-j/3fwe2pEOquHabP/puljOKwAZFjIE9gXZqA91sC48M=", + "owner": "jcollie", + "repo": "zig2nix", + "rev": "c311d8e77a6ee0d995f40a6e10a89a3a4ab04f9a", + "type": "github" + }, + "original": { + "owner": "jcollie", + "repo": "zig2nix", + "rev": "c311d8e77a6ee0d995f40a6e10a89a3a4ab04f9a", + "type": "github" + } + }, "zsh-auto-notify": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index a08f578..5741e7e 100644 --- a/flake.nix +++ b/flake.nix @@ -103,6 +103,11 @@ url = "github:SaumonNet/proxmox-nixos"; }; + nvf = { + url = "github:notashelf/nvf"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # Security sops-nix = { url = "github:Mic92/sops-nix"; @@ -145,16 +150,18 @@ }; }; - 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; } { + 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; imports = [ @@ -170,7 +177,7 @@ darwinConfigurations = libx.genDarwin hosts.darwin; # Templates - templates = import "${self}/templates" { inherit self; }; + templates = import "${self}/templates" {inherit self;}; }; }; } diff --git a/home/default.nix b/home/default.nix index 4882f06..cdc275d 100644 --- a/home/default.nix +++ b/home/default.nix @@ -9,40 +9,38 @@ hmStateVersion, isWorkstation ? false, wm ? "", + theme, swayEnable ? false, hyprlandEnable ? false, wmEnable ? false, allDirs, ... -}: - -let +}: let inherit (pkgs.stdenv) isDarwin; inherit (pkgs.stdenv) isLinux; + inherit (lib) optional; stateVersion = hmStateVersion; isRoot = username == "root"; homeDirectory = - if isDarwin then - "/Users/${username}" - else if isRoot then - "/root" - else - "/home/${username}"; + 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 = "${self}/home/modules/ssh"; sshModuleExistPath = builtins.pathExists sshModulePath; -in -{ +in { home-manager = { useGlobalPkgs = true; useUserPackages = true; backupFileExtension = "backup-" - + pkgs.lib.readFile "${pkgs.runCommand "timestamp" { } "echo -n `date '+%Y%m%d%H%M%S'` > $out"}"; + + pkgs.lib.readFile "${pkgs.runCommand "timestamp" {} "echo -n `date '+%Y%m%d%H%M%S'` > $out"}"; extraSpecialArgs = { inherit @@ -56,6 +54,7 @@ in isLinux isWorkstation wm + theme swayEnable hyprlandEnable wmEnable @@ -68,15 +67,14 @@ in inputs.impermanence.nixosModules.home-manager.impermanence inputs.sops-nix.homeManagerModules.sops inputs.nur.modules.homeManager.default + inputs.nvf.homeManagerModules.default "${self}/modules" "${self}/home/modules" ] - ++ lib.optional sshModuleExistPath sshModulePath - ++ lib.optional userConfigurationPathExist userConfigurationPath - ++ lib.optional userModulesPathExist userModulesPath; - - nixpkgs.overlays = [ inputs.nur.overlay ]; + ++ optional sshModuleExistPath sshModulePath + ++ optional userConfigurationPathExist userConfigurationPath + ++ optional userModulesPathExist userModulesPath; home = { inherit username; diff --git a/home/modules/alacritty/default.nix b/home/modules/alacritty/default.nix index 7e63fae..affeff5 100644 --- a/home/modules/alacritty/default.nix +++ b/home/modules/alacritty/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.alacritty; -in -{ +in { options = { module.alacritty.enable = mkEnableOption "Enables Alacritty"; }; diff --git a/home/modules/btop/default.nix b/home/modules/btop/default.nix index 0dc7d30..0542747 100644 --- a/home/modules/btop/default.nix +++ b/home/modules/btop/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.btop; -in -{ +in { options = { module.btop.enable = mkEnableOption "Enables btop"; }; diff --git a/home/modules/chrome/default.nix b/home/modules/chrome/default.nix index 198272b..9f6115f 100644 --- a/home/modules/chrome/default.nix +++ b/home/modules/chrome/default.nix @@ -3,14 +3,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.chromium; -in -{ +in { options = { module.chromium.enable = mkEnableOption "Enables Chromium"; }; diff --git a/home/modules/cinnamon/dconf2nix.nix b/home/modules/cinnamon/dconf2nix.nix index a6e950d..3081962 100644 --- a/home/modules/cinnamon/dconf2nix.nix +++ b/home/modules/cinnamon/dconf2nix.nix @@ -1,9 +1,10 @@ # Generated via dconf2nix: https://github.com/gvolpe/dconf2nix -{ lib, username, ... }: - -with lib.hm.gvariant; - { + lib, + username, + ... +}: +with lib.hm.gvariant; { dconf.settings = { "org/cinnamon" = { alttab-minimized-aware = true; @@ -12,7 +13,7 @@ with lib.hm.gvariant; alttab-switcher-show-all-workspaces = false; alttab-switcher-style = "icons+thumbnails"; app-menu-label = ""; - command-history = [ "r" ]; + command-history = ["r"]; desklet-snap-interval = 25; desktop-effects-close = "fly"; desktop-effects-close-effect = "traditional"; @@ -35,7 +36,7 @@ with lib.hm.gvariant; desktop-effects-unmaximize-effect = "none"; desktop-effects-unmaximize-time = 100; desktop-effects-unmaximize-transition = "easeNone"; - device-aliases = [ "/org/freedesktop/UPower/devices/battery_BAT0:=Laptop" ]; + 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" @@ -61,8 +62,8 @@ with lib.hm.gvariant; "panel4:center:0:spacer@cinnamon.org:156" "panel1:center:0:spacer@cinnamon.org:157" ]; - enabled-desklets = [ ]; - enabled-extensions = [ "horizontal-osd@berk-karaal" ]; + enabled-desklets = []; + enabled-extensions = ["horizontal-osd@berk-karaal"]; favorite-apps = [ "google-chrome.desktop" "cinnamon-settings.desktop" @@ -79,7 +80,7 @@ with lib.hm.gvariant; next-desklet-id = 13; no-adjacent-panel-barriers = false; panel-edit-mode = false; - panel-launchers = [ "DEPRECATED" ]; + panel-launchers = ["DEPRECATED"]; 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}]"; @@ -187,41 +188,41 @@ with lib.hm.gvariant; "custom3" "custom0" ]; - looking-glass-keybinding = [ ]; + looking-glass-keybinding = []; }; "org/cinnamon/desktop/keybindings/custom-keybindings/custom0" = { - binding = [ "Tab" ]; + binding = ["Tab"]; command = "gnome-terminal"; name = "mouse button 10"; }; "org/cinnamon/desktop/keybindings/custom-keybindings/custom2" = { - binding = [ "Print" ]; + binding = ["Print"]; command = "flameshot gui"; name = "screenshot"; }; "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" ]; + area-screenshot-clip = ["Print"]; screensaver = [ "l" "XF86ScreenSaver" "Cyrillic_de" ]; - screenshot = [ ]; - terminal = [ "Return" ]; + screenshot = []; + terminal = ["Return"]; }; "org/cinnamon/desktop/keybindings/wm" = { - close = [ "q" ]; - minimize = [ "m" ]; + close = ["q"]; + minimize = ["m"]; move-to-workspace-1 = [ "1" "exclam" @@ -270,25 +271,25 @@ with lib.hm.gvariant; "9" "parenleft" ]; - switch-to-workspace-1 = [ "1" ]; - switch-to-workspace-10 = [ "0" ]; - switch-to-workspace-11 = [ "minus" ]; - switch-to-workspace-12 = [ "equal" ]; - switch-to-workspace-2 = [ "2" ]; - switch-to-workspace-3 = [ "3" ]; - switch-to-workspace-4 = [ "4" ]; - switch-to-workspace-5 = [ "5" ]; - switch-to-workspace-6 = [ "6" ]; - switch-to-workspace-7 = [ "7" ]; - switch-to-workspace-8 = [ "8" ]; - switch-to-workspace-9 = [ "9" ]; + switch-to-workspace-1 = ["1"]; + switch-to-workspace-10 = ["0"]; + switch-to-workspace-11 = ["minus"]; + switch-to-workspace-12 = ["equal"]; + switch-to-workspace-2 = ["2"]; + switch-to-workspace-3 = ["3"]; + switch-to-workspace-4 = ["4"]; + switch-to-workspace-5 = ["5"]; + switch-to-workspace-6 = ["6"]; + switch-to-workspace-7 = ["7"]; + switch-to-workspace-8 = ["8"]; + switch-to-workspace-9 = ["9"]; switch-to-workspace-up = [ "Up" "F1" "w" ]; - toggle-fullscreen = [ "f" ]; - toggle-maximized = [ "f" ]; + toggle-fullscreen = ["f"]; + toggle-maximized = ["f"]; }; "org/cinnamon/desktop/media-handling" = { @@ -398,7 +399,7 @@ with lib.hm.gvariant; attach-modal-dialogs = true; center-new-windows = true; draggable-border-width = 10; - experimental-features = [ "scale-monitor-framebuffer" ]; + experimental-features = ["scale-monitor-framebuffer"]; placement-mode = "center"; resize-threshold = 24; tile-hud-threshold = 25; diff --git a/home/modules/cinnamon/default.nix b/home/modules/cinnamon/default.nix index 6f2d3e8..95c16f1 100644 --- a/home/modules/cinnamon/default.nix +++ b/home/modules/cinnamon/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.cinnamon; -in -{ +in { imports = [ # ./dconf2nix.nix ]; diff --git a/home/modules/dconf/default.nix b/home/modules/dconf/default.nix index ea185c4..e9298e6 100644 --- a/home/modules/dconf/default.nix +++ b/home/modules/dconf/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.dconf; -in -{ +in { options = { module.dconf.enable = mkEnableOption "Enables dconf"; }; diff --git a/home/modules/default.nix b/home/modules/default.nix index 6c86b96..4d62684 100644 --- a/home/modules/default.nix +++ b/home/modules/default.nix @@ -2,8 +2,6 @@ self, allDirs, ... -}: - -{ +}: { imports = allDirs "${self}/home/modules"; } diff --git a/home/modules/emacs/default.nix b/home/modules/emacs/default.nix index ddda6c3..bc029fa 100644 --- a/home/modules/emacs/default.nix +++ b/home/modules/emacs/default.nix @@ -3,14 +3,11 @@ lib, pkgs, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.emacs; -in -{ +in { options = { module.emacs.enable = mkEnableOption "Enable emacs"; }; diff --git a/home/modules/eza/default.nix b/home/modules/eza/default.nix index b701ad5..dffa614 100644 --- a/home/modules/eza/default.nix +++ b/home/modules/eza/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.eza; -in -{ +in { options = { module.eza.enable = mkEnableOption "Enables eza"; }; diff --git a/home/modules/fastfetch/default.nix b/home/modules/fastfetch/default.nix index f04155f..7b03ea0 100644 --- a/home/modules/fastfetch/default.nix +++ b/home/modules/fastfetch/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.fastfetch; -in -{ +in { options = { module.fastfetch = { enable = mkEnableOption "Enable fastfetch"; diff --git a/home/modules/firefox/default.nix b/home/modules/firefox/default.nix index f4eaeed..61cf157 100644 --- a/home/modules/firefox/default.nix +++ b/home/modules/firefox/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.firefox; -in -{ +in { options = { module.firefox.enable = mkEnableOption "Enables firefox"; }; diff --git a/home/modules/fish/default.nix b/home/modules/fish/default.nix index 651808d..95c265b 100644 --- a/home/modules/fish/default.nix +++ b/home/modules/fish/default.nix @@ -5,14 +5,11 @@ username, pkgs, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.fish; -in -{ +in { options = { module.fish.enable = mkEnableOption "Enables Fish"; }; diff --git a/home/modules/flameshot/default.nix b/home/modules/flameshot/default.nix index 6699e23..496b29d 100644 --- a/home/modules/flameshot/default.nix +++ b/home/modules/flameshot/default.nix @@ -3,14 +3,11 @@ config, username, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.flameshot; -in -{ +in { options = { module.flameshot.enable = mkEnableOption "Enables Flameshot"; }; diff --git a/home/modules/foot/default.nix b/home/modules/foot/default.nix index 5e5534f..134387b 100644 --- a/home/modules/foot/default.nix +++ b/home/modules/foot/default.nix @@ -2,14 +2,16 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.foot; -in -{ + + serverEnable = + if config.module.defaults.terminal == "foot-client" + then true + else false; +in { options = { module.foot.enable = mkEnableOption "Enables Foot"; }; @@ -17,7 +19,7 @@ in config = mkIf cfg.enable { programs.foot = { enable = true; - server.enable = true; + server.enable = serverEnable; settings = { main = { @@ -39,6 +41,7 @@ in key-bindings = { clipboard-copy = "Control+c XF86Copy"; clipboard-paste = "Control+v XF86Paste"; + noop = "Mod4+space"; }; text-bindings = { diff --git a/home/modules/fuzzel/default.nix b/home/modules/fuzzel/default.nix index b173e23..9ec6504 100644 --- a/home/modules/fuzzel/default.nix +++ b/home/modules/fuzzel/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.fuzzel; -in -{ +in { options = { module.fuzzel = { enable = mkEnableOption "Enable fuzzel app runner"; diff --git a/home/modules/fzf/default.nix b/home/modules/fzf/default.nix index bb803cc..6b78731 100644 --- a/home/modules/fzf/default.nix +++ b/home/modules/fzf/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.fzf; -in -{ +in { options = { module.fzf.enable = mkEnableOption "Enables fzf"; }; diff --git a/home/modules/git/default.nix b/home/modules/git/default.nix index b97a331..9313378 100644 --- a/home/modules/git/default.nix +++ b/home/modules/git/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.git; -in -{ +in { options = { module.git.enable = mkEnableOption "Enables git"; }; diff --git a/home/modules/helix/default.nix b/home/modules/helix/default.nix index 5a3db79..066524f 100644 --- a/home/modules/helix/default.nix +++ b/home/modules/helix/default.nix @@ -3,14 +3,11 @@ pkgs, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.helix; -in -{ +in { options = { module.helix.enable = mkEnableOption "Enables helix"; }; @@ -37,7 +34,7 @@ in text-width = 70; bufferline = "multiple"; default-line-ending = "lf"; - rulers = [ 73 ]; + rulers = [73]; cursorline = true; auto-info = true; color-modes = true; diff --git a/home/modules/htop/default.nix b/home/modules/htop/default.nix index 66bb879..d64c15a 100644 --- a/home/modules/htop/default.nix +++ b/home/modules/htop/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.htop; -in -{ +in { options = { module.htop.enable = mkEnableOption "Enables htop"; }; diff --git a/home/modules/hypridle/default.nix b/home/modules/hypridle/default.nix index 60dbbe9..cc24d8c 100644 --- a/home/modules/hypridle/default.nix +++ b/home/modules/hypridle/default.nix @@ -7,11 +7,10 @@ swayEnable, hyprlandEnable, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; + inherit (lib) optionals; -with lib; - -let cfg = config.module.hypridle; suspendCmd = "${pkgs.systemd}/bin/systemctl suspend"; @@ -21,33 +20,29 @@ let hyprlockCmd = "${config.programs.hyprlock.package}/bin/hyprlock"; swaylockCmd = "${pkgs.swaylock}/bin/swaylock"; lockScreen = - if hyprlandEnable then - hyprlockCmd - else if swayEnable then - swaylockCmd - else - ""; + 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 - ""; + if hyprlandEnable + then hyprlandOnScreen + else if swayEnable + then swayOnScreen + else ""; screenOff = - if hyprlandEnable then - hyprlandOffScreen - else if swayEnable then - swayOffScreen - else - ""; -in -{ + if hyprlandEnable + then hyprlandOffScreen + else if swayEnable + then swayOffScreen + else ""; +in { options = { module.hypridle.enable = mkEnableOption "Enables Hypridle"; }; @@ -79,14 +74,14 @@ in on-resume = ""; } ] - ++ lib.optionals (hostname == "nbox") [ + ++ optionals (hostname == "nbox") [ { timeout = 900; on-timeout = suspendCmd; on-resume = ""; } ] - ++ lib.optionals (hostname == "pcbox") [ + ++ optionals (hostname == "pcbox") [ { timeout = 7200; on-timeout = suspendCmd; diff --git a/home/modules/hyprland/binds/default.nix b/home/modules/hyprland/binds/default.nix index 568eaaf..c7b56dc 100644 --- a/home/modules/hyprland/binds/default.nix +++ b/home/modules/hyprland/binds/default.nix @@ -4,11 +4,9 @@ lib, pkgs, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.hyprland.binds; terminal = config.module.defaults.terminalCmd; @@ -20,8 +18,7 @@ let screenshotArea = "${pkgs.grimblast}/bin/grimblast --notify --freeze copy area"; screenshotScreen = "${pkgs.grimblast}/bin/grimblast --notify --freeze copy output"; -in -{ +in { options = { module.hyprland.binds.enable = mkEnableOption "Enables binds in Hyprland"; }; @@ -80,7 +77,7 @@ in # Compositor commands "SUPER, Q, killactive" "SUPER, F, fullscreen, 1" - "SUPER, Space, togglefloating" + "SUPERSHIFT, F, togglefloating" # Grouped (tabbed) windows "SUPER, G, togglegroup" @@ -152,26 +149,21 @@ in ]; # layer rules - 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}" + 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}" + ]; # Window rules windowrulev2 = [ diff --git a/home/modules/hyprland/default.nix b/home/modules/hyprland/default.nix index 6e95ad0..8d0235e 100644 --- a/home/modules/hyprland/default.nix +++ b/home/modules/hyprland/default.nix @@ -5,14 +5,17 @@ lib, pkgs, ... -}: +}: let + inherit + (lib) + mkEnableOption + mkDefault + mkBefore + mkIf + ; -with lib; - -let cfg = config.module.hyprland; -in -{ +in { imports = [ "${self}/home/modules/hyprland/binds" "${self}/home/modules/hyprland/monitors" @@ -35,7 +38,7 @@ in systemd = { enable = true; - extraCommands = lib.mkBefore [ + extraCommands = mkBefore [ "systemctl --user stop graphical-session.target" "systemctl --user start hyprland-session.target" ]; diff --git a/home/modules/hyprland/monitors/default.nix b/home/modules/hyprland/monitors/default.nix index 8653f1c..d9d1b68 100644 --- a/home/modules/hyprland/monitors/default.nix +++ b/home/modules/hyprland/monitors/default.nix @@ -3,59 +3,54 @@ lib, hostname, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -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 - [ ]; + 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 = - if hostname == "pcbox" then - [ - "1, monitor:DP-2, default:true" - "2, monitor:DP-2, default:true" - "3, monitor:DP-2, default:true" - "4, monitor:DP-2, default:true" - "5, monitor:DP-2, default:true" - "6, monitor:DP-2, default:true" - "7, monitor:DP-1, default:true" - "8, monitor:DP-1, default:true" - "9, monitor:DP-1, default:true" - "10, monitor:DP-1, default:true" - "11, monitor:DP-1, default:true" - "12, monitor:DP-1, default:true" - ] - else if hostname == "nbox" then - [ - "1, monitor:eDP-1, default:true" - "2, monitor:eDP-1, default:true" - "3, monitor:eDP-1, default:true" - "4, monitor:eDP-1, default:true" - "5, monitor:eDP-1, default:true" - "6, monitor:eDP-1, default:true" - # "7, monitor:eDP-1, default:true" - # "8, monitor:eDP-1, default:true" - # "9, monitor:eDP-1, default:true" - # "10, monitor:eDP-1, default:true" - # "11, monitor:eDP-1, default:true" - # "12, monitor:eDP-1, default:true" - ] - else - [ ]; -in -{ + if hostname == "pcbox" + then [ + "1, monitor:DP-2, default:true" + "2, monitor:DP-2, default:true" + "3, monitor:DP-2, default:true" + "4, monitor:DP-2, default:true" + "5, monitor:DP-2, default:true" + "6, monitor:DP-2, default:true" + "7, monitor:DP-1, default:true" + "8, monitor:DP-1, default:true" + "9, monitor:DP-1, default:true" + "10, monitor:DP-1, default:true" + "11, monitor:DP-1, default:true" + "12, monitor:DP-1, default:true" + ] + else if hostname == "nbox" + then [ + "1, monitor:eDP-1, default:true" + "2, monitor:eDP-1, default:true" + "3, monitor:eDP-1, default:true" + "4, monitor:eDP-1, default:true" + "5, monitor:eDP-1, default:true" + "6, monitor:eDP-1, default:true" + # "7, monitor:eDP-1, default:true" + # "8, monitor:eDP-1, default:true" + # "9, monitor:eDP-1, default:true" + # "10, monitor:eDP-1, default:true" + # "11, monitor:eDP-1, default:true" + # "12, monitor:eDP-1, default:true" + ] + else []; +in { options = { module.hyprland.monitors.enable = mkEnableOption "Enables monitors in Hyprland"; }; diff --git a/home/modules/hyprlock/default.nix b/home/modules/hyprlock/default.nix index 146cc4c..5cb1ccc 100644 --- a/home/modules/hyprlock/default.nix +++ b/home/modules/hyprlock/default.nix @@ -4,14 +4,11 @@ lib, pkgs, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.hyprlock; -in -{ +in { options = { module.hyprlock.enable = mkEnableOption "Enables Hyprlock"; }; diff --git a/home/modules/hyprpaper/default.nix b/home/modules/hyprpaper/default.nix index e22682f..3b4bd25 100644 --- a/home/modules/hyprpaper/default.nix +++ b/home/modules/hyprpaper/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.hyprpaper; -in -{ +in { options = { module.hyprpaper.enable = mkEnableOption "Enables hyprpaper"; }; @@ -19,8 +16,8 @@ in enable = true; settings = { - preload = [ "../../../assets/grey_gradient.png" ]; - wallpapers = [ "../../../assets/grey_gradient.png" ]; + preload = ["../../../assets/grey_gradient.png"]; + wallpapers = ["../../../assets/grey_gradient.png"]; }; }; }; diff --git a/home/modules/lazygit/default.nix b/home/modules/lazygit/default.nix index 78d154a..048f4b3 100644 --- a/home/modules/lazygit/default.nix +++ b/home/modules/lazygit/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.lazygit; -in -{ +in { options = { module.lazygit.enable = mkEnableOption "Enables lazygit"; }; diff --git a/home/modules/librewolf/default.nix b/home/modules/librewolf/default.nix index 1d38be9..1d44cbd 100644 --- a/home/modules/librewolf/default.nix +++ b/home/modules/librewolf/default.nix @@ -3,14 +3,11 @@ config, pkgs, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.librewolf; -in -{ +in { options = { module.librewolf.enable = mkEnableOption "Enables librewolf"; }; @@ -24,7 +21,7 @@ in id = 1; name = "Work"; - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [ ublock-origin vimium ]; @@ -50,7 +47,7 @@ in name = "Default"; isDefault = true; - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [ ublock-origin sponsorblock return-youtube-dislikes @@ -61,7 +58,7 @@ in search = { force = true; - default = "nogoo"; + default = "Google"; order = [ "Google" @@ -81,7 +78,7 @@ in "4get" = { updateInterval = 24 * 60 * 60 * 1000; - definedAliases = [ "@4get" ]; + definedAliases = ["@4get"]; urls = [ { template = "https://4get.bloat.cat/web"; @@ -97,7 +94,7 @@ in "nogoo" = { updateInterval = 24 * 60 * 60 * 1000; - definedAliases = [ "@nogoo" ]; + definedAliases = ["@nogoo"]; urls = [ { template = "https://nogoo.me/search"; @@ -114,7 +111,7 @@ in "YouTube" = { iconUpdateURL = "https://youtube.com/favicon.ico"; updateInterval = 24 * 60 * 60 * 1000; - definedAliases = [ "@yt" ]; + definedAliases = ["@yt"]; urls = [ { template = "https://www.youtube.com/results"; @@ -130,7 +127,7 @@ in "Nix Packages" = { icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@np" ]; + definedAliases = ["@np"]; urls = [ { template = "https://search.nixos.org/packages"; @@ -150,7 +147,7 @@ in "NixOS Options" = { icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@no" ]; + definedAliases = ["@no"]; urls = [ { template = "https://search.nixos.org/options"; @@ -171,7 +168,7 @@ in "GitHub" = { iconUpdateURL = "https://github.com/favicon.ico"; updateInterval = 24 * 60 * 60 * 1000; - definedAliases = [ "@gh" ]; + definedAliases = ["@gh"]; urls = [ { @@ -188,7 +185,7 @@ in "Home Manager" = { icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@hm" ]; + definedAliases = ["@hm"]; url = [ { diff --git a/home/modules/neofetch/default.nix b/home/modules/neofetch/default.nix index aaad0ed..db1896a 100644 --- a/home/modules/neofetch/default.nix +++ b/home/modules/neofetch/default.nix @@ -4,20 +4,17 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.neofetch; -in -{ +in { options = { module.neofetch.enable = mkEnableOption "Enables neofetch"; }; config = mkIf cfg.enable { - home.packages = [ pkgs.neofetch ]; + home.packages = [pkgs.neofetch]; 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 deleted file mode 100644 index dbc863e..0000000 --- a/home/modules/neovim/config/init.lua +++ /dev/null @@ -1 +0,0 @@ -require("config") diff --git a/home/modules/neovim/config/lua/config/init.lua b/home/modules/neovim/config/lua/config/init.lua deleted file mode 100644 index bba220d..0000000 --- a/home/modules/neovim/config/lua/config/init.lua +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index e223a88..0000000 --- a/home/modules/neovim/config/lua/config/keymaps.lua +++ /dev/null @@ -1,86 +0,0 @@ -local map = vim.keymap.set -local opts = { noremap = true, silent = true } -local builtin = require("telescope.builtin") - -local function escape(str) - local escape_chars = [[;,."|\]] - return vim.fn.escape(str, escape_chars) -end - --- Russian layout -local en_shift = [[~QWERTYUIOP{}ASDFGHJKL:"ZXCVBNM<>]] -local ru_shift = [[ËЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ]] -local en = [[`qwertyuiop[]asdfghjkl;'zxcvbnm]] -local ru = [[ёйцукенгшщзхъфывапролджэячсмить]] - -vim.opt.langmap = vim.fn.join({ - escape(ru_shift) .. ";" .. escape(en_shift), - escape(ru) .. ";" .. escape(en), -}, ",") - --- Base --- nnoremap , :nohlsearch -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" }) - -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" }) - --- BarBar --- Move to previous/next -map("n", "", "BufferPrevious", opts) -map("n", "", "BufferNext", opts) --- Re-order to previous/next -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) --- Pin/unpin buffer -map("n", "", "BufferPin", opts) --- Close buffer -map("n", "", "BufferClose", opts) --- Wipeout buffer --- :BufferWipeout --- Close commands --- :BufferCloseAllButCurrent --- :BufferCloseAllButPinned --- :BufferCloseAllButCurrentOrPinned --- :BufferCloseBuffersLeft --- :BufferCloseBuffersRight --- Magic buffer-picking mode -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) - --- Other: --- :BarbarEnable - enables barbar (enabled by default) --- :BarbarDisable - very bad command, should never be used - --- 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, {}) diff --git a/home/modules/neovim/config/lua/config/lazy.lua b/home/modules/neovim/config/lua/config/lazy.lua deleted file mode 100644 index 3601f39..0000000 --- a/home/modules/neovim/config/lua/config/lazy.lua +++ /dev/null @@ -1,57 +0,0 @@ -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, - }) -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 = { - "●", - "➜", - "★", - "‒", - }, - }, - }, -}) diff --git a/home/modules/neovim/config/lua/config/options.lua b/home/modules/neovim/config/lua/config/options.lua deleted file mode 100644 index b8b2a33..0000000 --- a/home/modules/neovim/config/lua/config/options.lua +++ /dev/null @@ -1,21 +0,0 @@ -local opt = vim.opt -local g = vim.g - -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 - -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 deleted file mode 100644 index 83e348f..0000000 --- a/home/modules/neovim/config/lua/lsp/handlers.lua +++ /dev/null @@ -1,60 +0,0 @@ -local M = {} - --- M.diagnostic = function() --- vim.diagnostic.config(PREF.lsp.diagnostic) --- for type, icon in pairs(PREF.ui.signs) do --- local hl = "DiagnosticSign" .. type --- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) --- end --- end - -local cmp_ok, cmp = pcall(require, "cmp_nvim_lsp") -local ok_c, capabilities = pcall(require("cmp_nvim_lsp").defaults_capabilities) -if cmp_ok and ok_c then - capabilities.textDocument.complition.complitionItem.snippetSupport = true - M.capabilities = capabilities -end - -M.on_attach = function(client, bufnr) - local map = function(mode, key, action) - vim.keymap.set(mode, key, action, { buffer = bufnr, silent = true, noremap = true }) - 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", "rf", vim.lsp.buf.references) - map("n", "ca", vim.lsp.buf.code_action) - map("n", "rn", vim.lsp.buf.rename) - map("n", "f", function() - require("conform").format({ lsp_fallback = true }) - end) - - vim.api.nvim_create_autocmd("CursorHold", { - buffer = bufnr, - callback = function() - local float_opts = { - focusable = false, - close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, - border = "rounded", - source = "always", - prefix = " ", - } - - if not vim.b.diagnostics_pos then - vim.b.diagnostics_pos = { nil, nil } - end - - local cursor_pos = vim.api.nvim_win_get_cursor(0) - if - (cursor_pos[1] ~= vim.b.diagnostics_pos[1] or cursor_pos[2] ~= vim.b.diagnostics_pos[2]) - and #vim.diagnostic.get() > 0 - then - vim.diagnostic.open_float(nil, float_opts) - end - - vim.b.diagnostics_pos = cursor_pos - end, - }) -end - -return M diff --git a/home/modules/neovim/config/lua/lsp/init.lua b/home/modules/neovim/config/lua/lsp/init.lua deleted file mode 100644 index cf744dc..0000000 --- a/home/modules/neovim/config/lua/lsp/init.lua +++ /dev/null @@ -1,32 +0,0 @@ -local status_ok, lsp = pcall(require, "lspconfig") -if not status_ok then - 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" -} - -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) -end diff --git a/home/modules/neovim/config/lua/lsp/settings/ansiblels.lua b/home/modules/neovim/config/lua/lsp/settings/ansiblels.lua deleted file mode 100644 index c20b886..0000000 --- a/home/modules/neovim/config/lua/lsp/settings/ansiblels.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - 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 deleted file mode 100644 index 7af4375..0000000 --- a/home/modules/neovim/config/lua/lsp/settings/dockerls.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - 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 deleted file mode 100644 index 59edbb9..0000000 --- a/home/modules/neovim/config/lua/lsp/settings/gopls.lua +++ /dev/null @@ -1,19 +0,0 @@ -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, - }, - }, -} diff --git a/home/modules/neovim/config/lua/lsp/settings/helm_ls.lua b/home/modules/neovim/config/lua/lsp/settings/helm_ls.lua deleted file mode 100644 index d115452..0000000 --- a/home/modules/neovim/config/lua/lsp/settings/helm_ls.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - 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 deleted file mode 100644 index 5eb5a19..0000000 --- a/home/modules/neovim/config/lua/lsp/settings/jsonls.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - settings = { - json = { - schemas = require("schemastore").json.schemas(), - validate = { enable = true }, - }, - }, -} diff --git a/home/modules/neovim/config/lua/lsp/settings/lua_ls.lua b/home/modules/neovim/config/lua/lsp/settings/lua_ls.lua deleted file mode 100644 index 4b53f97..0000000 --- a/home/modules/neovim/config/lua/lsp/settings/lua_ls.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - settings = { - Lua = { - runtime = { - version = "LuaJIT", - }, - completion = { - callSnippet = "Replace", - }, - diagnostics = { - globals = { "vim" }, - }, - }, - }, -} diff --git a/home/modules/neovim/config/lua/lsp/settings/nil_ls.lua b/home/modules/neovim/config/lua/lsp/settings/nil_ls.lua deleted file mode 100644 index 233d4b9..0000000 --- a/home/modules/neovim/config/lua/lsp/settings/nil_ls.lua +++ /dev/null @@ -1,14 +0,0 @@ ---[[ return { - settings = { - ["nil"] = { - nix = { - flake = { - autoArchive = true, - autoEvalInputs = false, - }, - }, - }, - }, -} -]] --- diff --git a/home/modules/neovim/config/lua/lsp/settings/pyright.lua b/home/modules/neovim/config/lua/lsp/settings/pyright.lua deleted file mode 100644 index 6a0c23c..0000000 --- a/home/modules/neovim/config/lua/lsp/settings/pyright.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - settings = { - python = { - analysis = { - useLibraryCodeForTypes = true, - autoSearchPaths = true, - diagnosticMode = "openFilesOnly", - typeCheckingMode = "basic", - }, - }, - }, -} diff --git a/home/modules/neovim/config/lua/lsp/settings/yamlls.lua b/home/modules/neovim/config/lua/lsp/settings/yamlls.lua deleted file mode 100644 index 28929ce..0000000 --- a/home/modules/neovim/config/lua/lsp/settings/yamlls.lua +++ /dev/null @@ -1,12 +0,0 @@ -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/**", - }, - }, -} diff --git a/home/modules/neovim/config/lua/plugins/auto-sessions.lua b/home/modules/neovim/config/lua/plugins/auto-sessions.lua deleted file mode 100644 index 661348b..0000000 --- a/home/modules/neovim/config/lua/plugins/auto-sessions.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - { - "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, - }, -} diff --git a/home/modules/neovim/config/lua/plugins/autopairs.lua b/home/modules/neovim/config/lua/plugins/autopairs.lua deleted file mode 100644 index cb2d0a5..0000000 --- a/home/modules/neovim/config/lua/plugins/autopairs.lua +++ /dev/null @@ -1,38 +0,0 @@ -return { - { - "windwp/nvim-autopairs", - enabled = true, - event = "InsertEnter", - - 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.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 deleted file mode 100644 index 9c84199..0000000 --- a/home/modules/neovim/config/lua/plugins/autosave.lua +++ /dev/null @@ -1,36 +0,0 @@ -return { - { - "Pocco81/auto-save.nvim", - enable = true, - lazy = false, - - 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, - - 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, - }, - - 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 deleted file mode 100644 index c14deda..0000000 --- a/home/modules/neovim/config/lua/plugins/barbar.lua +++ /dev/null @@ -1,23 +0,0 @@ -return { - { - "romgrk/barbar.nvim", - enable = true, - lazy = false, - - 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", - }, -} diff --git a/home/modules/neovim/config/lua/plugins/blankline.lua b/home/modules/neovim/config/lua/plugins/blankline.lua deleted file mode 100644 index 7ab2399..0000000 --- a/home/modules/neovim/config/lua/plugins/blankline.lua +++ /dev/null @@ -1,49 +0,0 @@ -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", - }, - - { - "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 deleted file mode 100644 index f963f93..0000000 --- a/home/modules/neovim/config/lua/plugins/cmp.lua +++ /dev/null @@ -1,158 +0,0 @@ -return { - { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - { - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "hrsh7th/cmp-nvim-lsp", - "onsails/lspkind.nvim", - "saadparwaiz1/cmp_luasnip", - "rafamadriz/friendly-snippets", - { - "L3MON4D3/LuaSnip", - config = function() - local luasnip = require("luasnip") - luasnip.config.set_config({ - history = true, - updateevents = "TextChanged,TextChangedI", - enable_autosnippets = true, - }) - require("luasnip.loaders.from_vscode").lazy_load() - end, - }, - }, - }, - config = function() - local cmp = require("cmp") - local lspkind = require("lspkind") - local status, lspkind = pcall(require, "lspkind") - if not status then - return - end - - lspkind.init({ - - symbol_map = { - Text = "󰦨 ", - Method = " ", - Function = " ", - Constructor = " ", - Field = " ", - Variable = " ", - Class = " ", - Interface = " ", - Module = " ", - Property = " ", - Unit = " ", - Value = "󰾡 ", - Enum = " ", - Keyword = " ", - Snippet = " ", - Color = " ", - File = " ", - Reference = " ", - Folder = " ", - EnumMember = " ", - Constant = " ", - Struct = " ", - Event = " ", - Operator = " ", - TypeParameter = " ", - Specifier = " ", - Statement = " ", - Recovery = " ", - TranslationUnit = " ", - }, - }) - - cmp.setup({ - preselect = "None", - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - - window = { - completion = { - winhighlight = "Normal:CmpPmenu,Search:None", - scrollbar = false, - }, - documentation = cmp.config.disable, - }, - - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - else - fallback() - end - end, { "i", "s" }), - }), - sources = cmp.config.sources({ - { name = "luasnip", group_index = 1 }, - { - name = "nvim_lsp", - max_item_count = 35, - group_index = 1, - entry_filter = function(entry) - return require("cmp.types").lsp.CompletionItemKind[entry:get_kind()] ~= "Text" - end, - }, - { - name = "path", - group_index = 2, - trigger_characters = { "/", "./", "../" }, - }, - { - name = "buffer", - option = { - get_bufnrs = function() - return vim.api.nvim_list_bufs() - end, - }, - keyword_length = 2, - max_item_count = 5, - group_index = 2, - }, - }), - completion = { - keyword_length = 1, - completeopt = "menu,menuone,noinsert", - }, - - view = { - entries = "custom", - }, - - formatting = { - fields = { - "abbr", - "kind", - }, - format = lspkind.cmp_format({ - maxwidth = 50, - mode = "symbol_text", - }), - }, - experimental = { - ghost_text = false, - }, - }) - end, - }, -} diff --git a/home/modules/neovim/config/lua/plugins/comment.lua b/home/modules/neovim/config/lua/plugins/comment.lua deleted file mode 100644 index 4cf712d..0000000 --- a/home/modules/neovim/config/lua/plugins/comment.lua +++ /dev/null @@ -1,31 +0,0 @@ -return { - { - "folke/todo-comments.nvim", - event = { "BufReadPost", "BufNewFile" }, - opts = {}, - }, - - { - "numToStr/Comment.nvim", - enabled = true, - event = { "BufReadPre" }, - dependencies = { - { - "JoosepAlviste/nvim-ts-context-commentstring", - dependencies = { "nvim-treesitter/nvim-treesitter" }, - }, - }, - config = function() - vim.g.skip_ts_context_commentstring_module = true - require("Comment").setup({ - toggler = { - line = "", - }, - opleader = { - block = "", - }, - pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), - }) - end, - }, -} diff --git a/home/modules/neovim/config/lua/plugins/dressing.lua b/home/modules/neovim/config/lua/plugins/dressing.lua deleted file mode 100644 index f461cb1..0000000 --- a/home/modules/neovim/config/lua/plugins/dressing.lua +++ /dev/null @@ -1,38 +0,0 @@ -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", - }, - }, - }, - }, -} diff --git a/home/modules/neovim/config/lua/plugins/git.lua b/home/modules/neovim/config/lua/plugins/git.lua deleted file mode 100644 index 385fcf2..0000000 --- a/home/modules/neovim/config/lua/plugins/git.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - "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 deleted file mode 100644 index 08ba7d8..0000000 --- a/home/modules/neovim/config/lua/plugins/gitsings.lua +++ /dev/null @@ -1,48 +0,0 @@ -return { - { - "lewis6991/gitsigns.nvim", - event = { "BufReadPost", "BufNewFile" }, - enabled = true, - config = function() - require("gitsigns").setup({ - signs = { - add = { text = "┃" }, - change = { text = "┃" }, - delete = { text = "-" }, - topdelete = { text = "‾" }, - changedelete = { text = "~" }, - untracked = { text = "┆" }, - }, - signcolumn = true, - numhl = false, - linehl = false, - word_diff = false, - watch_gitdir = { - interval = 1000, - follow_files = true, - }, - attach_to_untracked = true, - current_line_blame = false, - current_line_blame_opts = { - virt_text = true, - virt_text_pos = "eol", - delay = 1000, - ignore_whitespace = false, - }, - current_line_blame_formatter = ", - ", - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, - max_file_length = 40000, - preview_config = { - - border = "single", - style = "minimal", - relative = "cursor", - row = 0, - col = 1, - }, - }) - end, - }, -} diff --git a/home/modules/neovim/config/lua/plugins/lualine.lua b/home/modules/neovim/config/lua/plugins/lualine.lua deleted file mode 100644 index 1d1f0bf..0000000 --- a/home/modules/neovim/config/lua/plugins/lualine.lua +++ /dev/null @@ -1,221 +0,0 @@ -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, - }, -} diff --git a/home/modules/neovim/config/lua/plugins/markdown-preview.lua b/home/modules/neovim/config/lua/plugins/markdown-preview.lua deleted file mode 100644 index 980a8e0..0000000 --- a/home/modules/neovim/config/lua/plugins/markdown-preview.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - { - "iamcco/markdown-preview.nvim", - enabled = true, - build = "cd app && npm install", - ft = { "markdown" }, - config = function() - vim.g.mkdp_filetypes = { "markdown" } - end, - }, -} diff --git a/home/modules/neovim/config/lua/plugins/mini.lua b/home/modules/neovim/config/lua/plugins/mini.lua deleted file mode 100644 index 744374b..0000000 --- a/home/modules/neovim/config/lua/plugins/mini.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - { - "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 deleted file mode 100644 index 9f0deed..0000000 --- a/home/modules/neovim/config/lua/plugins/mylsp.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - { - "neovim/nvim-lspconfig", - enable = true, - lazy = false, - -- event = { "VeryLazy" }, - - dependencies = { - "b0o/schemastore.nvim", - "nvim-lua/plenary.nvim", - }, - - config = function() - require("lsp.init") - end, - }, -} diff --git a/home/modules/neovim/config/lua/plugins/noice.lua b/home/modules/neovim/config/lua/plugins/noice.lua deleted file mode 100644 index caaf1c0..0000000 --- a/home/modules/neovim/config/lua/plugins/noice.lua +++ /dev/null @@ -1,46 +0,0 @@ -return { - { - "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", - }, - }, - }, - - 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 deleted file mode 100644 index 8c51df1..0000000 --- a/home/modules/neovim/config/lua/plugins/nvim-ansible.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - { - "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 deleted file mode 100644 index cb7e656..0000000 --- a/home/modules/neovim/config/lua/plugins/nvim-tree.lua +++ /dev/null @@ -1,96 +0,0 @@ -local HEIGHT_RATIO = 0.9 -local WIDTH_RATIO = 0.5 - -return { - { - "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, - }, - - 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, - }, -} diff --git a/home/modules/neovim/config/lua/plugins/telescope.lua b/home/modules/neovim/config/lua/plugins/telescope.lua deleted file mode 100644 index b082a4f..0000000 --- a/home/modules/neovim/config/lua/plugins/telescope.lua +++ /dev/null @@ -1,93 +0,0 @@ -return { - { - "nvim-telescope/telescope.nvim", - dependencies = { - { - "natecraddock/telescope-zf-native.nvim", - }, - }, - cmd = "Telescope oldfiles", - keys = { - { - ";f", - function() - local builtin = require("telescope.builtin") - builtin.find_files({ - no_ignore = false, - hidden = true, - }) - end, - desc = "Lists files in your current working directory, respects .gitignore", - }, - { - ";r", - function() - local builtin = require("telescope.builtin") - builtin.live_grep({ - additional_args = { "--hidden" }, - }) - end, - desc = "Live Grep", - }, - { - ";;", - function() - local builtin = require("telescope.builtin") - builtin.resume() - end, - desc = "Resume the previous telescope picker", - }, - { - ";s", - function() - local builtin = require("telescope.builtin") - builtin.treesitter() - end, - desc = "Lists Function names, variables, from Treesitter", - }, - }, - config = function(_, opts) - local telescope = require("telescope") - local actions = require("telescope.actions") - - telescope.setup({ - extensions = { - ["zf-native"] = { - file = { - enable = true, - highlight_results = true, - match_filename = true, - initial_sort = nil, - smart_case = true, - }, - }, - }, - defaults = { - wrap_results = false, - prompt_prefix = "  ", - selection_caret = " ", - entry_prefix = " ", - layout_strategy = "horizontal", - sorting_strategy = "ascending", - winblend = 0, - mappings = { - n = { - ["q"] = "close", - }, - }, - layout_config = { - horizontal = { - prompt_position = "top", - preview_width = 0.5, - results_width = 0.6, - }, - width = 0.85, - height = 0.70, - preview_cutoff = 120, - }, - }, - }) - require("telescope").load_extension("zf-native") - end, - }, -} diff --git a/home/modules/neovim/config/lua/plugins/theme.lua b/home/modules/neovim/config/lua/plugins/theme.lua deleted file mode 100644 index 5398bbf..0000000 --- a/home/modules/neovim/config/lua/plugins/theme.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - { - "shaunsingh/nord.nvim", - enable = true, - lazy = false, - - 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 deleted file mode 100644 index fd073e6..0000000 --- a/home/modules/neovim/config/lua/plugins/treesitter.lua +++ /dev/null @@ -1,37 +0,0 @@ -return { - { - "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", - }, - - ignore_install = {}, - - highlight = { - enable = true, - disable = { "help" }, - }, - - 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 deleted file mode 100644 index 2a3af56..0000000 --- a/home/modules/neovim/config/lua/plugins/vim-helm.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - { - "towolf/vim-helm", - enable = true, - lazy = false, - - ft = "helm", - }, -} diff --git a/home/modules/neovim/default.nix b/home/modules/neovim/default.nix index 0a71df3..ddff96f 100644 --- a/home/modules/neovim/default.nix +++ b/home/modules/neovim/default.nix @@ -3,48 +3,401 @@ lib, config, pkgs, + theme, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; + inherit (lib.generators) mkLuaInline; -with lib; - -let cfg = config.module.nvim; -in -{ +in { options = { module.nvim.enable = mkEnableOption "Enables nvim"; }; config = mkIf cfg.enable { - xdg.configFile."nvim" = { - source = "${self}/home/modules/neovim/config"; - recursive = true; - }; - - programs.neovim = { + programs.nvf = { enable = true; - viAlias = true; - vimAlias = true; - defaultEditor = true; - - extraPackages = with pkgs; [ - gcc - nodejs_22 - ansible-language-server - yaml-language-server - marksman - gopls - dockerfile-language-server-nodejs - docker-compose-language-service - cmake-language-server - helm-ls - nil - nixd - lua-language-server - stylua - pyright - ]; + + settings = { + vim = { + viAlias = true; + vimAlias = true; + + withNodeJs = false; + withPython3 = false; + withRuby = false; + + enableLuaLoader = true; + useSystemClipboard = true; + hideSearchHighlight = true; + searchCase = "smart"; + + options = { + mouse = "a"; + colorcolumn = "79"; + encoding = "utf-8"; + fileformat = "unix"; + number = true; + relativenumber = true; + swapfile = false; + scrolloff = 7; + tabstop = 2; + shiftwidth = 2; + softtabstop = 2; + expandtab = true; + smartindent = true; + }; + + globals = { + mapleader = ","; + editorconfig = true; + }; + + keymaps = [ + { + key = ""; + mode = ["n"]; + action = ":NvimTreeToggle"; + silent = true; + desc = "Toggle File tree"; + } + { + key = ""; + mode = "n"; + action = "bnext"; + silent = true; + desc = "Go to next buffer"; + } + { + key = ""; + mode = "n"; + action = "bprevious"; + silent = true; + desc = "Go to previous buffer"; + } + { + key = "bd"; + mode = "n"; + action = "bdel"; + silent = true; + desc = "Close current buffer"; + } + { + key = ";;"; + mode = "n"; + action = "Telescope"; + silent = true; + } + { + key = ";g"; + mode = "n"; + action = "Telescope live_grep"; + silent = true; + desc = "Grep files"; + } + { + key = ";f"; + mode = "n"; + action = "Telescope find_files"; + silent = true; + desc = "Find files"; + } + { + key = "gn"; + mode = "n"; + action = ":LazyGit"; + silent = true; + desc = "Open LazyGit"; + } + { + key = ""; + mode = "n"; + action = "ggG"; + silent = true; + desc = "Select all"; + } + ]; + + extraLuaFiles = [ + "${self}/home/modules/neovim/lua/autocmds.lua" + "${self}/home/modules/neovim/lua/rulayout.lua" + ]; + + autopairs.nvim-autopairs.enable = true; + autocomplete.nvim-cmp.enable = true; + telescope.enable = true; + statusline.lualine.enable = true; + comments.comment-nvim.enable = true; + git.gitsigns.enable = true; + + lsp = { + enable = true; + lsplines.enable = true; + }; + + languages = { + enableLSP = true; + enableFormat = true; + enableTreesitter = true; + enableExtraDiagnostics = true; + + bash.enable = true; + clang.enable = true; + css.enable = true; + dart.enable = true; + go.enable = true; + haskell.enable = true; + hcl.enable = true; + html.enable = true; + java.enable = true; + kotlin.enable = true; + lua.enable = true; + markdown.enable = true; + nim.enable = true; + nix.enable = true; + python.enable = true; + ruby.enable = true; + rust.enable = true; + scala.enable = true; + sql.enable = true; + typst.enable = true; + ts.enable = true; + terraform.enable = true; + yaml.enable = true; + zig.enable = true; + }; + + theme = { + enable = true; + name = theme; + style = "dark"; + }; + + notify.nvim-notify = { + enable = true; + + setupOpts = { + render = "minimal"; + stages = "static"; + }; + }; + + spellcheck = { + enable = true; + languages = [ + "en" + "ru" + ]; + }; + + terminal.toggleterm = { + enable = true; + + setupOpts = { + direction = "float"; + }; + }; + + utility = { + preview.markdownPreview = { + enable = true; + }; + }; + + mini = { + icons.enable = true; + + tabline = { + enable = true; + + setupOpts = { + show_icons = true; + }; + }; + }; + + visuals = { + indent-blankline.enable = true; + }; + + ui = { + noice.enable = true; + + borders = { + enable = true; + globalStyle = "rounded"; + + plugins.nvim-cmp.enable = false; + }; + + smartcolumn = { + enable = true; + + setupOpts.custom_colorcolumn = { + nix = "110"; + rust = "120"; + }; + }; + }; + + filetree = { + nvimTree = { + enable = true; + openOnSetup = false; + + setupOpts = { + sync_root_with_cwd = true; + respect_buf_cwd = true; + sort_by = "case_sensitive"; + git.enable = true; + + update_focused_file = { + enable = true; + update_root = true; + }; + + view = { + number = false; + float = { + enable = true; + open_win_config = mkLuaInline '' + function() + local screen_w = vim.opt.columns:get() + local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get() + local window_w = screen_w * 0.5 + local window_h = screen_h * 0.8 + 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 = mkLuaInline '' + function() + return math.floor(vim.opt.columns:get() * 0.5) + 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; + }; + }; + }; + }; + + lazy.plugins = { + auto-session = { + package = pkgs.vimPlugins.auto-session; + setupModule = "auto-session"; + lazy = false; + + setupOpts = { + auto_session_enabled = true; + auto_session_root_dir = mkLuaInline '' + vim.fn.stdpath("data") .. "/sessions/" + ''; + pre_save_cmds = mkLuaInline '' + { close_floating_windows, close_toggleterm, "NvimTreeClose" } + ''; + post_restore_cmds = mkLuaInline '' + { clear_jumps, "NvimTreeOpen" } + ''; + save_extra_cmds = mkLuaInline '' + { "NvimTreeOpen" } + ''; + }; + }; + + "auto-save.nvim" = { + package = pkgs.vimPlugins.auto-save-nvim; + setupModule = "auto-save"; + lazy = false; + + after = '' + local group = vim.api.nvim_create_augroup('autosave', {}) + + vim.api.nvim_create_autocmd('User', { + pattern = 'AutoSaveWritePost', + group = group, + callback = function(opts) + if opts.data.saved_buffer ~= nil then + local filename = vim.api.nvim_buf_get_name(opts.data.saved_buffer) + vim.notify('AutoSave: saved at ' .. vim.fn.strftime('%H:%M:%S'), vim.log.levels.INFO) + end + end, + }) + ''; + }; + + "lazygit.nvim" = { + package = pkgs.vimPlugins.lazygit-nvim; + lazy = true; + + cmd = [ + "LazyGit" + "LazyGitConfig" + "LazyGitCurrentFile" + "LazyGitFilter" + "LazyGitFilterCurrentFile" + ]; + }; + }; + }; + }; }; }; } diff --git a/home/modules/neovim/config/lua/config/autocmds.lua b/home/modules/neovim/lua/autocmds.lua similarity index 99% rename from home/modules/neovim/config/lua/config/autocmds.lua rename to home/modules/neovim/lua/autocmds.lua index de5b538..18e2317 100644 --- a/home/modules/neovim/config/lua/config/autocmds.lua +++ b/home/modules/neovim/lua/autocmds.lua @@ -1,5 +1,4 @@ local autocmd = vim.api.nvim_create_autocmd - local function check_git_repo() local cmd = "git rev-parse --is-inside-work-tree" if vim.fn.system(cmd) == "true\n" then diff --git a/home/modules/neovim/lua/rulayout.lua b/home/modules/neovim/lua/rulayout.lua new file mode 100644 index 0000000..ffb319e --- /dev/null +++ b/home/modules/neovim/lua/rulayout.lua @@ -0,0 +1,15 @@ +local function escape(str) + local escape_chars = [[;,."|\]] + return vim.fn.escape(str, escape_chars) +end + +-- Russian layout +local en_shift = [[~QWERTYUIOP{}ASDFGHJKL:"ZXCVBNM<>]] +local ru_shift = [[ËЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ]] +local en = [[`qwertyuiop[]asdfghjkl;'zxcvbnm]] +local ru = [[ёйцукенгшщзхъфывапролджэячсмить]] + +vim.opt.langmap = vim.fn.join({ + escape(ru_shift) .. ";" .. escape(en_shift), + escape(ru) .. ";" .. escape(en), +}, ",") diff --git a/home/modules/password-store/default.nix b/home/modules/password-store/default.nix index 260911d..78eab66 100644 --- a/home/modules/password-store/default.nix +++ b/home/modules/password-store/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.password-store; -in -{ +in { options = { module.password-store.enable = mkEnableOption "Enables password-store"; }; diff --git a/home/modules/ripgrep/default.nix b/home/modules/ripgrep/default.nix index 2dd864c..dcfd85a 100644 --- a/home/modules/ripgrep/default.nix +++ b/home/modules/ripgrep/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.ripgrep; -in -{ +in { options = { module.ripgrep.enable = mkEnableOption "Enables ripgrep"; }; diff --git a/home/modules/rofi/default.nix b/home/modules/rofi/default.nix index a724a81..5c31d88 100644 --- a/home/modules/rofi/default.nix +++ b/home/modules/rofi/default.nix @@ -3,14 +3,11 @@ lib, pkgs, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.rofi; -in -{ +in { options = { module.rofi.enable = mkEnableOption "Enables rofi"; }; @@ -35,85 +32,83 @@ in drun-display-format = "{name}"; }; - 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"; - }; + 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"; + }; + }; }; }; } diff --git a/home/modules/sway/default.nix b/home/modules/sway/default.nix index e27b675..5666ed2 100644 --- a/home/modules/sway/default.nix +++ b/home/modules/sway/default.nix @@ -4,14 +4,11 @@ lib, pkgs, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.sway; -in -{ +in { imports = [ "${self}/home/modules/sway/keybinds" "${self}/home/modules/sway/outputs" @@ -54,7 +51,7 @@ in "type:keyboard" = { xkb_layout = "us,ru"; - xkb_options = "grp:caps_toggle"; + xkb_options = "grp:win_space_toggle,grp:alt_shift_toggle,grp:caps_toggle"; repeat_delay = "300"; repeat_rate = "60"; }; @@ -70,24 +67,24 @@ in inner = 7; }; - bars = [ ]; + bars = []; window = { titlebar = false; }; startup = [ - { command = "${pkgs.blueman}/bin/blueman-applet"; } - { 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.blueman}/bin/blueman-applet";} + {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 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 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'"; } diff --git a/home/modules/sway/keybinds/default.nix b/home/modules/sway/keybinds/default.nix index 0b9bce9..4510239 100644 --- a/home/modules/sway/keybinds/default.nix +++ b/home/modules/sway/keybinds/default.nix @@ -3,11 +3,9 @@ lib, pkgs, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.sway.keybindings; super = "Mod4"; @@ -39,7 +37,7 @@ let 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 + case $op in poweroff) ;& reboot) @@ -55,8 +53,7 @@ let ;; esac ''; -in -{ +in { options.module.sway.keybindings = { enable = mkEnableOption "Enable sway keybindings"; }; @@ -68,9 +65,9 @@ in bindkeysToCode = true; assigns = { - "2" = [ { app_id = "org.telegram.desktop"; } ]; - "4" = [ { app_id = "obsidian"; } ]; - "8" = [ { app_id = "vesktop"; } ]; + "2" = [{app_id = "org.telegram.desktop";}]; + "4" = [{app_id = "obsidian";}]; + "8" = [{app_id = "vesktop";}]; }; keybindings = { @@ -85,10 +82,10 @@ in # Change focus # Vim like - "${super}+h" = "focus left"; - "${super}+j" = "focus down"; - "${super}+k" = "focus up"; - "${super}+l" = "focus right"; + "${super}+j" = "focus left"; + "${super}+k" = "focus down"; + "${super}+l" = "focus up"; + "${super}+apostrophe" = "focus right"; # With arrows "${super}+Left" = "focus left"; @@ -98,10 +95,10 @@ in # Move focused window # Vim like - "${super}+Shift+h" = "move left"; - "${super}+Shift+j" = "move down"; - "${super}+Shift+k" = "move up"; - "${super}+Shift+l" = "move right"; + "${super}+Shift+j" = "move left"; + "${super}+Shift+k" = "move down"; + "${super}+Shift+l" = "move up"; + "${super}+Shift+apostrophe" = "move right"; # With arrows "${super}+Shift+Left" = "move left"; @@ -134,7 +131,7 @@ in "${super}+f" = "fullscreen"; # Float mode - "${super}+Space" = "floating toggle"; + "${super}+Shift+f" = "floating toggle"; # Resize mode "${super}+r" = "mode resize"; diff --git a/home/modules/sway/outputs/default.nix b/home/modules/sway/outputs/default.nix index 2a38f53..b0d0009 100644 --- a/home/modules/sway/outputs/default.nix +++ b/home/modules/sway/outputs/default.nix @@ -3,15 +3,13 @@ lib, hostname, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.sway.outputs; outputs = { - default = { }; + default = {}; pcbox = { DP-1 = { @@ -41,7 +39,7 @@ let }; workspaces = { - default = [ ]; + default = []; pcbox = [ { @@ -148,8 +146,7 @@ let } ]; }; -in -{ +in { options.module.sway.outputs = { enable = mkEnableOption "Enable sway outputs"; }; diff --git a/home/modules/swaylock/default.nix b/home/modules/swaylock/default.nix index 4e0fc8d..556406d 100644 --- a/home/modules/swaylock/default.nix +++ b/home/modules/swaylock/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.swaylock; -in -{ +in { options = { module.swaylock = { enable = mkEnableOption "Enable swaylock"; diff --git a/home/modules/swaync/default.nix b/home/modules/swaync/default.nix index b32e521..a87f8cd 100644 --- a/home/modules/swaync/default.nix +++ b/home/modules/swaync/default.nix @@ -3,14 +3,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.swaync; -in -{ +in { options = { module.swaync.enable = mkEnableOption "Enables swaync"; }; diff --git a/home/modules/thunderbird/default.nix b/home/modules/thunderbird/default.nix index 99f04a9..0190688 100644 --- a/home/modules/thunderbird/default.nix +++ b/home/modules/thunderbird/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.thunderbird; -in -{ +in { options = { module.thunderbird.enable = mkEnableOption "Enables thunderbird"; }; diff --git a/home/modules/vscode/default.nix b/home/modules/vscode/default.nix index c0e7b3b..23936e5 100644 --- a/home/modules/vscode/default.nix +++ b/home/modules/vscode/default.nix @@ -3,14 +3,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.vscode; -in -{ +in { imports = [ "${self}/home/modules/vscode/keybindings" "${self}/home/modules/vscode/extentions" @@ -22,7 +19,7 @@ in }; config = mkIf cfg.enable { - programs.vscode = { + programs.vscode.profiles.default = { enable = true; enableUpdateCheck = false; }; diff --git a/home/modules/vscode/extentions/default.nix b/home/modules/vscode/extentions/default.nix index 59c0fa3..df40980 100644 --- a/home/modules/vscode/extentions/default.nix +++ b/home/modules/vscode/extentions/default.nix @@ -1,10 +1,5 @@ -{ - pkgs, - ... -}: - -{ - programs.vscode.extensions = with pkgs.vscode-extensions; [ +{pkgs, ...}: { + programs.vscode.profiles.default.extensions = with pkgs.vscode-extensions; [ # "13xforever".language-x86-64-assembly arcticicestudio.nord-visual-studio-code naumovs.theme-oceanicnext diff --git a/home/modules/vscode/keybindings/default.nix b/home/modules/vscode/keybindings/default.nix index f603e50..253c82f 100644 --- a/home/modules/vscode/keybindings/default.nix +++ b/home/modules/vscode/keybindings/default.nix @@ -1,9 +1,3 @@ -{ - self, - ... -}: - -{ - home.file.".config/Code/User/keybindings.json".source = - "${self}/home/modules/vscode/keybindings/keybindings.json"; +{self, ...}: { + 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 acecf26..225bc2d 100644 --- a/home/modules/vscode/settings/default.nix +++ b/home/modules/vscode/settings/default.nix @@ -1,7 +1,5 @@ -_: - -{ - programs.vscode.userSettings = { +_: { + programs.vscode.profiles.default.userSettings = { "workbench.startupEditor" = "newUntitledFile"; "workbench.colorCustomizations" = { "[Oceanic Next (dimmed bg)]" = { @@ -9,11 +7,11 @@ _: "editor.background" = "#262626"; }; }; - "editor.rulers" = [ 80 ]; + "editor.rulers" = [80]; "[dart]" = { "editor.formatOnSave" = true; "editor.formatOnType" = true; - "editor.rulers" = [ 80 ]; + "editor.rulers" = [80]; "editor.selectionHighlight" = false; "editor.suggest.snippetsPreventQuickSuggestions" = false; "editor.suggestSelection" = "first"; diff --git a/home/modules/waybar/default.nix b/home/modules/waybar/default.nix index a77186b..e72085e 100644 --- a/home/modules/waybar/default.nix +++ b/home/modules/waybar/default.nix @@ -5,14 +5,11 @@ lib, wm, ... -}: +}: let + inherit (lib) mkEnableOption mkIf mkAfter; -with lib; - -let cfg = config.module.waybar; -in -{ +in { options = { module.waybar.enable = mkEnableOption "Enables waybar"; }; diff --git a/home/modules/wofi/default.nix b/home/modules/wofi/default.nix index 844ddfe..b0a548d 100644 --- a/home/modules/wofi/default.nix +++ b/home/modules/wofi/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.wofi; -in -{ +in { options = { module.wofi = { enable = mkEnableOption "Enable wofi app runner"; diff --git a/home/modules/yazi/default.nix b/home/modules/yazi/default.nix index 817d642..4f30710 100644 --- a/home/modules/yazi/default.nix +++ b/home/modules/yazi/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.yazi; -in -{ +in { options = { module.yazi.enable = mkEnableOption "Enables yazi"; }; diff --git a/home/modules/zathura/default.nix b/home/modules/zathura/default.nix index 269f556..5cb2341 100644 --- a/home/modules/zathura/default.nix +++ b/home/modules/zathura/default.nix @@ -2,14 +2,11 @@ config, lib, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.zathura; -in -{ +in { options = { module.zathura.enable = mkEnableOption "Enables zathura"; }; diff --git a/home/modules/zoxide/default.nix b/home/modules/zoxide/default.nix index 619e27f..d181c35 100644 --- a/home/modules/zoxide/default.nix +++ b/home/modules/zoxide/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.zoxide; -in -{ +in { options = { module.zoxide.enable = mkEnableOption "Enables zoxide"; }; diff --git a/home/modules/zsh/default.nix b/home/modules/zsh/default.nix index e54d1b1..0bd2d4d 100644 --- a/home/modules/zsh/default.nix +++ b/home/modules/zsh/default.nix @@ -5,14 +5,11 @@ username, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.zsh; -in -{ +in { options = { module.zsh.enable = mkEnableOption "Enables zsh"; }; @@ -53,22 +50,22 @@ 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 = { diff --git a/home/users/maxmur/default.nix b/home/users/maxmur/default.nix index 32db143..78de6ae 100644 --- a/home/users/maxmur/default.nix +++ b/home/users/maxmur/default.nix @@ -5,11 +5,7 @@ swayEnable ? false, wmEnable ? false, ... -}: - -{ - nixpkgs.overlays = [ ]; - +}: { stylix.targets = { vscode.enable = false; helix.enable = false; @@ -23,7 +19,6 @@ stylix.enable = isWorkstation; chromium.enable = isLinux && isWorkstation; - firefox.enable = isLinux && isWorkstation; librewolf.enable = isLinux && isWorkstation; thunderbird.enable = isLinux && isWorkstation; foot.enable = isLinux && isWorkstation; @@ -62,6 +57,7 @@ xdg.enable = isLinux && isWorkstation; packages.enable = true; + variables.enable = true; }; }; } diff --git a/home/users/maxmur/modules/default.nix b/home/users/maxmur/modules/default.nix index ef34673..1634c90 100644 --- a/home/users/maxmur/modules/default.nix +++ b/home/users/maxmur/modules/default.nix @@ -3,11 +3,8 @@ username, allDirs, ... -}: - -let +}: let userModules = "${self}/home/users/${username}/modules"; -in -{ +in { imports = allDirs userModules; } diff --git a/home/users/maxmur/modules/impermanence/default.nix b/home/users/maxmur/modules/impermanence/default.nix index 68cd522..7496a3d 100644 --- a/home/users/maxmur/modules/impermanence/default.nix +++ b/home/users/maxmur/modules/impermanence/default.nix @@ -3,14 +3,11 @@ config, username, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.user.impermanence; -in -{ +in { options = { module.user.impermanence.enable = mkEnableOption "Enables home impermanence"; }; @@ -62,10 +59,13 @@ in ".config/syncthing" ".config/obs-studio" ".config/pulse" + ".config/Thunar" + ".config/vlc" ".local/share/chat.fluffy.fluffychat" ".local/share/zoxide" ".local/share/fish" ".local/share/nix" + ".local/share/nvf" ".local/share/containers" ".local/share/Trash" ".local/share/TelegramDesktop" diff --git a/home/users/maxmur/modules/packages/default.nix b/home/users/maxmur/modules/packages/default.nix index 3d1e945..e08b22c 100644 --- a/home/users/maxmur/modules/packages/default.nix +++ b/home/users/maxmur/modules/packages/default.nix @@ -6,15 +6,12 @@ isWorkstation, wmEnable, ... -}: - -with lib; - -let +}: let + inherit (lib) mkEnableOption mkIf optionals; inherit (pkgs.stdenv) isLinux; + cfg = config.module.user.packages; -in -{ +in { options.module.user.packages = { enable = mkEnableOption "Enable user packages"; }; @@ -22,8 +19,7 @@ in config = mkIf cfg.enable { fonts.fontconfig.enable = true; - home.packages = - with pkgs; + home.packages = with pkgs; [ # Utils bat @@ -39,7 +35,7 @@ in age sops ] - ++ lib.optionals isWorkstation [ + ++ optionals isWorkstation [ # Text Editors obsidian @@ -49,7 +45,7 @@ in nerd-fonts.iosevka corefonts ] - ++ lib.optionals (isLinux && isWorkstation) [ + ++ optionals (isLinux && isWorkstation) [ inputs.ghostty.packages.x86_64-linux.default # Programming go @@ -66,6 +62,7 @@ in telegram-desktop fluffychat vesktop + google-chrome # Office onlyoffice-bin @@ -74,11 +71,12 @@ in obs-studio dconf2nix via + vial gat vlc eog ] - ++ lib.optionals wmEnable [ + ++ optionals wmEnable [ imagemagick grim slurp diff --git a/home/users/maxmur/modules/variables/default.nix b/home/users/maxmur/modules/variables/default.nix new file mode 100644 index 0000000..1f21fa6 --- /dev/null +++ b/home/users/maxmur/modules/variables/default.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkEnableOption mkIf mkForce; + + cfg = config.module.user.variables; +in { + options = { + module.user.variables.enable = mkEnableOption "Enables variables"; + }; + + config = mkIf cfg.enable { + home.sessionVariables = { + QT_QPA_PLATFORMTHEME = mkForce "gtk3"; + QT_QPA_PLATFORM = "wayland"; + SDL_VIDEODRIVER = "wayland"; + CLUTTER_BACKEND = "wayland"; + GDK_BACKEND = "wayland"; + MOZ_ENABLE_WAYLAND = "1"; + XDG_SESSION_TYPE = "wayland"; + NIXOS_OZONE_WL = "1"; + MOZ_LEGACY_PROFILES = "1"; + }; + }; +} diff --git a/home/users/maxmur/modules/xdg/default.nix b/home/users/maxmur/modules/xdg/default.nix index 98d996a..a9ea591 100644 --- a/home/users/maxmur/modules/xdg/default.nix +++ b/home/users/maxmur/modules/xdg/default.nix @@ -2,14 +2,11 @@ config, lib, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.user.xdg; -in -{ +in { options = { module.user.xdg.enable = mkEnableOption "Enables xdg"; }; @@ -32,7 +29,7 @@ in "image/jpeg" = "org.gnome.eog.desktop"; "image/jpg" = "org.gnome.eog.desktop"; - "application/pdf" = "org.pwmt.zathura.desktop"; + "application/pdf" = "org.pwmt.zathura-pdf-mupdf.desktop"; }; }; }; diff --git a/home/users/root/default.nix b/home/users/root/default.nix index d81b280..b8c569b 100644 --- a/home/users/root/default.nix +++ b/home/users/root/default.nix @@ -2,9 +2,7 @@ pkgs, inputs, ... -}: - -{ +}: { home = { # Software packages = with pkgs; [ diff --git a/home/users/test/default.nix b/home/users/test/default.nix index c61ecf9..e1e6d50 100644 --- a/home/users/test/default.nix +++ b/home/users/test/default.nix @@ -2,9 +2,7 @@ pkgs, inputs, ... -}: - -{ +}: { programs.home-manager.enable = true; home = { diff --git a/home/users/test/nbox/default.nix b/home/users/test/nbox/default.nix index d05970a..f692bff 100644 --- a/home/users/test/nbox/default.nix +++ b/home/users/test/nbox/default.nix @@ -2,9 +2,7 @@ inputs, pkgs, ... -}: - -{ +}: { home = { homeDirectory = "/home/test"; diff --git a/hosts.nix b/hosts.nix index 4ac78a8..c7c8b99 100644 --- a/hosts.nix +++ b/hosts.nix @@ -6,6 +6,7 @@ stateVersion = "25.05"; isWorkstation = true; wm = "sway"; + theme = "nord"; }; nbox = { @@ -14,6 +15,7 @@ stateVersion = "25.05"; isWorkstation = true; wm = "sway"; + theme = "nord"; }; rasp = { @@ -21,6 +23,7 @@ platform = "aarch64-linux"; stateVersion = "25.05"; isWorkstation = false; + theme = "nord"; }; hlbox = { @@ -28,6 +31,7 @@ platform = "x86_64-linux"; stateVersion = "25.05"; isWorkstation = false; + theme = "nord"; }; p8box = { @@ -36,6 +40,7 @@ stateVersion = "25.05"; isWorkstation = true; wm = "sway"; + theme = "nord"; }; }; @@ -45,6 +50,7 @@ platform = "aarch64-darwin"; stateVersion = 5; isWorkstation = true; + theme = "nord"; }; }; } diff --git a/lib/default.nix b/lib/default.nix index 0fd9875..04e38df 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -2,9 +2,7 @@ self, inputs, ... -}: - -let +}: let defaultStateVersion = "24.11"; constructors = [ @@ -12,30 +10,27 @@ let "${self}/system" ]; - allDirs = - dirName: + 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 ? defaultStateVersion, - hmStateVersion ? stateVersion, - platform ? "x86_64-linux", - hostname ? machineDir, - isWorkstation ? false, - wm ? null, - hostType ? "nixos", - }: - let - swayEnable = wm == "sway"; - hyprlandEnable = wm == "hyprland"; - wmEnable = hyprlandEnable || swayEnable; - in + mkHost = machineDir: { + username ? "user", + stateVersion ? defaultStateVersion, + hmStateVersion ? stateVersion, + platform ? "x86_64-linux", + hostname ? machineDir, + isWorkstation ? false, + wm ? null, + theme ? "nord", + hostType ? "nixos", + }: let + swayEnable = wm == "sway"; + hyprlandEnable = wm == "hyprland"; + wmEnable = hyprlandEnable || swayEnable; + in inputs.nixpkgs.lib.nixosSystem { specialArgs = { inherit @@ -50,6 +45,7 @@ let machineDir isWorkstation wm + theme hyprlandEnable swayEnable wmEnable @@ -57,8 +53,7 @@ let ; }; - modules = - with inputs; + modules = with inputs; [ home-manager.nixosModules.home-manager stylix.nixosModules.stylix @@ -67,7 +62,6 @@ let 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 @@ -76,23 +70,21 @@ let }; # Helper function for generating darwin host configs - 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 + mkHostDarwin = machineDir: { + username ? "user", + stateVersion ? 6, + hmStateVersion ? defaultStateVersion, + hostname ? machineDir, + platform ? "aarch64-darwin", + isWorkstation ? false, + wm ? null, + theme ? "nord", + hostType ? "darwin", + }: let + swayEnable = wm == "sway"; + hyprlandEnable = wm == "hyprland"; + wmEnable = hyprlandEnable || swayEnable; + in inputs.darwin.lib.darwinSystem { specialArgs = { inherit @@ -107,6 +99,7 @@ let stateVersion hmStateVersion wm + theme hyprlandEnable swayEnable wmEnable @@ -114,16 +107,14 @@ let ; }; - modules = - with inputs; + 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 diff --git a/modules/default.nix b/modules/default.nix index 8cfa1f9..bdd4711 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -2,8 +2,6 @@ self, allDirs, ... -}: - -{ +}: { imports = allDirs "${self}/modules"; } diff --git a/modules/defaults/default.nix b/modules/defaults/default.nix index f85a92c..104a55d 100644 --- a/modules/defaults/default.nix +++ b/modules/defaults/default.nix @@ -3,19 +3,18 @@ config, pkgs, ... -}: +}: let + inherit (lib) mkOption; + inherit (lib.types) enum str listOf; -with lib; - -let cfg = config.module.defaults; -in -{ +in { options.module.defaults = { # Defaults terminal = mkOption { - type = types.enum [ + type = enum [ "foot" + "foot-client" "alacritty" ]; @@ -23,7 +22,7 @@ in }; appLauncher = mkOption { - type = types.enum [ + type = enum [ "wofi" "rofi" "rofi-wayland" @@ -34,7 +33,7 @@ in }; browser = mkOption { - type = types.enum [ + type = enum [ "librewolf" "firefox" "chromium" @@ -44,89 +43,104 @@ in }; # Defaults cmds - terminalCmd = mkOption { - type = types.str; - default = "${pkgs.${cfg.terminal}}/bin/${cfg.terminal}"; - }; - - browserCmd = + terminalCmd = let + terminalExecs = { + foot = "${pkgs.foot}/bin/foot"; + foot-client = "${pkgs.foot}/bin/footclient"; + alacritty = "${pkgs.alacritty}/bin/alacritty"; + }; + in + mkOption { + type = str; + default = terminalExecs.${cfg.terminal}; + }; - let - browserExecs = { - librewolf = "${pkgs.librewolf}/bin/librewolf"; - firefox = "${pkgs.firefox}/bin/firefox"; - chromium = "${pkgs.ungoogled-chromium}/bin/chromium"; - }; - in + browserCmd = let + browserExecs = { + librewolf = "${pkgs.librewolf}/bin/librewolf"; + firefox = "${pkgs.firefox}/bin/firefox"; + chromium = "${pkgs.ungoogled-chromium}/bin/chromium"; + }; + in mkOption { - type = types.str; + type = 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 + 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; + type = str; default = appLauncherExecs.${cfg.appLauncher}; }; audioControlCmd = mkOption { - type = types.str; + type = str; default = "${pkgs.pulseaudio}/bin/pactl"; }; brightnessControlCmd = mkOption { - type = types.str; + type = 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"; - }; + clipHistCmd = let + cliphistBase = "${pkgs.cliphist}/bin/cliphist"; + createExec = launcher: "${cliphistBase} list | ${launcher} | ${cliphistBase} decode | ${pkgs.wl-clipboard}/bin/wl-copy"; + + cliphistExecs = { + rofi = createExec "${pkgs.rofi}/bin/rofi -dmenu"; + rofi-wayland = createExec "${pkgs.rofi-wayland}/bin/rofi -dmenu"; + wofi = createExec "${pkgs.wofi}/bin/wofi --show dmenu"; + fuzzel = createExec "${pkgs.fuzzel}/bin/fuzzel -d"; + }; + in + mkOption { + type = str; + default = cliphistExecs.${cfg.appLauncher}; + }; notificationsAppCmd = mkOption { - type = types.str; + type = str; default = "${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw"; }; ssh = { pubKeys = mkOption { - type = types.listOf types.str; - default = [ ]; + type = listOf str; + default = []; }; }; network = { iface = mkOption { - type = types.str; + type = str; default = ""; }; ip = mkOption { - type = types.str; + type = str; default = ""; }; gw = mkOption { - type = types.str; + type = str; default = ""; }; mask = mkOption { - type = types.str; + type = str; default = ""; }; cidr = mkOption { - type = types.str; + type = str; default = ""; }; }; diff --git a/modules/nix/default.nix b/modules/nix/default.nix index bb890cc..510dfc9 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -3,21 +3,20 @@ lib, config, pkgs, + username, ... -}: +}: let + inherit (lib) mkEnableOption mkOption mkIf; + inherit (lib.types) bool; -with lib; - -let cfg = config.module.nix-config; -in -{ +in { options = { module.nix-config = { enable = mkEnableOption "Enables nix-config"; useNixPackageManagerConfig = mkOption { - type = types.bool; + type = bool; description = "Whether to use custom Nix package manager settings."; default = true; }; @@ -49,11 +48,20 @@ in "flakes" ]; + allowed-users = ["@wheel"]; + + trusted-users = [ + "root" + username + ]; + substituters = [ "https://hyprland.cachix.org" "https://nyx.chaotic.cx" "https://ghostty.cachix.org" "https://cache.saumon.network/proxmox-nixos" + "https://nixpkgs-python.cachix.org" + "https://devenv.cachix.org" ]; trusted-public-keys = [ @@ -61,6 +69,8 @@ in "chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8=" "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" "proxmox-nixos:nveXDuVVhFDRFx8Dn19f1WDEaNRJjPrF2CPD2D+m1ys=" + "nixpkgs-python.cachix.org-1:hxjI7pFxTyuTHn2NkvWCrAUcNZLNS3ZAvfYNuYifcEU=" + "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" ]; }; }; diff --git a/modules/stylix/default.nix b/modules/stylix/default.nix index 462e25b..fd90c1b 100644 --- a/modules/stylix/default.nix +++ b/modules/stylix/default.nix @@ -4,25 +4,58 @@ self, config, hostname, + theme, ... -}: +}: let + inherit (lib) mkEnableOption mkOption mkIf; + inherit (lib) optionalAttrs; + inherit (lib.types) bool; -with lib; - -let cfg = config.module.stylix; - theme = "${pkgs.base16-schemes}/share/themes/nord.yaml"; - wallpaper = "${self}/assets/grey_gradient.png"; - cursorSize = if hostname == "nbox" then 24 else 14; -in -{ + cursorSize = + if hostname == "nbox" + then 24 + else 14; + + themes = { + nord = { + scheme = "${pkgs.base16-schemes}/share/themes/nord.yaml"; + wallpaper = "${self}/assets/grey_gradient.png"; + + font = { + package = pkgs.nerd-fonts.iosevka; + name = "Iosevka Nerd Font Mono"; + }; + + cursor = { + name = "Vimix-cursors"; + package = pkgs.vimix-cursors; + }; + }; + + gruvbox = { + scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-material-dark-medium.yaml"; + wallpaper = "${self}/assets/grey_gradient.png"; + + font = { + package = pkgs.nerd-fonts.jetbrains-mono; + name = "JetBrains Mono Nerd Font"; + }; + + cursor = { + package = pkgs.material-cursors; + name = "material_dark_cursors"; + }; + }; + }; +in { options = { module.stylix = { enable = mkEnableOption "Enables stylix"; useCursor = mkOption { - type = types.bool; + type = bool; default = true; description = "Enable cursor settings"; }; @@ -33,11 +66,10 @@ in stylix = { enable = true; - image = wallpaper; + image = themes.${theme}.wallpaper; autoEnable = true; polarity = "dark"; - - base16Scheme = theme; + base16Scheme = themes.${theme}.scheme; opacity = { applications = 1.0; @@ -55,24 +87,17 @@ in }; serif = { - package = pkgs.nerd-fonts.iosevka; - name = "Iosevka Nerd Font Mono"; + inherit (themes.${theme}.font) package name; }; sansSerif = config.stylix.fonts.serif; - - monospace = { - inherit (config.stylix.fonts.serif) package; - name = "Iosevka Nerd Font Mono"; - }; - + monospace = config.stylix.fonts.serif; emoji = config.stylix.fonts.serif; }; } // optionalAttrs cfg.useCursor { cursor = { - name = "Vimix-cursors"; - package = pkgs.vimix-cursors; + inherit (themes.${theme}.cursor) package name; size = cursorSize; }; }; diff --git a/overlays/nixpkgs/default.nix b/overlays/nixpkgs/default.nix index 7c8d402..a7917fa 100644 --- a/overlays/nixpkgs/default.nix +++ b/overlays/nixpkgs/default.nix @@ -1,34 +1,32 @@ -{ - inputs, - ... -}: - -let +{inputs, ...}: let baseSettings = { config = { allowBroken = true; }; }; - permittedInsecurePackages = [ ]; - unfreeSettings = baseSettings // { - config = baseSettings.config // { - inherit permittedInsecurePackages; - allowUnfree = true; + permittedInsecurePackages = []; + unfreeSettings = + baseSettings + // { + config = + baseSettings.config + // { + inherit permittedInsecurePackages; + allowUnfree = true; + }; }; - }; -in -{ +in { nixpkgs.overlays = [ (final: _prev: { - stable = import inputs.stable { inherit (final) system; } // baseSettings; - stable-unfree = import inputs.stable { inherit (final) system; } // unfreeSettings; + 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; + 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; + master = import inputs.master {inherit (final) system;} // baseSettings; + master-unfree = import inputs.master {inherit (final) system;} // unfreeSettings; }) ]; } diff --git a/parts/default.nix b/parts/default.nix index 82aa76f..d9348b3 100644 --- a/parts/default.nix +++ b/parts/default.nix @@ -1,9 +1,4 @@ -{ - lib, - ... -}: - -{ +{lib, ...}: { imports = builtins.filter (module: lib.pathIsDirectory module) ( map (module: builtins.toString ./. + "/${module}") ( builtins.attrNames (builtins.readDir (builtins.toString ./.)) diff --git a/parts/devshell/default.nix b/parts/devshell/default.nix index f5775d5..2c36273 100644 --- a/parts/devshell/default.nix +++ b/parts/devshell/default.nix @@ -1,32 +1,30 @@ { - 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 5d5096b..2b54163 100644 --- a/parts/topology/default.nix +++ b/parts/topology/default.nix @@ -2,9 +2,7 @@ inputs, self, ... -}: - -{ +}: { imports = [ inputs.nix-topology.flakeModule ./timeweb @@ -15,14 +13,13 @@ # For nix topology topology.modules = [ ( - { config, ... }: - let - inherit (config.lib.topology) + {config, ...}: let + inherit + (config.lib.topology) mkInternet mkConnection ; - in - { + in { inherit (self) nixosConfigurations; nodes.internet = mkInternet { diff --git a/parts/topology/home/default.nix b/parts/topology/home/default.nix index 3e30f28..dbd672e 100644 --- a/parts/topology/home/default.nix +++ b/parts/topology/home/default.nix @@ -1,23 +1,17 @@ -{ - self, - ... -}: - -{ +{self, ...}: { perSystem = _: { # For nix topology topology.modules = [ ( - { config, ... }: - let - inherit (config.lib.topology) + {config, ...}: let + inherit + (config.lib.topology) mkRouter mkSwitch mkDevice mkConnection ; - in - { + in { inherit (self) nixosConfigurations; networks = { @@ -38,13 +32,13 @@ image = ../images/Innbox_G84.png; interfaceGroups = [ - [ "eth1" ] - [ "wan1" ] + ["eth1"] + ["wan1"] ]; interfaces = { eth1 = { - addresses = [ "192.168.0.1" ]; + addresses = ["192.168.0.1"]; network = "mgts-bridge"; }; }; @@ -63,28 +57,35 @@ "eth1" "wifi" ] - [ "wan1" ] + ["wan1"] ]; interfaces = { eth1 = { - addresses = [ "192.168.1.1" ]; + addresses = ["192.168.1.1"]; network = "home-maxmur"; }; wifi = { - addresses = [ "192.168.1.1" ]; + addresses = ["192.168.1.1"]; network = "home-maxmur"; }; wan1 = { - addresses = [ "192.168.0.2" ]; + addresses = ["192.168.0.2"]; network = "mgts-bridge"; }; }; connections = { - wifi = mkConnection "nbox" "wlp3s0"; + wifi = [ + (mkConnection + "nbox" + "wlp3s0") + (mkConnection + "p8box" + "wlp3s0") + ]; }; }; @@ -107,7 +108,7 @@ eth2 = mkConnection "pcbox" "eth0"; eth3 = mkConnection "rasp" "eth0"; eth4 = mkConnection "macbox" "eth0"; - eth5 = mkConnection "mbox" "eth0"; + eth5 = mkConnection "hlbox" "vmbr0"; }; }; @@ -118,30 +119,13 @@ interfaces = { eth0 = { - addresses = [ "192.168.1.75" ]; - 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" ]; + addresses = ["192.168.1.75"]; network = "home-maxmur"; }; }; interfaceGroups = [ - [ "eth0" ] + ["eth0"] ]; }; }; diff --git a/parts/topology/timeweb/default.nix b/parts/topology/timeweb/default.nix index 3448116..2bb0565 100644 --- a/parts/topology/timeweb/default.nix +++ b/parts/topology/timeweb/default.nix @@ -1,22 +1,16 @@ -{ - self, - ... -}: - -{ +{self, ...}: { perSystem = _: { # For nix topology topology.modules = [ ( - { config, ... }: - let - inherit (config.lib.topology) + {config, ...}: let + inherit + (config.lib.topology) mkRouter mkDevice mkConnection ; - in - { + in { inherit (self) nixosConfigurations; networks = { @@ -35,13 +29,13 @@ timeweb-router = mkRouter "Timeweb router" { info = "Timeweb internal router"; interfaceGroups = [ - [ "eth1" ] - [ "wan1" ] + ["eth1"] + ["wan1"] ]; interfaces = { eth1 = { - addresses = [ "10.20.0.1" ]; + addresses = ["10.20.0.1"]; network = "timeweb-private"; }; }; @@ -61,12 +55,12 @@ interfaces = { eth0 = { - addresses = [ "10.20.0.4" ]; + addresses = ["10.20.0.4"]; network = "timeweb-private"; }; wg0 = { - addresses = [ "10.200.100.1" ]; + addresses = ["10.200.100.1"]; network = "wireguard-private"; renderer.hidePhysicalConnections = false; virtual = true; @@ -75,8 +69,8 @@ }; interfaceGroups = [ - [ "eth0" ] - [ "wg0" ] + ["eth0"] + ["wg0"] ]; services = { @@ -102,13 +96,13 @@ interfaces = { eth0 = { - addresses = [ "10.20.0.5" ]; + addresses = ["10.20.0.5"]; network = "timeweb-private"; }; }; interfaceGroups = [ - [ "eth0" ] + ["eth0"] ]; services = { diff --git a/parts/treefmt/default.nix b/parts/treefmt/default.nix index 20c207d..1a94f36 100644 --- a/parts/treefmt/default.nix +++ b/parts/treefmt/default.nix @@ -1,9 +1,4 @@ -{ - inputs, - ... -}: - -{ +{inputs, ...}: { imports = [ inputs.treefmt-nix.flakeModule ]; @@ -35,7 +30,7 @@ shellcheck.enable = true; prettier.enable = true; - nixfmt.enable = true; + alejandra.enable = true; stylua.enable = true; yamlfmt.enable = true; }; diff --git a/pkgs/ufetch/default.nix b/pkgs/ufetch/default.nix index b10586d..3f7b107 100644 --- a/pkgs/ufetch/default.nix +++ b/pkgs/ufetch/default.nix @@ -5,7 +5,6 @@ makeWrapper, bash, }: - stdenv.mkDerivation rec { pname = "ufetch"; version = "0.3"; @@ -18,8 +17,8 @@ stdenv.mkDerivation rec { }; strictDeps = true; - nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ bash ]; + nativeBuildInputs = [makeWrapper]; + buildInputs = [bash]; installPhase = '' mkdir -p $out/bin cp -r ufetch-nixos $out/bin diff --git a/system/darwin/modules/default.nix b/system/darwin/modules/default.nix index d0c1951..87a13d7 100644 --- a/system/darwin/modules/default.nix +++ b/system/darwin/modules/default.nix @@ -1,4 +1,2 @@ -_: - -{ +_: { } diff --git a/system/default.nix b/system/default.nix index a598c08..cef35ba 100644 --- a/system/default.nix +++ b/system/default.nix @@ -7,26 +7,25 @@ platform ? null, stateVersion ? null, ... -}: +}: let + inherit (lib) optional; -let machineConfigurationPath = "${self}/system/machine/${machineDir}"; machineConfigurationPathExist = builtins.pathExists machineConfigurationPath; machineModulesPath = "${self}/system/machine/${machineDir}/modules"; machineModulesPathExist = builtins.pathExists machineModulesPath; -in -{ +in { imports = [ "${self}/modules" "${self}/overlays/nixpkgs" "${self}/system/${hostType}/modules" ] - ++ lib.optional machineConfigurationPathExist machineConfigurationPath - ++ lib.optional machineModulesPathExist machineModulesPath; + ++ optional machineConfigurationPathExist machineConfigurationPath + ++ optional machineModulesPathExist machineModulesPath; module.nix-config.enable = true; - system = { inherit stateVersion; }; + system = {inherit stateVersion;}; nixpkgs = { hostPlatform = platform; @@ -34,6 +33,7 @@ in overlays = [ inputs.nix-topology.overlays.default inputs.proxmox-nixos.overlays.${platform} + inputs.nur.overlays.default ]; }; } diff --git a/system/machine/hlbox/default.nix b/system/machine/hlbox/default.nix index bfb5025..9347402 100644 --- a/system/machine/hlbox/default.nix +++ b/system/machine/hlbox/default.nix @@ -1,9 +1,4 @@ -{ - config, - ... -}: - -{ +{config, ...}: { module = { boot.enable = true; timedate.enable = true; @@ -43,6 +38,8 @@ }; services = { + irqbalance.enable = true; + proxmox-ve = { enable = true; ipAddress = config.module.defaults.network.ip; diff --git a/system/machine/hlbox/modules/default.nix b/system/machine/hlbox/modules/default.nix index ed0fd43..8bcb676 100644 --- a/system/machine/hlbox/modules/default.nix +++ b/system/machine/hlbox/modules/default.nix @@ -3,11 +3,8 @@ machineDir, allDirs, ... -}: - -let +}: let modules = "${self}/system/machine/${machineDir}/modules"; -in -{ +in { imports = allDirs modules; } diff --git a/system/machine/hlbox/modules/hardware/default.nix b/system/machine/hlbox/modules/hardware/default.nix index 7b45ccc..ebe3183 100644 --- a/system/machine/hlbox/modules/hardware/default.nix +++ b/system/machine/hlbox/modules/hardware/default.nix @@ -3,11 +3,8 @@ machineDir, allDirs, ... -}: - -let +}: let hardwareModulesPath = "${self}/system/machine/${machineDir}/modules/hardware"; -in -{ +in { imports = allDirs hardwareModulesPath; } diff --git a/system/machine/hlbox/modules/hardware/disks/default.nix b/system/machine/hlbox/modules/hardware/disks/default.nix index cacdedb..3039501 100644 --- a/system/machine/hlbox/modules/hardware/disks/default.nix +++ b/system/machine/hlbox/modules/hardware/disks/default.nix @@ -1,7 +1,5 @@ -_: - -{ - swapDevices = [ ]; +_: { + swapDevices = []; boot.zfs.extraPools = [ "zmirror" @@ -13,7 +11,7 @@ _: "/" = { device = "zpool/root"; fsType = "zfs"; - options = [ "zfsutil" ]; + options = ["zfsutil"]; }; "/boot" = { @@ -28,13 +26,13 @@ _: "/home" = { device = "zpool/home"; fsType = "zfs"; - options = [ "zfsutil" ]; + options = ["zfsutil"]; }; "/nix" = { device = "zpool/nix"; fsType = "zfs"; - options = [ "zfsutil" ]; + options = ["zfsutil"]; }; }; } diff --git a/system/machine/hlbox/modules/hardware/extra-hardware/default.nix b/system/machine/hlbox/modules/hardware/extra-hardware/default.nix index 40e58b2..02ec3c1 100644 --- a/system/machine/hlbox/modules/hardware/extra-hardware/default.nix +++ b/system/machine/hlbox/modules/hardware/extra-hardware/default.nix @@ -1,9 +1,4 @@ -{ - pkgs, - ... -}: - -{ +{pkgs, ...}: { hardware = { enableAllFirmware = true; cpu.intel.updateMicrocode = true; diff --git a/system/machine/hlbox/modules/hardware/graphics-card/default.nix b/system/machine/hlbox/modules/hardware/graphics-card/default.nix index 757f43a..d9c3019 100644 --- a/system/machine/hlbox/modules/hardware/graphics-card/default.nix +++ b/system/machine/hlbox/modules/hardware/graphics-card/default.nix @@ -1,6 +1,4 @@ -_: - -{ +_: { 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 index 9912af3..0c7d5b2 100644 --- a/system/machine/hlbox/modules/hardware/kernel/default.nix +++ b/system/machine/hlbox/modules/hardware/kernel/default.nix @@ -1,23 +1,19 @@ -{ - config, - ... -}: - -let +{config, ...}: let ipKernelParam = with config.module.defaults.network; [ "ip=${ip}::${gw}:${mask}::${iface}:none" ]; -in -{ +in { boot = { kernelModules = [ "kvm-intel" "r8169" ]; - extraModulePackages = [ ]; - kernelParams = [ - "zfs.zfs_arc_max=2147483648" - ] ++ ipKernelParam; + extraModulePackages = []; + kernelParams = + [ + "zfs.zfs_arc_max=2147483648" + ] + ++ ipKernelParam; initrd = { availableKernelModules = [ @@ -30,7 +26,7 @@ in "sd_mod" "r8169" ]; - kernelModules = [ ]; + kernelModules = []; network = { enable = true; @@ -38,7 +34,7 @@ in ssh = { enable = true; port = 2222; - hostKeys = [ /etc/secrets/initrd/ssh_host_ed25519_key ]; + 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 index 06e0bc0..44d1240 100644 --- a/system/machine/hlbox/modules/hardware/network/default.nix +++ b/system/machine/hlbox/modules/hardware/network/default.nix @@ -2,9 +2,7 @@ config, username, ... -}: - -{ +}: { users.users.${username}.openssh.authorizedKeys.keys = config.module.defaults.ssh.pubKeys; networking = { @@ -21,7 +19,7 @@ networks = { "10-lan" = { - matchConfig.Name = [ config.module.defaults.network.iface ]; + matchConfig.Name = [config.module.defaults.network.iface]; networkConfig = { Bridge = "vmbr0"; }; @@ -36,7 +34,7 @@ ]; routes = [ - { Gateway = config.module.defaults.network.gw; } + {Gateway = config.module.defaults.network.gw;} ]; }; }; diff --git a/system/machine/macbox/default.nix b/system/machine/macbox/default.nix index a2ce064..9692a0b 100644 --- a/system/machine/macbox/default.nix +++ b/system/machine/macbox/default.nix @@ -3,9 +3,7 @@ pkgs, username, ... -}: - -{ +}: { module = { stylix = { enable = true; diff --git a/system/machine/macbox/modules/default.nix b/system/machine/macbox/modules/default.nix index d0c1951..87a13d7 100644 --- a/system/machine/macbox/modules/default.nix +++ b/system/machine/macbox/modules/default.nix @@ -1,4 +1,2 @@ -_: - -{ +_: { } diff --git a/system/machine/nbox/default.nix b/system/machine/nbox/default.nix index 404e86e..8435f11 100644 --- a/system/machine/nbox/default.nix +++ b/system/machine/nbox/default.nix @@ -1,6 +1,4 @@ -_: - -{ +_: { module = { sound.enable = true; lanzaboote.enable = true; @@ -34,6 +32,7 @@ _: greetd.enable = true; ollama.enable = true; netbird.enable = true; + irqbalance.enable = true; scx = { enable = true; diff --git a/system/machine/nbox/modules/default.nix b/system/machine/nbox/modules/default.nix index ed0fd43..8bcb676 100644 --- a/system/machine/nbox/modules/default.nix +++ b/system/machine/nbox/modules/default.nix @@ -3,11 +3,8 @@ machineDir, allDirs, ... -}: - -let +}: let modules = "${self}/system/machine/${machineDir}/modules"; -in -{ +in { imports = allDirs modules; } diff --git a/system/machine/nbox/modules/hardware/default.nix b/system/machine/nbox/modules/hardware/default.nix index 7b45ccc..ebe3183 100644 --- a/system/machine/nbox/modules/hardware/default.nix +++ b/system/machine/nbox/modules/hardware/default.nix @@ -3,11 +3,8 @@ machineDir, allDirs, ... -}: - -let +}: let hardwareModulesPath = "${self}/system/machine/${machineDir}/modules/hardware"; -in -{ +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 71b7e28..4fd57e0 100644 --- a/system/machine/nbox/modules/hardware/disks/default.nix +++ b/system/machine/nbox/modules/hardware/disks/default.nix @@ -1,14 +1,12 @@ -_: - -{ +_: { # 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" ]; + wantedBy = ["initrd.target"]; + after = ["systemd-cryptsetup@crypted.service"]; + before = ["sysroot.mount"]; script = '' vgchange -ay pool @@ -98,7 +96,7 @@ _: content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; subvolumes = { "/root" = { diff --git a/system/machine/nbox/modules/hardware/extra-hardware/default.nix b/system/machine/nbox/modules/hardware/extra-hardware/default.nix index 065c07e..f7bb484 100644 --- a/system/machine/nbox/modules/hardware/extra-hardware/default.nix +++ b/system/machine/nbox/modules/hardware/extra-hardware/default.nix @@ -3,14 +3,14 @@ pkgs, config, ... -}: - -{ +}: let + inherit (lib) mkDefault; +in { # Extra drivers settings hardware = { enableAllFirmware = true; enableRedistributableFirmware = true; - cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + cpu.intel.updateMicrocode = mkDefault config.hardware.enableRedistributableFirmware; firmware = with pkgs; [ sof-firmware diff --git a/system/machine/nbox/modules/hardware/graphics-card/default.nix b/system/machine/nbox/modules/hardware/graphics-card/default.nix index f684e86..3cb2221 100644 --- a/system/machine/nbox/modules/hardware/graphics-card/default.nix +++ b/system/machine/nbox/modules/hardware/graphics-card/default.nix @@ -2,9 +2,7 @@ pkgs, self, ... -}: - -{ +}: { # Graphics card settings nixpkgs.overlays = [ (import "${self}/system/nixos/overlays/vaapiIntel") diff --git a/system/machine/nbox/modules/hardware/impermanence/default.nix b/system/machine/nbox/modules/hardware/impermanence/default.nix index 6e94223..db3cdfd 100644 --- a/system/machine/nbox/modules/hardware/impermanence/default.nix +++ b/system/machine/nbox/modules/hardware/impermanence/default.nix @@ -1,6 +1,4 @@ -_: - -{ +_: { programs.fuse.userAllowOther = true; environment.persistence = { diff --git a/system/machine/nbox/modules/hardware/kernel/default.nix b/system/machine/nbox/modules/hardware/kernel/default.nix index cb955fb..e693c32 100644 --- a/system/machine/nbox/modules/hardware/kernel/default.nix +++ b/system/machine/nbox/modules/hardware/kernel/default.nix @@ -1,14 +1,9 @@ -{ - pkgs, - ... -}: - -{ +{pkgs, ...}: { # Kernel settings boot = { kernelPackages = pkgs.linuxPackages_cachyos; - extraModulePackages = [ ]; + extraModulePackages = []; kernelModules = [ "kvm-intel" diff --git a/system/machine/nbox/modules/hardware/network/default.nix b/system/machine/nbox/modules/hardware/network/default.nix index 9e2d347..94ac218 100644 --- a/system/machine/nbox/modules/hardware/network/default.nix +++ b/system/machine/nbox/modules/hardware/network/default.nix @@ -1,12 +1,10 @@ -_: - -{ +_: { systemd.network = { enable = true; networks.wlp3s0 = { matchConfig.Name = "wlp3s0"; - address = [ "192.168.1.111/24" ]; + address = ["192.168.1.111/24"]; }; }; diff --git a/system/machine/p8box/default.nix b/system/machine/p8box/default.nix index 9833348..17ee227 100644 --- a/system/machine/p8box/default.nix +++ b/system/machine/p8box/default.nix @@ -1,6 +1,4 @@ -_: - -{ +_: { module = { sound.enable = true; boot.enable = true; @@ -29,6 +27,7 @@ _: zram.enable = true; greetd.enable = true; netbird.enable = true; + irqbalance.enable = true; scx = { enable = true; diff --git a/system/machine/p8box/modules/default.nix b/system/machine/p8box/modules/default.nix index ed0fd43..8bcb676 100644 --- a/system/machine/p8box/modules/default.nix +++ b/system/machine/p8box/modules/default.nix @@ -3,11 +3,8 @@ machineDir, allDirs, ... -}: - -let +}: let modules = "${self}/system/machine/${machineDir}/modules"; -in -{ +in { imports = allDirs modules; } diff --git a/system/machine/p8box/modules/hardware/default.nix b/system/machine/p8box/modules/hardware/default.nix index 7b45ccc..ebe3183 100644 --- a/system/machine/p8box/modules/hardware/default.nix +++ b/system/machine/p8box/modules/hardware/default.nix @@ -3,11 +3,8 @@ machineDir, allDirs, ... -}: - -let +}: let hardwareModulesPath = "${self}/system/machine/${machineDir}/modules/hardware"; -in -{ +in { imports = allDirs hardwareModulesPath; } diff --git a/system/machine/p8box/modules/hardware/disks/default.nix b/system/machine/p8box/modules/hardware/disks/default.nix index cdc9d21..cffe93e 100644 --- a/system/machine/p8box/modules/hardware/disks/default.nix +++ b/system/machine/p8box/modules/hardware/disks/default.nix @@ -1,17 +1,14 @@ -_: - -let +_: let label = "Nixos-Main"; -in -{ +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" ]; + wantedBy = ["initrd.target"]; + after = ["systemd-cryptsetup@crypted.service"]; + before = ["sysroot.mount"]; script = '' vgchange -ay pool @@ -79,7 +76,7 @@ in content = { type = "luks"; name = "crypted"; - extraFormatArgs = [ "--label=${label}" ]; + extraFormatArgs = ["--label=${label}"]; content = { type = "lvm_pv"; @@ -102,7 +99,7 @@ in content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; subvolumes = { "/root" = { diff --git a/system/machine/p8box/modules/hardware/extra-hardware/default.nix b/system/machine/p8box/modules/hardware/extra-hardware/default.nix index 6d1f4dd..a0b33bb 100644 --- a/system/machine/p8box/modules/hardware/extra-hardware/default.nix +++ b/system/machine/p8box/modules/hardware/extra-hardware/default.nix @@ -2,11 +2,11 @@ lib, config, ... -}: - -{ +}: let + inherit (lib) mkDefault; +in { hardware = { enableRedistributableFirmware = true; - cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + cpu.intel.updateMicrocode = mkDefault config.hardware.enableRedistributableFirmware; }; } diff --git a/system/machine/p8box/modules/hardware/impermanence/default.nix b/system/machine/p8box/modules/hardware/impermanence/default.nix index 6e94223..db3cdfd 100644 --- a/system/machine/p8box/modules/hardware/impermanence/default.nix +++ b/system/machine/p8box/modules/hardware/impermanence/default.nix @@ -1,6 +1,4 @@ -_: - -{ +_: { programs.fuse.userAllowOther = true; environment.persistence = { diff --git a/system/machine/p8box/modules/hardware/kernel/default.nix b/system/machine/p8box/modules/hardware/kernel/default.nix index c82b8ba..4847866 100644 --- a/system/machine/p8box/modules/hardware/kernel/default.nix +++ b/system/machine/p8box/modules/hardware/kernel/default.nix @@ -1,9 +1,4 @@ -{ - pkgs, - ... -}: - -{ +{pkgs, ...}: { boot = { kernelPackages = pkgs.linuxPackages_latest; @@ -16,7 +11,7 @@ "video=DSI-1:panel_orientation=right_side_up" ]; - extraModulePackages = [ ]; + extraModulePackages = []; initrd = { availableKernelModules = [ diff --git a/system/machine/p8box/modules/hardware/network/default.nix b/system/machine/p8box/modules/hardware/network/default.nix index 1f967ee..f07507e 100644 --- a/system/machine/p8box/modules/hardware/network/default.nix +++ b/system/machine/p8box/modules/hardware/network/default.nix @@ -1,6 +1,4 @@ -_: - -{ +_: { systemd.network = { enable = true; }; @@ -26,4 +24,10 @@ _: ]; }; }; + + topology.self = { + interfaces.wlp3s0 = { + addresses = ["192.168.1.102"]; + }; + }; } diff --git a/system/machine/pcbox/default.nix b/system/machine/pcbox/default.nix index 27417c0..6a2018f 100644 --- a/system/machine/pcbox/default.nix +++ b/system/machine/pcbox/default.nix @@ -1,9 +1,4 @@ -{ - config, - ... -}: - -{ +{config, ...}: { module = { sound.enable = true; boot.enable = true; @@ -37,6 +32,7 @@ netbird.enable = true; yggdrasil.enable = true; zram.enable = true; + irqbalance.enable = true; scx = { enable = true; diff --git a/system/machine/pcbox/modules/default.nix b/system/machine/pcbox/modules/default.nix index ed0fd43..8bcb676 100644 --- a/system/machine/pcbox/modules/default.nix +++ b/system/machine/pcbox/modules/default.nix @@ -3,11 +3,8 @@ machineDir, allDirs, ... -}: - -let +}: let modules = "${self}/system/machine/${machineDir}/modules"; -in -{ +in { imports = allDirs modules; } diff --git a/system/machine/pcbox/modules/hardware/default.nix b/system/machine/pcbox/modules/hardware/default.nix index 7b45ccc..ebe3183 100644 --- a/system/machine/pcbox/modules/hardware/default.nix +++ b/system/machine/pcbox/modules/hardware/default.nix @@ -3,11 +3,8 @@ machineDir, allDirs, ... -}: - -let +}: let hardwareModulesPath = "${self}/system/machine/${machineDir}/modules/hardware"; -in -{ +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 7a5a4fd..3b50cf3 100644 --- a/system/machine/pcbox/modules/hardware/disks/default.nix +++ b/system/machine/pcbox/modules/hardware/disks/default.nix @@ -1,14 +1,12 @@ -_: - -{ +_: { # 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" ]; + wantedBy = ["initrd.target"]; + after = ["systemd-cryptsetup@crypted.service"]; + before = ["sysroot.mount"]; script = '' vgchange -ay pool @@ -98,7 +96,7 @@ _: content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; subvolumes = { "/root" = { diff --git a/system/machine/pcbox/modules/hardware/extra-hardware/default.nix b/system/machine/pcbox/modules/hardware/extra-hardware/default.nix index 10cf5b4..6bc9f2e 100644 --- a/system/machine/pcbox/modules/hardware/extra-hardware/default.nix +++ b/system/machine/pcbox/modules/hardware/extra-hardware/default.nix @@ -1,9 +1,4 @@ -{ - pkgs, - ... -}: - -{ +{pkgs, ...}: { hardware = { enableAllFirmware = true; cpu.amd.updateMicrocode = true; diff --git a/system/machine/pcbox/modules/hardware/graphics-card/default.nix b/system/machine/pcbox/modules/hardware/graphics-card/default.nix index 5e50da1..9862835 100644 --- a/system/machine/pcbox/modules/hardware/graphics-card/default.nix +++ b/system/machine/pcbox/modules/hardware/graphics-card/default.nix @@ -1,9 +1,4 @@ -{ - pkgs, - ... -}: - -{ +{pkgs, ...}: { services.xserver.videoDrivers = [ "amdgpu" ]; diff --git a/system/machine/pcbox/modules/hardware/impermanence/default.nix b/system/machine/pcbox/modules/hardware/impermanence/default.nix index 4d6a9c9..dc7b7a6 100644 --- a/system/machine/pcbox/modules/hardware/impermanence/default.nix +++ b/system/machine/pcbox/modules/hardware/impermanence/default.nix @@ -1,6 +1,4 @@ -_: - -{ +_: { programs.fuse.userAllowOther = true; environment.persistence = { diff --git a/system/machine/pcbox/modules/hardware/kernel/default.nix b/system/machine/pcbox/modules/hardware/kernel/default.nix index 77938fd..bd7daeb 100644 --- a/system/machine/pcbox/modules/hardware/kernel/default.nix +++ b/system/machine/pcbox/modules/hardware/kernel/default.nix @@ -2,9 +2,7 @@ pkgs, config, ... -}: - -{ +}: { boot = { kernelPackages = pkgs.linuxPackages_cachyos; @@ -15,12 +13,19 @@ "zenpower" ]; + blacklistedKernelModules = [ + "sp5100-tco" + "iTCO_wdt" + ]; + extraModulePackages = [ config.boot.kernelPackages.zenpower ]; kernelParams = [ "drm_kms_helper.poll=0" + "amd_pstate=guided" + "kernel.watchdog=0" ]; initrd = { @@ -37,5 +42,15 @@ "amdgpu" ]; }; + + kernel.sysctl = { + "vm.swappiness" = 100; + "vm.dirty_background_bytes" = 67108864; + "vm.dirty_bytes" = 268435456; + "vm.dirty_expire_centisecs" = 1500; + "vm.dirty_writeback_centisecs" = 100; + "vm.vfs_cache_pressure" = 50; + "vm.max_map_count" = 1048576; + }; }; } diff --git a/system/machine/pcbox/modules/hardware/network/default.nix b/system/machine/pcbox/modules/hardware/network/default.nix index e121e28..ae5cada 100644 --- a/system/machine/pcbox/modules/hardware/network/default.nix +++ b/system/machine/pcbox/modules/hardware/network/default.nix @@ -1,12 +1,10 @@ -_: - -{ +_: { systemd.network = { enable = true; networks.eth0 = { - address = [ "192.168.1.50/24" ]; - dns = [ "192.168.1.8" ]; + address = ["192.168.1.50/24"]; + dns = ["192.168.1.8"]; }; }; @@ -15,6 +13,7 @@ _: enable = true; allowedTCPPorts = [ + 3500 8384 22000 ]; @@ -39,4 +38,10 @@ _: ]; }; }; + + topology.self = { + interfaces.eth0 = { + addresses = ["192.168.1.50"]; + }; + }; } diff --git a/system/machine/pcbox/modules/ollama/default.nix b/system/machine/pcbox/modules/ollama/default.nix index 3998851..f8143a5 100644 --- a/system/machine/pcbox/modules/ollama/default.nix +++ b/system/machine/pcbox/modules/ollama/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.ollama.gpuSupport; -in -{ +in { options = { module.services.ollama.gpuSupport.enable = mkEnableOption "Enable gpuSupport for ollama"; }; diff --git a/system/machine/rasp/default.nix b/system/machine/rasp/default.nix index e7a8715..02649d8 100644 --- a/system/machine/rasp/default.nix +++ b/system/machine/rasp/default.nix @@ -1,9 +1,4 @@ -{ - config, - ... -}: - -{ +{config, ...}: { module = { locales.enable = true; network.enable = true; @@ -38,6 +33,7 @@ services = { unbound.enable = true; + irqbalance.enable = true; adguard-home = { enable = true; diff --git a/system/machine/rasp/modules/default.nix b/system/machine/rasp/modules/default.nix index ed0fd43..8bcb676 100644 --- a/system/machine/rasp/modules/default.nix +++ b/system/machine/rasp/modules/default.nix @@ -3,11 +3,8 @@ machineDir, allDirs, ... -}: - -let +}: let modules = "${self}/system/machine/${machineDir}/modules"; -in -{ +in { imports = allDirs modules; } diff --git a/system/machine/rasp/modules/hardware/default.nix b/system/machine/rasp/modules/hardware/default.nix index 8f0609c..b7a2ea4 100644 --- a/system/machine/rasp/modules/hardware/default.nix +++ b/system/machine/rasp/modules/hardware/default.nix @@ -4,12 +4,9 @@ pkgs, allDirs, ... -}: - -let +}: let machineHardwareModulesPath = "${self}/system/machine/${machineDir}/modules/hardware"; -in -{ +in { imports = allDirs machineHardwareModulesPath; boot = { @@ -30,7 +27,7 @@ in "/" = { device = "/dev/disk/by-label/NIXOS_SD"; fsType = "ext4"; - options = [ "noatime" ]; + options = ["noatime"]; }; }; diff --git a/system/machine/rasp/modules/hardware/network/default.nix b/system/machine/rasp/modules/hardware/network/default.nix index a7bbb2b..cdb7055 100644 --- a/system/machine/rasp/modules/hardware/network/default.nix +++ b/system/machine/rasp/modules/hardware/network/default.nix @@ -2,9 +2,7 @@ config, username, ... -}: - -{ +}: { users.users.${username}.openssh.authorizedKeys.keys = config.module.defaults.ssh.pubKeys; systemd.network = { @@ -12,7 +10,7 @@ networks.eth0 = { matchConfig.Name = "eth0"; - address = [ "192.168.1.8/24" ]; + address = ["192.168.1.8/24"]; }; }; @@ -66,7 +64,7 @@ }; interfaces.wg0 = { - addresses = [ "10.200.100.3" ]; + addresses = ["10.200.100.3"]; renderer.hidePhysicalConnections = false; virtual = true; type = "wireguard"; diff --git a/system/machine/rasp/modules/nginx/default.nix b/system/machine/rasp/modules/nginx/default.nix index f88d85a..8a2c3aa 100644 --- a/system/machine/rasp/modules/nginx/default.nix +++ b/system/machine/rasp/modules/nginx/default.nix @@ -1,6 +1,4 @@ -_: - -{ +_: { services.nginx = { enable = true; diff --git a/system/machine/rasp/modules/temp-control/default.nix b/system/machine/rasp/modules/temp-control/default.nix index 885e7cf..bf6b9d5 100644 --- a/system/machine/rasp/modules/temp-control/default.nix +++ b/system/machine/rasp/modules/temp-control/default.nix @@ -1,9 +1,4 @@ -{ - pkgs, - ... -}: - -{ +{pkgs, ...}: { environment.systemPackages = (with pkgs; [ python312 diff --git a/system/nixos/modules/binfmt/default.nix b/system/nixos/modules/binfmt/default.nix index 554a4cb..01d4583 100644 --- a/system/nixos/modules/binfmt/default.nix +++ b/system/nixos/modules/binfmt/default.nix @@ -2,19 +2,16 @@ config, lib, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.binfmt; -in -{ +in { options.module.binfmt = { enable = mkEnableOption "Enable module binfmt"; }; config = mkIf cfg.enable { - boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; + boot.binfmt.emulatedSystems = ["aarch64-linux"]; }; } diff --git a/system/nixos/modules/bluetooth/default.nix b/system/nixos/modules/bluetooth/default.nix index 7b765bd..0d58668 100644 --- a/system/nixos/modules/bluetooth/default.nix +++ b/system/nixos/modules/bluetooth/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.bluetooth; -in -{ +in { options = { module.bluetooth = { enable = mkEnableOption "Enables bluetooth"; diff --git a/system/nixos/modules/boot/default.nix b/system/nixos/modules/boot/default.nix index 1554a5a..5adefa7 100644 --- a/system/nixos/modules/boot/default.nix +++ b/system/nixos/modules/boot/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.boot; -in -{ +in { options = { module.boot = { enable = mkEnableOption "Enables Bootloader"; diff --git a/system/nixos/modules/default.nix b/system/nixos/modules/default.nix index 1889cfc..2896199 100644 --- a/system/nixos/modules/default.nix +++ b/system/nixos/modules/default.nix @@ -2,11 +2,8 @@ self, allDirs, ... -}: - -let +}: let modules = "${self}/system/nixos/modules"; -in -{ +in { imports = allDirs modules; } diff --git a/system/nixos/modules/lanzaboot/default.nix b/system/nixos/modules/lanzaboot/default.nix index 28d65ee..fc357d4 100644 --- a/system/nixos/modules/lanzaboot/default.nix +++ b/system/nixos/modules/lanzaboot/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf mkForce; -with lib; - -let cfg = config.module.lanzaboote; -in -{ +in { options = { module.lanzaboote = { enable = mkEnableOption "Enables lanzaboote"; @@ -19,7 +16,7 @@ in config = mkIf cfg.enable { # Bootloader settings boot = { - loader.systemd-boot.enable = lib.mkForce false; + loader.systemd-boot.enable = mkForce false; loader.efi.canTouchEfiVariables = true; lanzaboote = { diff --git a/system/nixos/modules/locales/default.nix b/system/nixos/modules/locales/default.nix index 4c7d3a6..07f6425 100644 --- a/system/nixos/modules/locales/default.nix +++ b/system/nixos/modules/locales/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.locales; -in -{ +in { options = { module.locales.enable = mkEnableOption "Enables locales"; }; @@ -18,7 +15,7 @@ in # Locale settings i18n = { defaultLocale = "en_US.UTF-8"; - supportedLocales = [ "all" ]; + supportedLocales = ["all"]; }; }; } diff --git a/system/nixos/modules/minimal/default.nix b/system/nixos/modules/minimal/default.nix index 90777d3..1e97cdb 100644 --- a/system/nixos/modules/minimal/default.nix +++ b/system/nixos/modules/minimal/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf mkDefault; -with lib; - -let cfg = config.module.minimal; -in -{ +in { options = { module.minimal = { enable = mkEnableOption "Enables minimal"; diff --git a/system/nixos/modules/network/default.nix b/system/nixos/modules/network/default.nix index 5f09169..7812e61 100644 --- a/system/nixos/modules/network/default.nix +++ b/system/nixos/modules/network/default.nix @@ -3,14 +3,17 @@ config, hostname, ... -}: +}: let + inherit + (lib) + mkEnableOption + mkIf + mkDefault + mkForce + ; -with lib; - -let cfg = config.module.network; -in -{ +in { options = { module.network = { enable = mkEnableOption "Enables network"; diff --git a/system/nixos/modules/nix/default.nix b/system/nixos/modules/nix/default.nix index 4d14ec4..71ed7b6 100644 --- a/system/nixos/modules/nix/default.nix +++ b/system/nixos/modules/nix/default.nix @@ -1,9 +1,4 @@ -{ - config, - ... -}: - -{ +{config, ...}: { nix = { gc = { automatic = !config.programs.nh.enable; diff --git a/system/nixos/modules/nixos-ng/default.nix b/system/nixos/modules/nixos-ng/default.nix index 09df45a..bc31611 100644 --- a/system/nixos/modules/nixos-ng/default.nix +++ b/system/nixos/modules/nixos-ng/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.nixos-ng; -in -{ +in { options = { module.nixos-ng = { enable = mkEnableOption "Enables nixos-ng"; @@ -31,10 +28,10 @@ in }; /* - etc.overlay = { - enable = true; - mutable = true; - }; + etc.overlay = { + enable = true; + mutable = true; + }; */ }; }; diff --git a/system/nixos/modules/pihole/default.nix b/system/nixos/modules/pihole/default.nix index 1a09ca7..d47aecf 100644 --- a/system/nixos/modules/pihole/default.nix +++ b/system/nixos/modules/pihole/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.pihole; -in -{ +in { options = { module.pihole.enable = mkEnableOption "Enables pihole"; }; @@ -54,8 +51,8 @@ in }; systemd.services.docker-pihole = { - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; + after = ["network.target"]; + wantedBy = ["multi-user.target"]; }; }; } diff --git a/system/nixos/modules/plymouth/default.nix b/system/nixos/modules/plymouth/default.nix index 2bd496c..201a29f 100644 --- a/system/nixos/modules/plymouth/default.nix +++ b/system/nixos/modules/plymouth/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.plymouth; -in -{ +in { options = { module.plymouth = { enable = mkEnableOption "Enables plymouth"; diff --git a/system/nixos/modules/programs/dconf/default.nix b/system/nixos/modules/programs/dconf/default.nix index 28d8e18..7946e64 100644 --- a/system/nixos/modules/programs/dconf/default.nix +++ b/system/nixos/modules/programs/dconf/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.programs.dconf; -in -{ +in { options = { module.programs.dconf.enable = mkEnableOption "Enable dconf"; }; diff --git a/system/nixos/modules/programs/default.nix b/system/nixos/modules/programs/default.nix index 405fcda..25f0e9a 100644 --- a/system/nixos/modules/programs/default.nix +++ b/system/nixos/modules/programs/default.nix @@ -2,11 +2,8 @@ self, allDirs, ... -}: - -let +}: let hostProgramModulesPath = "${self}/system/nixos/modules/programs"; -in -{ +in { imports = allDirs hostProgramModulesPath; } diff --git a/system/nixos/modules/programs/fish/default.nix b/system/nixos/modules/programs/fish/default.nix index 3c0e83a..48957ae 100644 --- a/system/nixos/modules/programs/fish/default.nix +++ b/system/nixos/modules/programs/fish/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.programs.fish; -in -{ +in { options = { module.programs.fish.enable = mkEnableOption "Enable fish"; }; diff --git a/system/nixos/modules/programs/gnupg/default.nix b/system/nixos/modules/programs/gnupg/default.nix index ed28985..4d15804 100644 --- a/system/nixos/modules/programs/gnupg/default.nix +++ b/system/nixos/modules/programs/gnupg/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.programs.gnupg; -in -{ +in { options = { module.programs.gnupg.enable = mkEnableOption "Enables GnuPG"; }; diff --git a/system/nixos/modules/programs/home-manager/default.nix b/system/nixos/modules/programs/home-manager/default.nix index ec4c314..c33e971 100644 --- a/system/nixos/modules/programs/home-manager/default.nix +++ b/system/nixos/modules/programs/home-manager/default.nix @@ -3,14 +3,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.programs.hm; -in -{ +in { options = { module.programs.hm.enable = mkEnableOption "Enable Home Manager"; }; diff --git a/system/nixos/modules/programs/kdeconnect/default.nix b/system/nixos/modules/programs/kdeconnect/default.nix index 65d5187..d893b9d 100644 --- a/system/nixos/modules/programs/kdeconnect/default.nix +++ b/system/nixos/modules/programs/kdeconnect/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.programs.kdeconnect; -in -{ +in { options = { module.programs.kdeconnect.enable = mkEnableOption "Enable kdeconnect"; }; diff --git a/system/nixos/modules/programs/mtr/default.nix b/system/nixos/modules/programs/mtr/default.nix index b565f7d..4d99e4f 100644 --- a/system/nixos/modules/programs/mtr/default.nix +++ b/system/nixos/modules/programs/mtr/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.programs.mtr; -in -{ +in { options = { module.programs.mtr.enable = mkEnableOption "Enable mtr"; }; diff --git a/system/nixos/modules/programs/nix-helper/default.nix b/system/nixos/modules/programs/nix-helper/default.nix index b03aef6..8f18bda 100644 --- a/system/nixos/modules/programs/nix-helper/default.nix +++ b/system/nixos/modules/programs/nix-helper/default.nix @@ -3,14 +3,11 @@ config, username, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.programs.nh; -in -{ +in { options = { module.programs.nh.enable = mkEnableOption "Enable Nix Helper"; }; diff --git a/system/nixos/modules/programs/systemPackages/default.nix b/system/nixos/modules/programs/systemPackages/default.nix index 84329bc..c040b49 100644 --- a/system/nixos/modules/programs/systemPackages/default.nix +++ b/system/nixos/modules/programs/systemPackages/default.nix @@ -4,14 +4,12 @@ config, isWorkstation, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; + inherit (lib) optionals; -with lib; - -let cfg = config.module.programs.systemPackages; -in -{ +in { options = { module.programs.systemPackages.enable = mkEnableOption "Enable System Software"; }; @@ -24,8 +22,7 @@ in corefonts ]; - environment.systemPackages = - with pkgs; + environment.systemPackages = with pkgs; [ # Utils git diff --git a/system/nixos/modules/programs/xdg-portal/default.nix b/system/nixos/modules/programs/xdg-portal/default.nix index 2a626af..e1a97d2 100644 --- a/system/nixos/modules/programs/xdg-portal/default.nix +++ b/system/nixos/modules/programs/xdg-portal/default.nix @@ -4,14 +4,11 @@ config, wm, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.programs.xdg-portal; -in -{ +in { options = { module.programs.xdg-portal.enable = mkEnableOption "Enable xdg-portal"; }; diff --git a/system/nixos/modules/programs/zsh/default.nix b/system/nixos/modules/programs/zsh/default.nix index b94f316..e9ed897 100644 --- a/system/nixos/modules/programs/zsh/default.nix +++ b/system/nixos/modules/programs/zsh/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.programs.zsh; -in -{ +in { options = { module.programs.zsh.enable = mkEnableOption "Enable zsh"; }; diff --git a/system/nixos/modules/security/default.nix b/system/nixos/modules/security/default.nix index 8a22704..77def82 100644 --- a/system/nixos/modules/security/default.nix +++ b/system/nixos/modules/security/default.nix @@ -2,14 +2,12 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; + inherit (lib) optionals optionalAttrs; -with lib; - -let cfg = config.module.security; -in -{ +in { options = { module.security = { enable = mkEnableOption "Enables security"; @@ -23,9 +21,9 @@ in sudo.enable = false; pam.services = { - gtklock = { }; - swaylock = { }; - hyprlock = { }; + gtklock = {}; + swaylock = {}; + hyprlock = {}; }; sudo-rs = { @@ -43,6 +41,7 @@ in "page_alloc.shuffle=1" "page_poison=1" "slab_nomerge" + "oops=panic" ] ++ optionals cfg.disableIPV6 [ # Disable ipv6 @@ -50,6 +49,9 @@ in ]; blacklistedKernelModules = [ + "appletalk" + "decnet" + # Obscure network protocols "ax25" "netrom" diff --git a/system/nixos/modules/services/adguard-home/default.nix b/system/nixos/modules/services/adguard-home/default.nix index 9973c52..1dec23a 100644 --- a/system/nixos/modules/services/adguard-home/default.nix +++ b/system/nixos/modules/services/adguard-home/default.nix @@ -2,31 +2,29 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf mkOption; + inherit (lib.types) str listOf attrs; -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; + type = str; default = "0.0.0.0"; }; bindHosts = mkOption { - type = types.listOf types.str; - default = [ "0.0.0.0" ]; + type = listOf str; + default = ["0.0.0.0"]; }; dnsRewrites = mkOption { - type = types.listOf types.attrs; - default = [ ]; + type = listOf attrs; + default = []; }; }; }; diff --git a/system/nixos/modules/services/bolt/default.nix b/system/nixos/modules/services/bolt/default.nix index 24fc692..2769e75 100644 --- a/system/nixos/modules/services/bolt/default.nix +++ b/system/nixos/modules/services/bolt/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.bolt; -in -{ +in { options = { module.services.bolt.enable = mkEnableOption "Enable bolt"; }; diff --git a/system/nixos/modules/services/cpu-autofreq/default.nix b/system/nixos/modules/services/cpu-autofreq/default.nix index 9714a13..f14d55c 100644 --- a/system/nixos/modules/services/cpu-autofreq/default.nix +++ b/system/nixos/modules/services/cpu-autofreq/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.cpu-autofreq; -in -{ +in { options = { module.services.cpu-autofreq.enable = mkEnableOption "Enable cpu-autofreq"; }; diff --git a/system/nixos/modules/services/default.nix b/system/nixos/modules/services/default.nix index 66cc166..a04b0f3 100644 --- a/system/nixos/modules/services/default.nix +++ b/system/nixos/modules/services/default.nix @@ -2,11 +2,8 @@ self, allDirs, ... -}: - -let +}: let hostServicesModulesPath = "${self}/system/nixos/modules/services"; -in -{ +in { imports = allDirs hostServicesModulesPath; } diff --git a/system/nixos/modules/services/fwupd/default.nix b/system/nixos/modules/services/fwupd/default.nix index 28934df..440ebf5 100644 --- a/system/nixos/modules/services/fwupd/default.nix +++ b/system/nixos/modules/services/fwupd/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.fwupd; -in -{ +in { options = { module.services.fwupd.enable = mkEnableOption "Enable fwupd"; }; diff --git a/system/nixos/modules/services/greetd/default.nix b/system/nixos/modules/services/greetd/default.nix index 9d39341..079a838 100644 --- a/system/nixos/modules/services/greetd/default.nix +++ b/system/nixos/modules/services/greetd/default.nix @@ -6,11 +6,9 @@ inputs, wm, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.greetd; wms = { @@ -19,8 +17,7 @@ let }; wmCmd = wms.${wm}; -in -{ +in { options = { module.services.greetd = { enable = mkEnableOption "Enable greetd"; diff --git a/system/nixos/modules/services/homepage-dashboard/default.nix b/system/nixos/modules/services/homepage-dashboard/default.nix index 4672d05..9cf640d 100644 --- a/system/nixos/modules/services/homepage-dashboard/default.nix +++ b/system/nixos/modules/services/homepage-dashboard/default.nix @@ -3,14 +3,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.homepage-dashboard; -in -{ +in { options = { module.services.homepage-dashboard = { enable = mkEnableOption "Enables homepage-dashboard"; @@ -24,40 +21,40 @@ in }; /* - 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"; - }; + 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}"; + "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/nixos/modules/services/hyprland/default.nix b/system/nixos/modules/services/hyprland/default.nix index a87b895..914de33 100644 --- a/system/nixos/modules/services/hyprland/default.nix +++ b/system/nixos/modules/services/hyprland/default.nix @@ -4,14 +4,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.hyprland; -in -{ +in { options = { module.services.hyprland.enable = mkEnableOption "Enables hyprland"; }; diff --git a/system/nixos/modules/services/irqbalance/default.nix b/system/nixos/modules/services/irqbalance/default.nix new file mode 100644 index 0000000..0c03158 --- /dev/null +++ b/system/nixos/modules/services/irqbalance/default.nix @@ -0,0 +1,19 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.module.services.irqbalance; +in { + options = { + module.services.irqbalance.enable = mkEnableOption "Enables irqbalance"; + }; + + config = mkIf cfg.enable { + services.irqbalance = { + enable = true; + }; + }; +} diff --git a/system/nixos/modules/services/netbird/default.nix b/system/nixos/modules/services/netbird/default.nix index 7f52dc6..c6d0a62 100644 --- a/system/nixos/modules/services/netbird/default.nix +++ b/system/nixos/modules/services/netbird/default.nix @@ -3,14 +3,11 @@ config, pkgs, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.netbird; -in -{ +in { options = { module.services.netbird = { enable = mkEnableOption "Enables netbird"; @@ -19,6 +16,6 @@ in config = mkIf cfg.enable { services.netbird.enable = true; - environment.systemPackages = [ pkgs.netbird-ui ]; + environment.systemPackages = [pkgs.netbird-ui]; }; } diff --git a/system/nixos/modules/services/ollama/default.nix b/system/nixos/modules/services/ollama/default.nix index 1a140a7..646b416 100644 --- a/system/nixos/modules/services/ollama/default.nix +++ b/system/nixos/modules/services/ollama/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.ollama; -in -{ +in { options = { module.services.ollama.enable = mkEnableOption "Enables ollama"; }; diff --git a/system/nixos/modules/services/polkit/default.nix b/system/nixos/modules/services/polkit/default.nix index acbb2a3..378e887 100644 --- a/system/nixos/modules/services/polkit/default.nix +++ b/system/nixos/modules/services/polkit/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.polkit; -in -{ +in { options = { module.services.polkit.enable = mkEnableOption "Enable polkit"; }; diff --git a/system/nixos/modules/services/printing/default.nix b/system/nixos/modules/services/printing/default.nix index 992edbd..81c60c5 100644 --- a/system/nixos/modules/services/printing/default.nix +++ b/system/nixos/modules/services/printing/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.printing; -in -{ +in { options = { module.services.printing.enable = mkEnableOption "Enable printing"; }; diff --git a/system/nixos/modules/services/proxmox-ve/default.nix b/system/nixos/modules/services/proxmox-ve/default.nix index 982f6bc..2dc93fd 100644 --- a/system/nixos/modules/services/proxmox-ve/default.nix +++ b/system/nixos/modules/services/proxmox-ve/default.nix @@ -2,19 +2,17 @@ config, lib, ... -}: +}: let + inherit (lib) mkEnableOption mkIf mkOption; + inherit (lib.types) str; -with lib; - -let cfg = config.module.services.proxmox-ve; -in -{ +in { options.module.services.proxmox-ve = { enable = mkEnableOption "Enable module proxmox-ve"; ipAddress = mkOption { - type = types.str; + type = str; default = ""; description = "IP address for proxmox"; }; diff --git a/system/nixos/modules/services/qmk/default.nix b/system/nixos/modules/services/qmk/default.nix index cdb24ba..0a58181 100644 --- a/system/nixos/modules/services/qmk/default.nix +++ b/system/nixos/modules/services/qmk/default.nix @@ -3,14 +3,11 @@ pkgs, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.qmk; -in -{ +in { options = { module.services.qmk.enable = mkEnableOption "Enables qmk"; }; diff --git a/system/nixos/modules/services/scx/default.nix b/system/nixos/modules/services/scx/default.nix index 74ae100..4799ea3 100644 --- a/system/nixos/modules/services/scx/default.nix +++ b/system/nixos/modules/services/scx/default.nix @@ -2,20 +2,18 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf mkOption; + inherit (lib.types) str; -with lib; - -let cfg = config.module.services.scx; -in -{ +in { options = { module.services.scx = { enable = mkEnableOption "Enables scx module"; schedulerType = mkOption { - type = types.str; + type = str; default = "scx_rustland"; }; }; diff --git a/system/nixos/modules/services/ssh/default.nix b/system/nixos/modules/services/ssh/default.nix index 09bdef3..20826aa 100644 --- a/system/nixos/modules/services/ssh/default.nix +++ b/system/nixos/modules/services/ssh/default.nix @@ -2,19 +2,18 @@ config, lib, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; + inherit (lib) zipAttrs; + inherit (lib.types) attrs listOf; -with lib; - -let cfg = config.module.services.ssh; -in -{ +in { options.module.services.ssh = { enable = mkEnableOption "Enable module"; listenAddresses = lib.mkOption { - type = lib.types.listOf lib.types.attrs; + type = listOf attrs; default = [ { addr = "0.0.0.0"; @@ -28,9 +27,11 @@ in }; config = mkIf cfg.enable { - networking.firewall.allowedTCPPorts = [ - 22 - ] ++ (lib.zipAttrs cfg.listenAddresses).port; + networking.firewall.allowedTCPPorts = + [ + 22 + ] + ++ (zipAttrs cfg.listenAddresses).port; services.endlessh-go = { enable = true; diff --git a/system/nixos/modules/services/syncthing/default.nix b/system/nixos/modules/services/syncthing/default.nix index efc81f0..16d0565 100644 --- a/system/nixos/modules/services/syncthing/default.nix +++ b/system/nixos/modules/services/syncthing/default.nix @@ -3,14 +3,11 @@ config, username, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.syncthing; -in -{ +in { options = { module.services.syncthing.enable = mkEnableOption "Enable syncthing"; }; diff --git a/system/nixos/modules/services/tlp/default.nix b/system/nixos/modules/services/tlp/default.nix index 585c6c8..718c89a 100644 --- a/system/nixos/modules/services/tlp/default.nix +++ b/system/nixos/modules/services/tlp/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.tlp; -in -{ +in { options = { module.services.tlp.enable = mkEnableOption "Enable tlp"; }; diff --git a/system/nixos/modules/services/udev/default.nix b/system/nixos/modules/services/udev/default.nix index 5c3d8b5..1a4b60a 100644 --- a/system/nixos/modules/services/udev/default.nix +++ b/system/nixos/modules/services/udev/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.udev; -in -{ +in { options = { module.services.udev.enable = mkEnableOption "Enable udev"; }; diff --git a/system/nixos/modules/services/unbound/default.nix b/system/nixos/modules/services/unbound/default.nix index 0c3153b..5c8f79f 100644 --- a/system/nixos/modules/services/unbound/default.nix +++ b/system/nixos/modules/services/unbound/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.unbound; -in -{ +in { options = { module.services.unbound = { enable = mkEnableOption "Enables unbound"; diff --git a/system/nixos/modules/services/xserver/default.nix b/system/nixos/modules/services/xserver/default.nix index c826c51..4b921b7 100644 --- a/system/nixos/modules/services/xserver/default.nix +++ b/system/nixos/modules/services/xserver/default.nix @@ -3,14 +3,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.xserver; -in -{ +in { options = { module.services.xserver.enable = mkEnableOption "Enable xserver"; }; diff --git a/system/nixos/modules/services/yggdrasil/default.nix b/system/nixos/modules/services/yggdrasil/default.nix index c5437b7..072215d 100644 --- a/system/nixos/modules/services/yggdrasil/default.nix +++ b/system/nixos/modules/services/yggdrasil/default.nix @@ -2,14 +2,11 @@ config, lib, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.yggdrasil; -in -{ +in { options.module.services.yggdrasil = { enable = mkEnableOption "Enable module yggdrasil"; }; diff --git a/system/nixos/modules/services/zram/default.nix b/system/nixos/modules/services/zram/default.nix index 3439709..013093d 100644 --- a/system/nixos/modules/services/zram/default.nix +++ b/system/nixos/modules/services/zram/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.services.zram; -in -{ +in { options = { module.services.zram.enable = mkEnableOption "Enable zram"; }; diff --git a/system/nixos/modules/sound/default.nix b/system/nixos/modules/sound/default.nix index 52e46c0..86acbbd 100644 --- a/system/nixos/modules/sound/default.nix +++ b/system/nixos/modules/sound/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.sound; -in -{ +in { options = { module.sound.enable = mkEnableOption "Enables sound in your system"; }; @@ -23,6 +20,44 @@ in alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; + + extraConfig = { + pipewire = { + "92-low-latency" = { + "context.properties" = { + "default.clock.rate" = 48000; + "default.clock.allowed-rates" = [ + 44100 + 48000 + 88200 + 96000 + ]; + + "default.clock.min-quantum" = 512; + "default.clock.quantum" = 4096; + "default.clock.max-quantum" = 8192; + }; + }; + + "93-no-resampling" = { + "context.properties" = { + "default.clock.rate" = 48000; + "default.clock.allowed-rates" = [ + 44100 + 48000 + 96000 + 192000 + ]; + }; + }; + + "94-no-upmixing" = { + "stream.properties" = { + "channelmix.upmix" = false; + }; + }; + }; + }; }; }; } diff --git a/system/nixos/modules/timedate/default.nix b/system/nixos/modules/timedate/default.nix index 5e67ed0..53cc4d4 100644 --- a/system/nixos/modules/timedate/default.nix +++ b/system/nixos/modules/timedate/default.nix @@ -2,14 +2,11 @@ lib, config, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.timedate; -in -{ +in { options = { module.timedate.enable = mkEnableOption "Enables timedate"; }; diff --git a/system/nixos/modules/users/default.nix b/system/nixos/modules/users/default.nix index f36136f..5209965 100644 --- a/system/nixos/modules/users/default.nix +++ b/system/nixos/modules/users/default.nix @@ -5,14 +5,11 @@ config, username, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.users; -in -{ +in { options = { module.users.enable = mkEnableOption "Enables users"; }; diff --git a/system/nixos/modules/variables/default.nix b/system/nixos/modules/variables/default.nix index 41ccc24..597ec2b 100644 --- a/system/nixos/modules/variables/default.nix +++ b/system/nixos/modules/variables/default.nix @@ -3,36 +3,23 @@ config, username, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.variables; -in -{ +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/virtualization/default.nix b/system/nixos/modules/virtualization/default.nix index 62622a6..22b4a04 100644 --- a/system/nixos/modules/virtualization/default.nix +++ b/system/nixos/modules/virtualization/default.nix @@ -4,14 +4,11 @@ username, pkgs, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.virtualisation; -in -{ +in { options = { module.virtualisation = { enable = mkEnableOption "Enables virtualisation"; @@ -24,7 +21,7 @@ in virt-manager ]; - users.extraGroups.vboxusers.members = [ username ]; + users.extraGroups.vboxusers.members = [username]; virtualisation = { docker.enable = true; diff --git a/system/nixos/modules/zapret/default.nix b/system/nixos/modules/zapret/default.nix index dd753c1..dda04aa 100644 --- a/system/nixos/modules/zapret/default.nix +++ b/system/nixos/modules/zapret/default.nix @@ -3,26 +3,24 @@ config, pkgs, ... -}: +}: let + inherit (lib) mkEnableOption mkIf mkOption; + inherit (lib.types) str int; -with lib; - -let cfg = config.module.zapret; -in -{ +in { options = { module.zapret = { enable = mkEnableOption "Enables zapret"; wan = mkOption { - type = types.str; + type = str; default = "eth0"; description = ""; }; qnum = mkOption { - type = types.int; + type = int; default = 200; description = ""; }; @@ -47,8 +45,8 @@ in services = { zapret = { description = "gigi za shagi"; - wantedBy = [ "multi-user.target" ]; - requires = [ "network.target" ]; + wantedBy = ["multi-user.target"]; + requires = ["network.target"]; serviceConfig = { ExecStart = "${pkgs.zapret}/bin/nfqws --pidfile=/run/nfqws.pid --dpi-desync=fake --dpi-desync=disorder --dpi-desync=split2 --dpi-desync-ttl=1 --dpi-desync-repeats=6 --dpi-desync-autottl=3 --wssize 1:6 --dpi-desync-fake-tls=0x00000000 --dpi-desync-split-pos=1 --qnum=${toString cfg.qnum}"; diff --git a/templates/default.nix b/templates/default.nix index 7283630..a07a299 100644 --- a/templates/default.nix +++ b/templates/default.nix @@ -1,9 +1,4 @@ -{ - self, - ... -}: - -{ +{self, ...}: { devshell = { description = "Flake devshell template"; path = "${self}/templates/devshell"; diff --git a/templates/devshell/flake.nix b/templates/devshell/flake.nix index 30bd741..51e205d 100644 --- a/templates/devshell/flake.nix +++ b/templates/devshell/flake.nix @@ -6,11 +6,13 @@ flake-utils.url = "github:numtide/flake-utils"; }; - outputs = - { nixpkgs, flake-utils, ... }: + outputs = { + nixpkgs, + flake-utils, + ... + }: flake-utils.lib.eachDefaultSystem ( - system: - let + system: let pkgs = import nixpkgs { inherit system; @@ -18,12 +20,10 @@ allowUnfree = true; }; }; - in - { - devShell = - with pkgs; + in { + devShell = with pkgs; mkShell { - buildInputs = [ ]; + buildInputs = []; }; } ); diff --git a/templates/module/default.nix b/templates/module/default.nix index e5ab574..5bd4994 100644 --- a/templates/module/default.nix +++ b/templates/module/default.nix @@ -2,18 +2,16 @@ config, lib, ... -}: +}: let + inherit (lib) mkEnableOption mkIf; -with lib; - -let cfg = config.module.""; -in -{ +in { options.module."" = { enable = mkEnableOption "Enable module"; }; - config = mkIf cfg.enable { - }; + config = + mkIf cfg.enable { + }; } diff --git a/templates/overlay/default.nix b/templates/overlay/default.nix index ecfb435..1f5fe8e 100644 --- a/templates/overlay/default.nix +++ b/templates/overlay/default.nix @@ -1,3 +1,3 @@ _: prev: { - package = prev.package.override { }; + package = prev.package.override {}; }