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 .#SkyOS

1
.gitignore vendored Normal file
View file

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

View file

@ -53,7 +53,8 @@ in
}:
{
devShells = builtins.listToAttrs (
devShells =
builtins.listToAttrs (
map (name: {
inherit name;
value =
@ -66,7 +67,18 @@ in
shellHook = cfg.shellHook or "";
};
}) dirs
);
)
// {
nixos =
let
cfg = import ./nixos.nix pkgs;
in
pkgs.mkShell {
name = "SkyOS";
packages = map (p: p) (builtins.attrValues cfg.packages);
shellHook = cfg.shellHook or "";
};
};
};
flake.templates = builtins.listToAttrs (
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;
}