first
This commit is contained in:
193
examples/home-manager-standalone.nix
Normal file
193
examples/home-manager-standalone.nix
Normal file
@@ -0,0 +1,193 @@
|
||||
# Example Standalone Home Manager Configuration using m3ta-nixpkgs
|
||||
# This file demonstrates how to use m3ta-nixpkgs with standalone Home Manager
|
||||
# (without NixOS)
|
||||
{
|
||||
description = "Example Home Manager configuration with m3ta-nixpkgs";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Add m3ta-nixpkgs as an input
|
||||
m3ta-nixpkgs = {
|
||||
url = "git+https://code.m3ta.dev/m3tam3re/nixpkgs";
|
||||
# Or use a local path during development:
|
||||
# url = "path:/home/user/projects/m3ta-nixpkgs";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
m3ta-nixpkgs,
|
||||
...
|
||||
} @ inputs: let
|
||||
system = "x86_64-linux"; # Change to your system: aarch64-linux, x86_64-darwin, aarch64-darwin
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
# Apply m3ta-nixpkgs overlays
|
||||
overlays = [
|
||||
m3ta-nixpkgs.overlays.default
|
||||
];
|
||||
};
|
||||
in {
|
||||
homeConfigurations = {
|
||||
# Replace 'm3tam3re' with your actual username
|
||||
m3tam3re = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
|
||||
# Pass inputs as extra special args
|
||||
extraSpecialArgs = {inherit inputs;};
|
||||
|
||||
modules = [
|
||||
# Import m3ta's Home Manager modules
|
||||
m3ta-nixpkgs.homeManagerModules.default
|
||||
|
||||
# Main Home Manager configuration
|
||||
{
|
||||
# ============================================
|
||||
# User Information
|
||||
# ============================================
|
||||
home.username = "m3tam3re";
|
||||
home.homeDirectory = "/home/m3tam3re";
|
||||
home.stateVersion = "24.05";
|
||||
|
||||
# ============================================
|
||||
# Packages from m3ta-nixpkgs
|
||||
# ============================================
|
||||
# Since we applied the overlay above, packages are available directly
|
||||
home.packages = with pkgs; [
|
||||
# Custom packages from m3ta-nixpkgs
|
||||
code2prompt
|
||||
hyprpaper-random
|
||||
launch-webapp
|
||||
msty-studio
|
||||
pomodoro-timer
|
||||
zellij-ps
|
||||
|
||||
# Regular packages from nixpkgs
|
||||
git
|
||||
vim
|
||||
htop
|
||||
fzf
|
||||
ripgrep
|
||||
];
|
||||
|
||||
# ============================================
|
||||
# Custom Home Manager Modules
|
||||
# ============================================
|
||||
# If you've defined custom Home Manager modules
|
||||
# programs.myProgram = {
|
||||
# enable = true;
|
||||
# package = pkgs.myProgram;
|
||||
# settings = {
|
||||
# theme = "dark";
|
||||
# };
|
||||
# };
|
||||
|
||||
# ============================================
|
||||
# Shell Configuration
|
||||
# ============================================
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
shellAliases = {
|
||||
ll = "ls -l";
|
||||
".." = "cd ..";
|
||||
};
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
};
|
||||
|
||||
# ============================================
|
||||
# Git Configuration
|
||||
# ============================================
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "Your Name";
|
||||
userEmail = "your.email@example.com";
|
||||
extraConfig = {
|
||||
init.defaultBranch = "main";
|
||||
pull.rebase = false;
|
||||
};
|
||||
};
|
||||
|
||||
# ============================================
|
||||
# Additional Programs
|
||||
# ============================================
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
# ============================================
|
||||
# Environment Variables
|
||||
# ============================================
|
||||
home.sessionVariables = {
|
||||
EDITOR = "vim";
|
||||
VISUAL = "vim";
|
||||
};
|
||||
|
||||
# ============================================
|
||||
# File Management
|
||||
# ============================================
|
||||
# Create custom config files
|
||||
home.file.".config/my-app/config.json".text = ''
|
||||
{
|
||||
"setting": "value"
|
||||
}
|
||||
'';
|
||||
|
||||
# ============================================
|
||||
# Allow Home Manager to manage itself
|
||||
# ============================================
|
||||
programs.home-manager.enable = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# ============================================
|
||||
# Minimal Example Configuration
|
||||
# ============================================
|
||||
minimal = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [m3ta-nixpkgs.overlays.default];
|
||||
};
|
||||
|
||||
modules = [
|
||||
{
|
||||
home.username = "m3tam3re";
|
||||
home.homeDirectory = "/home/m3tam3re";
|
||||
home.stateVersion = "24.05";
|
||||
|
||||
# Just use a couple of custom packages
|
||||
home.packages = with pkgs; [
|
||||
code2prompt
|
||||
zellij-ps
|
||||
];
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
153
examples/nixos-configuration.nix
Normal file
153
examples/nixos-configuration.nix
Normal file
@@ -0,0 +1,153 @@
|
||||
# Example NixOS Configuration using m3ta-nixpkgs
|
||||
# This file demonstrates how to integrate m3ta-nixpkgs into your NixOS system
|
||||
{
|
||||
description = "Example NixOS configuration with m3ta-nixpkgs";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
# Add m3ta-nixpkgs as an input
|
||||
m3ta-nixpkgs = {
|
||||
url = "git+https://code.m3ta.dev/m3tam3re/nixpkgs";
|
||||
# Or use a local path during development:
|
||||
# url = "path:/home/user/projects/m3ta-nixpkgs";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
m3ta-nixpkgs,
|
||||
home-manager,
|
||||
...
|
||||
} @ inputs: {
|
||||
nixosConfigurations = {
|
||||
# Replace 'hostname' with your actual hostname
|
||||
hostname = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
|
||||
specialArgs = {inherit inputs;};
|
||||
|
||||
modules = [
|
||||
# Your hardware configuration
|
||||
./hardware-configuration.nix
|
||||
|
||||
# Import m3ta's NixOS modules (if any are defined)
|
||||
m3ta-nixpkgs.nixosModules.default
|
||||
|
||||
# Main configuration
|
||||
({pkgs, ...}: {
|
||||
# ============================================
|
||||
# METHOD 1: Using Overlays (Recommended)
|
||||
# ============================================
|
||||
# This makes custom packages available as if they were in nixpkgs
|
||||
nixpkgs.overlays = [
|
||||
m3ta-nixpkgs.overlays.default
|
||||
# Or use individual overlays for more control:
|
||||
# m3ta-nixpkgs.overlays.additions
|
||||
# m3ta-nixpkgs.overlays.modifications
|
||||
];
|
||||
|
||||
# Now you can use packages normally
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Custom packages from m3ta-nixpkgs
|
||||
code2prompt
|
||||
hyprpaper-random
|
||||
msty-studio
|
||||
pomodoro-timer
|
||||
tuxedo-backlight
|
||||
zellij-ps
|
||||
|
||||
# Regular nixpkgs packages
|
||||
vim
|
||||
git
|
||||
htop
|
||||
];
|
||||
|
||||
# ============================================
|
||||
# METHOD 2: Direct Package Reference
|
||||
# ============================================
|
||||
# Use this if you don't want to use overlays
|
||||
# environment.systemPackages = [
|
||||
# inputs.m3ta-nixpkgs.packages.${pkgs.system}.code2prompt
|
||||
# inputs.m3ta-nixpkgs.packages.${pkgs.system}.zellij-ps
|
||||
# ];
|
||||
|
||||
# ============================================
|
||||
# Using Custom NixOS Modules
|
||||
# ============================================
|
||||
# If you've defined custom NixOS modules, configure them here
|
||||
# m3ta.myModule = {
|
||||
# enable = true;
|
||||
# # module-specific options
|
||||
# };
|
||||
|
||||
# ============================================
|
||||
# System Configuration
|
||||
# ============================================
|
||||
system.stateVersion = "24.05";
|
||||
networking.hostName = "hostname";
|
||||
|
||||
# Enable flakes
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
})
|
||||
|
||||
# ============================================
|
||||
# Home Manager Integration
|
||||
# ============================================
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.m3tam3re = {pkgs, ...}: {
|
||||
# Import m3ta's Home Manager modules
|
||||
imports = [
|
||||
m3ta-nixpkgs.homeManagerModules.default
|
||||
# Or import specific modules:
|
||||
# m3ta-nixpkgs.homeManagerModules.zellij-ps
|
||||
];
|
||||
|
||||
# Home Manager packages with overlay
|
||||
home.packages = with pkgs; [
|
||||
launch-webapp
|
||||
# Other packages...
|
||||
];
|
||||
|
||||
# Configure custom Home Manager modules
|
||||
# programs.myProgram = {
|
||||
# enable = true;
|
||||
# # options...
|
||||
# };
|
||||
|
||||
home.stateVersion = "24.05";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# ============================================
|
||||
# Alternative: Minimal Configuration
|
||||
# ============================================
|
||||
minimal = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
({pkgs, ...}: {
|
||||
nixpkgs.overlays = [m3ta-nixpkgs.overlays.default];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
code2prompt
|
||||
];
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user