feat(devShells): shell for nix language
This commit is contained in:
parent
4681e362e9
commit
9036985dde
5 changed files with 48 additions and 1 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
|
@ -0,0 +1 @@
|
|||
use flake .#nix
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
Isolated environments for convenient software development.
|
||||
Provides shells for all languages I use:
|
||||
- ~~❄️ [Nix]~~ (not yet)
|
||||
- ❄️ [Nix](./devShells/nix.md)
|
||||
- ~~🦀 Rust~~ (not yet)
|
||||
- ~~🐍 Python~~ (not yet)
|
||||
|
||||
|
|
|
|||
1
devShells/nix/.envrc
Normal file
1
devShells/nix/.envrc
Normal file
|
|
@ -0,0 +1 @@
|
|||
use flake
|
||||
20
devShells/nix/default.nix
Normal file
20
devShells/nix/default.nix
Normal 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
25
devShells/nix/flake.nix
Normal 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);
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue