Refactor custom options

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-06-11 19:02:35 +01:00
parent 229169de0f
commit 0b15c9c3fa
27 changed files with 46 additions and 164 deletions

View File

@@ -1,4 +0,0 @@
{ ... }:
{
imports = [ ./options.nix ];
}

View File

@@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./cpu/options.nix
./impermanence/options.nix
];
}

View File

@@ -1,7 +1,5 @@
{ config, pkgs, ... }:
{
imports = [ ./options.nix ];
# uuidgen -r | tr -d -
# https://github.com/NixOS/nixpkgs/blob/master/nixos/doc/manual/administration/systemd-state.section.md
# https://github.com/NixOS/nixpkgs/pull/286140/files

View File

@@ -18,8 +18,6 @@
};
home-manager.users.${user} = {
imports = [ (import ./options.nix { inherit home; }) ];
xdg = {
enable = true;
mimeApps.enable = true;

View File

@@ -1,112 +0,0 @@
{
home ? throw "home argument is required",
}:
{ config, lib, ... }:
let
cfg = config.xdg;
in
{
options.xdg =
with lib;
with types;
{
relativeCacheHome = mkOption {
type = str;
readOnly = true;
default = ".cache";
description = "Relative path to directory holding application caches.";
};
relativeConfigHome = mkOption {
type = str;
readOnly = true;
default = ".config";
description = "Relative path to directory holding application configurations.";
};
relativeDataHome = mkOption {
type = str;
readOnly = true;
default = ".local/share";
description = "Relative path to directory holding application data.";
};
relativeStateHome = mkOption {
type = str;
readOnly = true;
default = ".local/state";
description = "Relative path to directory holding application states.";
};
userDirs = {
relativeDesktop = mkOption {
type = str;
readOnly = true;
default = "Desktop";
description = "Relative path to the Desktop directory.";
};
relativeDocuments = mkOption {
type = str;
readOnly = true;
default = "Documents";
description = "Relative path to the Documents directory.";
};
relativeDownload = mkOption {
type = str;
readOnly = true;
default = "Downloads";
description = "Relative path to the Downloads directory.";
};
relativeMusic = mkOption {
type = str;
readOnly = true;
default = "Music";
description = "Relative path to the Music directory.";
};
relativePictures = mkOption {
type = str;
readOnly = true;
default = "Pictures";
description = "Relative path to the Pictures directory.";
};
relativeTemplates = mkOption {
type = str;
readOnly = true;
default = "Templates";
description = "Relative path to the Templates directory.";
};
relativeVideos = mkOption {
type = str;
readOnly = true;
default = "Videos";
description = "Relative path to the Videos directory.";
};
};
};
config.xdg =
with lib;
with cfg;
{
cacheHome = mkDefault "${home}/${relativeCacheHome}";
configHome = mkDefault "${home}/${relativeConfigHome}";
dataHome = mkDefault "${home}/${relativeDataHome}";
stateHome = mkDefault "${home}/${relativeStateHome}";
userDirs = with userDirs; {
desktop = mkDefault "${home}/${relativeDesktop}";
documents = mkDefault "${home}/${relativeDocuments}";
download = mkDefault "${home}/${relativeDownload}";
music = mkDefault "${home}/${relativeMusic}";
pictures = mkDefault "${home}/${relativePictures}";
templates = mkDefault "${home}/${relativeTemplates}";
videos = mkDefault "${home}/${relativeVideos}";
};
};
}

View File

@@ -94,7 +94,7 @@ footer = { fg = "{{colors.surface.default.hex}}", bg = "{{colors.on_surface.def
prepend_dirs = [
{ name = ".cache", text = "" },
{ name = ".local", text = "󱋣" },
{ name = "Games", text = "" },
{ name = "Games", text = "󰊖" },
{ name = "git", text = "" },
{ name = "Templates", text = "" },
{ name = "VMs", text = "" },

View File

@@ -12,8 +12,6 @@
};
home-manager.users.${user} = {
imports = [ ./options.nix ];
programs.zsh = {
enable = true;
dotDir = ".config/zsh";

View File

@@ -0,0 +1,18 @@
{
user ? throw "user argument is required",
home ? throw "home argument is required",
}:
{ ... }:
{
imports = [
./options.nix
];
home-manager.users.${user}.imports = [
./console/zsh/options.nix
./gui/clipbook/options.nix
./gui/hyprland/options.nix
(import ./gui/theme/options.nix { inherit user home; })
./gui/vscode/options.nix
];
}

View File

@@ -13,8 +13,6 @@ let
in
{
home-manager.users.${user} = {
imports = [ ./options.nix ];
programs.clipbook.enable = true;
wayland.windowManager.hyprland.settings.bind =

View File

@@ -26,8 +26,6 @@
};
home-manager.users.${user} = {
imports = [ ./options.nix ];
wayland.windowManager.hyprland = {
enable = true;
systemd.enable = false;

View File

@@ -17,8 +17,6 @@ in
environment.persistence."/persist/state"."${home}/.config/theme" = { };
home-manager.users.${user} = {
imports = [ (import ./options.nix { inherit user home; }) ];
theme.enable = true;
wayland.windowManager.hyprland.settings.bind = [

View File

@@ -68,7 +68,7 @@ in
configDir = mkOption {
type = str;
default = "${config.xdg.configHome}/theme";
default = "${home}/.config/theme";
description = "The path to the theme config directory.";
};

View File

@@ -17,8 +17,6 @@ in
environment.persistence."/persist/state"."${home}/.config/Code" = { };
home-manager.users.${user} = {
imports = [ ./options.nix ];
programs.vscode = {
enable = true;
mutableExtensionsDir = false;