feat(devShells): shell for nix language

This commit is contained in:
Sk7Str1p3 2026-04-19 09:03:51 +03:00
parent 4681e362e9
commit 9036985dde
No known key found for this signature in database
GPG key ID: 4DD995933D06D43B
5 changed files with 48 additions and 1 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake .#nix

View file

@ -3,7 +3,7 @@
/** /**
Isolated environments for convenient software development. Isolated environments for convenient software development.
Provides shells for all languages I use: Provides shells for all languages I use:
- ~~ [Nix]~~ (not yet) - [Nix](./devShells/nix.md)
- ~~🦀 Rust~~ (not yet) - ~~🦀 Rust~~ (not yet)
- ~~🐍 Python~~ (not yet) - ~~🐍 Python~~ (not yet)

1
devShells/nix/.envrc Normal file
View file

@ -0,0 +1 @@
use flake

20
devShells/nix/default.nix Normal file
View file

@ -0,0 +1,20 @@
# Nix
/**
Basic shell for nix-only projects.
Many nix projects have their own devshell,
but they don't install most necessary tools.
*/
pkgs: rec {
/**
nix language server
*/
packages.nixd = pkgs.nixd;
/**
nix formatter
*/
packages.nixfmt = pkgs.nixfmt;
/**
nix linter
*/
packages.statix = pkgs.statix;
}

25
devShells/nix/flake.nix Normal file
View file

@ -0,0 +1,25 @@
{
description = "Development shell for nix projects";
inputs.nixpkgs = "github:nixos/nixpkgs";
inputs.utils = "github:numtide/flake-utils";
outputs =
{
self,
nixpkgs,
utils,
}:
utils.lib.eachDefaultSystem (
sys:
let
pkgs = nixpkgs.legacyPackages.${sys};
in
{
devShells.default = pkgs.mkShell {
name = "nix";
packages = map (p: p) (builtins.attrValues (import ./. pkgs).packages);
};
}
);
}