feat(devShells): shell for NixOS configuration development
This commit is contained in:
parent
f0a1b103e0
commit
e4f81f2e3f
4 changed files with 47 additions and 8 deletions
1
.envrc
1
.envrc
|
|
@ -1 +1,2 @@
|
||||||
use flake .#nix
|
use flake .#nix
|
||||||
|
use flake .#SkyOS
|
||||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
.direnv/
|
||||||
|
|
@ -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
25
devShells/nixos.nix
Normal 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;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue