tweak: user-parts options
This commit is contained in:
parent
23fd5899b6
commit
5535b5439d
3 changed files with 15 additions and 85 deletions
|
|
@ -7,7 +7,9 @@
|
||||||
# in place of regular declarations.
|
# in place of regular declarations.
|
||||||
# eg.
|
# eg.
|
||||||
#
|
#
|
||||||
# home-manager.${user-parts.user.username} = {
|
# home-manager.users.${user-parts.user.username} = {
|
||||||
|
# OR
|
||||||
|
# home-manager.users.${config.nixos.user-parts.user.username} = {
|
||||||
#
|
#
|
||||||
# # # copies wallpapers from flake into ~/
|
# # # copies wallpapers from flake into ~/
|
||||||
# # home.file."Wallpapers" = {
|
# # home.file."Wallpapers" = {
|
||||||
|
|
@ -22,7 +24,7 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
options.nixos.variables = {
|
options.nixos.user-parts = {
|
||||||
user = lib.mkOption {
|
user = lib.mkOption {
|
||||||
type = lib.types.submodule {
|
type = lib.types.submodule {
|
||||||
options = {
|
options = {
|
||||||
|
|
@ -65,7 +67,7 @@
|
||||||
config = {
|
config = {
|
||||||
# Make `nixos-variables` available as a module argument to all NixOS
|
# Make `nixos-variables` available as a module argument to all NixOS
|
||||||
# modules (home-manager modules already get it via extraSpecialArgs).
|
# modules (home-manager modules already get it via extraSpecialArgs).
|
||||||
_module.args.nixos-variables = config.nixos.variables;
|
_module.args.user-parts = config.nixos.variables;
|
||||||
nixos.variables = {
|
nixos.variables = {
|
||||||
home-directory = lib.mkDefault "/home/${config.nixos.variables.user.username}";
|
home-directory = lib.mkDefault "/home/${config.nixos.variables.user.username}";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
# User Options Module
|
|
||||||
#
|
|
||||||
# This module defines the core user-level configuration options that are used
|
|
||||||
# throughout the system. These options provide a centralized way to configure
|
|
||||||
# user-specific settings without modifying individual modules.
|
|
||||||
#
|
|
||||||
# Usage:
|
|
||||||
# Set these options in your host configuration (e.g., hosts/Desktop/modules/userOptions.nix):
|
|
||||||
#
|
|
||||||
# config.userOptions = {
|
|
||||||
# username = "myuser";
|
|
||||||
# hostName = "myhost";
|
|
||||||
# browser = "firefox";
|
|
||||||
# colorScheme = "kanagawa";
|
|
||||||
# wallpaper = "kanagawa.png";
|
|
||||||
# dots = "/home/myuser/.dotfiles";
|
|
||||||
# };
|
|
||||||
#
|
|
||||||
# These options are then accessible throughout all modules via `config.user-options.*`
|
|
||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
# user options module declaration
|
|
||||||
flake.nixosModules.user-parts2 =
|
|
||||||
{ lib, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
# list of per user options available
|
|
||||||
options.user-options = {
|
|
||||||
|
|
||||||
# currently unused
|
|
||||||
colorScheme = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = ''
|
|
||||||
The base16 color scheme name for Stylix theming.
|
|
||||||
This will be used to theme all compatible applications system-wide.
|
|
||||||
|
|
||||||
Available schemes: https://github.com/tinted-theming/schemes
|
|
||||||
Popular options: "kanagawa", "catppuccin-macchiato", "tokyo-night", "gruvbox-dark-medium", "nord"
|
|
||||||
'';
|
|
||||||
example = "kanagawa";
|
|
||||||
};
|
|
||||||
|
|
||||||
# where config is stored
|
|
||||||
dots = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = ''
|
|
||||||
The absolute path to the dotfiles repository (flake root).
|
|
||||||
Used by various modules to reference assets and configuration files.
|
|
||||||
'';
|
|
||||||
example = "/home/user/.dotfiles";
|
|
||||||
};
|
|
||||||
|
|
||||||
# username to use
|
|
||||||
username = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = ''
|
|
||||||
The primary user's username for this system.
|
|
||||||
This is used throughout the configuration for Home Manager and user-specific settings.
|
|
||||||
'';
|
|
||||||
example = "myuser";
|
|
||||||
};
|
|
||||||
|
|
||||||
# wallpaper to use
|
|
||||||
wallpaper = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = ''
|
|
||||||
The wallpaper filename (without path).
|
|
||||||
The file should be located in the assets/ directory of this repository.
|
|
||||||
Stylix will use this wallpaper and can optionally generate colors from it.
|
|
||||||
'';
|
|
||||||
example = "kanagawa.png";
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -5,7 +5,12 @@
|
||||||
# user module declaration
|
# user module declaration
|
||||||
flake.nixosModules.serenity =
|
flake.nixosModules.serenity =
|
||||||
|
|
||||||
{ pkgs, config, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
user-parts,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
|
@ -28,6 +33,10 @@
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
user-parts = {
|
||||||
|
user.username = "serenity";
|
||||||
|
};
|
||||||
|
|
||||||
# configure user here
|
# configure user here
|
||||||
#config.user-options = {
|
#config.user-options = {
|
||||||
#username = "serenity";
|
#username = "serenity";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue