Rename example-template.nix to prevent module evaluation errors

This commit is contained in:
2026-04-07 05:17:36 +02:00
parent 1b69e0d2a4
commit f2b33079fc

View File

@@ -0,0 +1,58 @@
{ config, lib, pkgs, ... }:
# Template for creating new Home Manager modules
# Copy this file and customize for your needs
{
options.programs.myapp = {
enable = lib.mkEnableOption "My application";
setting1 = lib.mkOption {
type = lib.types.str;
default = "default";
description = "A configuration setting";
};
};
config = let
cfg = config.programs.myapp;
in lib.mkIf cfg.enable {
# Home packages needed for this app
home.packages = with pkgs; [
# myapp
];
# Home Manager built-in programs and services
# Example: configure a program via home-manager
# programs.neovim.enable = true;
# Create custom files in home directory
# home.file.".config/myapp/config.yaml".source = ./config.yaml;
# Set environment variables
# home.sessionVariables = {
# MY_VAR = "value";
# };
};
}
/*
How to use this module:
1. Save this template as home/modules/myapp.nix
2. Import it in home/default.nix:
imports = [
./modules/myapp.nix
];
3. Enable in home/default.nix:
programs.myapp.enable = true;
programs.myapp.setting1 = "custom value";
4. Rebuild:
home-manager switch --flake .#myusername@linux
*/