From b8ba3056da39e2763094b7c695da0c9d5ee287c5 Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Sun, 2 Feb 2025 14:42:48 -0500 Subject: templates/standard: expand --- templates/standard/nix/module.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 templates/standard/nix/module.nix (limited to 'templates/standard/nix/module.nix') diff --git a/templates/standard/nix/module.nix b/templates/standard/nix/module.nix new file mode 100644 index 0000000..36e91ea --- /dev/null +++ b/templates/standard/nix/module.nix @@ -0,0 +1,27 @@ +self: +{ + config, + lib, + pkgs, + ... +}: + +let + namespace = "myProgram"; + cfg = config.services.${namespace}; + + inherit (pkgs.stdenv.hostPlatform) system; + packages = self.packages.${system} or throw "myProgram: ${system} is not supported"; +in + +{ + options.services.${namespace} = { + enable = lib.mkEnableOption "something amazing"; + + package = lib.mkPackageOption packages "hello" { }; + }; + + config = { + environment.systemPackages = [ cfg.package ]; + }; +} -- cgit v1.2.3