Restructure home and system modules

This commit is contained in:
Florian RICHER 2024-05-27 22:40:30 +02:00
parent b86a8b50c7
commit a03355b3a1
35 changed files with 82 additions and 82 deletions

View file

@ -15,7 +15,7 @@
programs.home-manager.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
homeModules = {
modules.home = {
apps = {
chromium.enable = true;
flatpak.enable = true;

View file

@ -7,7 +7,7 @@
{
imports =
[
../../modules
../../modules/system
# Include the results of the hardware scan.
./hardware-configuration.nix
@ -35,7 +35,7 @@
};
};
modules = {
modules.system = {
desktop = {
plasma.enable = true;
};
@ -45,7 +45,7 @@
openssh.enable = true;
};
system = {
hardware = {
bluetooth.enable = true;
gamingKernel.enable = true;
keymaps.layout = "us";

View file

@ -7,7 +7,7 @@
{
imports =
[
../../modules
../../modules/system
# Include the results of the hardware scan.
./hardware-configuration.nix
@ -19,12 +19,12 @@
networking.hostName = "nixos-desktop-perso"; # Define your hostname.
modules = {
modules.system = {
desktop = {
plasma.enable = true;
};
system = {
hardware = {
bluetooth.enable = true;
gamingKernel.enable = true;
keymaps.layout = "us";

View file

@ -7,7 +7,7 @@
{
imports =
[
../../modules
../../modules/system
# Include the results of the hardware scan.
./hardware-configuration.nix
@ -32,12 +32,12 @@
nvidiaBusId = "PCI:1:0:0";
};
modules = {
modules.system = {
desktop = {
plasma.enable = true;
};
system = {
hardware = {
bluetooth.enable = true;
gamingKernel.enable = true;
keymaps.layout = "us";

View file

@ -7,7 +7,7 @@
{
imports =
[
../../modules
../../modules/system
# Include the results of the hardware scan.
./hardware-configuration.nix
@ -32,12 +32,12 @@
nvidiaBusId = "PCI:1:0:0";
};
modules = {
modules.system = {
desktop = {
plasma.enable = true;
};
system = {
hardware = {
bluetooth.enable = true;
gamingKernel.enable = true;
keymaps.layout = "us";

View file

@ -1,9 +0,0 @@
{ config, pkgs, ... }:
{
imports = [
./desktop
./server
./system
];
}

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.homeModules.apps.chromium;
cfg = config.modules.home.apps.chromium;
in
{
options.homeModules.apps.chromium = {
options.modules.home.apps.chromium = {
enable = mkEnableOption ''
Enable chromium with my custom configurations
'';

View file

@ -2,12 +2,12 @@
with lib;
let
cfg = config.homeModules.apps.flatpak;
cfg = config.modules.home.apps.flatpak;
in
{
imports = [ nix-flatpak.homeManagerModules.nix-flatpak ];
options.homeModules.apps.flatpak = {
options.modules.home.apps.flatpak = {
enable = mkEnableOption ''
Enable flatpak with my custom configurations
'';

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.homeModules.apps.jetbrainsToolbox;
cfg = config.modules.home.apps.jetbrainsToolbox;
in
{
options.homeModules.apps.jetbrainsToolbox = {
options.modules.home.apps.jetbrainsToolbox = {
enable = mkEnableOption ''
Enable jetbrainsToolbox with my custom configurations
'';

View file

@ -2,16 +2,16 @@
with lib;
let
cfg = config.homeModules.apps.kitty;
cfg = config.modules.home.apps.kitty;
in
{
options.homeModules.apps.kitty = {
options.modules.home.apps.kitty = {
enable = mkEnableOption ''
Enable kitty with my custom configurations
'';
enableBlur = mkOption {
default = !config.homeModules.desktop.hyprland.enable; # Disable by default if hyprland is enabled (Hyprland enable own blur)
default = !config.modules.home.desktop.hyprland.enable; # Disable by default if hyprland is enabled (Hyprland enable own blur)
example = true;
description = ''
Enable blur (Usefull to disable with hyprland)

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.homeModules.apps.vscode;
cfg = config.modules.home.apps.vscode;
in
{
options.homeModules.apps.vscode = {
options.modules.home.apps.vscode = {
enable = mkEnableOption ''
Enable vscode with my custom configurations
'';

View file

@ -2,7 +2,7 @@
with lib;
let
cfg = config.homeModules.desktop.hyprland;
cfg = config.modules.home.desktop.hyprland;
set_volume = pkgs.writeScriptBin "set_volume.sh" ''
#!${pkgs.runtimeShell}
@ -10,13 +10,13 @@ let
'';
in
{
options.homeModules.desktop.hyprland = {
options.modules.home.desktop.hyprland = {
enable = mkEnableOption ''
Enable hyprland with my custom configurations
'';
};
config = mkIf cfg.enable {
homeModules.apps.kitty.enable = true;
modules.home.apps.kitty.enable = true;
wayland.windowManager.hyprland = {
enable = true;

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.homeModules.shell.atuin;
cfg = config.modules.home.shell.atuin;
in
{
options.homeModules.shell.atuin = {
options.modules.home.shell.atuin = {
enable = mkEnableOption ''
Enable atuin with my custom configurations
'';

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.homeModules.shell.direnv;
cfg = config.modules.home.shell.direnv;
in
{
options.homeModules.shell.direnv = {
options.modules.home.shell.direnv = {
enable = mkEnableOption ''
Enable direnv with my custom configurations
'';

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.homeModules.shell.git;
cfg = config.modules.home.shell.git;
in
{
options.homeModules.shell.git = {
options.modules.home.shell.git = {
enable = mkEnableOption ''
Enable git with my custom configurations
'';

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.homeModules.shell.zsh;
cfg = config.modules.home.shell.zsh;
in
{
options.homeModules.shell.zsh = {
options.modules.home.shell.zsh = {
enable = mkEnableOption ''
Enable zsh with my custom configurations
'';

View file

@ -1,17 +1,9 @@
{ ... }:
{ config, pkgs, ... }:
{
imports = [
./bluetooth
./gamingKernel
./keymaps
./nvidia
./pipewire
./plymouth
./printing
./waydroid
# Common configuration
./system.nix
./desktop
./hardware
./server
];
}

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.modules.desktop.gnome;
cfg = config.modules.system.desktop.gnome;
in
{
options.modules.desktop.gnome = {
options.modules.system.desktop.gnome = {
enable = mkEnableOption ''
Enable gnome with my custom configurations
'';

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.modules.desktop.plasma;
cfg = config.modules.system.desktop.plasma;
in
{
options.modules.desktop.plasma = {
options.modules.system.desktop.plasma = {
enable = mkEnableOption ''
Enable plasma with my custom configurations
'';
@ -36,7 +36,7 @@ in
# Uncomment when kwin is available in nixpkgs and NVIDIA 555
nixpkgs.overlays = [
(import ../../../overlays/kwin)
(import ../../../../overlays/kwin)
];
};
}

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.modules.system.bluetooth;
cfg = config.modules.system.hardware.bluetooth;
in
{
options.modules.system.bluetooth = {
options.modules.system.hardware.bluetooth = {
enable = mkEnableOption ''
Enable pipewire with my custom configurations
'';

View file

@ -0,0 +1,17 @@
{ ... }:
{
imports = [
./bluetooth
./gamingKernel
./keymaps
./nvidia
./pipewire
./plymouth
./printing
./waydroid
# Common configuration
./common.nix
];
}

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.modules.system.gamingKernel;
cfg = config.modules.system.hardware.gamingKernel;
in
{
options.modules.system.gamingKernel = {
options.modules.system.hardware.gamingKernel = {
enable = mkEnableOption ''
Enable gaming kernel with my custom configurations
'';

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.modules.system.keymaps;
cfg = config.modules.system.hardware.keymaps;
in
{
options.modules.system.keymaps = {
options.modules.system.hardware.keymaps = {
layout = mkOption {
default = "fr";
example = "fr";

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.modules.system.nvidia;
cfg = config.modules.system.hardware.nvidia;
in
{
options.modules.system.nvidia = {
options.modules.system.hardware.nvidia = {
enable = mkEnableOption ''
Enable nvidia with my custom configurations
'';

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.modules.system.pipewire;
cfg = config.modules.system.hardware.pipewire;
in
{
options.modules.system.pipewire = {
options.modules.system.hardware.pipewire = {
enable = mkEnableOption ''
Enable pipewire with my custom configurations
'';

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.modules.system.plymouth;
cfg = config.modules.system.hardware.plymouth;
in
{
options.modules.system.plymouth = {
options.modules.system.hardware.plymouth = {
enable = mkEnableOption ''
Enable plymouth with my custom configurations
'';

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.modules.system.printing;
cfg = config.modules.system.hardware.printing;
in
{
options.modules.system.printing = {
options.modules.system.hardware.printing = {
enable = mkEnableOption ''
Enable printing with my custom configurations
'';

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.modules.system.waydroid;
cfg = config.modules.system.hardware.waydroid;
in
{
options.modules.system.waydroid = {
options.modules.system.hardware.waydroid = {
enable = mkEnableOption ''
Enable waydroid with my custom configurations
'';

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.modules.server.docker;
cfg = config.modules.system.server.docker;
in
{
options.modules.server.docker = {
options.modules.system.server.docker = {
enable = mkEnableOption ''
Enable docker with my custom configurations
'';
@ -13,7 +13,7 @@ in
config = mkIf cfg.enable {
virtualisation.docker = {
enable = true;
enableNvidia = config.modules.system.nvidia.enable;
enableNvidia = config.modules.system.hardware.nvidia.enable;
};
};
}

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.modules.server.openssh;
cfg = config.modules.system.server.openssh;
in
{
options.modules.server.openssh = {
options.modules.system.server.openssh = {
enable = mkEnableOption ''
Enable openssh with my custom configurations
'';