Browse Source

Test module

main
parent
commit
fadff728c4
Signed by: chris GPG Key ID: 3025DCBD46F81C0F
  1. 5
      modules/default.nix
  2. 23
      modules/hello.nix

5
modules/default.nix

@ -0,0 +1,5 @@
{
imports = [
./hello.nix
];
}

23
modules/hello.nix

@ -0,0 +1,23 @@
{ lib, pkgs, config, ...}:
with lib;
let
cfg = config.services.hello;
in {
options.services.hello = {
enable = mkEnableOption "Hello service.";
greeter = mkOption {
type = types.str;
default = "world";
};
};
config = mkIf cfg.enable {
environment.systemPackages = [
(pkgs.writeShellScriptBin "hello" ''
echo "'Hello, ${escapeShellArg cfg.greeter}!'"
'');
];
};
}
Loading…
Cancel
Save