commit b5dfc7998d4103ea7798f41476790becf2271709 Author: cartierf89 Date: Tue Aug 19 11:52:43 2025 -0400 nix os diff --git a/README.md b/README.md new file mode 100755 index 0000000..83c2ea6 --- /dev/null +++ b/README.md @@ -0,0 +1,70 @@ +# My NixOS Configuration + +![screenshot](screenshot.png) + +My modular NixOS configuration with Home Manager integration. + +## Structure + +``` +| nix / +|-flake.nix (Where everything starts) +|-assets/ (profile pic, sddm background, etc) +|-hosts/ (Configs for my machines: desktop, laptop) +|-modules/ (Pieces I want to be able to switch in and out) +|--system/ (System level configs like bootloader, GPU drivers) +|--home/ (Most of the juice is here. Managed by home manager. Program configs and such) +``` + +## Base setup + +**OS:** NixOS + +**Display Manager:** SDDM with the [Chili Theme](https://github.com/MarianArlt/sddm-chili) and a custom wallpaper to match my theme. + +**Window Manager:** HyprLand + +### Desktop Environment + +Since HyprLand is just a window manager, I had to choose everything else you expect a computer to have. I went with a lot of the KDE +tools since they played a lot nicer with stylix for theming as well as just respecting the XDG environment variables. + +- **File Manager**: Thunar +- **Image Viewer**: GwenView +- **Generic Text Editor**: Kate +- **Video Player**: MPV +- **PDF Viewer**: Okular +- **Audio Player**: Elisa +- **Archive/Zip Manager**: Ark +- **App Launcher:** Wofi + +### Ecosystem + +- **HyprPanel:** The nice top bar you see in the screenshot +- **Hyprpaper:** Just sets my wallpapers + +## System Packages + +- **Cachix:** Binary caches for faster builds +- **Stylix:** One of the best things to ever happen to nix. Theme everything consistenly with one config + +## Terminal Tools + +- Zsh: Funally made the switch after more than a decade of using bash +- bat: Better cat +- yazi +- starship: Cool and customizable terminal prompt +- ripgrep + +## Dev tools + +- VsCode +- Datagrip + +## Theming + +- Consistent **Gruvbox** color scheme across all applications thanks to stylix + +## Extra Features + +- [Solaar](https://pwr-solaar.github.io/Solaar/) to manage my logitech mouse. \ No newline at end of file diff --git a/assets/sddm-background.png b/assets/sddm-background.png new file mode 100755 index 0000000..62aa705 Binary files /dev/null and b/assets/sddm-background.png differ diff --git a/assets/user-icon.png b/assets/user-icon.png new file mode 100644 index 0000000..8da0c8c Binary files /dev/null and b/assets/user-icon.png differ diff --git a/assets/wallpaper.png b/assets/wallpaper.png new file mode 100755 index 0000000..62aa705 Binary files /dev/null and b/assets/wallpaper.png differ diff --git a/flake.lock b/flake.lock new file mode 100755 index 0000000..62eb249 --- /dev/null +++ b/flake.lock @@ -0,0 +1,608 @@ +{ + "nodes": { + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1746562888, + "narHash": "sha256-YgNJQyB5dQiwavdDFBMNKk1wyS77AtdgDk/VtU6wEaI=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "806a1777a5db2a1ef9d5d6f493ef2381047f2b89", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-fish": { + "flake": false, + "locked": { + "lastModified": 1622559957, + "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "type": "github" + } + }, + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1752979451, + "narHash": "sha256-0CQM+FkYy0fOO/sMGhOoNL80ftsAzYCg9VhIrodqusM=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "27cf1e66e50abc622fb76a3019012dc07c678fac", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1732806396, + "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + } + }, + "firefox-gnome-theme": { + "flake": false, + "locked": { + "lastModified": 1748383148, + "narHash": "sha256-pGvD/RGuuPf/4oogsfeRaeMm6ipUIznI2QSILKjKzeA=", + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "rev": "4eb2714fbed2b80e234312611a947d6cb7d70caf", + "type": "github" + }, + "original": { + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1754487366, + "narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "neovim-nightly-overlay", + "hercules-ci-effects", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751413152, + "narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "77826244401ea9de6e3bac47c2db46005e1f30b5", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751413152, + "narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "77826244401ea9de6e3bac47c2db46005e1f30b5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat_2", + "gitignore": "gitignore", + "nixpkgs": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1754416808, + "narHash": "sha256-c6yg0EQ9xVESx6HGDOCMcyRSjaTpNJP10ef+6fRcofA=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "9c52372878df6911f9afc1e2a1391f55e4dfc864", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "neovim-nightly-overlay", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1748186689, + "narHash": "sha256-UaD7Y9f8iuLBMGHXeJlRu6U1Ggw5B9JnkFs3enZlap0=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "8c88f917db0f1f0d80fa55206c863d3746fa18d0", + "type": "github" + }, + "original": { + "owner": "GNOME", + "ref": "48.2", + "repo": "gnome-shell", + "type": "github" + } + }, + "hercules-ci-effects": { + "inputs": { + "flake-parts": "flake-parts_2", + "nixpkgs": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1752595130, + "narHash": "sha256-CNBgr4OZSuklGtNOa9CnTNo9+Xceqn/EDAC1Tc43fH8=", + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "rev": "5f2e09654b2e70ba643e41609d9f9b6640f22113", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1754613544, + "narHash": "sha256-ueR1mGX4I4DWfDRRxxMphbKDNisDeMPMusN72VV1+cc=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "cc2fa2331aebf9661d22bb507d362b39852ac73f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "hyprshell": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1754802608, + "narHash": "sha256-GRWUaXM5pCLAJgo68UHNRwPyR6BzujAr+OjfzORvBLA=", + "ref": "refs/heads/main", + "rev": "cf212539708422ef62469cb5e1abefd5303e28b3", + "revCount": 11, + "type": "git", + "url": "https://gitgud.foo/thegrind/hypr-shell.git" + }, + "original": { + "type": "git", + "url": "https://gitgud.foo/thegrind/hypr-shell.git" + } + }, + "my-assets": { + "flake": false, + "locked": { + "path": "./assets", + "type": "path" + }, + "original": { + "path": "./assets", + "type": "path" + }, + "parent": [] + }, + "neovim-nightly-overlay": { + "inputs": { + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "git-hooks": "git-hooks", + "hercules-ci-effects": "hercules-ci-effects", + "neovim-src": "neovim-src", + "nixpkgs": "nixpkgs_2", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1755033072, + "narHash": "sha256-KQ5qgugljc44XtEVmGzRdBwTDIqARCM3b/9dRsEBZIk=", + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "rev": "3cf910c2727eed304b8aabcfddc109e0c0371bfb", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "type": "github" + } + }, + "neovim-src": { + "flake": false, + "locked": { + "lastModified": 1754951943, + "narHash": "sha256-jDrRkJQ+iDDAZn+8bi6lxumSNUwgdyFgJVTzVwz1lIM=", + "owner": "neovim", + "repo": "neovim", + "rev": "a26cdcb20e68f38f636b14a03c3f9657f5c74f67", + "type": "github" + }, + "original": { + "owner": "neovim", + "repo": "neovim", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1754725699, + "narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "85dbfc7aaf52ecb755f87e577ddbe6dbbdbc1054", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1754800730, + "narHash": "sha256-HfVZCXic9XLBgybP0318ym3cDnGwBs/+H5MgxFVYF4I=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "641d909c4a7538f1539da9240dedb1755c907e40", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1754498491, + "narHash": "sha256-erbiH2agUTD0Z30xcVSFcDHzkRvkRXOQ3lb887bcVrs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c2ae88e026f9525daf89587f3cbee584b92b6134", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nur": { + "inputs": { + "flake-parts": [ + "stylix", + "flake-parts" + ], + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751906969, + "narHash": "sha256-BSQAOdPnzdpOuCdAGSJmefSDlqmStFNScEnrWzSqKPw=", + "owner": "nix-community", + "repo": "NUR", + "rev": "ddb679f4131e819efe3bbc6457ba19d7ad116f25", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "hyprshell": "hyprshell", + "my-assets": "my-assets", + "neovim-nightly-overlay": "neovim-nightly-overlay", + "nixpkgs": "nixpkgs_3", + "stylix": "stylix" + } + }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-fish": "base16-fish", + "base16-helix": "base16-helix", + "base16-vim": "base16-vim", + "firefox-gnome-theme": "firefox-gnome-theme", + "flake-parts": "flake-parts_3", + "gnome-shell": "gnome-shell", + "nixpkgs": [ + "nixpkgs" + ], + "nur": "nur", + "systems": "systems", + "tinted-foot": "tinted-foot", + "tinted-kitty": "tinted-kitty", + "tinted-schemes": "tinted-schemes", + "tinted-tmux": "tinted-tmux", + "tinted-zed": "tinted-zed" + }, + "locked": { + "lastModified": 1754597531, + "narHash": "sha256-OpC9/PBIuL2WEJUkcuD/wVxI8r+3o6f5RylSIefjHo4=", + "owner": "danth", + "repo": "stylix", + "rev": "63bb34a66ad7d1af2e95ee20dd675896b2074c32", + "type": "github" + }, + "original": { + "owner": "danth", + "repo": "stylix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tinted-foot": { + "flake": false, + "locked": { + "lastModified": 1726913040, + "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + } + }, + "tinted-kitty": { + "flake": false, + "locked": { + "lastModified": 1735730497, + "narHash": "sha256-4KtB+FiUzIeK/4aHCKce3V9HwRvYaxX+F1edUrfgzb8=", + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "de6f888497f2c6b2279361bfc790f164bfd0f3fa", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-kitty", + "type": "github" + } + }, + "tinted-schemes": { + "flake": false, + "locked": { + "lastModified": 1750770351, + "narHash": "sha256-LI+BnRoFNRa2ffbe3dcuIRYAUcGklBx0+EcFxlHj0SY=", + "owner": "tinted-theming", + "repo": "schemes", + "rev": "5a775c6ffd6e6125947b393872cde95867d85a2a", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "schemes", + "type": "github" + } + }, + "tinted-tmux": { + "flake": false, + "locked": { + "lastModified": 1751159871, + "narHash": "sha256-UOHBN1fgHIEzvPmdNMHaDvdRMgLmEJh2hNmDrp3d3LE=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "bded5e24407cec9d01bd47a317d15b9223a1546c", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" + } + }, + "tinted-zed": { + "flake": false, + "locked": { + "lastModified": 1751158968, + "narHash": "sha256-ksOyv7D3SRRtebpXxgpG4TK8gZSKFc4TIZpR+C98jX8=", + "owner": "tinted-theming", + "repo": "base16-zed", + "rev": "86a470d94204f7652b906ab0d378e4231a5b3384", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-zed", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1754847726, + "narHash": "sha256-2vX8QjO5lRsDbNYvN9hVHXLU6oMl+V/PsmIiJREG4rE=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "7d81f6fb2e19bf84f1c65135d1060d829fae2408", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100755 index 0000000..5552b91 --- /dev/null +++ b/flake.nix @@ -0,0 +1,82 @@ +{ + description = "cartier's computer configuration"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + hyprshell.url = "git+https://gitgud.foo/thegrind/hypr-shell.git"; + stylix = { + url = "github:danth/stylix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; + + my-assets = { + url = "path:./assets"; + flake = false; + }; + }; + + outputs = + { + self, + nixpkgs, + my-assets, + ... + }@inputs: + let + system = "x86_64-linux"; + + # Common overlays for all hosts + overlays = [ + inputs.neovim-nightly-overlay.overlays.default + ]; + + # Helper function to create a host configuration + mkHost = + hostname: modules: + nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs; + inherit hostname; # Pass hostname to modules + assets = my-assets; + }; + modules = [ + # Common modules for all hosts + inputs.home-manager.nixosModules.default + inputs.stylix.nixosModules.stylix + + # Apply overlays to all hosts + ( + { config, pkgs, ... }: + { + nixpkgs.overlays = overlays; + } + ) + + # Host config + ./modules/system/common/fonts.nix + ./modules/system/common/xdg.nix + ./hosts/${hostname} + ] + ++ modules; # Additional modules passed to mkHost + }; + in + { + nixosConfigurations = { + desktop = mkHost "desktop" [ + ./modules/system/nvidia.nix + ./modules/system/nfs.nix + ./modules/system/display-manager/sddm.nix + ./modules/system/gaming.nix + ]; + + laptop = mkHost "laptop" [ + ./modules/system/display-manager/sddm.nix + ]; + }; + }; +} diff --git a/hosts/common-config.nix b/hosts/common-config.nix new file mode 100755 index 0000000..0022e5b --- /dev/null +++ b/hosts/common-config.nix @@ -0,0 +1,190 @@ +{ + config, + pkgs, + inputs, + hostname, + assets, + ... +}: +{ + # Bootloader. + boot = { + loader = { + systemd-boot = { + enable = true; + }; + + efi = { + canTouchEfiVariables = true; + }; + }; + + # Mount my second drive + supportedFilesystems = [ "ntfs" ]; + }; + + networking = { + hostName = hostname; + + networkmanager = { + enable = true; + }; + }; + + time = { + timeZone = "America/New_York"; + }; + + i18n = { + defaultLocale = "en_US.UTF-8"; + + extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + }; + + services = { + printing = { + enable = true; + }; + + # Flatpak is here just for discord pretty much + flatpak = { + enable = true; + }; + + pulseaudio = { + enable = false; + }; + + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + openssh = { + enable = true; + }; + }; + + systemd.services.flatpak-repo = { + wantedBy = [ "multi-user.target" ]; + path = [ pkgs.flatpak ]; + script = '' + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + ''; + }; + + security = { + rtkit = { + enable = true; + }; + }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + environment = { + systemPackages = with pkgs; [ + brave + git + openssh + xdg-user-dirs-gtk # This helps with Nautilus integration + cachix + ]; + + # Set up my user icon + etc = { + "avatars/cartier.png".source = "${assets}/user-icon.png"; + }; + }; + + users.users.cartier = { + isNormalUser = true; + description = "cartier"; + shell = pkgs.zsh; + useDefaultShell = true; + extraGroups = [ + "networkmanager" + "wheel" + ]; + }; + + system = { + stateVersion = "25.05"; # Did you read the comment? + activationScripts.avatar = '' + mkdir -p /var/lib/AccountsService/icons + ln -sf /etc/avatars/cartier.png /var/lib/AccountsService/icons/cartier + ''; + }; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + nix.settings = { + substituters = [ + "https://cache.nixos.org/" + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + ]; + }; + + programs = { + hyprland.enable = true; + + ssh = { + startAgent = true; + extraConfig = " + Host myhost + Hostname gitgud.foo + "; + }; + + # More thunar support + xfconf = { + enable = true; + + }; + + zsh.enable = true; + }; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + # Theme + stylix = { + enable = true; + base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark.yaml"; + # image = "/home/cartier/Documents/wallpapers/Fantasy-Mountain.png"; + polarity = "dark"; + }; + + # Enable home manager + home-manager = { + extraSpecialArgs = { + inherit inputs; + assets = assets; + }; + users = { + "cartier" = { + imports = [ + ../modules/home/home.nix + ]; + }; + }; + }; +} diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix new file mode 100755 index 0000000..141fe8d --- /dev/null +++ b/hosts/desktop/default.nix @@ -0,0 +1,45 @@ +{ + config, + pkgs, + inputs, + hostname, + assets, + ... +}: +{ + imports = [ + ../common-config.nix + ../../modules/system/nix-valet.nix + ../../modules/system/device-management/logitech.nix + ./hardware-configuration.nix + ]; + + # Mount second hard drive + boot = { + supportedFilesystems = [ + "ntfs" + ]; + }; + + fileSystems."/mnt/working-files" = { + device = "/dev/disk/by-uuid/BE8EBBDA8EBB8A03"; + fsType = "ntfs"; + options = [ + "uid=1000" # your user ID (check with `id -u`) + "gid=100" # your primary group ID (check with `id -g`) + "dmask=022" # dir permissions + "fmask=133" # file permissions + "nofail" + + # make Nautilus show it with a friendly name/icon + "x-gvfs-show" + "x-gvfs-name=Working Files" + ]; + }; + + environment = { + systemPackages = with pkgs; [ + pkgs.ntfs3g + ]; + }; +} diff --git a/hosts/desktop/hardware-configuration.nix b/hosts/desktop/hardware-configuration.nix new file mode 100755 index 0000000..077a87b --- /dev/null +++ b/hosts/desktop/hardware-configuration.nix @@ -0,0 +1,72 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/8f492948-4572-44d4-9da9-9394894320f4"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/EAA9-478C"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + fileSystems."/home" = { + device = "/dev/disk/by-uuid/6646d409-6417-4410-b3a0-fe6bafb2b9f3"; + fsType = "ext4"; + }; + + fileSystems."/tmp" = { + device = "/dev/disk/by-uuid/9fe1009a-f604-40ff-a13d-e78d9041397f"; + fsType = "ext4"; + }; + + fileSystems."/var/log" = { + device = "/dev/disk/by-uuid/9d39eb6d-09ab-4d66-8864-c19f9d59f620"; + fsType = "ext4"; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/6fa52bf4-b1d9-468f-bc3a-f0c740e80c86"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp7s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix new file mode 100755 index 0000000..a0a3426 --- /dev/null +++ b/hosts/laptop/default.nix @@ -0,0 +1,18 @@ +{ + config, + pkgs, + inputs, + hostname, + ... +}: +{ + imports = [ + ../common-config.nix + ./hardware-configuration.nix + ]; + + services.xserver.libinput.enable = true; + services.gvfs.enable = true; + services.udisks2.enable = true; + services.upower.enable = true; +} diff --git a/hosts/laptop/hardware-configuration.nix b/hosts/laptop/hardware-configuration.nix new file mode 100755 index 0000000..87b987e --- /dev/null +++ b/hosts/laptop/hardware-configuration.nix @@ -0,0 +1,41 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/95adc709-ea77-4bca-88db-d4ddd6dc0b7b"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/C9A4-8C66"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/9366aedd-e4d0-4466-8e2b-4316e62ce99f"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/modules/home/common/fzf.nix b/modules/home/common/fzf.nix new file mode 100755 index 0000000..34591b6 --- /dev/null +++ b/modules/home/common/fzf.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + programs.fzf = { + enable = true; + enableZshIntegration = true; + }; +} diff --git a/modules/home/common/git.nix b/modules/home/common/git.nix new file mode 100755 index 0000000..f551c9d --- /dev/null +++ b/modules/home/common/git.nix @@ -0,0 +1,54 @@ +{ + config, + pkgs, + ... +}: +{ + home.packages = [ + pkgs.git + ]; + + # Git configuration + programs.git = { + enable = true; + + # User information (from your init.sh) + userName = "cartierf89"; + userEmail = "cartierer0eduardo@hotmail.com"; + + # Git settings + extraConfig = { + init = { + defaultBranch = "main"; + }; + + core = { + editor = "code --wait"; + autocrlf = "input"; + ignorecase = false; + }; + + pull = { + rebase = true; + }; + + push = { + default = "simple"; + autoSetupRemote = true; + }; + + merge = { + tool = "code"; + }; + + diff = { + tool = "code"; + }; + + # Better diff output + color = { + ui = true; + }; + }; + }; +} diff --git a/modules/home/common/kitty.nix b/modules/home/common/kitty.nix new file mode 100755 index 0000000..8fcf075 --- /dev/null +++ b/modules/home/common/kitty.nix @@ -0,0 +1,29 @@ +{ + config, + lib, + pkgs, + ... +}: +let + kittyConfig = '' + font_size 16.0 + + background_opacity 0.7 + background_blur 1 + + hide_window_decorations yes + + map ctrl+shift+t new_tab_with_cwd + ''; +in +{ + home.packages = with pkgs; [ + kitty + ]; + + programs.kitty = { + enable = true; + + extraConfig = kittyConfig; + }; +} diff --git a/modules/home/common/neovim.nix b/modules/home/common/neovim.nix new file mode 100755 index 0000000..6cd5da6 --- /dev/null +++ b/modules/home/common/neovim.nix @@ -0,0 +1,13 @@ +# neovim.nix +{ + config, + pkgs, + inputs, + ... +}: + +{ + home.packages = [ + inputs.neovim-nightly-overlay.packages.${pkgs.system}.default + ]; +} diff --git a/modules/home/common/shell.nix b/modules/home/common/shell.nix new file mode 100755 index 0000000..5769a0d --- /dev/null +++ b/modules/home/common/shell.nix @@ -0,0 +1,137 @@ +{ + config, + pkgs, + ... +}: +{ + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + + # Shell aliases (equivalent to your script functions) + shellAliases = { + sudo = "sudo "; + # Nix + rb = "git add . && sudo nixos-rebuild switch --flake $HOME/nix#desktop"; + rbl = "git add . && sudo nixos-rebuild switch --flake $HOME/nix#laptop"; + + eza = "eza"; + ls = "eza -lh --group-directories-first --icons"; + cat = "bat"; + bat = "bat"; + + # Quicker navigation + ".." = "cd .."; + "..." = "cd ../.."; + "...." = "cd ../../.."; + "....." = "cd ../../../.."; + + # Git + gs = "git status"; + ga = "git add -A"; + gc = "git commit -m"; + grm = "git rm $(git ls-files --deleted)"; + gb = "git checkout -b"; + + # Docker aliases + dc = "docker-compose"; + bx = "docker buildx"; + de = "docker exec -it"; + dub = "docker compose up -d --build"; + dup = "docker-compose up"; + dwn = "docker-compose down"; + da = "docker_artisan"; + + # Laravel & php + a = "php artisan"; + + # Convenience + cls = "clear"; + home = "cd ~"; + projects = "cd ~/projects"; + co = "code ."; + clipboard = "wl-copy"; + + # Jigsaw + jig = "vendor/bin/jigsaw"; + + # Golang + gr = "go run ."; + gmt = "go mod tidy"; + }; + + # Additional bash configuration + initContent = '' + function pape() { + hyprctl hyprpaper preload $1 + hyprctl hyprpaper wallpaper ", $1" + } + # Open something in the projects folder + function o() { + cd "$HOME/projects/$1" + } + + function proj() { + eza -ld $HOME/projects/* --color=never | + awk '{print $7}' | + wofi --dmenu --prompt "Open project:" | xargs -I{} code {} -n && exit + } + + function makepasswd() { + openssl rand -base64 16 | clipboard + echo "Password copied to clipboard" + } + + function mountnewshares() { + sudo systemctl daemon-reload + sudo mount -a + } + + function makerole() { + mkdir -p "roles/$1/tasks" + mkdir -p "roles/$1/defaults" + touch "roles/$1/tasks/main.yml" + touch "roles/$1/defaults/main.yml" + } + + function pyvenv() { + python3 -m venv .venv + source .venv/bin/activate + } + + function newsshkey() { + KEY_NAME="id_ed25519_$1" + KEY_PATH="$HOME/.ssh/$KEY_NAME" + ssh-keygen -t ed25519 -C "$1" -f "$KEY_PATH" -N "" + ssh-add "$KEY_PATH" + echo "Key created and added" + echo "Key: $KEY_NAME" + echo "Saved to: $KEY_PATH" + } + + function listsshkeys() { + ls "$HOME/.ssh" + } + + function copypublickey() { + KEY_NAME="$1" + KEY_PATH="$HOME/.ssh/$KEY_NAME" + cat "$KEY_PATH.pub" | clipboard + echo "Key copied to clipboard" + } + + function makerole() { + mkdir -p "roles/$1/tasks" + mkdir -p "roles/$1/defaults" + touch "roles/$1/tasks/main.yml" + touch "roles/$1/defaults/main.yml" + } + ''; + }; + + home.sessionPath = [ + "$HOME/.config/composer/vendor/bin" + ]; +} diff --git a/modules/home/common/starship.nix b/modules/home/common/starship.nix new file mode 100755 index 0000000..eaa8c40 --- /dev/null +++ b/modules/home/common/starship.nix @@ -0,0 +1,44 @@ +{ + config, + pkgs, + ... +}: +{ + home.packages = with pkgs; [ + starship + ]; + + # Starship prompt configuration (equivalent to your starship-prompt.sh) + programs.starship = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + + settings = { + character = { + success_symbol = "[† ❯](bold green)"; + error_symbol = "[€ ❯](bold red)"; + }; + + directory = { + truncation_length = 9; + }; + + php = { + format = "[$symbol($version )]($style)"; + }; + + golang = { + format = "[$symbol($version )]($style)"; + }; + + nodejs = { + format = "[$symbol($version )]($style)"; + }; + + bun = { + format = "[$symbol($version )]($style)"; + }; + }; + }; +} diff --git a/modules/home/common/yazi.nix b/modules/home/common/yazi.nix new file mode 100755 index 0000000..5a99983 --- /dev/null +++ b/modules/home/common/yazi.nix @@ -0,0 +1,23 @@ +{ + config, + pkgs, + inputs, + ... +}: +{ + programs.yazi = { + enable = true; + keymap = { + manager.prepend_keymap = [ + { + on = [ + "b" + "g" + ]; + run = "shell 'hyprctl hyprpaper preload \"$0\" && hyprctl hyprpaper wallpaper \", $0\"'"; + desc = "Set as wallpaper"; + } + ]; + }; + }; +} diff --git a/modules/home/gnome/gnome.nix b/modules/home/gnome/gnome.nix new file mode 100755 index 0000000..110a23f --- /dev/null +++ b/modules/home/gnome/gnome.nix @@ -0,0 +1,86 @@ +{ + config, + pkgs, + lib, + ... +}: +{ + imports = [ + ./gnome/keybinds.nix + ]; + + window + + home.packages = with pkgs; [ + gnomeExtensions.blur-my-shell + gnomeExtensions.dash-to-dock + gnomeExtensions.space-bar + gnomeExtensions.just-perfection + ]; + + dconf.enable = true; + + # All the gnome configuration is under this + dconf.settings = { + # Interface settings + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + gtk-theme = "Adwaita-dark"; + icon-theme = "Adwaita"; + cursor-theme = "Adwaita"; + font-name = "Cantarell 11"; + document-font-name = "Cantarell 11"; + monospace-font-name = "FiraCode Nerd Font 10"; + show-battery-percentage = true; + clock-show-weekday = true; + clock-show-date = true; + clock-show-seconds = false; + clock-format = "12h"; + }; + + # Nautilus (file manager) preferences + "org/gnome/nautilus/preferences" = { + default-folder-viewer = "list-view"; + search-filter-time-type = "last_modified"; + show-hidden-files = true; + }; + + # GNOME Shell extensions + "org/gnome/shell" = { + enabled-extensions = [ + "blur-my-shell@aunetx" + "space-bar@luchrioh" + "just-perfection-desktop@just-perfection" + ]; + disabled-extensions = [ + "tiling-assistant@ubuntu.com" + "ubuntu-appindicators@ubuntu.com" + "ubuntu-dock@ubuntu.com" + "ding@rastersoft.com" + ]; + }; + + # Dash to Dock settings + "org/gnome/shell/extensions/dash-to-dock" = { + dock-position = "BOTTOM"; + dock-fixed = false; + intellihide-mode = "FOCUS_APPLICATION_WINDOWS"; + show-favorites = true; + show-running = true; + show-apps-at-top = true; + click-action = "cycle-windows"; + }; + + # Power settings + "org/gnome/settings-daemon/plugins/power" = { + sleep-inactive-ac-type = "nothing"; + sleep-inactive-battery-timeout = 1800; + }; + + # Privacy settings + "org/gnome/desktop/privacy" = { + report-technical-problems = false; + send-software-usage-stats = false; + }; + }; +} diff --git a/modules/home/gnome/keybinds.nix b/modules/home/gnome/keybinds.nix new file mode 100755 index 0000000..ccef23b --- /dev/null +++ b/modules/home/gnome/keybinds.nix @@ -0,0 +1,132 @@ +{ + config, + pkgs, + lib, + ... +}: +let + # Helper function to create custom keybindings + mkCustomKeybinding = + index: + { + name, + command, + binding, + }: + { + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${toString index}" = { + inherit name command binding; + }; + }; + + # Helper function to generate custom keybinding paths + mkCustomKeybindingPaths = + count: + lib.genList ( + i: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${toString i}/" + ) count; + + # Helper function to generate workspace keybindings + mkWorkspaceKeybindings = + count: + lib.genAttrs (lib.genList (i: "switch-to-workspace-${toString (i + 1)}") count) ( + name: + let + num = lib.strings.removePrefix "switch-to-workspace-" name; + in + [ "${num}" ] + ); + + # Helper function to disable application shortcuts + mkDisableAppShortcuts = + count: + lib.genAttrs (lib.genList (i: "switch-to-application-${toString (i + 1)}") count) (name: [ ]); + + # Define custom keybindings + customKeybindings = [ + { + name = "Flameshot"; + command = "flameshot gui"; + binding = "s"; + } + { + name = "New Brave window"; + command = "brave"; + binding = "o"; + } + { + name = "New Brave incognito window"; + command = "brave --incognito"; + binding = "p"; + } + { + name = "Kitty"; + command = "kitty"; + binding = "q"; + } + { + name = "File Explorer"; + command = "nautilus --new-window"; + binding = "e"; + } + { + name = "Project selector"; + command = "kitty --start-as=normal -- bash -ic 'proj'"; + binding = "p"; + } + { + name = "Open nix config"; + command = "kitty --start-as=normal -- bash -ic 'code ~/nix && exit'"; + binding = "n"; + } + { + name = "ChatGPT"; + command = "brave --new-window --app=https://chatgpt.com"; + binding = "Return"; + } + { + name = "BTop"; + command = "kitty --start-as=normal -- bash -ic 'btop'"; + binding = "Escape"; + } + { + name = "FastFetch"; + command = "kitty --start-as=normal -- bash -ic 'fastfetch'"; + binding = "1"; + } + ]; + + # Generate all custom keybinding settings + customKeybindingSettings = lib.foldl lib.mergeAttrs { } ( + lib.imap0 (index: keybind: mkCustomKeybinding index keybind) customKeybindings + ); +in +{ + # GNOME desktop configuration (equivalent to your scripts/gnome/ files) + dconf.settings = lib.mergeAttrs { + # Window manager keybindings (from keybinds.sh) + "org/gnome/desktop/wm/keybindings" = lib.mergeAttrs { + close = [ "c" ]; + maximize = [ "Up" ]; + toggle-fullscreen = [ "F11" ]; + } (mkWorkspaceKeybindings 6); + + # Workspace settings + "org/gnome/mutter" = { + dynamic-workspaces = false; + }; + + "org/gnome/desktop/wm/preferences" = { + num-workspaces = 6; + resize-with-right-button = true; + }; + + # Disable Super+number for applications (to use for workspaces) + "org/gnome/shell/keybindings" = mkDisableAppShortcuts 9; + + # Custom keybindings (from your keybinds.sh) + "org/gnome/settings-daemon/plugins/media-keys" = { + custom-keybindings = mkCustomKeybindingPaths (lib.length customKeybindings); + }; + } customKeybindingSettings; +} diff --git a/modules/home/home.nix b/modules/home/home.nix new file mode 100755 index 0000000..39060f3 --- /dev/null +++ b/modules/home/home.nix @@ -0,0 +1,151 @@ +{ + config, + pkgs, + lib, + inputs, + ... +}: +{ + imports = [ + ./common/git.nix + ./common/kitty.nix + ./common/neovim.nix + ./common/shell.nix + ./common/starship.nix + ./common/yazi.nix + ./common/fzf.nix + ./hyprland + ]; + + nixpkgs.config.allowUnfree = true; + + # gtk = { + # enable = true; + # iconTheme = { + # name = "Papirus"; + # package = pkgs.papirus-icon-theme; + # }; + # }; +services.udiskie = { + enable = true; + settings = { + # workaround for + # https://github.com/nix-community/home-manager/issues/632 + program_options = { + # replace with your favorite file manager + file_manager = "${pkgs.xfce.thunar}/bin/thunar"; + }; + }; +}; + home = { + username = "cartier"; + homeDirectory = "/home/cartier"; + stateVersion = "25.05"; # Home manager version. Do not update carelessly + packages = with pkgs; [ + # Basics + quickshell + obsidian + + # Terminal tools + ripgrep + bat + eza + jq + + # Dev tools + jetbrains.datagrip + vscode + nixfmt # Nix formatting + pkgs.libsForQt5.full # QML formatting (for working on quickshell) + claude-code + xsel + nss.tools + + # System tools + btop + fastfetch + gnumake + dig + lsof + + # Langs + php + php84Packages.composer + laravel + go + nodejs_22 + bun + ]; + + sessionVariables = { + EDITOR = "code"; + BROWSER = "brave"; + TERMINAL = "kitty"; + NVD_BACKEND = "wayland"; + OZONE_PLATFORM = "wayland"; + OZONE_PLATFORM_HINT = "auto"; + XDG_CACHE_HOME = "${config.home.homeDirectory}/.cache"; + XDG_CONFIG_HOME = "${config.home.homeDirectory}/.config"; + XDG_DATA_HOME = "${config.home.homeDirectory}/.local/share"; + XDG_STATE_HOME = "${config.home.homeDirectory}/.local/state"; + }; + }; + + # Programs home manager should manage + programs = { + btop = { + enable = true; + }; + }; + + stylix = { + enable = true; + targets = { + btop.enable = true; + }; + }; + + xdg = { + enable = true; + configFile."user-dirs.conf" = { + text = '' + enabled=True + filename_encoding=UTF-8 + ''; + force = true; # This forces overwrite of existing content + }; + userDirs = { + enable = true; + createDirectories = true; + desktop = "${config.home.homeDirectory}/Desktop"; + documents = "${config.home.homeDirectory}/Documents"; + download = "${config.home.homeDirectory}/Downloads"; + music = "${config.home.homeDirectory}/Music"; + pictures = "${config.home.homeDirectory}/Pictures"; + publicShare = "${config.home.homeDirectory}/Public"; + templates = "${config.home.homeDirectory}/Templates"; + videos = "${config.home.homeDirectory}/Videos"; + }; + + # TODO: Move the http handler to a browser.nix + # # File/app associations + # mimeApps = { + # enable = true; + # defaultApplications = { + # "text/html" = "brave.desktop"; + # "x-scheme-handler/http" = "brave.desktop"; + # "x-scheme-handler/https" = "brave.desktop"; + # "x-scheme-handler/about" = "brave.desktop"; + # "x-scheme-handler/unknown" = "brave.desktop"; + # "application/pdf" = "org.gnome.Evince.desktop"; + # "text/plain" = "code.desktop"; + # "application/json" = "code.desktop"; + # "application/javascript" = "code.desktop"; + # "text/x-php" = "code.desktop"; + # }; + # }; + }; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +} diff --git a/modules/home/hyprland/background.png b/modules/home/hyprland/background.png new file mode 100755 index 0000000..c868176 Binary files /dev/null and b/modules/home/hyprland/background.png differ diff --git a/modules/home/hyprland/binds.nix b/modules/home/hyprland/binds.nix new file mode 100755 index 0000000..afee1a2 --- /dev/null +++ b/modules/home/hyprland/binds.nix @@ -0,0 +1,98 @@ +{ + config, + pkgs, + inputs, + ... +}: + +{ + wayland.windowManager.hyprland.settings = { + "$mod" = "SUPER"; + "$browser" = "brave"; + "$terminal" = "kitty"; + "$file_browser" = "thunar"; + "$webapp" = "$browser --new-window --app="; + + binds = { + drag_threshold = 10; + }; + + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + + # Media Keys + + bindle = [ + ", XF86AudioRaiseVolume, exec, wpctl set-volume 54 1%+" + ", XF86AudioLowerVolume, exec, wpctl set-volume 54 1%-" + ", XF86AudioMute, exec, wpctl set-mute 54 toggle" + + ]; + bind = [ + # Start programs + "$mod, t, exec, $terminal" + "$mod CTRL, 1, exec, $browser" + "$mod SHIFT, p, exec, $browser --incognito" + "$mod, e, exec, $file_browser" + "$mod SHIFT, n, exec, code ~/nix" + "$mod SHIFT, ESC, exec, $terminal --start-as=normal -- bash -ic 'btop'" + # "$mod ALT, p, exec, $terminal --start-as=normal -- bash -ic 'proj'" + + "$mod ALT, p, exec, eza -ld $HOME/projects/* --color=never | awk '{print $7}' | wofi --dmenu --prompt \"Open project:\" | xargs -I{} code {} -n && exit" + "$mod, RETURN, exec, $webapphttps://claude.ai" + + + # Window and workspace navigation + # Move between windows with vim keys + "$mod, h, movefocus, l" + "$mod, l, movefocus, r" + "$mod, k, movefocus, u" + "$mod, j, movefocus, d" + "$mod, c, killactive" + # Move between workspaces + "$mod ALT, l, movetoworkspace, r+1" + "$mod ALT, h, movetoworkspace, r-1" + "$mod SHIFT, l, workspace, r+1" + "$mod SHIFT, h, workspace, r-1" + # Window management + "$mod, 0, layoutmsg, rollnext" + + "$mod, f, fullscreen, 0" + "$mod, v, togglefloating, active" + "$mod, SPACE, exec, wofi --show drun" + "$mod, d, exec, ${pkgs.wofi-emoji}/bin/wofi-emoji" + + "$mod SHIFT, s, exec, hyprshot --mode region" + ", PRINT, exec, hyprshot --mode output" + + "$mod SHIFT, c, togglespecialworkspace, comms" + "$mod SHIFT, a, togglespecialworkspace, research" + "$mod SHIFT ALT, x, exec, hyprctl dispatch exit" + "SHIFT, Print, exec, grimblast copy area" + "CTRL, Print, exec, grimblast copy active" + ] + ++ ( + # workspaces + # binds $mod + [shift +] {1..9} to [move to] workspace {1..9} + builtins.concatLists ( + builtins.genList ( + i: + let + ws = i + 1; + in + [ + "$mod, code:1${toString i}, workspace, ${toString ws}" + "$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}" + ] + ) 9 + ) + ); + }; + + wayland.windowManager.hyprland.plugins = [ + # inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}.hyprbars + ]; + +} diff --git a/modules/home/hyprland/default.nix b/modules/home/hyprland/default.nix new file mode 100755 index 0000000..bc8229b --- /dev/null +++ b/modules/home/hyprland/default.nix @@ -0,0 +1,117 @@ +{ + config, + pkgs, + inputs, + ... +}: + + + +{ + imports = [ + ./binds.nix + ./hyprpaper.nix + ./hyprpanel.nix + ./wofi.nix + ./desktop-env.nix + ]; + + home = { + sessionVariables = { + NIXOS_OZON_WL = "1"; + }; + + packages = with pkgs; [ + # Notifications + libnotify + + # Screenshots + grim + slurp + wl-clipboard + hyprshot + + # Desktop env + hyprpanel + + # Utility + wl-clipboard + ]; + }; + + # Important for certain apps working + # and dark mode being respected + xdg.portal = { + enable = true; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + pkgs.xdg-desktop-portal-hyprland + ]; + }; + + gtk = { + enable = true; + iconTheme = { + name = "Papirus"; + package = pkgs.papirus-icon-theme; + }; + }; + + wayland.windowManager.hyprland = { + + enable = true; + + settings = { + + input = { + repeat_delay = 200; + repeat_rate = 20; + touchpad.natural_scroll = true; + }; + + monitor = [ + "eDP-1, 2560x1440@60, 0x0, 1" + ]; + + general = { + layout = "master"; + gaps_out = 0; + gaps_in = 0; + }; + + workspace = [ + "1, persistent:true" + "2, persistent:true" + "3, persistent:true" + "4, persistent:true" + "5, persistent:true" + "6, persistent:true" + ]; + + # Window rules + windowrulev2 = [ + "opacity 0.85, class:^(Code)$" + ]; + + decoration = { + blur = { + enabled = false; + size = 8; + passes = 2; + }; + + active_opacity = 1.0; + inactive_opacity = 1.0; + }; + + exec-once = [ + # "quickshell -c hyprshell" + "hyprpanel" + ]; + }; + + plugins = [ + # inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}.hyprbars + ]; + }; +} diff --git a/modules/home/hyprland/desktop-env.nix b/modules/home/hyprland/desktop-env.nix new file mode 100755 index 0000000..3e26143 --- /dev/null +++ b/modules/home/hyprland/desktop-env.nix @@ -0,0 +1,151 @@ +/* + This file is for configuring all the normal things + you would need in a desktop environment that + hyprland doesn't come with by default + such as: + - A file manager + - An image viewer + - Video player +*/ +{ + pkgs, + ... +}: +# Complete Desktop Applications Suite for Home Manager +{ + # Media Viewers + home.packages = with pkgs; [ + # *** File Manager *** + xfce.thunar + xfce.thunar-volman # Removable drive support + xfce.thunar-media-tags-plugin + # Essential thumbnail generators + xfce.tumbler # Thunar's thumbnail service + ffmpegthumbnailer # Video thumbnails + libgsf # Office document thumbnails + poppler # PDF thumbnails + # ******************** + + # Image Viewers + kdePackages.gwenview # KDE image viewer - integrates well with Dolphin + # feh # Lightweight alternative + + # Video Players + mpv + + # Audio Players + kdePackages.elisa # KDE music player + + # Document Viewers + kdePackages.okular # KDE PDF/document viewer + + # Archive Managers + kdePackages.ark # KDE archive manager + + # Text Editors + kdePackages.kate # KDE advanced text editor + # kwrite # KDE simple text editor + # gedit # GNOME text editor alternative + + # Office & Productivity + # libreoffice # Full office suite + # onlyoffice-bin # Alternative office suite + ]; + + xdg.configFile."Thunar/thunarrc".text = '' + [Configuration] + DefaultView=ThunarDetailsView + ''; + + # XDG MIME associations for seamless integration + xdg.mimeApps = { + enable = true; + defaultApplications = { + # Image files + "image/jpeg" = "org.kde.gwenview.desktop"; + "image/png" = "org.kde.gwenview.desktop"; + "image/gif" = "org.kde.gwenview.desktop"; + "image/bmp" = "org.kde.gwenview.desktop"; + "image/tiff" = "org.kde.gwenview.desktop"; + "image/webp" = "org.kde.gwenview.desktop"; + "image/svg+xml" = "org.kde.gwenview.desktop"; + + # Video files + "video/mp4" = "mpv.desktop"; + "video/mpeg" = "mpv.desktop"; + "video/quicktime" = "mpv.desktop"; + "video/x-msvideo" = "mpv.desktop"; + "video/x-matroska" = "mpv.desktop"; + "video/webm" = "mpv.desktop"; + + # Audio files + "audio/mpeg" = "org.kde.elisa.desktop"; + "audio/flac" = "org.kde.elisa.desktop"; + "audio/x-wav" = "org.kde.elisa.desktop"; + "audio/ogg" = "org.kde.elisa.desktop"; + "audio/mp4" = "org.kde.elisa.desktop"; + + # Document files + "application/pdf" = "org.kde.okular.desktop"; + "application/postscript" = "org.kde.okular.desktop"; + "application/epub+zip" = "org.kde.okular.desktop"; + + # Text files + "text/plain" = "org.kde.kate.desktop"; + "text/markdown" = "org.kde.kate.desktop"; + "application/x-shellscript" = "org.kde.kate.desktop"; + + # Archive files + "application/zip" = "org.kde.ark.desktop"; + "application/x-tar" = "org.kde.ark.desktop"; + "application/x-compressed-tar" = "org.kde.ark.desktop"; + "application/x-7z-compressed" = "org.kde.ark.desktop"; + "application/x-rar" = "org.kde.ark.desktop"; + + # Directory + "inode/directory" = "thunar.desktop"; + }; + }; + + home.sessionVariables = { + FILE_MANAGER = "thunar"; + }; + + # Configure specific programs + programs = { + # Configure mpv for advanced video playback + mpv = { + enable = true; + config = { + # Hardware acceleration + hwdec = "auto"; + vo = "gpu"; + + # UI improvements + osc = true; + border = false; + + # Subtitle settings + sub-auto = "fuzzy"; + sub-file-paths = "ass:srt:sub:subs:subtitles"; + + # Audio settings + volume = 100; + volume-max = 200; + }; + }; + }; + + # Optional: Create custom desktop entries for specific workflows + xdg.desktopEntries = { + # Open terminal in current directory (for Dolphin integration) + "terminal-here" = { + name = "Terminal Here"; + comment = "Open terminal in current location"; + exec = "kitty --workdir %u"; + icon = "utilities-terminal"; + mimeType = [ "inode/directory" ]; + noDisplay = true; + }; + }; +} diff --git a/modules/home/hyprland/hyprpanel.nix b/modules/home/hyprland/hyprpanel.nix new file mode 100755 index 0000000..08f632b --- /dev/null +++ b/modules/home/hyprland/hyprpanel.nix @@ -0,0 +1,58 @@ +{ inputs, pkgs, ... }: + +{ + programs.hyprpanel = { + enable = true; + settings = { + bar = { + layouts = { + "0" = { + left = [ + "dashboard" + "workspaces" + "cpu" + "ram" + "systray" + ]; + middle = [ + "clock" + ]; + right = [ + "media" + "volume" + "network" + "notifications" + "battery" + ]; + }; + }; + }; + + bar.launcher.autoDetectIcon = true; + bar.workspaces.show_icons = true; + + menus.clock = { + time = { + military = false; + hideSeconds = true; + }; + weather.unit = "imperial"; + }; + + menus.dashboard.directories.enabled = false; + menus.dashboard.stats.enable_gpu = true; + + theme = import ./hyprpanel/theme-gruvbox.nix; + + # theme.bar.transparent = { + # transparent = false; + # buttons.style = "wave"; + # }; + + # theme.font = { + # name = "CaskaydiaCove NF"; + # size = "14px"; + # }; + }; + }; +} diff --git a/modules/home/hyprland/hyprpanel/theme-gruvbox.nix b/modules/home/hyprland/hyprpanel/theme-gruvbox.nix new file mode 100755 index 0000000..c66a28f --- /dev/null +++ b/modules/home/hyprland/hyprpanel/theme-gruvbox.nix @@ -0,0 +1,685 @@ +{ + font.size = "14px"; + bar = { + background = "#1d2021"; + border.color = "#83a598"; + + buttons = { + style = "wave"; + background = "#282828"; + icon_background = "#242438"; + hover = "#504945"; + text = "#83a598"; + icon = "#83a598"; + borderColor = "#83a598"; + + dashboard = { + background = "#282828"; + icon = "#fabd2f"; + border = "#fabd2f"; + }; + + workspaces = { + background = "#282828"; + hover = "#504945"; + available = "#83a598"; + occupied = "#fb4934"; + active = "#d3869b"; + numbered_active_highlighted_text_color = "#21252b"; + numbered_active_underline_color = "#ffffff"; + border = "#ffffff"; + }; + + windowtitle = { + background = "#282828"; + text = "#d3869b"; + icon = "#d3869b"; + icon_background = "#d3869b"; + border = "#d3869b"; + }; + + media = { + background = "#282828"; + text = "#83a598"; + icon = "#83a598"; + icon_background = "#83a598"; + border = "#83a598"; + }; + + volume = { + background = "#282828"; + text = "#fe8018"; + icon = "#fe8018"; + icon_background = "#fe8018"; + border = "#fe8018"; + }; + + network = { + background = "#282828"; + text = "#b16286"; + icon = "#b16286"; + icon_background = "#b16286"; + border = "#b16286"; + }; + + bluetooth = { + background = "#282828"; + text = "#83a598"; + icon = "#83a598"; + icon_background = "#83a598"; + border = "#83a598"; + }; + + systray = { + background = "#282828"; + border = "#504945"; + customIcon = "#ebdbb2"; + }; + + battery = { + background = "#282828"; + text = "#fabd2f"; + icon = "#fabd2f"; + icon_background = "#fabd2f"; + border = "#fabd2f"; + }; + + clock = { + background = "#282828"; + text = "#d3869b"; + icon = "#d3869b"; + icon_background = "#d3869b"; + border = "#d3869b"; + }; + + notifications = { + background = "#282828"; + icon = "#83a598"; + icon_background = "#83a598"; + total = "#83a598"; + border = "#83a598"; + }; + + modules = { + power = { + background = "#282828"; + icon = "#cc241d"; + icon_background = "#282828"; + border = "#282828"; + }; + + weather = { + background = "#282828"; + text = "#fe8017"; + icon = "#fe8017"; + icon_background = "#282828"; + border = "#fe8017"; + }; + + updates = { + background = "#282828"; + text = "#b16286"; + icon = "#b16286"; + icon_background = "#282828"; + border = "#b16286"; + }; + + kbLayout = { + background = "#282828"; + text = "#83a598"; + icon = "#83a598"; + icon_background = "#282828"; + border = "#83a598"; + }; + + netstat = { + background = "#282828"; + text = "#b8bb26"; + icon = "#b8bb26"; + icon_background = "#282828"; + border = "#b8bb26"; + }; + + storage = { + background = "#282828"; + text = "#83a598"; + icon = "#83a598"; + icon_background = "#282828"; + border = "#83a598"; + }; + + cpu = { + background = "#282828"; + text = "#d3869b"; + icon = "#d3869b"; + icon_background = "#282828"; + border = "#d3869b"; + }; + + ram = { + background = "#282828"; + text = "#fabd2f"; + icon = "#fabd2f"; + icon_background = "#282828"; + border = "#fabd2f"; + }; + + submap = { + background = "#282828"; + text = "#8ec07c"; + border = "#8ec07c"; + icon = "#8ec07c"; + icon_background = "#282828"; + }; + + hyprsunset = { + icon = "#fabd2f"; + background = "#282828"; + icon_background = "#282828"; + text = "#fabd2f"; + border = "#fabd2f"; + }; + + hypridle = { + icon = "#83a598"; + background = "#282828"; + icon_background = "#282828"; + text = "#83a598"; + border = "#83a598"; + }; + + cava = { + text = "#8ec07c"; + background = "#282828"; + icon_background = "#282828"; + icon = "#8ec07c"; + border = "#8ec07c"; + }; + + microphone = { + border = "#b8bb26"; + background = "#282828"; + text = "#b8bb26"; + icon = "#b8bb26"; + icon_background = "#282828"; + }; + + worldclock = { + text = "#d3869b"; + background = "#282828"; + icon_background = "#d3869b"; + icon = "#d3869b"; + border = "#d3869b"; + }; + }; + }; + + menus = { + background = "#1d2021"; + cards = "#1d2021"; + border.color = "#3c3836"; + text = "#ebdbb2"; + dimtext = "#665c54"; + feinttext = "#3c3836"; + label = "#83a598"; + + popover = { + background = "#32302f"; + border = "#32302f"; + text = "#83a598"; + }; + + listitems = { + passive = "#ebdbb2"; + active = "#83a598"; + }; + + icons = { + passive = "#665c54"; + active = "#83a598"; + }; + + switch = { + enabled = "#83a598"; + disabled = "#3c3836"; + puck = "#504945"; + }; + + check_radio_button = { + background = "#3c3836"; + active = "#83a598"; + }; + + buttons = { + default = "#83a598"; + active = "#d3869b"; + disabled = "#665c54"; + text = "#32302f"; + }; + + iconbuttons = { + passive = "#ebdbb2"; + active = "#83a598"; + }; + + progressbar = { + foreground = "#83a598"; + background = "#504945"; + }; + + slider = { + primary = "#83a598"; + background = "#665c54"; + backgroundhover = "#504945"; + puck = "#7c6f64"; + }; + + dropdownmenu = { + background = "#1d2021"; + text = "#ebdbb2"; + divider = "#1d2021"; + }; + + tooltip = { + background = "#1d2021"; + text = "#ebdbb2"; + }; + + menu = { + media = { + background.color = "#1d2021"; + card.color = "#282828"; + border.color = "#3c3836"; + song = "#83a598"; + artist = "#8ec07c"; + album = "#d3869b"; + timestamp = "#ebdbb2"; + + buttons = { + inactive = "#665c54"; + enabled = "#8ec07c"; + background = "#83a598"; + text = "#1d2021"; + }; + + slider = { + primary = "#d3869b"; + background = "#665c54"; + backgroundhover = "#504945"; + puck = "#7c6f64"; + }; + }; + + volume = { + background.color = "#1d2021"; + border.color = "#3c3836"; + card.color = "#282828"; + label.color = "#fe8018"; + text = "#ebdbb2"; + + listitems = { + passive = "#ebdbb2"; + active = "#fe8018"; + }; + + iconbutton = { + passive = "#ebdbb2"; + active = "#fe8018"; + }; + + icons = { + passive = "#a89984"; + active = "#fe8018"; + }; + + audio_slider = { + primary = "#fe8018"; + background = "#665c54"; + backgroundhover = "#504945"; + puck = "#665c54"; + }; + + input_slider = { + primary = "#fe8018"; + background = "#665c54"; + backgroundhover = "#504945"; + puck = "#665c54"; + }; + }; + + network = { + background.color = "#1d2021"; + card.color = "#282828"; + border.color = "#3c3836"; + label.color = "#b16286"; + text = "#ebdbb2"; + status.color = "#7c6f64"; + scroller.color = "#b16286"; + + listitems = { + passive = "#ebdbb2"; + active = "#b16286"; + }; + + icons = { + passive = "#a89984"; + active = "#b16286"; + }; + + iconbuttons = { + passive = "#ebdbb2"; + active = "#b16286"; + }; + + switch = { + enabled = "#b16286"; + disabled = "#3c3836"; + puck = "#504945"; + }; + }; + + bluetooth = { + background.color = "#1d2021"; + card.color = "#282828"; + border.color = "#3c3836"; + label.color = "#83a598"; + text = "#ebdbb2"; + status = "#7c6f64"; + switch_divider = "#504945"; + scroller.color = "#83a598"; + + switch = { + enabled = "#83a598"; + disabled = "#3c3836"; + puck = "#504945"; + }; + + listitems = { + passive = "#ebdbb2"; + active = "#83a598"; + }; + + icons = { + passive = "#a89984"; + active = "#83a598"; + }; + + iconbutton = { + passive = "#ebdbb2"; + active = "#83a598"; + }; + }; + + systray = { + dropdownmenu = { + background = "#1d2021"; + text = "#ebdbb2"; + divider = "#1d2021"; + }; + }; + + battery = { + background.color = "#1d2021"; + card.color = "#282828"; + border.color = "#3c3836"; + label.color = "#fabd2f"; + text = "#ebdbb2"; + + listitems = { + passive = "#ebdbb2"; + active = "#fabd2f"; + }; + + icons = { + passive = "#a89984"; + active = "#fabd2f"; + }; + + slider = { + primary = "#fabd2f"; + background = "#665c54"; + backgroundhover = "#504945"; + puck = "#7c6f64"; + }; + }; + + clock = { + background.color = "#1d2021"; + card.color = "#282828"; + border.color = "#3c3836"; + text = "#ebdbb2"; + + time = { + time = "#d3869b"; + timeperiod = "#8ec07c"; + }; + + calendar = { + yearmonth = "#8ec07c"; + weekdays = "#d3869b"; + paginator = "#d3869b"; + currentday = "#d3869b"; + days = "#ebdbb2"; + contextdays = "#665c54"; + }; + + weather = { + icon = "#d3869b"; + temperature = "#ebdbb2"; + status = "#8ec07c"; + stats = "#d3869b"; + + thermometer = { + extremelyhot = "#cc241d"; + hot = "#fe8019"; + moderate = "#83a598"; + cold = "#458588"; + extremelycold = "#83a598"; + }; + + hourly = { + time = "#d3869b"; + icon = "#d3869b"; + temperature = "#d3869b"; + }; + }; + }; + + dashboard = { + background.color = "#1d2021"; + card.color = "#282828"; + border.color = "#3c3836"; + + profile = { + name = "#d3869b"; + }; + + powermenu = { + shutdown = "#cc241d"; + restart = "#fe8019"; + logout = "#b8bb26"; + sleep = "#83a598"; + + confirmation = { + card = "#1d2021"; + background = "#1d2021"; + border = "#3c3836"; + label = "#83a598"; + body = "#ebdbb2"; + confirm = "#8ec07b"; + deny = "#d3869b"; + button_text = "#1d2021"; + }; + }; + + shortcuts = { + background = "#83a598"; + text = "#32302f"; + recording = "#b8bb26"; + }; + + controls = { + disabled = "#665c54"; + + wifi = { + background = "#b16286"; + text = "#32302f"; + }; + + bluetooth = { + background = "#83a598"; + text = "#32302f"; + }; + + notifications = { + background = "#fabd2f"; + text = "#32302f"; + }; + + volume = { + background = "#fb4934"; + text = "#32302f"; + }; + + input = { + background = "#d3869b"; + text = "#32302f"; + }; + }; + + directories = { + left = { + top.color = "#d3869b"; + middle.color = "#fabd2f"; + bottom.color = "#fb4934"; + }; + + right = { + top.color = "#8ec07c"; + middle.color = "#b16286"; + bottom.color = "#83a598"; + }; + }; + + monitors = { + bar_background = "#504945"; + + cpu = { + icon = "#fb4934"; + bar = "#fb4934"; + label = "#fb4934"; + }; + + ram = { + icon = "#fabd2f"; + bar = "#fabd2f"; + label = "#fabd2f"; + }; + + gpu = { + icon = "#b8bb26"; + bar = "#b8bb26"; + label = "#b8bb26"; + }; + + disk = { + icon = "#d3869b"; + bar = "#d3869b"; + label = "#d3869b"; + }; + }; + }; + + power = { + background.color = "#1d2021"; + border.color = "#3c3836"; + + buttons = { + shutdown = { + background = "#282828"; + icon_background = "#cc241d"; + text = "#cc241d"; + icon = "#32302f"; + }; + + restart = { + background = "#282828"; + icon_background = "#fe8019"; + text = "#fe8019"; + icon = "#32302f"; + }; + + logout = { + background = "#282828"; + icon_background = "#b8bb26"; + text = "#b8bb26"; + icon = "#32302f"; + }; + + sleep = { + background = "#282828"; + icon_background = "#83a598"; + text = "#83a598"; + icon = "#32302f"; + }; + }; + }; + + notifications = { + background = "#1d2021"; + card = "#282828"; + border = "#3c3836"; + label = "#83a598"; + no_notifications_label = "#3c3836"; + switch_divider = "#504945"; + clear = "#83a598"; + + switch = { + enabled = "#83a598"; + disabled = "#3c3836"; + puck = "#504945"; + }; + + pager = { + background = "#1d2021"; + button = "#83a598"; + label = "#a89984"; + }; + + scrollbar = { + color = "#83a598"; + }; + }; + }; + }; + }; + + osd = { + bar_container = "#1d2021"; + icon_container = "#83a598"; + bar_color = "#83a598"; + bar_empty_color = "#3c3836"; + bar_overflow_color = "#cc241d"; + icon = "#1d2021"; + label = "#83a598"; + }; + + notification = { + background = "#32302f"; + label = "#83a598"; + border = "#3c3836"; + time = "#928374"; + text = "#ebdbb2"; + labelicon = "#83a598"; + + actions = { + background = "#83a598"; + text = "#32302f"; + }; + + close_button = { + background = "#83a598"; + label = "#1d2021"; + }; + }; +} diff --git a/modules/home/hyprland/hyprpaper.nix b/modules/home/hyprland/hyprpaper.nix new file mode 100755 index 0000000..d556cbe --- /dev/null +++ b/modules/home/hyprland/hyprpaper.nix @@ -0,0 +1,29 @@ +{ + config, + pkgs, + inputs, + assets, + ... +}: + +{ + home.packages = [ + pkgs.hyprpaper + ]; + # Home Manager + xdg.configFile."wallpaper.png".source = "${assets}/wallpaper.png"; + services.hyprpaper = { + enable = true; + settings = { + ipc = "on"; + splash = false; + preload = [ + "/home/cartier/.config/wallpaper.png" + ]; + + wallpaper = [ + ", /home/cartier/.config/wallpaper.png" + ]; + }; + }; +} diff --git a/modules/home/hyprland/windowrules.nix b/modules/home/hyprland/windowrules.nix new file mode 100755 index 0000000..e69de29 diff --git a/modules/home/hyprland/wofi.nix b/modules/home/hyprland/wofi.nix new file mode 100755 index 0000000..258968e --- /dev/null +++ b/modules/home/hyprland/wofi.nix @@ -0,0 +1,114 @@ +{ + config, + pkgs, + inputs, + lib, + ... +}: +let + accent = "#${config.lib.stylix.colors.base0D}"; + background = "#${config.lib.stylix.colors.base00}"; + background-alt = "#${config.lib.stylix.colors.base01}"; + foreground = "#${config.lib.stylix.colors.base05}"; + font = config.stylix.fonts.serif.name; +in +{ + home.packages = with pkgs; [ + wofi-emoji + ]; + + programs.wofi = { + enable = true; + + settings = { + allow_markup = true; + width = 650; + show = "drun"; + prompt = "Apps"; + normal_window = true; + layer = "top"; + height = "325px"; + orientation = "vertical"; + halign = "fill"; + line_wrap = "off"; + dynamic_lines = false; + allow_images = true; + image_size = 24; + exec_search = false; + hide_search = false; + parse_search = false; + insensitive = true; + hide_scroll = true; + no_actions = true; + sort_order = "default"; + gtk_dark = true; + filter_rate = 100; + key_expand = "Tab"; + key_exit = "Escape"; + }; + + style = + lib.mkForce + # css + '' + * { + font-family: "${font}"; + font-weight: 600; + font-size: 16px; + } + + #window { + background-color: ${background}; + color: ${foreground}; + border-radius: 0; + } + + #outer-box { + padding: 20px; + } + + #input { + background-color: ${background-alt}; + border: 0px solid ${accent}; + color: ${foreground}; + padding: 8px 12px; + } + + #scroll { + margin-top: 20px; + } + + #inner-box {} + + #img { + padding-right: 8px; + } + + #text { + color: ${foreground}; + } + + #text:selected { + color: ${foreground}; + } + + #entry { + padding: 6px; + } + + #entry:selected { + background-color: ${accent}; + color: ${foreground}; + } + + #unselected {} + + #selected {} + + #input, + #entry:selected { + border-radius: 0; + } + ''; + }; +} diff --git a/modules/system/common/fonts.nix b/modules/system/common/fonts.nix new file mode 100755 index 0000000..8fc14cf --- /dev/null +++ b/modules/system/common/fonts.nix @@ -0,0 +1,22 @@ +{ config, pkgs, ... }: + +{ + fonts.packages = + with pkgs; + [ + nerd-fonts.fira-code + nerd-fonts.sauce-code-pro + # nerd-fonts._Oxproto + nerd-fonts.space-mono + nerd-fonts.droid-sans-mono + noto-fonts-cjk-sans + noto-fonts-emoji + liberation_ttf + fira-code-symbols + mplus-outline-fonts.githubRelease + dina-font + proggyfonts + monaspace + ] + ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts); +} diff --git a/modules/system/common/xdg.nix b/modules/system/common/xdg.nix new file mode 100755 index 0000000..0624071 --- /dev/null +++ b/modules/system/common/xdg.nix @@ -0,0 +1,20 @@ +{ + config, + pkgs, + lib, + inputs, + ... +}: +{ + + # Configure all the xdg stuff so apps work correctly + xdg = { + portal = { + enable = true; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + pkgs.xdg-desktop-portal-hyprland + ]; + }; + }; +} diff --git a/modules/system/device-management/logitech.nix b/modules/system/device-management/logitech.nix new file mode 100755 index 0000000..f7642df --- /dev/null +++ b/modules/system/device-management/logitech.nix @@ -0,0 +1,30 @@ +{ + config, + pkgs, + inputs, + ... +}: + +{ + boot = { + kernelModules = [ "uinput" ]; + }; + + environment = { + systemPackages = with pkgs; [ + solaar # Manage logitech mouse + ]; + }; + + hardware = { + logitech = { + wireless.enable = true; + wireless.enableGraphical = true; + }; + }; + + users.users.cartier.extraGroups = [ + "input" + "plugdev" + ]; +} diff --git a/modules/system/display-manager/gdm.nix b/modules/system/display-manager/gdm.nix new file mode 100755 index 0000000..3060956 --- /dev/null +++ b/modules/system/display-manager/gdm.nix @@ -0,0 +1,13 @@ +{ + config, + pkgs, + inputs, + ... +}: +{ + services.displayManager = { + gdm = { + enable = true; + }; + }; +} diff --git a/modules/system/display-manager/sddm.nix b/modules/system/display-manager/sddm.nix new file mode 100755 index 0000000..7f65bdf --- /dev/null +++ b/modules/system/display-manager/sddm.nix @@ -0,0 +1,63 @@ +{ + config, + pkgs, + inputs, + assets, + ... +}: +let + basePath = "/home/cartier/Documents/wallpapers"; + wallpaper = "Fantasy-Mountain.png"; +in +{ + environment = { + etc = { + "sddm-wallpaper.png".source = "${assets}/sddm-background.png"; + "gtk-3.0/settings.ini".text = '' + [Settings] + gtk-icon-theme-name=Papirus + gtk-theme-name=Adwaita + gtk-cursor-theme-name=Adwaita + ''; + }; + + systemPackages = with pkgs; [ + papirus-icon-theme + (sddm-chili-theme.override { + themeConfig = { + background = "/etc/sddm-wallpaper.png"; + ScreenWidth = "3440"; + ScreenHeight = "1440"; + recursiveBlurLoops = 1; + recursiveBlurRadius = 10; + }; + }) + libsForQt5.qt5.qtgraphicaleffects + ]; + + pathsToLink = [ + "/share/icons" + ]; + + variables = { + GTK_ICON_THEME = "Papirus"; + }; + }; + + programs.dconf.enable = true; + + services.displayManager.sddm = { + enable = true; + wayland.enable = true; + theme = "chili"; + autoNumlock = true; + package = pkgs.libsForQt5.sddm; + extraPackages = with pkgs.libsForQt5.qt5; [ + qtgraphicaleffects + qtquickcontrols2 + qtquickcontrols + qtsvg + qtdeclarative # QtQuick core + ]; + }; +} diff --git a/modules/system/gaming.nix b/modules/system/gaming.nix new file mode 100755 index 0000000..433687f --- /dev/null +++ b/modules/system/gaming.nix @@ -0,0 +1,11 @@ +{ ... }: + +{ + # Install Steam + programs.steam = { + enable = true; + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers + }; +} diff --git a/modules/system/gnome.nix b/modules/system/gnome.nix new file mode 100755 index 0000000..7b0862a --- /dev/null +++ b/modules/system/gnome.nix @@ -0,0 +1,20 @@ +{ + config, + pkgs, + inputs, + ... +}: +{ + services.xserver.enable = true; + services.desktopManager.gnome.enable = true; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + environment.systemPackages = with pkgs; [ + gnome-tweaks + ]; +} diff --git a/modules/system/nfs.nix b/modules/system/nfs.nix new file mode 100755 index 0000000..2de8a4f --- /dev/null +++ b/modules/system/nfs.nix @@ -0,0 +1,51 @@ +{ lib, pkgs, ... }: + +let + nasIp = "10.89.0.15"; + baseMnt = "/mnt/main"; + shares = [ + "backups" + "container-data" + "cartier" + ]; + + configureShare = share: { + name = "/mnt/${share}"; + value = { + device = "${nasIp}:${baseMnt}/${share}"; + fsType = "nfs"; + options = [ + "x-systemd.automount" + "noauto" + "rw" + "vers=4" + + # make Nautilus/Dolphin/Any File Manager show it with a friendly name/icon + "x-gvfs-show" + "x-gvfs-name=NAS — ${share}" + "x-gvfs-icon=network-server" + ]; + }; + }; + + shareConfig = map configureShare shares; + fsConfig = builtins.listToAttrs shareConfig; + +in +{ + # Enable NFS client support + boot.supportedFilesystems = [ "nfs" ]; + services = { + rpcbind.enable = true; # Required for NFS + gvfs.enable = true; + udisks2.enable = true; + }; + + # Add NFS utilities + environment.systemPackages = with pkgs; [ + nfs-utils + ]; + + fileSystems = fsConfig; + systemd.tmpfiles.rules = map (share: "d /mnt/${share} 0755 root root -") shares; +} diff --git a/modules/system/nix-valet.nix b/modules/system/nix-valet.nix new file mode 100755 index 0000000..40da2d4 --- /dev/null +++ b/modules/system/nix-valet.nix @@ -0,0 +1,201 @@ +/* + This module gives the same functionality as laravel valet or valet linux. + + Set up DNSMasq to point all *.test domains to caddy. + + Caddy will look for a folder with the same name in ~/projects and serve it. +*/ +{ + config, + pkgs, + lib, + ... +}: + +{ + services = { + # Enable dnsmasq + dnsmasq = { + enable = true; + settings = { + # Point all .test domains to localhost + address = "/.test/127.0.0.1"; + # Don't forward .test queries to upstream DNS + # server = "/test/"; + # Listen on localhost only + listen-address = "127.0.0.1"; + # Bind to interface + bind-interfaces = true; + # Cache size + cache-size = 1000; + # Don't read /etc/hosts + no-hosts = true; + # Don't poll /etc/resolv.conf + no-poll = true; + }; + }; + + # Enable PHP-FPM + # phpfpm = { + # pools.www = { + # user = "cartier"; + # group = "users"; + # settings = { + # "listen.owner" = "cartier"; + # "listen.group" = "users"; + # "listen.mode" = "0660"; + # "pm" = "dynamic"; + # "pm.max_children" = 32; + # "pm.start_servers" = 2; + # "pm.min_spare_servers" = 2; + # "pm.max_spare_servers" = 4; + # "pm.max_requests" = 500; + # }; + # phpEnv."PATH" = lib.makeBinPath [ pkgs.php ]; + # }; + # }; + + # Enable Caddy + caddy = { + enable = true; + package = pkgs.frankenphp; + globalConfig = '' + auto_https off + frankenphp + debug + order php_server before file_server + ''; + /* + WORKING CONFIG + map {host} {pname} { + ~^(.+)\.test$ $1 + default "unknown" + } + root * /home/cartier/projects/{pname}/public + + # Add file server directive with browse enabled for debugging + file_server browse + + # Or for PHP apps, add try_files + try_files {path} {path}/ /index.php?{query} + + php_server + */ + extraConfig = '' + # Specific subdomain first (more specific routes come first) + http://caddytest.test { + respond "fuck" + } + + http://*.test, http://*.*.test { + map {host} {project_dir} { + ~^(.+)\.test$ $1 + default "unknown" + } + + vars base_path "/home/cartier/projects/{project_dir}" + + @laravel file { + root {vars.base_path}/public + try_files index.php + } + + @jigsaw file { + root {vars.base_path}/build_local + try_files index.html + } + + handle @laravel { + root * {vars.base_path}/public + php_server + file_server + + try_files {path} {path}/ /index.php?{query} + } + + handle @jigsaw { + root * {vars.base_path}/build_local + try_files {path} {path}/ /index.html + file_server + } + + handle { + respond "Unknown project type" + } + } + ''; + }; + + # Configure system to use local dnsmasq for .test domains + resolved = { + enable = true; + domains = [ "~test" ]; + fallbackDns = [ + "10.89.0.1" + # "8.8.8.8" + # "1.1.1.1" + ]; + extraConfig = '' + DNS=127.0.0.1#53 + Domains=~test + DNSSEC=false + ''; + }; + }; + + # Install PHP and related packages + environment.systemPackages = with pkgs; [ + # Add common PHP extensions you might need + php84Extensions.mbstring + php84Extensions.xml + php84Extensions.curl + php84Extensions.zip + php84Extensions.gd + php84Extensions.intl + php84Extensions.bcmath + php84Extensions.soap + php84Extensions.mysqli + php84Extensions.pdo_mysql + php84Extensions.pgsql + php84Extensions.pdo_sqlite + ]; + + # Create a dedicated caddy config directory + systemd.tmpfiles.rules = [ + "d /var/lib/caddy 0755 cartier users -" + ]; + + systemd.services.caddy = { + serviceConfig = { + User = lib.mkForce "cartier"; + Group = lib.mkForce "users"; + + ProtectHome = lib.mkForce false; # This is key! + ProtectSystem = lib.mkForce false; + PrivateTmp = lib.mkForce false; + + # More comprehensive capabilities + AmbientCapabilities = [ + "CAP_NET_BIND_SERVICE" + "CAP_SETUID" + "CAP_SETGID" + ]; + CapabilityBoundingSet = [ + "CAP_NET_BIND_SERVICE" + "CAP_SETUID" + "CAP_SETGID" + ]; + # Keep it simple - just set the config directory + Environment = [ "XDG_CONFIG_HOME=/var/lib/caddy" ]; + # Ensure the working directory is accessible + WorkingDirectory = "/var/lib/caddy"; + }; + }; + + # And make sure your user is in the caddy group + users.users.cartier = { + extraGroups = [ + "users" + ]; + }; +} diff --git a/modules/system/nvidia.nix b/modules/system/nvidia.nix new file mode 100755 index 0000000..70215c3 --- /dev/null +++ b/modules/system/nvidia.nix @@ -0,0 +1,25 @@ +{ config, pkgs, ... }: + +{ + nixpkgs.config.allowUnfree = true; + + hardware.graphics = { + enable = true; + enable32Bit = true; # steam/wine + }; + + services.xserver.videoDrivers = [ "nvidia" ]; + + boot.blacklistedKernelModules = [ "nouveau" ]; + + hardware.nvidia = { + modesetting.enable = true; + nvidiaSettings = true; + open = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + powerManagement.enable = false; + powerManagement.finegrained = false; + }; + + boot.kernelParams = [ "nvidia_drm.modeset=1" ]; +} diff --git a/screenshot.png b/screenshot.png new file mode 100755 index 0000000..d6c72ae Binary files /dev/null and b/screenshot.png differ