mirror of
https://github.com/nix-community/flakelight.git
synced 2024-11-21 15:03:15 +01:00
Add hardeningDisable to devShell module
This commit is contained in:
parent
566fbde51a
commit
aaf1441ff7
@ -508,6 +508,9 @@ list.
|
|||||||
initialization. It can optionally be a function taking the package set and
|
initialization. It can optionally be a function taking the package set and
|
||||||
returning such a string.
|
returning such a string.
|
||||||
|
|
||||||
|
`devShell.hardeningDisable` is a list of hardening options to disable. Setting
|
||||||
|
it to `["all"]` disables all Nix hardening.
|
||||||
|
|
||||||
`devShell.env` is for setting environment variables in the shell. It is an
|
`devShell.env` is for setting environment variables in the shell. It is an
|
||||||
attribute set mapping variables to values. It can optionally be a function
|
attribute set mapping variables to values. It can optionally be a function
|
||||||
taking the package set and returning such an attribute set.
|
taking the package set and returning such an attribute set.
|
||||||
|
@ -25,6 +25,11 @@ let
|
|||||||
default = "";
|
default = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
hardeningDisable = mkOption {
|
||||||
|
type = listOf str;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
|
||||||
env = mkOption {
|
env = mkOption {
|
||||||
type = optFunctionTo (lazyAttrsOf str);
|
type = optFunctionTo (lazyAttrsOf str);
|
||||||
default = { };
|
default = { };
|
||||||
@ -59,7 +64,10 @@ let
|
|||||||
else
|
else
|
||||||
let cfg' = mapAttrs (_: v: v pkgs) cfg; in
|
let cfg' = mapAttrs (_: v: v pkgs) cfg; in
|
||||||
pkgs.mkShell.override { inherit (cfg') stdenv; }
|
pkgs.mkShell.override { inherit (cfg') stdenv; }
|
||||||
(cfg'.env // { inherit (cfg') inputsFrom packages shellHook; });
|
(cfg'.env // {
|
||||||
|
inherit (cfg') inputsFrom packages shellHook;
|
||||||
|
inherit (cfg) hardeningDisable;
|
||||||
|
});
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
|
@ -343,6 +343,7 @@ in
|
|||||||
'';
|
'';
|
||||||
env.TEST_VAR = "test value";
|
env.TEST_VAR = "test value";
|
||||||
stdenv = pkgs: pkgs.clangStdenv;
|
stdenv = pkgs: pkgs.clangStdenv;
|
||||||
|
hardeningDisable = [ "all" ];
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(f: lib.isDerivation f.devShells.x86_64-linux.default);
|
(f: lib.isDerivation f.devShells.x86_64-linux.default);
|
||||||
|
Loading…
Reference in New Issue
Block a user