Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
80 lines (71 loc) · 2 KB

File metadata and controls

80 lines (71 loc) · 2 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{
system ? builtins.currentSystem,
inputs ? import ./flake.lock.nix { },
nixpkgs ? import inputs.nixpkgs {
inherit system;
# Makes the config pure as well. See <nixpkgs>/top-level/impure.nix:
config = { };
overlays = [ ];
},
}:
let
# Build a list of all the files, imported as Nix code, from a directory.
importTree =
dir:
let
data = builtins.readDir dir;
op =
sum: name:
let
path = "${dir}/${name}";
type = data.${name};
in
sum
++ (
if type == "regular" then
[ path ]
# assume it's a directory
else
importTree path
);
in
builtins.foldl' op [ ] (builtins.attrNames data);
in
rec {
# Folder that contains all the extra modules
extraModulesPath = toString ./extra;
# Alias for backward compatibility.
extraModulesDir = extraModulesPath;
# Get the modules documentation from an empty evaluation
modules-docs =
(eval {
configuration = {
# Load all of the extra modules so they appear in the docs
imports = importTree extraModulesPath;
};
}).config.modules-docs;
# Docs
docs = nixpkgs.callPackage ./docs { inherit modules-docs; };
# Tests
tests = import ./tests {
inherit system;
inputs = null;
pkgs = nixpkgs;
};
# Evaluate the devshell module
eval = import ./modules nixpkgs;
importTOML = import ./nix/importTOML.nix;
# Build the devshell from a TOML declaration.
fromTOML = path: mkShell (importTOML path);
# A utility to build a "naked" nix-shell environment that doesn't contain
# all of the default environment variables. This is mostly for internal use.
mkNakedShell = nixpkgs.callPackage ./nix/mkNakedShell.nix { };
# A developer shell that works in all scenarios
#
# * nix-build
# * nix-shell
# * flake app
# * direnv integration
# * setup hook for derivation or hercules ci effect
mkShell = configuration: (eval { inherit configuration; }).shell;
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.