init by ai
This commit is contained in:
56
home/modules/example-template.nix
Normal file
56
home/modules/example-template.nix
Normal file
@@ -0,0 +1,56 @@
|
||||
{ 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
|
||||
Reference in New Issue
Block a user