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; programs.home-manager.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
homeModules = { modules.home = {
apps = { apps = {
chromium.enable = true; chromium.enable = true;
flatpak.enable = true; flatpak.enable = true;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,16 +2,16 @@
with lib; with lib;
let let
cfg = config.homeModules.apps.kitty; cfg = config.modules.home.apps.kitty;
in in
{ {
options.homeModules.apps.kitty = { options.modules.home.apps.kitty = {
enable = mkEnableOption '' enable = mkEnableOption ''
Enable kitty with my custom configurations Enable kitty with my custom configurations
''; '';
enableBlur = mkOption { 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; example = true;
description = '' description = ''
Enable blur (Usefull to disable with hyprland) Enable blur (Usefull to disable with hyprland)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.system.bluetooth; cfg = config.modules.system.hardware.bluetooth;
in in
{ {
options.modules.system.bluetooth = { options.modules.system.hardware.bluetooth = {
enable = mkEnableOption '' enable = mkEnableOption ''
Enable pipewire with my custom configurations 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; with lib;
let let
cfg = config.modules.system.gamingKernel; cfg = config.modules.system.hardware.gamingKernel;
in in
{ {
options.modules.system.gamingKernel = { options.modules.system.hardware.gamingKernel = {
enable = mkEnableOption '' enable = mkEnableOption ''
Enable gaming kernel with my custom configurations Enable gaming kernel with my custom configurations
''; '';

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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