[home] Refactor into roles
This commit is contained in:
38
home/home-desktop.nix
Normal file
38
home/home-desktop.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{ pkgs, globalInputs, system, ... }:
|
||||
|
||||
let
|
||||
customPkgs = pkgs.callPackage ../packages {};
|
||||
in
|
||||
{
|
||||
# Provide arguments to role modules
|
||||
_module.args = { inherit customPkgs; };
|
||||
# Home Manager configuration for full desktop experience
|
||||
home.username = "johno";
|
||||
home.homeDirectory = "/home/johno";
|
||||
home.stateVersion = "24.05";
|
||||
|
||||
# Enable all desktop roles for full-featured experience
|
||||
home.roles = {
|
||||
base.enable = true;
|
||||
desktop.enable = true;
|
||||
office.enable = true;
|
||||
media.enable = true;
|
||||
development.enable = true;
|
||||
communication.enable = true;
|
||||
sync.enable = true;
|
||||
kdeconnect.enable = true;
|
||||
};
|
||||
|
||||
targets.genericLinux.enable = true;
|
||||
home.sessionVariables = {};
|
||||
home.sessionPath = [];
|
||||
|
||||
imports = [
|
||||
./roles
|
||||
./modules/emacs
|
||||
./modules/i3+sway
|
||||
./modules/kubectl
|
||||
./modules/plasma-manager
|
||||
./modules/tmux
|
||||
];
|
||||
}
|
||||
41
home/home-laptop-compact.nix
Normal file
41
home/home-laptop-compact.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{ config, lib, pkgs, globalInputs, system, ... }:
|
||||
|
||||
let
|
||||
customPkgs = pkgs.callPackage ../packages {};
|
||||
in
|
||||
{
|
||||
# Provide arguments to role modules
|
||||
_module.args = { inherit customPkgs; };
|
||||
# Home Manager configuration for compact laptop setups
|
||||
# Optimized for space-constrained environments
|
||||
|
||||
home.username = "johno";
|
||||
home.homeDirectory = "/home/johno";
|
||||
home.stateVersion = "24.05";
|
||||
|
||||
# Enable essential roles only (exclude heavy office/media packages)
|
||||
home.roles = {
|
||||
base.enable = true;
|
||||
desktop.enable = true;
|
||||
development.enable = true;
|
||||
communication.enable = true;
|
||||
sync.enable = true;
|
||||
kdeconnect.enable = true;
|
||||
# office.enable = false; # Excluded for storage constraints
|
||||
# media.enable = false; # Excluded for storage constraints
|
||||
};
|
||||
|
||||
targets.genericLinux.enable = true;
|
||||
home.sessionVariables = {};
|
||||
home.sessionPath = [];
|
||||
|
||||
imports = [
|
||||
./roles
|
||||
./modules/emacs
|
||||
./modules/i3+sway
|
||||
./modules/kubectl
|
||||
./modules/plasma-manager
|
||||
./modules/tmux
|
||||
];
|
||||
|
||||
}
|
||||
42
home/home-live-usb.nix
Normal file
42
home/home-live-usb.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{ pkgs, globalInputs, system, ... }:
|
||||
|
||||
let
|
||||
customPkgs = pkgs.callPackage ../packages {};
|
||||
in
|
||||
{
|
||||
# Provide arguments to role modules
|
||||
_module.args = { inherit customPkgs; };
|
||||
# Home Manager configuration for live USB environments
|
||||
# Minimal setup without persistent services
|
||||
|
||||
home.username = "nixos";
|
||||
home.homeDirectory = "/home/nixos";
|
||||
home.stateVersion = "24.05";
|
||||
|
||||
# Enable minimal roles only (no sync or kdeconnect for live environment)
|
||||
home.roles = {
|
||||
base.enable = true;
|
||||
desktop.enable = true;
|
||||
# development.enable = false; # Not needed for live USB
|
||||
# communication.enable = false; # Not needed for live USB
|
||||
# office.enable = false; # Not needed for live USB
|
||||
# media.enable = false; # Not needed for live USB
|
||||
# sync.enable = false; # No persistent sync on live USB
|
||||
# kdeconnect.enable = false; # No device integration on live USB
|
||||
};
|
||||
|
||||
targets.genericLinux.enable = true;
|
||||
home.sessionVariables = {};
|
||||
home.sessionPath = [];
|
||||
|
||||
imports = [
|
||||
./roles
|
||||
./modules/emacs
|
||||
./modules/i3+sway
|
||||
./modules/kubectl
|
||||
./modules/plasma-manager
|
||||
./modules/tmux
|
||||
];
|
||||
|
||||
# Live USB specific overrides can go here if needed
|
||||
}
|
||||
42
home/home-media-center.nix
Normal file
42
home/home-media-center.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{ pkgs, globalInputs, system, ... }:
|
||||
|
||||
let
|
||||
customPkgs = pkgs.callPackage ../packages {};
|
||||
in
|
||||
{
|
||||
# Provide arguments to role modules
|
||||
_module.args = { inherit customPkgs; };
|
||||
# Home Manager configuration for media center setups
|
||||
# Optimized for living room media consumption and gaming
|
||||
|
||||
home.username = "johno";
|
||||
home.homeDirectory = "/home/johno";
|
||||
home.stateVersion = "24.05";
|
||||
|
||||
# Enable media center focused roles
|
||||
home.roles = {
|
||||
base.enable = true;
|
||||
desktop.enable = true;
|
||||
media.enable = true;
|
||||
communication.enable = true;
|
||||
kdeconnect.enable = true;
|
||||
development.enable = true;
|
||||
# office.enable = false; # Not needed for media center
|
||||
# sync.enable = false; # Shared machine, no personal file sync
|
||||
};
|
||||
|
||||
targets.genericLinux.enable = true;
|
||||
home.sessionVariables = {};
|
||||
home.sessionPath = [];
|
||||
|
||||
imports = [
|
||||
./roles
|
||||
./modules/emacs
|
||||
./modules/i3+sway
|
||||
./modules/kubectl
|
||||
./modules/plasma-manager
|
||||
./modules/tmux
|
||||
];
|
||||
|
||||
# Media center specific overrides can go here if needed
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./home.nix
|
||||
];
|
||||
|
||||
home.i3_sway.extraSwayConfig = {
|
||||
output.eDP-1.scale = "1.75";
|
||||
};
|
||||
}
|
||||
203
home/home.nix
203
home/home.nix
@@ -1,203 +0,0 @@
|
||||
{ pkgs, customPkgs, globalInputs, system, ... }:
|
||||
|
||||
let
|
||||
customPkgs = pkgs.callPackage ../packages {};
|
||||
in
|
||||
{
|
||||
# Home Manager needs a bit of information about you and the paths it should
|
||||
# manage.
|
||||
home.username = "johno";
|
||||
home.homeDirectory = "/home/johno";
|
||||
|
||||
# This value determines the Home Manager release that your configuration is
|
||||
# compatible with. This helps avoid breakage when a new Home Manager release
|
||||
# introduces backwards incompatible changes.
|
||||
#
|
||||
# You should not change this value, even if you update Home Manager. If you do
|
||||
# want to update the value, then make sure to first check the Home Manager
|
||||
# release notes.
|
||||
home.stateVersion = "24.05"; # Please read the comment before changing.
|
||||
|
||||
# The home.packages option allows you to install Nix packages into your
|
||||
# environment.
|
||||
home.packages = [
|
||||
# # Adds the 'hello' command to your environment. It prints a friendly
|
||||
# # "Hello, world!" when run.
|
||||
# pkgs.hello
|
||||
|
||||
# # It is sometimes useful to fine-tune packages, for example, by applying
|
||||
# # overrides. You can do that directly here, just don't forget the
|
||||
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
|
||||
# # fonts?
|
||||
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
|
||||
|
||||
# # You can also create simple shell scripts directly inside your
|
||||
# # configuration. For example, this adds a command 'my-hello' to your
|
||||
# # environment:
|
||||
# (pkgs.writeShellScriptBin "my-hello" ''
|
||||
# echo "Hello, ${config.home.username}!"
|
||||
# '')
|
||||
|
||||
pkgs.bitwarden
|
||||
pkgs.claude-code
|
||||
pkgs.codex
|
||||
pkgs.dunst
|
||||
pkgs.element-desktop
|
||||
pkgs.fd
|
||||
#pkgs.fluffychat # security vulnerability in current version
|
||||
pkgs.goose-cli
|
||||
pkgs.gzip
|
||||
pkgs.htop
|
||||
pkgs.jellyfin-media-player
|
||||
pkgs.keepassxc
|
||||
pkgs.killall
|
||||
pkgs.kitty
|
||||
pkgs.less
|
||||
pkgs.moonlight-qt
|
||||
pkgs.ncdu
|
||||
pkgs.nextcloud-talk-desktop
|
||||
pkgs.openscad-unstable
|
||||
pkgs.syncthingtray
|
||||
pkgs.pandoc
|
||||
#pkgs.pinentry-qt
|
||||
#pkgs.pytest
|
||||
pkgs.shellcheck
|
||||
pkgs.solaar # Logitech management software
|
||||
(pkgs.snapcast.override { pulseaudioSupport = true; })
|
||||
pkgs.tmux
|
||||
pkgs.waybar
|
||||
pkgs.wofi
|
||||
pkgs.vlc
|
||||
|
||||
## Kubernetes cluster management handled by kubectl-secure module
|
||||
|
||||
globalInputs.google-cookie-retrieval.packages.${system}.default
|
||||
|
||||
# Custom packages
|
||||
customPkgs.tea-rbw
|
||||
];
|
||||
|
||||
# Home Manager is pretty good at managing dotfiles. The primary way to manage
|
||||
# plain files is through 'home.file'.
|
||||
home.file = {
|
||||
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
|
||||
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
|
||||
# # symlink to the Nix store copy.
|
||||
# ".screenrc".source = dotfiles/screenrc;
|
||||
|
||||
# # You can also set the file content immediately.
|
||||
# ".gradle/gradle.properties".text = ''
|
||||
# org.gradle.console=verbose
|
||||
# org.gradle.daemon.idletimeout=3600000
|
||||
# '';
|
||||
};
|
||||
|
||||
targets.genericLinux.enable = true;
|
||||
|
||||
# Home Manager can also manage your environment variables through
|
||||
# 'home.sessionVariables'. These will be explicitly sourced when using a
|
||||
# shell provided by Home Manager. If you don't want to manage your shell
|
||||
# through Home Manager then you have to manually source 'hm-session-vars.sh'
|
||||
# located at either
|
||||
#
|
||||
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||
#
|
||||
# or
|
||||
#
|
||||
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
|
||||
#
|
||||
# or
|
||||
#
|
||||
# /etc/profiles/per-user/johno/etc/profile.d/hm-session-vars.sh
|
||||
#
|
||||
home.sessionVariables = {
|
||||
};
|
||||
|
||||
home.sessionPath = [
|
||||
];
|
||||
|
||||
imports = [
|
||||
./modules/emacs
|
||||
./modules/i3+sway
|
||||
./modules/kubectl
|
||||
./modules/plasma-manager
|
||||
./modules/tmux
|
||||
];
|
||||
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
initExtra = ''
|
||||
codex() {
|
||||
local key
|
||||
key="$(rbw get openai-api-key-codex)"
|
||||
OPENAI_API_KEY="$key" command codex "$@"
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
programs.command-not-found.enable = true;
|
||||
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "John Ogle";
|
||||
userEmail = "john@ogle.fyi";
|
||||
extraConfig = {
|
||||
safe.directory = "/etc/nixos";
|
||||
};
|
||||
};
|
||||
|
||||
programs.jq.enable = true;
|
||||
|
||||
programs.kubectl-secure.enable = true;
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
};
|
||||
|
||||
programs.rbw = {
|
||||
enable = true;
|
||||
settings = {
|
||||
email = "john@johnogle.info";
|
||||
base_url = "https://bitwarden.johnogle.info";
|
||||
pinentry = pkgs.pinentry-qt;
|
||||
};
|
||||
};
|
||||
|
||||
programs.spotify-player.enable = true;
|
||||
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
addKeysToAgent = "yes";
|
||||
matchBlocks = {
|
||||
"nucdeb1" = {
|
||||
hostname = "nucdeb1.oglehome";
|
||||
user = "root";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.kdeconnect = {
|
||||
enable = true;
|
||||
indicator = true;
|
||||
package = pkgs.kdePackages.kdeconnect-kde;
|
||||
};
|
||||
|
||||
services.gnome-keyring = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
xdg.enable = true;
|
||||
}
|
||||
86
home/roles/base/default.nix
Normal file
86
home/roles/base/default.nix
Normal file
@@ -0,0 +1,86 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.home.roles.base;
|
||||
in
|
||||
{
|
||||
options.home.roles.base = {
|
||||
enable = mkEnableOption "Enable base CLI tools and essential programs";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
# Core CLI utilities
|
||||
fd
|
||||
gzip
|
||||
htop
|
||||
killall
|
||||
less
|
||||
ncdu
|
||||
shellcheck
|
||||
tmux
|
||||
|
||||
# Development/automation tools that are widely used
|
||||
claude-code
|
||||
codex
|
||||
goose-cli
|
||||
pandoc
|
||||
];
|
||||
|
||||
# Essential programs everyone needs
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
initExtra = ''
|
||||
codex() {
|
||||
local key
|
||||
key="$(rbw get openai-api-key-codex)"
|
||||
OPENAI_API_KEY="$key" command codex "$@"
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
programs.command-not-found.enable = true;
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "John Ogle";
|
||||
userEmail = "john@ogle.fyi";
|
||||
extraConfig = {
|
||||
safe.directory = "/etc/nixos";
|
||||
};
|
||||
};
|
||||
|
||||
programs.jq.enable = true;
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
};
|
||||
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
addKeysToAgent = "yes";
|
||||
matchBlocks = {
|
||||
"nucdeb1" = {
|
||||
hostname = "nucdeb1.oglehome";
|
||||
user = "root";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.rbw = {
|
||||
enable = true;
|
||||
settings = {
|
||||
email = "john@johnogle.info";
|
||||
base_url = "https://bitwarden.johnogle.info";
|
||||
pinentry = pkgs.pinentry-qt;
|
||||
};
|
||||
};
|
||||
|
||||
# Note: modules must be imported at top-level home config
|
||||
};
|
||||
}
|
||||
24
home/roles/communication/default.nix
Normal file
24
home/roles/communication/default.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ config, lib, pkgs, globalInputs, system, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.home.roles.communication;
|
||||
in
|
||||
{
|
||||
options.home.roles.communication = {
|
||||
enable = mkEnableOption "Enable communication and messaging applications";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [
|
||||
# Communication apps
|
||||
pkgs.element-desktop
|
||||
pkgs.fluffychat
|
||||
pkgs.nextcloud-talk-desktop
|
||||
|
||||
# For logging back into google chat
|
||||
globalInputs.google-cookie-retrieval.packages.${system}.default
|
||||
];
|
||||
};
|
||||
}
|
||||
13
home/roles/default.nix
Normal file
13
home/roles/default.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
imports = [
|
||||
./base
|
||||
./communication
|
||||
./desktop
|
||||
./development
|
||||
./gaming
|
||||
./kdeconnect
|
||||
./media
|
||||
./office
|
||||
./sync
|
||||
];
|
||||
}
|
||||
44
home/roles/desktop/default.nix
Normal file
44
home/roles/desktop/default.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.home.roles.desktop;
|
||||
in
|
||||
{
|
||||
options.home.roles.desktop = {
|
||||
enable = mkEnableOption "Enable desktop GUI applications and utilities";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
# Desktop applications
|
||||
bitwarden
|
||||
dunst
|
||||
keepassxc
|
||||
kitty
|
||||
|
||||
# Desktop utilities
|
||||
solaar # Logitech management software
|
||||
waybar
|
||||
wofi
|
||||
|
||||
# System utilities with GUI components
|
||||
(snapcast.override { pulseaudioSupport = true; })
|
||||
];
|
||||
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.spotify-player.enable = true;
|
||||
|
||||
services.gnome-keyring = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
xdg.enable = true;
|
||||
|
||||
# Note: modules must be imported at top-level home config
|
||||
};
|
||||
}
|
||||
23
home/roles/development/default.nix
Normal file
23
home/roles/development/default.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{ config, lib, pkgs, customPkgs, globalInputs, system, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.home.roles.development;
|
||||
in
|
||||
{
|
||||
options.home.roles.development = {
|
||||
enable = mkEnableOption "Enable development tools and utilities";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [
|
||||
# Custom packages
|
||||
customPkgs.tea-rbw
|
||||
];
|
||||
|
||||
programs.kubectl-secure.enable = true;
|
||||
|
||||
# Note: modules must be imported at top-level home config
|
||||
};
|
||||
}
|
||||
20
home/roles/gaming/default.nix
Normal file
20
home/roles/gaming/default.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.home.roles.gaming;
|
||||
in
|
||||
{
|
||||
options.home.roles.gaming = {
|
||||
enable = mkEnableOption "Enable gaming applications and tools";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
# Gaming applications would go here
|
||||
# This role is created for future expansion
|
||||
# moonlight-qt is currently in media role but could be moved here
|
||||
];
|
||||
};
|
||||
}
|
||||
20
home/roles/kdeconnect/default.nix
Normal file
20
home/roles/kdeconnect/default.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.home.roles.kdeconnect;
|
||||
in
|
||||
{
|
||||
options.home.roles.kdeconnect = {
|
||||
enable = mkEnableOption "Enable KDE Connect for device integration";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.kdeconnect = {
|
||||
enable = true;
|
||||
indicator = true;
|
||||
package = pkgs.kdePackages.kdeconnect-kde;
|
||||
};
|
||||
};
|
||||
}
|
||||
21
home/roles/media/default.nix
Normal file
21
home/roles/media/default.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.home.roles.media;
|
||||
in
|
||||
{
|
||||
options.home.roles.media = {
|
||||
enable = mkEnableOption "Enable media and multimedia applications";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
# Media players and streaming
|
||||
jellyfin-media-player
|
||||
moonlight-qt
|
||||
vlc
|
||||
];
|
||||
};
|
||||
}
|
||||
22
home/roles/office/default.nix
Normal file
22
home/roles/office/default.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.home.roles.office;
|
||||
in
|
||||
{
|
||||
options.home.roles.office = {
|
||||
enable = mkEnableOption "Enable office applications and document processing tools";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
# Office suite
|
||||
libreoffice
|
||||
|
||||
# CAD/Design tools
|
||||
openscad-unstable
|
||||
];
|
||||
};
|
||||
}
|
||||
22
home/roles/sync/default.nix
Normal file
22
home/roles/sync/default.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.home.roles.sync;
|
||||
in
|
||||
{
|
||||
options.home.roles.sync = {
|
||||
enable = mkEnableOption "Enable file synchronization services";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
syncthingtray
|
||||
];
|
||||
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user