1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-06 16:57:08 +00:00
nix-darwin/modules/programs/nix-script.nix
2016-12-27 20:47:52 +01:00

47 lines
736 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.nix-script;
nix-script = pkgs.substituteAll {
inherit (cfg) name;
src = ../../pkgs/nix-tools/nix-script.sh;
dir = "bin";
isExecutable = true;
};
in
{
options = {
programs.nix-script.enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable the nix script.
'';
};
programs.nix-script.name = mkOption {
type = types.str;
default = "nix";
description = ''
Name to use for the nix script.
'';
};
};
config = mkIf cfg.enable {
environment.systemPackages =
[ # Nix wrapper script
nix-script
];
};
}