feat(devShells): shell for NixOS configuration development

This commit is contained in:
Sk7Str1p3 2026-04-28 11:42:19 +03:00
parent f0a1b103e0
commit e4f81f2e3f
No known key found for this signature in database
GPG key ID: 4DD995933D06D43B
4 changed files with 47 additions and 8 deletions

1
.envrc
View file

@ -1 +1,2 @@
use flake .#nix use flake .#nix
use flake .#SkyOS

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.direnv/

View file

@ -53,20 +53,32 @@ in
}: }:
{ {
devShells = builtins.listToAttrs ( devShells =
map (name: { builtins.listToAttrs (
inherit name; map (name: {
value = inherit name;
value =
let
cfg = import ./${name}/default.nix pkgs;
in
pkgs.mkShell {
inherit name;
packages = map (p: p) (builtins.attrValues cfg.packages);
shellHook = cfg.shellHook or "";
};
}) dirs
)
// {
nixos =
let let
cfg = import ./${name}/default.nix pkgs; cfg = import ./nixos.nix pkgs;
in in
pkgs.mkShell { pkgs.mkShell {
inherit name; name = "SkyOS";
packages = map (p: p) (builtins.attrValues cfg.packages); packages = map (p: p) (builtins.attrValues cfg.packages);
shellHook = cfg.shellHook or ""; shellHook = cfg.shellHook or "";
}; };
}) dirs };
);
}; };
flake.templates = builtins.listToAttrs ( flake.templates = builtins.listToAttrs (
map (name: { map (name: {

25
devShells/nixos.nix Normal file
View file

@ -0,0 +1,25 @@
# SkyOS
/**
Development shell with tools needed for configuration editing
*/
pkgs: {
/**
tool for managing __runtime__ secrets. See [sops-nix](https://github.com/mic92/sops-nix) for more info
*/
packages.sops = pkgs.sops;
/**
tool for managing __eval time__ secrets.
In near future, it's going to be replaced by my own project which uses `sops` instead of bare `age`
*/
packages.git-agecrypt = pkgs.git-agecrypt;
/**
tool for generating documentation from comments in .nix files
*/
packages.nixdoc = pkgs.nixdoc;
/**
tool for generating book from md files made by `nixdoc`
*/
packages.mdbook = pkgs.mdbook;
}