summaryrefslogtreecommitdiff
path: root/templates/standard/nix/module.nix
diff options
context:
space:
mode:
authorSeth Flynn <[email protected]>2025-02-02 14:42:48 -0500
committerSeth Flynn <[email protected]>2025-02-02 14:42:48 -0500
commitb8ba3056da39e2763094b7c695da0c9d5ee287c5 (patch)
treeaf9fb4dac47a8a1be2af1ff9898e2526b2983845 /templates/standard/nix/module.nix
parent2a05e0b50272f7ec681e33588bc5fc79f72f44af (diff)
templates/standard: expand
Diffstat (limited to 'templates/standard/nix/module.nix')
-rw-r--r--templates/standard/nix/module.nix27
1 files changed, 27 insertions, 0 deletions
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 ];
+ };
+}