From bfa1d5770d9099ed52daff25df678da9baaec659 Mon Sep 17 00:00:00 2001 From: s0me1newithhand7s <117505144+s0me1newithhand7s@users.noreply.github.com> Date: Sun, 19 Oct 2025 23:03:47 +0300 Subject: [PATCH] refactor(nix): devShell inited in `shell.nix` and information about added in `README.md` --- README.md | 4 ++++ flake.nix | 8 ++++++++ shell.nix | 31 +++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 shell.nix diff --git a/README.md b/README.md index a577af03..8127ec5c 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,10 @@ We welcome contributions of any size - bug fixes, new features, documentation im - **Want to code?** Check out our [development guidelines](https://docs.noctalia.dev/development/guideline) - **Need help?** Join our [Discord](https://discord.noctalia.dev) +### ✨ Nix DevShell (new) + +Nix users can use the flake's devShell to access a development environment. Run nix develop the repo root to enter the dev shell. In includes packages, utilities and environment variables needed to develop Noctalia. + --- ## 💜 Credits diff --git a/flake.nix b/flake.nix index d2046bb1..cc212c74 100644 --- a/flake.nix +++ b/flake.nix @@ -38,6 +38,14 @@ defaultPackage = eachSystem (system: self.packages.${system}.default); + devShells = eachSystem ( + system: let + pkgs = nixpkgs.legacyPackages.${system}; + in { + default = pkgs.callPackage ./shell.nix {}; + } + ); + homeModules.default = { pkgs, lib, diff --git a/shell.nix b/shell.nix new file mode 100644 index 00000000..b6dcf225 --- /dev/null +++ b/shell.nix @@ -0,0 +1,31 @@ +{ + alejandra, + statix, + deadnix, + shfmt, + shellcheck, + jsonfmt, + lefthook, + kdePackages, + mkShellNoCC, +}: +mkShellNoCC { + #it's faster than mkDerivation / mkShell + packages = [ + # nix + alejandra # formatter + statix # linter + deadnix # linter + + # shell + shfmt # formatter + shellcheck # linter + + # json + jsonfmt # formatter + + # CoC + lefthook # githooks + kdePackages.qtdeclarative # qmlfmt, qmllint, qmlls and etc; Qt6 + ]; +}