From eb5f9ef7da97714e72d7aa79fb39ab8d875b7b2b Mon Sep 17 00:00:00 2001 From: theArctesian Date: Wed, 24 Sep 2025 17:59:50 -0700 Subject: [PATCH] letting it auto run pretty much, god i don't know how to program anymore. This is kinda a joke --- README.md | 4 + configuration.nix | 58 +- flake.lock | 1096 ++++++++++++++++++++++++++++++++ flake.nix | 19 +- home.nix | 25 +- modules/colors.nix | 146 +++++ modules/core.nix | 190 +++++- modules/desktop/hyprland.nix | 12 +- modules/development.nix | 187 +++--- modules/hardware/amd.nix | 35 + modules/hardware/audio.nix | 42 ++ modules/hardware/bluetooth.nix | 45 ++ modules/hardware/default.nix | 29 +- modules/hardware/intel.nix | 39 ++ modules/hardware/nvidia.nix | 35 + modules/hardware/touchpad.nix | 45 ++ modules/helpers.nix | 125 ++++ modules/lib.nix | 195 ++++++ modules/packages.nix | 61 +- modules/services.nix | 36 +- modules/themes/tokyo-night.nix | 84 ++- modules/users.nix | 7 +- 22 files changed, 2253 insertions(+), 262 deletions(-) create mode 100644 flake.lock create mode 100644 modules/colors.nix create mode 100644 modules/hardware/amd.nix create mode 100644 modules/hardware/audio.nix create mode 100644 modules/hardware/bluetooth.nix create mode 100644 modules/hardware/intel.nix create mode 100644 modules/hardware/nvidia.nix create mode 100644 modules/hardware/touchpad.nix create mode 100644 modules/helpers.nix create mode 100644 modules/lib.nix diff --git a/README.md b/README.md index 4be3d94..d9b1ca0 100644 --- a/README.md +++ b/README.md @@ -306,6 +306,10 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file - Theme configurations adapted from community themes and color schemes - [Nix Flakes](https://nixos.wiki/wiki/Flakes) - for reproducible and composable configurations +## ๐Ÿ”— Similar Projects + +- [Omarchy Nix](https://github.com/henrysipp/omarchy-nix) - Another NixOS implementation of DHH's Omarchy with automatic theme generation from wallpapers + ## ๐Ÿ”— Links - [NixOS Manual](https://nixos.org/manual/nixos/stable/) - Official NixOS documentation diff --git a/configuration.nix b/configuration.nix index 23a52e5..da59d8c 100644 --- a/configuration.nix +++ b/configuration.nix @@ -16,8 +16,10 @@ in # Include the results of the hardware scan ./hardware-configuration.nix - # Omarchy modules + # OmniXY modules (lib must be first to provide helpers) + ./modules/lib.nix ./modules/core.nix + ./modules/colors.nix ./modules/desktop/hyprland.nix ./modules/packages.nix ./modules/development.nix @@ -27,6 +29,9 @@ in ./modules/hardware ]; + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + # Enable flakes nix = { settings = { @@ -67,8 +72,8 @@ in # Plymouth for boot splash plymouth = { enable = true; - theme = "omnixy"; - themePackages = [ (pkgs.callPackage ./packages/plymouth-theme.nix {}) ]; + theme = "bgrt"; # Use default theme for now + # themePackages = [ (pkgs.callPackage ./packages/plymouth-theme.nix {}) ]; }; # Kernel @@ -104,8 +109,7 @@ in }; }; - # Sound - sound.enable = true; + # Sound (deprecated option removed) hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { @@ -121,13 +125,8 @@ in enable = true; excludePackages = [ pkgs.xterm ]; - # Display manager - displayManager = { - gdm = { - enable = true; - wayland = true; - }; - }; + # Display manager disabled - using tuigreet in services.nix + displayManager.gdm.enable = false; }; # Console configuration @@ -146,14 +145,37 @@ in # Custom OmniXY settings omnixy = { enable = true; + user = "user"; # Change this to your username theme = currentTheme; + displayManager = "tuigreet"; - # Feature flags - features = { - docker = true; - development = true; - gaming = false; - multimedia = true; + # Quick Setup - Choose a preset that matches your use case + preset = "developer"; # Options: minimal, developer, creator, gamer, office, everything + + # Color scheme configuration (optional) + # Uncomment and customize these options for automatic color generation: + # colorScheme = inputs.nix-colors.colorSchemes.tokyo-night-dark; + # wallpaper = /path/to/your/wallpaper.jpg; + + # Fine-grained feature control (overrides preset settings) + # Uncomment and customize as needed: + # features = { + # coding = true; # Development tools, editors, programming languages + # containers = true; # Docker and container support + # gaming = false; # Steam, Wine, gaming performance tools + # media = true; # Video players, image viewers, media editing + # office = false; # Office suite, PDF viewers, productivity apps + # communication = false; # Chat apps, email, video conferencing + # virtualization = false; # VirtualBox, QEMU, VM tools + # backup = false; # Backup tools, cloud sync + # customThemes = true; # Advanced theming with nix-colors + # wallpaperEffects = true; # Dynamic wallpapers and color generation + # }; + + # Package management + packages = { + # Example: Exclude specific packages you don't want + # exclude = [ "discord" "spotify" "steam" "teams" ]; }; }; } \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..875841b --- /dev/null +++ b/flake.lock @@ -0,0 +1,1096 @@ +{ + "nodes": { + "aquamarine": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1755946532, + "narHash": "sha256-POePremlUY5GyA1zfbtic6XLxDaQcqHN6l+bIxdT5gc=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "81584dae2df6ac79f6b6dae0ecb7705e95129ada", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1755819240, + "narHash": "sha256-qcMhnL7aGAuFuutH4rq9fvAhCpJWVHLcHVZLtPctPlo=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "75ed5e5e3fce37df22e49125181fa37899c3ccd6", + "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-schemes": { + "flake": false, + "locked": { + "lastModified": 1696158499, + "narHash": "sha256-5yIHgDTPjoX/3oDEfLSQ0eJZdFL1SaCfb9d6M0RmOTM=", + "owner": "tinted-theming", + "repo": "base16-schemes", + "rev": "a9112eaae86d9dd8ee6bb9445b664fba2f94037a", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-schemes", + "type": "github" + } + }, + "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": 1756083905, + "narHash": "sha256-UqYGTBgI5ypGh0Kf6zZjom/vABg7HQocB4gmxzl12uo=", + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "rev": "b655eaf16d4cbec9c3472f62eee285d4b419a808", + "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-compat_3": { + "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": 1756770412, + "narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "4524271976b625a4a605beefd893f270620fd751", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "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-parts_3": { + "inputs": { + "nixpkgs-lib": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756770412, + "narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "4524271976b625a4a605beefd893f270620fd751", + "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_3", + "gitignore": "gitignore_2", + "nixpkgs": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1758108966, + "narHash": "sha256-ytw7ROXaWZ7OfwHrQ9xvjpUWeGVm86pwnEd1QhzawIo=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "54df955a695a84cd47d4a43e08e1feaf90b1fd9b", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "hyprland", + "pre-commit-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" + } + }, + "gitignore_2": { + "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": [ + "neovim-nightly-overlay", + "flake-parts" + ], + "nixpkgs": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1758022363, + "narHash": "sha256-ENUhCRWgSX4ni751HieNuQoq06dJvApV/Nm89kh+/A0=", + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "rev": "1a3667d33e247ad35ca250698d63f49a5453d824", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1758748290, + "narHash": "sha256-/U2axzLmPgJb/0J+vQ4XmS++72VZWxJnDblwqTyGmEk=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "2e260431fca7a782e0d0591985f2040944b43541", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1753964049, + "narHash": "sha256-lIqabfBY7z/OANxHoPeIrDJrFyYy9jAM4GQLzZ2feCM=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "44e91d467bdad8dcf8bbd2ac7cf49972540980a5", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprgraphics": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1758192433, + "narHash": "sha256-CR6RnqEJSTiFgA6KQY4TTLUWbZ8RBnb+hxQqesuQNzQ=", + "owner": "hyprwm", + "repo": "hyprgraphics", + "rev": "c44e749dd611521dee940d00f7c444ee0ae4cfb7", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprgraphics", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "aquamarine": "aquamarine", + "hyprcursor": "hyprcursor", + "hyprgraphics": "hyprgraphics", + "hyprland-protocols": "hyprland-protocols", + "hyprland-qtutils": "hyprland-qtutils", + "hyprlang": "hyprlang", + "hyprutils": "hyprutils", + "hyprwayland-scanner": "hyprwayland-scanner", + "nixpkgs": [ + "nixpkgs" + ], + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1758654510, + "narHash": "sha256-V4hLuM9uB4ecz0sFnnrt0idxpw0kGIw+6tLmBw2X0u8=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "ec9a72d9fbe8372c4cc4e86966f6b13d178b0bba", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-plugins": { + "inputs": { + "hyprland": [ + "hyprland" + ], + "nixpkgs": [ + "hyprland-plugins", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland-plugins", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1758650429, + "narHash": "sha256-tQLvuUu/8p9yEerYz+mcsSW7VNd7Z4vuSd4LGF8Y38w=", + "owner": "hyprwm", + "repo": "hyprland-plugins", + "rev": "1e3fa62428728bdc2d040f65afe98de1ae01c6b5", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-plugins", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1749046714, + "narHash": "sha256-kymV5FMnddYGI+UjwIw8ceDjdeg7ToDVjbHCvUlhn14=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "613878cb6f459c5e323aaafe1e6f388ac8a36330", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprland-qt-support": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprland-qtutils", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "hyprland-qtutils", + "nixpkgs" + ], + "systems": [ + "hyprland", + "hyprland-qtutils", + "systems" + ] + }, + "locked": { + "lastModified": 1749154592, + "narHash": "sha256-DO7z5CeT/ddSGDEnK9mAXm1qlGL47L3VAHLlLXoCjhE=", + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "rev": "4c8053c3c888138a30c3a6c45c2e45f5484f2074", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "type": "github" + } + }, + "hyprland-qtutils": { + "inputs": { + "hyprland-qt-support": "hyprland-qt-support", + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprland", + "hyprland-qtutils", + "hyprlang", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1757694755, + "narHash": "sha256-j+w5QUUr2QT/jkxgVKecGYV8J7fpzXCMgzEEr6LG9ug=", + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "rev": "5ffdfc13ed03df1dae5084468d935f0a3f2c9a4c", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1756810301, + "narHash": "sha256-wgZ3VW4VVtjK5dr0EiK9zKdJ/SOqGIBXVG85C3LVxQA=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "3d63fb4a42c819f198deabd18c0c2c1ded1de931", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1756117388, + "narHash": "sha256-oRDel6pNl/T2tI+nc/USU9ZP9w08dxtl7hiZxa0C/Wc=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "b2ae3204845f5f2f79b4703b441252d8ad2ecfd0", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1755184602, + "narHash": "sha256-RCBQN8xuADB0LEgaKbfRqwm6CdyopE1xIEhNc67FAbw=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "b3b0f1f40ae09d4447c20608e5a4faf8bf3c492d", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, + "neovim-nightly-overlay": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-parts": "flake-parts", + "git-hooks": "git-hooks", + "hercules-ci-effects": "hercules-ci-effects", + "neovim-src": "neovim-src", + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1758706325, + "narHash": "sha256-GWOpbBQuNrLvAK/BKr8btMj1iXjG0U9ipLq8qM9vZHY=", + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "rev": "0460f3bf0a042b41b7d83f778ce198cce9684abc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "type": "github" + } + }, + "neovim-src": { + "flake": false, + "locked": { + "lastModified": 1758670142, + "narHash": "sha256-JpH1MjRBPEOdgkfH9wmOwUvAudnL55KG63V6O51Lyn8=", + "owner": "neovim", + "repo": "neovim", + "rev": "b986fd96bc8d9ef8739efd9c5c4221f04a2c3463", + "type": "github" + }, + "original": { + "owner": "neovim", + "repo": "neovim", + "type": "github" + } + }, + "nix-colors": { + "inputs": { + "base16-schemes": "base16-schemes", + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1707825078, + "narHash": "sha256-hTfge2J2W+42SZ7VHXkf4kjU+qzFqPeC9k66jAUBMHk=", + "owner": "misterio77", + "repo": "nix-colors", + "rev": "b01f024090d2c4fc3152cd0cf12027a7b8453ba1", + "type": "github" + }, + "original": { + "owner": "misterio77", + "repo": "nix-colors", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1758427187, + "narHash": "sha256-pHpxZ/IyCwoTQPtFIAG2QaxuSm8jWzrzBGjwQZIttJc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "554be6495561ff07b6c724047bdd7e0716aa7b46", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1697935651, + "narHash": "sha256-qOfWjQ2JQSQL15KLh6D7xQhx0qgZlYZTYlcEiRuAMMw=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "e1e11fdbb01113d85c7f41cada9d2847660e3902", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1735563628, + "narHash": "sha256-OnSAY7XDSx7CtDoqNh8jwVwh4xNL/2HaJxGjryLWzX8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b134951a4c9f3c995fd7be05f3243f8ecd65d798", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1758427187, + "narHash": "sha256-pHpxZ/IyCwoTQPtFIAG2QaxuSm8jWzrzBGjwQZIttJc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "554be6495561ff07b6c724047bdd7e0716aa7b46", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nur": { + "inputs": { + "flake-parts": "flake-parts_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1758753194, + "narHash": "sha256-gIfCr49XDxDRwTlB4ibWebYRqfCqTWIa/LNZznPrSZ0=", + "owner": "nix-community", + "repo": "NUR", + "rev": "86cfcc7004c4d2bc719b4095289c90450b4b41f3", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "nur_2": { + "inputs": { + "flake-parts": [ + "stylix", + "flake-parts" + ], + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756961635, + "narHash": "sha256-hETvQcILTg5kChjYNns1fD5ELdsYB/VVgVmBtqKQj9A=", + "owner": "nix-community", + "repo": "NUR", + "rev": "6ca27b2654ac55e3f6e0ca434c1b4589ae22b370", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1758108966, + "narHash": "sha256-ytw7ROXaWZ7OfwHrQ9xvjpUWeGVm86pwnEd1QhzawIo=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "54df955a695a84cd47d4a43e08e1feaf90b1fd9b", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "hyprland": "hyprland", + "hyprland-plugins": "hyprland-plugins", + "neovim-nightly-overlay": "neovim-nightly-overlay", + "nix-colors": "nix-colors", + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable", + "nur": "nur", + "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_2", + "systems": "systems_2", + "tinted-foot": "tinted-foot", + "tinted-kitty": "tinted-kitty", + "tinted-schemes": "tinted-schemes", + "tinted-tmux": "tinted-tmux", + "tinted-zed": "tinted-zed" + }, + "locked": { + "lastModified": 1758750998, + "narHash": "sha256-Ho8CaZj/UwBF+QJDIAmA6KL9bPJRvLj5FxUOvbeuUfw=", + "owner": "danth", + "repo": "stylix", + "rev": "1284c1891b72c8670164eefe602300fe2d87f0cb", + "type": "github" + }, + "original": { + "owner": "danth", + "repo": "stylix", + "type": "github" + } + }, + "systems": { + "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_2": { + "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": 1754779259, + "narHash": "sha256-8KG2lXGaXLUE0F/JVwLQe7kOVm21IDfNEo0gfga5P4M=", + "owner": "tinted-theming", + "repo": "schemes", + "rev": "097d751b9e3c8b97ce158e7d141e5a292545b502", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "schemes", + "type": "github" + } + }, + "tinted-tmux": { + "flake": false, + "locked": { + "lastModified": 1754788770, + "narHash": "sha256-LAu5nBr7pM/jD9jwFc6/kyFY4h7Us4bZz7dvVvehuwo=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "fb2175accef8935f6955503ec9dd3c973eec385c", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" + } + }, + "tinted-zed": { + "flake": false, + "locked": { + "lastModified": 1755613540, + "narHash": "sha256-zBFrrTxHLDMDX/OYxkCwGGbAhPXLi8FrnLhYLsSOKeY=", + "owner": "tinted-theming", + "repo": "base16-zed", + "rev": "937bada16cd3200bdbd3a2f5776fc3b686d5cba0", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-zed", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1758206697, + "narHash": "sha256-/DbPkh6PZOgfueCbs3uzlk4ASU2nPPsiVWhpMCNkAd0=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "128222dc911b8e2e18939537bed1762b7f3a04aa", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1755354946, + "narHash": "sha256-zdov5f/GcoLQc9qYIS1dUTqtJMeDqmBmo59PAxze6e4=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "a10726d6a8d0ef1a0c645378f983b6278c42eaa0", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 43097fe..357d5df 100644 --- a/flake.nix +++ b/flake.nix @@ -24,15 +24,17 @@ inputs.hyprland.follows = "hyprland"; }; + # Nix colors for automatic color scheme generation + nix-colors = { + url = "github:misterio77/nix-colors"; + }; + # Stylix for theming stylix = { url = "github:danth/stylix"; inputs.nixpkgs.follows = "nixpkgs"; }; - # Nix colors - nix-colors.url = "github:misterio77/nix-colors"; - # Neovim nightly neovim-nightly-overlay = { url = "github:nix-community/neovim-nightly-overlay"; @@ -53,8 +55,8 @@ allowUnfree = true; }; overlays = [ - inputs.nur.overlay - inputs.neovim-nightly-overlay.overlay + inputs.nur.overlays.default + inputs.neovim-nightly-overlay.overlays.default ]; }; in @@ -76,6 +78,9 @@ # Replace with your username user = import ./home.nix; }; + sharedModules = [ + inputs.nix-colors.homeManagerModules.default + ]; }; } ]; @@ -178,8 +183,8 @@ # OmniXY scripts as packages omnixy-scripts = pkgs.callPackage ./packages/scripts.nix {}; - # Plymouth theme - plymouth-theme-omnixy = pkgs.callPackage ./packages/plymouth-theme.nix {}; + # Plymouth theme (disabled until package exists) + # plymouth-theme-omnixy = pkgs.callPackage ./packages/plymouth-theme.nix {}; }; # Apps that can be run diff --git a/home.nix b/home.nix index 3fdc074..8790a1f 100644 --- a/home.nix +++ b/home.nix @@ -16,6 +16,7 @@ # Packages to install home.packages = with pkgs; [ # Terminal utilities + ghostty alacritty kitty wezterm @@ -37,7 +38,7 @@ # System monitoring btop htop - nvtop + nvtopPackages.full # Media mpv @@ -84,7 +85,9 @@ wev # Fonts - (nerdfonts.override { fonts = [ "JetBrainsMono" "FiraCode" "Hack" ]; }) + nerd-fonts.jetbrains-mono + nerd-fonts.fira-code + nerd-fonts.hack noto-fonts noto-fonts-emoji liberation_ttf @@ -182,23 +185,23 @@ ''; character = { - success_symbol = "[โžœ](bold green)"; - error_symbol = "[โžœ](bold red)"; + success_symbol = lib.mkDefault "[โžœ](bold green)"; + error_symbol = lib.mkDefault "[โžœ](bold red)"; }; directory = { truncation_length = 3; truncate_to_repo = true; - style = "bold cyan"; + style = lib.mkDefault "bold cyan"; }; git_branch = { - style = "bold purple"; + style = lib.mkDefault "bold purple"; symbol = " "; }; git_status = { - style = "bold red"; + style = lib.mkDefault "bold red"; ahead = "โ‡ก\${count}"; diverged = "โ‡•โ‡ก\${ahead_count}โ‡ฃ\${behind_count}"; behind = "โ‡ฃ\${count}"; @@ -298,7 +301,7 @@ ]; userSettings = { - "workbench.colorTheme" = "One Dark Pro"; + "workbench.colorTheme" = lib.mkDefault "One Dark Pro"; "workbench.iconTheme" = "material-icon-theme"; "editor.fontFamily" = "'JetBrainsMono Nerd Font', monospace"; "editor.fontSize" = 14; @@ -377,10 +380,10 @@ gtk = { enable = true; theme = { - name = "Catppuccin-Mocha-Standard-Blue-dark"; - package = pkgs.catppuccin-gtk.override { + name = lib.mkDefault "Catppuccin-Mocha-Standard-Blue-dark"; + package = lib.mkDefault (pkgs.catppuccin-gtk.override { variant = "mocha"; - }; + }); }; iconTheme = { name = "Papirus-Dark"; diff --git a/modules/colors.nix b/modules/colors.nix new file mode 100644 index 0000000..d5ad3fc --- /dev/null +++ b/modules/colors.nix @@ -0,0 +1,146 @@ +{ config, pkgs, lib, inputs, ... }: + +with lib; + +let + cfg = config.omnixy; + omnixy = import ./helpers.nix { inherit config pkgs lib; }; + + # Function to generate colors from wallpaper using imagemagick + generateColorsFromWallpaper = wallpaperPath: pkgs.writeShellScriptBin "generate-colors" '' + #!/usr/bin/env bash + + # Extract dominant colors from wallpaper using imagemagick + colors=$(${pkgs.imagemagick}/bin/convert "${wallpaperPath}" -resize 1x1 -format "%[pixel:u]" info:) + + # Generate a simple color scheme based on the dominant color + # This is a simplified approach - ideally would use a more sophisticated algorithm + echo "# Generated color scheme from wallpaper: ${wallpaperPath}" + echo "# Dominant color: $colors" + + # For now, we'll use predefined schemes that match common wallpaper types + # In a real implementation, this would analyze the image and generate appropriate colors + ''; + + # Default color schemes for common wallpaper types + fallbackColorSchemes = { + dark = inputs.nix-colors.colorSchemes.tokyo-night-dark or null; + light = inputs.nix-colors.colorSchemes.tokyo-night-light or null; + blue = inputs.nix-colors.colorSchemes.nord or null; + purple = inputs.nix-colors.colorSchemes.catppuccin-mocha or null; + green = inputs.nix-colors.colorSchemes.gruvbox-dark-medium or null; + }; + + # Select color scheme based on wallpaper or user preference + selectedColorScheme = + if cfg.colorScheme != null then + cfg.colorScheme + else if cfg.wallpaper != null && cfg.features.autoColors then + # TODO: Implement actual color analysis + # For now, use a sensible default based on theme + fallbackColorSchemes.${cfg.theme} or fallbackColorSchemes.dark + else + # Use theme-based color scheme + fallbackColorSchemes.${cfg.theme} or fallbackColorSchemes.dark; + +in +{ + config = mkIf (cfg.enable or true) (mkMerge [ + # User-specific configuration using shared helpers + (omnixy.forUser (mkIf (selectedColorScheme != null) { + colorScheme = selectedColorScheme; + + # Add packages for color management + home.packages = omnixy.filterPackages (with pkgs; [ + imagemagick # For color extraction from images + ] ++ optionals (omnixy.isEnabled "customThemes" || omnixy.isEnabled "wallpaperEffects") [ + # Additional packages for advanced color analysis + python3Packages.pillow # For more sophisticated image analysis + python3Packages.colorthief # For extracting color palettes + ] ++ optionals (cfg.wallpaper != null) [ + # Generate wallpaper setter script that respects colors + (omnixy.makeScript "set-omnixy-wallpaper" "Set wallpaper with automatic color generation" '' + WALLPAPER_PATH="${cfg.wallpaper}" + + echo "Setting wallpaper: $WALLPAPER_PATH" + + # Set wallpaper with swww + if command -v swww &> /dev/null; then + swww img "$WALLPAPER_PATH" --transition-type wipe --transition-angle 30 --transition-step 90 + else + echo "swww not found, please install swww for wallpaper support" + fi + + # Optionally generate new colors from wallpaper + ${optionalString (omnixy.isEnabled "wallpaperEffects") '' + echo "Generating colors from wallpaper..." + # This would trigger a system rebuild with new colors + # For now, just notify the user + echo "Note: Automatic color generation requires system rebuild" + echo "Consider adding this wallpaper to your configuration and rebuilding" + ''} + '') + ]); + })) + + # System-level configuration + { + + # System-level packages for color management + environment.systemPackages = with pkgs; [ + # Color utilities + imagemagick + + # Wallpaper utilities + swww # Wayland wallpaper daemon + + # Script to help users set up automatic colors + (writeShellScriptBin "omnixy-setup-colors" '' + #!/usr/bin/env bash + + echo "OmniXY Color Setup" + echo "==================" + echo "" + echo "Current configuration:" + echo " Theme: ${cfg.theme}" + echo " Preset: ${if cfg.preset != null then cfg.preset else "none"}" + echo " Custom Themes: ${if cfg.features.customThemes or false then "enabled" else "disabled"}" + echo " Wallpaper Effects: ${if cfg.features.wallpaperEffects or false then "enabled" else "disabled"}" + echo " Wallpaper: ${if cfg.wallpaper != null then toString cfg.wallpaper else "not set"}" + echo " Color Scheme: ${if cfg.colorScheme != null then "custom" else "theme-based"}" + echo "" + + ${optionalString (!(cfg.features.wallpaperEffects or false)) '' + echo "To enable automatic color generation:" + echo " 1. Set omnixy.features.wallpaperEffects = true; in your configuration" + echo " 2. Set omnixy.wallpaper = /path/to/your/wallpaper.jpg;" + echo " 3. Rebuild your system with: omnixy-rebuild" + echo "" + ''} + + ${optionalString ((cfg.features.wallpaperEffects or false) && cfg.wallpaper == null) '' + echo "Wallpaper effects are enabled but no wallpaper is set." + echo "Set omnixy.wallpaper = /path/to/your/wallpaper.jpg; in your configuration." + echo "" + ''} + + echo "Available nix-colors schemes:" + echo " - tokyo-night-dark, tokyo-night-light" + echo " - catppuccin-mocha, catppuccin-latte" + echo " - gruvbox-dark-medium, gruvbox-light-medium" + echo " - nord" + echo " - everforest-dark-medium" + echo " - rose-pine, rose-pine-dawn" + echo "" + echo "To use a specific scheme:" + echo ' omnixy.colorScheme = inputs.nix-colors.colorSchemes.SCHEME_NAME;' + '') + ]; + + # Export color information for other modules to use + environment.variables = mkIf (selectedColorScheme != null) { + OMNIXY_COLOR_SCHEME = selectedColorScheme.slug or "unknown"; + }; + } + ]); +} \ No newline at end of file diff --git a/modules/core.nix b/modules/core.nix index 6370b80..9d015f6 100644 --- a/modules/core.nix +++ b/modules/core.nix @@ -9,27 +9,130 @@ in options.omnixy = { enable = mkEnableOption "OmniXY system configuration"; + # User Configuration user = mkOption { type = types.str; default = "user"; description = "Primary user for the system"; + example = "john"; }; + # Theme Configuration theme = mkOption { type = types.enum [ "tokyo-night" "catppuccin" "gruvbox" "nord" "everforest" "rose-pine" "kanagawa" ]; default = "tokyo-night"; - description = "System theme"; + description = "System theme - changes colors, wallpaper, and overall look"; + example = "catppuccin"; }; + # User-friendly theme aliases + darkMode = mkOption { + type = types.bool; + default = true; + description = "Use dark theme variant when available"; + }; + + displayManager = mkOption { + type = types.enum [ "gdm" "tuigreet" ]; + default = "tuigreet"; + description = "Display manager to use for login"; + }; + + colorScheme = mkOption { + type = types.nullOr types.attrs; + default = null; + description = "Color scheme from nix-colors. If null, uses theme-specific colors."; + example = "inputs.nix-colors.colorSchemes.tokyo-night-dark"; + }; + + wallpaper = mkOption { + type = types.nullOr types.path; + default = null; + description = "Path to wallpaper for automatic color generation"; + }; + + # Feature Categories - Simple on/off switches for major functionality features = { - docker = mkEnableOption "Docker container support"; - development = mkEnableOption "Development tools and environments"; - gaming = mkEnableOption "Gaming support (Steam, Wine, etc.)"; - multimedia = mkEnableOption "Multimedia applications"; + # Development + coding = mkEnableOption "Development tools, editors, and programming languages"; + containers = mkEnableOption "Docker and container support"; + + # Entertainment + gaming = mkEnableOption "Gaming support with Steam, Wine, and performance tools"; + media = mkEnableOption "Video players, image viewers, and media editing tools"; + + # Productivity + office = mkEnableOption "Office suite, PDF viewers, and productivity apps"; + communication = mkEnableOption "Chat apps, email clients, and video conferencing"; + + # System + virtualization = mkEnableOption "VM support (VirtualBox, QEMU, etc.)"; + backup = mkEnableOption "Backup tools and cloud sync applications"; + + # Appearance + customThemes = mkEnableOption "Advanced theming with nix-colors integration"; + wallpaperEffects = mkEnableOption "Dynamic wallpapers and color generation"; + }; + + # Simple Presets - Predefined feature combinations + preset = mkOption { + type = types.nullOr (types.enum [ "minimal" "developer" "creator" "gamer" "office" "everything" ]); + default = null; + description = '' + Quick setup preset that automatically enables related features: + - minimal: Just the basics (browser, terminal, file manager) + - developer: Coding tools, containers, git, IDEs + - creator: Media editing, design tools, content creation + - gamer: Gaming support, performance tools, Discord + - office: Productivity apps, office suite, communication + - everything: All features enabled + ''; + example = "developer"; }; }; config = mkIf cfg.enable { + # Apply preset configurations automatically + omnixy.features = mkMerge [ + # Default features based on preset + (mkIf (cfg.preset == "minimal") { + # Only basic features + }) + (mkIf (cfg.preset == "developer") { + coding = mkDefault true; + containers = mkDefault true; + customThemes = mkDefault true; + }) + (mkIf (cfg.preset == "creator") { + media = mkDefault true; + office = mkDefault true; + customThemes = mkDefault true; + wallpaperEffects = mkDefault true; + }) + (mkIf (cfg.preset == "gamer") { + gaming = mkDefault true; + media = mkDefault true; + communication = mkDefault true; + }) + (mkIf (cfg.preset == "office") { + office = mkDefault true; + communication = mkDefault true; + backup = mkDefault true; + }) + (mkIf (cfg.preset == "everything") { + coding = mkDefault true; + containers = mkDefault true; + gaming = mkDefault true; + media = mkDefault true; + office = mkDefault true; + communication = mkDefault true; + virtualization = mkDefault true; + backup = mkDefault true; + customThemes = mkDefault true; + wallpaperEffects = mkDefault true; + }) + ]; + # Basic system configuration system.autoUpgrade = { enable = true; @@ -42,7 +145,7 @@ in documentation = { enable = true; man.enable = true; - dev.enable = cfg.features.development; + dev.enable = cfg.features.coding or false; }; # Security settings @@ -106,8 +209,6 @@ in }; }; - # Enable flatpak support - flatpak.enable = true; # System monitoring smartd = { @@ -126,8 +227,6 @@ in # OpenGL support opengl = { enable = true; - driSupport = true; - driSupport32Bit = true; extraPackages = with pkgs; [ intel-media-driver vaapiIntel @@ -138,7 +237,7 @@ in }; # Docker configuration - virtualisation = mkIf cfg.features.docker { + virtualisation = mkIf (cfg.features.containers or false) { docker = { enable = true; enableOnBoot = true; @@ -149,21 +248,24 @@ in }; }; - # Development configuration - programs = mkIf cfg.features.development { - git = { + # Programs configuration + programs = { + # Development programs + git = mkIf (cfg.features.coding or false) { enable = true; lfs.enable = true; }; - npm.enable = true; - }; + npm = mkIf (cfg.features.coding or false) { + enable = true; + }; - # Gaming configuration - programs.steam = mkIf cfg.features.gaming { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; + # Gaming configuration + steam = mkIf (cfg.features.gaming or false) { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + }; }; # Environment variables @@ -279,7 +381,7 @@ in # Development basics git - make + gnumake gcc # Nix tools @@ -290,20 +392,40 @@ in # Custom OmniXY scripts (writeShellScriptBin "omnixy-info" '' #!/usr/bin/env bash - echo "OmniXY NixOS" - echo "============" - echo "Version: ${config.omnixy.version or "1.0.0"}" - echo "Theme: ${cfg.theme}" - echo "User: ${cfg.user}" + echo "๐ŸŒŸ OmniXY NixOS Configuration" + echo "=============================" echo "" - echo "Features:" - echo " Docker: ${if cfg.features.docker then "โœ“" else "โœ—"}" - echo " Development: ${if cfg.features.development then "โœ“" else "โœ—"}" - echo " Gaming: ${if cfg.features.gaming then "โœ“" else "โœ—"}" - echo " Multimedia: ${if cfg.features.multimedia then "โœ“" else "โœ—"}" + echo "๐Ÿ“‹ Basic Settings:" + echo " User: ${cfg.user}" + echo " Theme: ${cfg.theme}" + echo " Preset: ${if cfg.preset != null then cfg.preset else "custom"}" + echo " Display Manager: ${cfg.displayManager}" echo "" - echo "System Info:" - nixos-version + echo "๐ŸŽฏ Active Features:" + echo " Development: ${if cfg.features.coding or false then "โœ…" else "โŒ"}" + echo " Containers: ${if cfg.features.containers or false then "โœ…" else "โŒ"}" + echo " Gaming: ${if cfg.features.gaming or false then "โœ…" else "โŒ"}" + echo " Media: ${if cfg.features.media or false then "โœ…" else "โŒ"}" + echo " Office: ${if cfg.features.office or false then "โœ…" else "โŒ"}" + echo " Communication: ${if cfg.features.communication or false then "โœ…" else "โŒ"}" + echo " Virtualization: ${if cfg.features.virtualization or false then "โœ…" else "โŒ"}" + echo " Backup: ${if cfg.features.backup or false then "โœ…" else "โŒ"}" + echo "" + echo "๐ŸŽจ Theming:" + echo " Custom Themes: ${if cfg.features.customThemes or false then "โœ…" else "โŒ"}" + echo " Wallpaper Effects: ${if cfg.features.wallpaperEffects or false then "โœ…" else "โŒ"}" + echo " Color Scheme: ${if cfg.colorScheme != null then "Custom" else "Theme-based"}" + echo " Wallpaper: ${if cfg.wallpaper != null then toString cfg.wallpaper else "Not set"}" + echo "" + echo "๐Ÿ’ก Quick Commands:" + echo " omnixy-setup-colors - Configure colors and themes" + echo " omnixy-rebuild - Rebuild system configuration" + echo " omnixy-help - Show keyboard shortcuts and help" + echo "" + echo "๐Ÿ“Š System Information:" + nixos-version --json | ${pkgs.jq}/bin/jq -r '" NixOS: " + .nixosVersion' + echo " Kernel: $(uname -r)" + echo " Uptime: $(uptime -p)" '') ]; }; diff --git a/modules/desktop/hyprland.nix b/modules/desktop/hyprland.nix index 025e9de..c5ab2c0 100644 --- a/modules/desktop/hyprland.nix +++ b/modules/desktop/hyprland.nix @@ -18,7 +18,7 @@ in defaultTerminal = mkOption { type = types.str; - default = "alacritty"; + default = "ghostty"; description = "Default terminal emulator"; }; @@ -29,9 +29,9 @@ in }; wallpaper = mkOption { - type = types.path; - default = ./wallpapers/default.jpg; - description = "Path to wallpaper image"; + type = types.nullOr types.path; + default = null; + description = "Path to wallpaper image (optional)"; }; }; @@ -262,11 +262,11 @@ in mouse_move_enables_dpms = true key_press_enables_dpms = true enable_swallow = true - swallow_regex = ^(alacritty|kitty|footclient)$ + swallow_regex = ^(ghostty|alacritty|kitty|footclient)$ } # Window rules - windowrulev2 = opacity 0.9 override 0.9 override, class:^(Alacritty|kitty)$ + windowrulev2 = opacity 0.9 override 0.9 override, class:^(ghostty|Alacritty|kitty)$ windowrulev2 = opacity 0.9 override 0.9 override, class:^(Code|code-oss)$ windowrulev2 = float, class:^(pavucontrol|nm-connection-editor|blueman-manager)$ windowrulev2 = float, class:^(org.gnome.Calculator|gnome-calculator)$ diff --git a/modules/development.nix b/modules/development.nix index e0e7ed1..fa49544 100644 --- a/modules/development.nix +++ b/modules/development.nix @@ -3,10 +3,11 @@ with lib; let - cfg = config.omnixy.features.development; + cfg = config.omnixy; + omnixy = import ./helpers.nix { inherit config pkgs lib; }; in { - config = mkIf cfg { + config = omnixy.withFeature "coding" { # Development tools environment.systemPackages = with pkgs; [ # Version control @@ -102,7 +103,7 @@ in sqlite redis mongodb - dbeaver + dbeaver-bin # Container tools docker @@ -179,100 +180,10 @@ in tmuxinator asciinema tokei - loc cloc tree-sitter - ]; - # Docker daemon - virtualisation.docker = { - enable = true; - enableOnBoot = true; - daemon.settings = { - features = { buildkit = true; }; - registry-mirrors = [ "https://mirror.gcr.io" ]; - }; - - autoPrune = { - enable = true; - dates = "weekly"; - flags = [ "--all" ]; - }; - }; - - # Podman as Docker alternative - virtualisation.podman = { - enable = true; - dockerCompat = true; - defaultNetwork.settings.dns_enabled = true; - }; - - # Development services - services = { - # PostgreSQL - postgresql = { - enable = false; # Set to true to enable - package = pkgs.postgresql_15; - dataDir = "/var/lib/postgresql/15"; - authentication = '' - local all all trust - host all all 127.0.0.1/32 trust - host all all ::1/128 trust - ''; - }; - - # Redis - redis.servers."" = { - enable = false; # Set to true to enable - port = 6379; - bind = "127.0.0.1"; - }; - - # MySQL/MariaDB - mysql = { - enable = false; # Set to true to enable - package = pkgs.mariadb; - settings = { - mysqld = { - bind-address = "127.0.0.1"; - port = 3306; - }; - }; - }; - }; - - # VSCode settings - environment.variables = { - # Enable VSCode to use Wayland - NIXOS_OZONE_WL = "1"; - }; - - # Development shell environments - programs.direnv = { - enable = true; - nix-direnv.enable = true; - }; - - # Git configuration - programs.git = { - enable = true; - lfs.enable = true; - config = { - init.defaultBranch = "main"; - core = { - editor = "nvim"; - autocrlf = "input"; - }; - pull.rebase = false; - push.autoSetupRemote = true; - }; - }; - - # Enable lorri for automatic nix-shell - services.lorri.enable = true; - - # Add custom development scripts - environment.systemPackages = with pkgs; [ + # Custom development scripts (writeShellScriptBin "dev-postgres" '' #!/usr/bin/env bash echo "Starting PostgreSQL development container..." @@ -471,5 +382,93 @@ in echo "Run 'direnv allow' to activate the development environment" '') ]; + + # Docker daemon (only if containers feature is enabled) + virtualisation.docker = mkIf (omnixy.isEnabled "containers") { + enable = true; + enableOnBoot = true; + daemon.settings = { + features = { buildkit = true; }; + registry-mirrors = [ "https://mirror.gcr.io" ]; + }; + + autoPrune = { + enable = true; + dates = "weekly"; + flags = [ "--all" ]; + }; + }; + + # Podman as Docker alternative (disabled dockerCompat to avoid conflict) + virtualisation.podman = { + enable = true; + dockerCompat = false; + defaultNetwork.settings.dns_enabled = true; + }; + + # Development services + services = { + # PostgreSQL + postgresql = { + enable = false; # Set to true to enable + package = pkgs.postgresql_15; + dataDir = "/var/lib/postgresql/15"; + authentication = '' + local all all trust + host all all 127.0.0.1/32 trust + host all all ::1/128 trust + ''; + }; + + # Redis + redis.servers."" = { + enable = false; # Set to true to enable + port = 6379; + bind = "127.0.0.1"; + }; + + # MySQL/MariaDB + mysql = { + enable = false; # Set to true to enable + package = pkgs.mariadb; + settings = { + mysqld = { + bind-address = "127.0.0.1"; + port = 3306; + }; + }; + }; + }; + + # VSCode settings + environment.variables = { + # Enable VSCode to use Wayland + NIXOS_OZONE_WL = "1"; + }; + + # Development shell environments + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; + + # Git configuration + programs.git = { + enable = true; + lfs.enable = true; + config = { + init.defaultBranch = "main"; + core = { + editor = "nvim"; + autocrlf = "input"; + }; + pull.rebase = false; + push.autoSetupRemote = true; + }; + }; + + # Enable lorri for automatic nix-shell + services.lorri.enable = true; + }; } \ No newline at end of file diff --git a/modules/hardware/amd.nix b/modules/hardware/amd.nix new file mode 100644 index 0000000..231933a --- /dev/null +++ b/modules/hardware/amd.nix @@ -0,0 +1,35 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + options.hardware.amd.enable = mkEnableOption "AMD graphics support"; + + config = mkIf config.hardware.amd.enable { + # AMD driver configuration + services.xserver.videoDrivers = [ "amdgpu" ]; + + # Enable AMD GPU support + boot.initrd.kernelModules = [ "amdgpu" ]; + + # AMD specific packages + environment.systemPackages = with pkgs; [ + radeontop + nvtopPackages.amd + ]; + + # OpenGL packages for AMD + hardware.opengl.extraPackages = with pkgs; [ + amdvlk + rocm-opencl-icd + rocm-opencl-runtime + ]; + + hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ + driversi686Linux.amdvlk + ]; + + # AMD GPU firmware + hardware.enableRedistributableFirmware = true; + }; +} \ No newline at end of file diff --git a/modules/hardware/audio.nix b/modules/hardware/audio.nix new file mode 100644 index 0000000..0019184 --- /dev/null +++ b/modules/hardware/audio.nix @@ -0,0 +1,42 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + options.hardware.audio.pipewire.enable = mkEnableOption "PipeWire audio system"; + + config = mkIf config.hardware.audio.pipewire.enable { + # PipeWire configuration + security.rtkit.enable = true; + + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; + + # Audio packages + environment.systemPackages = with pkgs; [ + # Audio control + pavucontrol + pulsemixer + alsamixer + + # Audio tools + audacity + pulseaudio + + # Bluetooth audio + bluez + bluez-tools + ]; + + # Disable PulseAudio (conflicts with PipeWire) + hardware.pulseaudio.enable = false; + + # Audio group for user + users.groups.audio = {}; + }; +} \ No newline at end of file diff --git a/modules/hardware/bluetooth.nix b/modules/hardware/bluetooth.nix new file mode 100644 index 0000000..d6869fe --- /dev/null +++ b/modules/hardware/bluetooth.nix @@ -0,0 +1,45 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + options.hardware.bluetooth.enhanced.enable = mkEnableOption "Enhanced Bluetooth support"; + + config = mkIf config.hardware.bluetooth.enhanced.enable { + # Enable Bluetooth + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + settings = { + General = { + Enable = "Source,Sink,Media,Socket"; + Experimental = true; + }; + }; + }; + + # Bluetooth services + services.blueman.enable = true; + + # Bluetooth packages + environment.systemPackages = with pkgs; [ + bluez + bluez-tools + blueman + bluetuith + ]; + + # Auto-connect trusted devices + systemd.user.services.bluetooth-auto-connect = { + description = "Auto-connect Bluetooth devices"; + after = [ "bluetooth.service" ]; + partOf = [ "bluetooth.service" ]; + serviceConfig = { + Type = "forking"; + ExecStart = "${pkgs.bluez}/bin/bluetoothctl connect-all"; + RemainAfterExit = true; + }; + wantedBy = [ "default.target" ]; + }; + }; +} \ No newline at end of file diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix index 7a8a2c5..c94f722 100644 --- a/modules/hardware/default.nix +++ b/modules/hardware/default.nix @@ -14,8 +14,7 @@ with lib; # Common hardware support hardware = { - # Enable all firmware - enableAllFirmware = true; + # Enable redistributable firmware only enableRedistributableFirmware = true; # CPU microcode updates @@ -25,8 +24,6 @@ with lib; # OpenGL/Graphics opengl = { enable = true; - driSupport = true; - driSupport32Bit = true; # Common OpenGL packages extraPackages = with pkgs; [ @@ -50,8 +47,16 @@ with lib; # Sensor support (for laptops) sensor.iio.enable = true; - # Firmware updater - fwupd.enable = true; + # Scanner support + sane = { + enable = true; + extraBackends = with pkgs; [ + sane-airscan + epkowa + ]; + }; + + # Firmware updater (moved to services section) }; # Kernel modules @@ -80,8 +85,6 @@ with lib; # Power profiles daemon (modern power management) power-profiles-daemon.enable = true; - # Firmware update service - fwupd.enable = true; # Hardware monitoring smartd = { @@ -112,11 +115,9 @@ with lib; hwinfo inxi dmidecode - lscpu - lsusb - lspci - pciutils - usbutils + util-linux # provides lscpu + pciutils # provides lspci + usbutils # provides lsusb # Disk tools smartmontools @@ -164,7 +165,7 @@ with lib; # Virtual console configuration console = { earlySetup = true; - font = "${pkgs.terminus_font}/share/consolefonts/ter-132n.psf.gz"; + font = lib.mkDefault "${pkgs.terminus_font}/share/consolefonts/ter-132n.psf.gz"; packages = [ pkgs.terminus_font ]; }; } \ No newline at end of file diff --git a/modules/hardware/intel.nix b/modules/hardware/intel.nix new file mode 100644 index 0000000..8f839eb --- /dev/null +++ b/modules/hardware/intel.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + options.hardware.intel.enable = mkEnableOption "Intel graphics support"; + + config = mkIf config.hardware.intel.enable { + # Intel driver configuration + services.xserver.videoDrivers = [ "modesetting" ]; + + # Enable Intel GPU support + boot.initrd.kernelModules = [ "i915" ]; + + # Intel GPU early loading + boot.kernelParams = [ "i915.enable_guc=2" ]; + + # Intel specific packages + environment.systemPackages = with pkgs; [ + intel-gpu-tools + nvtopPackages.intel + ]; + + # OpenGL packages for Intel (already configured in default.nix) + hardware.opengl.extraPackages = with pkgs; [ + intel-media-driver + vaapiIntel + intel-compute-runtime + intel-ocl + ]; + + hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ + vaapiIntel + ]; + + # Intel GPU power management + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + }; +} \ No newline at end of file diff --git a/modules/hardware/nvidia.nix b/modules/hardware/nvidia.nix new file mode 100644 index 0000000..ee08427 --- /dev/null +++ b/modules/hardware/nvidia.nix @@ -0,0 +1,35 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + options.hardware.nvidia.enable = mkEnableOption "NVIDIA graphics support"; + + config = mkIf config.hardware.nvidia.enable { + # NVIDIA driver configuration + services.xserver.videoDrivers = [ "nvidia" ]; + + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = false; + powerManagement.finegrained = false; + open = false; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + + # NVIDIA specific packages + environment.systemPackages = with pkgs; [ + nvidia-vaapi-driver + libva-utils + nvtopPackages.nvidia + ]; + + # OpenGL packages for NVIDIA + hardware.opengl.extraPackages = with pkgs; [ + nvidia-vaapi-driver + vaapiVdpau + libvdpau-va-gl + ]; + }; +} \ No newline at end of file diff --git a/modules/hardware/touchpad.nix b/modules/hardware/touchpad.nix new file mode 100644 index 0000000..b31e205 --- /dev/null +++ b/modules/hardware/touchpad.nix @@ -0,0 +1,45 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + options.hardware.touchpad.enable = mkEnableOption "Enhanced touchpad support"; + + config = mkIf config.hardware.touchpad.enable { + # Touchpad support via libinput + services.xserver.libinput = { + enable = true; + touchpad = { + tapping = true; + tappingDragLock = true; + naturalScrolling = true; + scrollMethod = "twofinger"; + disableWhileTyping = true; + middleEmulation = true; + accelProfile = "adaptive"; + }; + }; + + # Synaptics touchpad (alternative, disabled by default) + services.xserver.synaptics = { + enable = false; + twoFingerScroll = true; + palmDetect = true; + tapButtons = true; + buttonsMap = [ 1 3 2 ]; + fingersMap = [ 0 0 0 ]; + }; + + # Touchpad packages + environment.systemPackages = with pkgs; [ + libinput + xinput + xorg.xf86inputlibinput + ]; + + # Touchpad gesture support + services.touchegg = { + enable = false; # Disabled by default, enable if needed + }; + }; +} \ No newline at end of file diff --git a/modules/helpers.nix b/modules/helpers.nix new file mode 100644 index 0000000..dd6eb6d --- /dev/null +++ b/modules/helpers.nix @@ -0,0 +1,125 @@ +{ config, pkgs, lib, ... }: + +# OmniXY Shared Helper Functions +# Import this in other modules to access common patterns + +with lib; + +let + cfg = config.omnixy; +in +{ + # Check if a feature is enabled, with fallback support + isEnabled = feature: cfg.features.${feature} or false; + + # Get user-specific paths + userPath = path: "/home/${cfg.user}/${path}"; + configPath = path: "/home/${cfg.user}/.config/${path}"; + cachePath = path: "/home/${cfg.user}/.cache/${path}"; + + # Common color helper that works with both nix-colors and fallbacks + getColor = colorName: fallback: + if cfg.colorScheme != null && cfg.colorScheme ? colors && cfg.colorScheme.colors ? ${colorName} + then "#${cfg.colorScheme.colors.${colorName}}" + else fallback; + + # Feature-based conditional inclusion + withFeature = feature: content: mkIf (cfg.features.${feature} or false) content; + withoutFeature = feature: content: mkIf (!(cfg.features.${feature} or false)) content; + + # User-specific home-manager configuration + forUser = userConfig: { + home-manager.users.${cfg.user} = userConfig; + }; + + # Package filtering with exclusion support + filterPackages = packages: + builtins.filter (pkg: + let name = pkg.name or pkg.pname or "unknown"; + in !(builtins.elem name (cfg.packages.exclude or [])) + ) packages; + + # Create a standardized script with OmniXY branding + makeScript = name: description: script: pkgs.writeShellScriptBin name '' + #!/usr/bin/env bash + # ${description} + # Part of OmniXY NixOS configuration + + set -euo pipefail + + ${script} + ''; + + # Standard paths for OmniXY + paths = { + config = "/etc/nixos"; + logs = "/var/log/omnixy"; + cache = "/var/cache/omnixy"; + runtime = "/run/omnixy"; + }; + + # Color scheme mappings (base16 colors to semantic names) + colors = { + # Background colors + bg = "#1a1b26"; # Primary background + bgAlt = "#16161e"; # Alternative background + bgAccent = "#2f3549"; # Accent background + + # Foreground colors + fg = "#c0caf5"; # Primary foreground + fgAlt = "#9aa5ce"; # Alternative foreground + fgDim = "#545c7e"; # Dimmed foreground + + # Accent colors (Tokyo Night defaults, can be overridden by themes) + red = "#f7768e"; # Error/danger + orange = "#ff9e64"; # Warning + yellow = "#e0af68"; # Attention + green = "#9ece6a"; # Success + cyan = "#7dcfff"; # Info + blue = "#7aa2f7"; # Primary accent + purple = "#bb9af7"; # Secondary accent + brown = "#db4b4b"; # Tertiary accent + }; + + # Standard application categories for consistent organization + categories = { + system = [ "file managers" "terminals" "system monitors" ]; + development = [ "editors" "version control" "compilers" "debuggers" ]; + multimedia = [ "media players" "image viewers" "audio tools" "video editors" ]; + productivity = [ "office suites" "note taking" "calendars" "email" ]; + communication = [ "messaging" "video calls" "social media" ]; + gaming = [ "game launchers" "emulators" "performance tools" ]; + utilities = [ "calculators" "converters" "system tools" ]; + }; + + # Standard service patterns + service = { + # Create a basic systemd service with OmniXY defaults + make = name: serviceConfig: { + description = serviceConfig.description or "OmniXY ${name} service"; + wantedBy = serviceConfig.wantedBy or [ "multi-user.target" ]; + after = serviceConfig.after or [ "network.target" ]; + serviceConfig = { + Type = serviceConfig.type or "simple"; + User = serviceConfig.user or cfg.user; + Group = serviceConfig.group or "users"; + Restart = serviceConfig.restart or "on-failure"; + RestartSec = serviceConfig.restartSec or "5"; + } // (serviceConfig.serviceConfig or {}); + }; + + # Create a user service + user = name: serviceConfig: { + home-manager.users.${cfg.user}.systemd.user.services.${name} = { + description = serviceConfig.description or "OmniXY ${name} user service"; + wantedBy = [ "default.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + Type = serviceConfig.type or "simple"; + Restart = serviceConfig.restart or "on-failure"; + RestartSec = serviceConfig.restartSec or "5"; + } // (serviceConfig.serviceConfig or {}); + }; + }; + }; +} \ No newline at end of file diff --git a/modules/lib.nix b/modules/lib.nix new file mode 100644 index 0000000..2bf556c --- /dev/null +++ b/modules/lib.nix @@ -0,0 +1,195 @@ +{ config, pkgs, lib, ... }: + +# Shared library module for OmniXY +# Provides common utilities, helpers, and patterns for other modules + +with lib; + +let + cfg = config.omnixy; + + # Helper functions for common patterns + helpers = { + # Check if a feature is enabled, with fallback support + isEnabled = feature: cfg.features.${feature} or false; + + # Get user-specific paths + userPath = path: "/home/${cfg.user}/${path}"; + configPath = path: "/home/${cfg.user}/.config/${path}"; + cachePath = path: "/home/${cfg.user}/.cache/${path}"; + + # Common color helper that works with both nix-colors and fallbacks + getColor = colorName: fallback: + if cfg.colorScheme != null && cfg.colorScheme ? colors && cfg.colorScheme.colors ? ${colorName} + then "#${cfg.colorScheme.colors.${colorName}}" + else fallback; + + # Feature-based conditional inclusion + withFeature = feature: content: mkIf (helpers.isEnabled feature) content; + withoutFeature = feature: content: mkIf (!helpers.isEnabled feature) content; + + # User-specific home-manager configuration + forUser = userConfig: { + home-manager.users.${cfg.user} = userConfig; + }; + + # Package filtering with exclusion support + filterPackages = packages: + builtins.filter (pkg: + let name = pkg.name or pkg.pname or "unknown"; + in !(builtins.elem name (cfg.packages.exclude or [])) + ) packages; + + # Create a standardized script with OmniXY branding + makeScript = name: description: script: pkgs.writeShellScriptBin name '' + #!/usr/bin/env bash + # ${description} + # Part of OmniXY NixOS configuration + + set -euo pipefail + + ${script} + ''; + + # Standard paths for OmniXY + paths = { + config = "/etc/nixos"; + logs = "/var/log/omnixy"; + cache = "/var/cache/omnixy"; + runtime = "/run/omnixy"; + }; + + # Color scheme mappings (base16 colors to semantic names) + colors = { + # Background colors + bg = "#1a1b26"; # Primary background + bgAlt = "#16161e"; # Alternative background + bgAccent = "#2f3549"; # Accent background + + # Foreground colors + fg = "#c0caf5"; # Primary foreground + fgAlt = "#9aa5ce"; # Alternative foreground + fgDim = "#545c7e"; # Dimmed foreground + + # Accent colors (Tokyo Night defaults, can be overridden by themes) + red = "#f7768e"; # Error/danger + orange = "#ff9e64"; # Warning + yellow = "#e0af68"; # Attention + green = "#9ece6a"; # Success + cyan = "#7dcfff"; # Info + blue = "#7aa2f7"; # Primary accent + purple = "#bb9af7"; # Secondary accent + brown = "#db4b4b"; # Tertiary accent + }; + + # Standard application categories for consistent organization + categories = { + system = [ "file managers" "terminals" "system monitors" ]; + development = [ "editors" "version control" "compilers" "debuggers" ]; + multimedia = [ "media players" "image viewers" "audio tools" "video editors" ]; + productivity = [ "office suites" "note taking" "calendars" "email" ]; + communication = [ "messaging" "video calls" "social media" ]; + gaming = [ "game launchers" "emulators" "performance tools" ]; + utilities = [ "calculators" "converters" "system tools" ]; + }; + + # Standard service patterns + service = { + # Create a basic systemd service with OmniXY defaults + make = name: serviceConfig: { + description = serviceConfig.description or "OmniXY ${name} service"; + wantedBy = serviceConfig.wantedBy or [ "multi-user.target" ]; + after = serviceConfig.after or [ "network.target" ]; + serviceConfig = { + Type = serviceConfig.type or "simple"; + User = serviceConfig.user or cfg.user; + Group = serviceConfig.group or "users"; + Restart = serviceConfig.restart or "on-failure"; + RestartSec = serviceConfig.restartSec or "5"; + } // (serviceConfig.serviceConfig or {}); + }; + + # Create a user service + user = name: serviceConfig: { + home-manager.users.${cfg.user}.systemd.user.services.${name} = (mkHelpers cfg).service.make name (serviceConfig // { + wantedBy = [ "default.target" ]; + after = [ "graphical-session.target" ]; + }); + }; + }; + }; + +in +{ + # Export shared configuration for other modules + config = { + # Ensure required directories exist + systemd.tmpfiles.rules = [ + "d ${helpers.paths.logs} 0755 root root -" + "d ${helpers.paths.cache} 0755 root root -" + "d ${helpers.paths.runtime} 0755 root root -" + "d ${helpers.userPath ".local/bin"} 0755 ${cfg.user} users -" + "d ${helpers.userPath ".local/share/omnixy"} 0755 ${cfg.user} users -" + ]; + + # Global environment variables that all modules can use + environment.variables = { + OMNIXY_USER = cfg.user; + OMNIXY_THEME = cfg.theme; + OMNIXY_PRESET = cfg.preset or "custom"; + OMNIXY_CONFIG_DIR = helpers.paths.config; + OMNIXY_CACHE_DIR = helpers.paths.cache; + }; + + # Standard shell aliases that work consistently across modules + programs.bash.shellAliases = { + # OmniXY management + omnixy-rebuild = "sudo nixos-rebuild switch --flake ${helpers.paths.config}#omnixy"; + omnixy-build = "sudo nixos-rebuild build --flake ${helpers.paths.config}#omnixy"; + omnixy-test = "sudo nixos-rebuild test --flake ${helpers.paths.config}#omnixy"; + omnixy-update = "cd ${helpers.paths.config} && sudo nix flake update"; + omnixy-clean = "sudo nix-collect-garbage -d && nix-collect-garbage -d"; + omnixy-generations = "sudo nix-env --list-generations --profile /nix/var/nix/profiles/system"; + + # System information + omnixy-status = "omnixy-info"; + omnixy-features = "echo 'Enabled features:' && omnixy-info | grep -A 10 'Active Features'"; + + # Quick navigation + omnixy-config = "cd ${helpers.paths.config}"; + omnixy-logs = "cd ${helpers.paths.logs}"; + }; + + # Provide a global package for accessing OmniXY utilities + environment.systemPackages = [ + (helpers.makeScript "omnixy-lib-test" "Test OmniXY library functions" '' + echo "๐Ÿงช OmniXY Library Test" + echo "====================" + echo "" + echo "Configuration:" + echo " User: ${cfg.user}" + echo " Theme: ${cfg.theme}" + echo " Preset: ${cfg.preset or "none"}" + echo "" + echo "Colors (base16 scheme):" + echo " Background: ${helpers.colors.bg}" + echo " Foreground: ${helpers.colors.fg}" + echo " Primary: ${helpers.colors.blue}" + echo " Success: ${helpers.colors.green}" + echo " Warning: ${helpers.colors.yellow}" + echo " Error: ${helpers.colors.red}" + echo "" + echo "Paths:" + echo " Config: ${helpers.paths.config}" + echo " Logs: ${helpers.paths.logs}" + echo " Cache: ${helpers.paths.cache}" + echo " User home: ${helpers.userPath ""}" + echo "" + echo "Features:" + ${concatStringsSep "\n" (mapAttrsToList (name: enabled: + ''echo " ${name}: ${if enabled then "โœ…" else "โŒ"}"'' + ) cfg.features)} + '') + ]; + }; +} \ No newline at end of file diff --git a/modules/packages.nix b/modules/packages.nix index 9986ac9..81f96c6 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -4,22 +4,30 @@ with lib; let cfg = config.omnixy; + omnixy = import ./helpers.nix { inherit config pkgs lib; }; in { options.omnixy.packages = { enable = mkEnableOption "OmniXY packages"; + exclude = mkOption { + type = types.listOf types.str; + default = []; + example = [ "discord" "spotify" "steam" ]; + description = "List of package names to exclude from installation"; + }; + categories = { base = mkEnableOption "Base system packages" // { default = true; }; - development = mkEnableOption "Development packages" // { default = true; }; - multimedia = mkEnableOption "Multimedia packages" // { default = true; }; - productivity = mkEnableOption "Productivity packages" // { default = true; }; - gaming = mkEnableOption "Gaming packages" // { default = false; }; + development = mkEnableOption "Development packages" // { default = omnixy.isEnabled "coding"; }; + multimedia = mkEnableOption "Multimedia packages" // { default = omnixy.isEnabled "media"; }; + productivity = mkEnableOption "Productivity packages" // { default = (omnixy.isEnabled "office" || omnixy.isEnabled "communication"); }; + gaming = mkEnableOption "Gaming packages" // { default = omnixy.isEnabled "gaming"; }; }; }; config = mkIf (cfg.enable or true) { - environment.systemPackages = with pkgs; + environment.systemPackages = with pkgs; omnixy.filterPackages ( # Base system packages (always installed) [ # Core utilities @@ -66,8 +74,7 @@ in # Text processing vim - nano - sed + gnused gawk jq yq-go @@ -177,7 +184,7 @@ in sqlite redis mongodb-tools - dbeaver + dbeaver-bin # API testing httpie @@ -207,7 +214,6 @@ in easyeffects spotify spotifyd - spotify-tui cmus mpd ncmpcpp @@ -216,7 +222,7 @@ in mpv vlc obs-studio - kdenlive + kdePackages.kdenlive handbrake ffmpeg-full @@ -239,7 +245,7 @@ in # PDF zathura evince - okular + kdePackages.okular mupdf ] @@ -258,7 +264,7 @@ in signal-desktop element-desktop zoom-us - teams + # teams not available on x86_64-linux # Office libreoffice @@ -304,29 +310,26 @@ in gamemode discord obs-studio - ]; + ] + ); # End of filterPackages # Font packages fonts.packages = with pkgs; [ # Nerd fonts (for icons in terminal) - (nerdfonts.override { - fonts = [ - "JetBrainsMono" - "FiraCode" - "Hack" - "Iosevka" - "Meslo" - "SourceCodePro" - "UbuntuMono" - "DroidSansMono" - "RobotoMono" - "Inconsolata" - ]; - }) + nerd-fonts.jetbrains-mono + nerd-fonts.fira-code + nerd-fonts.hack + nerd-fonts.iosevka + nerd-fonts.meslo-lg + nerd-fonts.sauce-code-pro + nerd-fonts.ubuntu-mono + nerd-fonts.droid-sans-mono + nerd-fonts.roboto-mono + nerd-fonts.inconsolata # System fonts noto-fonts - noto-fonts-cjk + noto-fonts-cjk-sans noto-fonts-emoji liberation_ttf ubuntu_font_family @@ -357,4 +360,4 @@ in }; }; }; -} \ No newline at end of file +} diff --git a/modules/services.nix b/modules/services.nix index c520426..78204a7 100644 --- a/modules/services.nix +++ b/modules/services.nix @@ -6,21 +6,30 @@ let cfg = config.omnixy; in { + # XDG Desktop Portals (required for Flatpak) + xdg.portal = { + enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-hyprland + xdg-desktop-portal-gtk + ]; + config.common.default = "*"; + }; + + # Tuigreet display manager (following omarchy-nix pattern) + services.greetd = { + enable = true; + settings.default_session.command = "${pkgs.tuigreet}/bin/tuigreet --time --cmd Hyprland"; + }; + # System services configuration services = { # Display server xserver = { enable = true; - # Display Manager - displayManager = { - gdm = { - enable = true; - wayland = true; - }; - - defaultSession = "hyprland"; - }; + # Display Manager disabled - using greetd instead + displayManager.gdm.enable = false; # Touchpad support libinput = { @@ -52,14 +61,6 @@ in ]; }; - # Scanner support - sane = { - enable = true; - extraBackends = with pkgs; [ - sane-airscan - epkowa - ]; - }; # Sound pipewire = { @@ -110,7 +111,6 @@ in enable = true; interval = "daily"; package = pkgs.plocate; - localuser = null; }; # Backup service (optional) diff --git a/modules/themes/tokyo-night.nix b/modules/themes/tokyo-night.nix index 917650c..e81dfc7 100644 --- a/modules/themes/tokyo-night.nix +++ b/modules/themes/tokyo-night.nix @@ -1,50 +1,79 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, lib, inputs, ... }: +let + cfg = config.omnixy; + + # Use nix-colors if available and configured, otherwise fallback to manual colors + useNixColors = cfg.colorScheme != null; + colorScheme = cfg.colorScheme; + + # Manual Tokyo Night colors as fallback + manualColors = { + bg = "#1a1b26"; + fg = "#c0caf5"; + accent = "#7aa2f7"; + red = "#f7768e"; + green = "#9ece6a"; + yellow = "#e0af68"; + blue = "#7aa2f7"; + magenta = "#bb9af7"; + cyan = "#7dcfff"; + white = "#c0caf5"; + black = "#15161e"; + }; + + # Helper function to get color from scheme or fallback + getColor = name: fallback: + if useNixColors && colorScheme ? colors && colorScheme.colors ? ${name} + then "#${colorScheme.colors.${name}}" + else fallback; + +in { # Tokyo Night theme configuration config = { - # Color palette + # Color palette - use nix-colors if available environment.variables = { OMNIXY_THEME = "tokyo-night"; - OMNIXY_THEME_BG = "#1a1b26"; - OMNIXY_THEME_FG = "#c0caf5"; - OMNIXY_THEME_ACCENT = "#7aa2f7"; + OMNIXY_THEME_BG = getColor "base00" manualColors.bg; + OMNIXY_THEME_FG = getColor "base05" manualColors.fg; + OMNIXY_THEME_ACCENT = getColor "base0D" manualColors.accent; }; # Home-manager theme configuration home-manager.users.${config.omnixy.user or "user"} = { - # Alacritty theme + # Alacritty theme - dynamic colors based on nix-colors or fallback programs.alacritty.settings.colors = { primary = { - background = "#1a1b26"; - foreground = "#c0caf5"; + background = getColor "base00" manualColors.bg; + foreground = getColor "base05" manualColors.fg; }; normal = { - black = "#15161e"; - red = "#f7768e"; - green = "#9ece6a"; - yellow = "#e0af68"; - blue = "#7aa2f7"; - magenta = "#bb9af7"; - cyan = "#7dcfff"; - white = "#a9b1d6"; + black = getColor "base00" manualColors.black; + red = getColor "base08" manualColors.red; + green = getColor "base0B" manualColors.green; + yellow = getColor "base0A" manualColors.yellow; + blue = getColor "base0D" manualColors.blue; + magenta = getColor "base0E" manualColors.magenta; + cyan = getColor "base0C" manualColors.cyan; + white = getColor "base05" manualColors.white; }; bright = { - black = "#414868"; - red = "#f7768e"; - green = "#9ece6a"; - yellow = "#e0af68"; - blue = "#7aa2f7"; - magenta = "#bb9af7"; - cyan = "#7dcfff"; - white = "#c0caf5"; + black = getColor "base03" "#414868"; + red = getColor "base08" manualColors.red; + green = getColor "base0B" manualColors.green; + yellow = getColor "base0A" manualColors.yellow; + blue = getColor "base0D" manualColors.blue; + magenta = getColor "base0E" manualColors.magenta; + cyan = getColor "base0C" manualColors.cyan; + white = getColor "base07" manualColors.fg; }; indexed_colors = [ - { index = 16; color = "#ff9e64"; } - { index = 17; color = "#db4b4b"; } + { index = 16; color = getColor "base09" "#ff9e64"; } + { index = 17; color = getColor "base0F" "#db4b4b"; } ]; }; @@ -250,7 +279,8 @@ (writeShellScriptBin "set-wallpaper" '' #!/usr/bin/env bash # Set Tokyo Night themed wallpaper - swww img ${./wallpapers/tokyo-night.jpg} --transition-type wipe --transition-angle 30 --transition-step 90 + echo "Wallpaper functionality disabled - add wallpaper manually with swww" + echo "Usage: swww img /path/to/wallpaper.jpg --transition-type wipe --transition-angle 30" '') ]; }; diff --git a/modules/users.nix b/modules/users.nix index f6dddce..da80219 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -63,15 +63,14 @@ in # User environment environment.systemPackages = with pkgs; [ # User management tools - shadow - passwd + shadow # provides passwd, useradd, etc. # Session management - loginctl + systemd # provides loginctl # User info finger_bsd - id-utils + idutils ]; # User-specific services