Begin stabilize system module

This commit is contained in:
Florian RICHER 2024-05-25 23:51:37 +02:00
parent edcbfaf379
commit 6163188786
24 changed files with 63 additions and 59 deletions

View file

@ -19,10 +19,10 @@
}; };
outputs = inputs@{ outputs = inputs@{
nixpkgs, nixpkgs,
home-manager, home-manager,
agenix, agenix,
... ...
}: }:
let let
systems = [ systems = [
@ -37,15 +37,14 @@
${s.name} = nixpkgs.lib.nixosSystem { ${s.name} = nixpkgs.lib.nixosSystem {
inherit (s) system; inherit (s) system;
modules = [ modules = [
./lib
./hosts/${s.name} ./hosts/${s.name}
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
agenix.nixosModules.default agenix.nixosModules.default
]; ];
home-manager.useGlobalPkgs = true; # home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; # home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = inputs; # home-manager.extraSpecialArgs = inputs;
}; };
}) {} systems; }) {} systems;
}; };

View file

@ -42,6 +42,23 @@
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
}; };
modules = {
# users.florian = {
# };
system = {
bluetooth.enable = true;
gamingKernel.enable = true;
# keymaps.layout = "fr";
nvidia.enable = true;
pipewire.enable = true;
plymouth.enable = true;
printing.enable = true;
waydroid.enable = true;
};
};
# Configure for testing in vm # Configure for testing in vm
virtualisation.vmVariant = { virtualisation.vmVariant = {
# following configuration is added only when building VM with build-vm # following configuration is added only when building VM with build-vm

View file

@ -1,15 +0,0 @@
{ lib, ... }:
let
applyHomeManagerConfig = { home-manager, ... }: let
applyConfig = user: {
home-manager.users.${user.name} = user.config;
};
in
{
home-manager.users = lib.foldl' (acc: user: acc // applyConfig user) {} (lib.attrValues home-manager.users);
};
in
{
applyHomeManagerConfig = applyHomeManagerConfig;
}

View file

@ -2,9 +2,9 @@
{ {
imports = [ imports = [
./cli # ./cli
./desktop # ./desktop
./server # ./server
./system ./system
]; ];
} }

View file

@ -2,14 +2,8 @@
{ {
imports = [ imports = [
./chromium
./flatpak
./gamingKernel
./gnome ./gnome
./hyprland ./hyprland
./jetbrainsToolbox
./kitty
./plasma ./plasma
./vscode
]; ];
} }

View file

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

11
modules/home/default.nix Normal file
View file

@ -0,0 +1,11 @@
{ config, pkgs, ... }:
{
imports = [
./chromium
./flatpak
./jetbrainsToolbox
./kitty
./vscode
];
}

View file

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

View file

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }: { config, lib, ... }:
with lib; with lib;
let let

View file

@ -1,13 +1,15 @@
{ config, pkgs, ... }: { ... }:
{ {
imports = [ imports = [
./bluetooth ./bluetooth
./keymaps ./gamingKernel
# ./keymaps
./nvidia ./nvidia
./pipewire ./pipewire
./plymouth ./plymouth
./printing ./printing
./waydroid
# Common configuration # Common configuration
./system.nix ./system.nix

View file

@ -2,15 +2,15 @@
with lib; with lib;
let let
cfg = config.modules.desktop.gamingKernel; cfg = config.modules.system.gamingKernel;
in in
{ {
options.modules.desktop.gamingKernel = { options.modules.system.gamingKernel = {
enable = mkEnableOption '' enable = mkEnableOption ''
Enable gaming kernel with my custom configurations Enable gaming kernel with my custom configurations
''; '';
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
virtualisation.waydroid.enable = true; boot.kernelPackages = pkgs.linuxPackages_zen;
}; };
} }

View file

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }: { config, lib, ... }:
with lib; with lib;
let let
@ -15,9 +15,5 @@ in
type = types.string; type = types.string;
}; };
}; };
config = { config = (import ./${cfg.layout}.nix {});
imports = [
./${cfg.layout}
];
};
} }

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { ... }:
{ {
# Configure keymap in X11 # Configure keymap in X11
services.xserver = { services.xserver = {

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { ... }:
{ {
# Configure keymap in X11 # Configure keymap in X11
services.xserver = { services.xserver = {

View file

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }: { config, lib, ... }:
with lib; with lib;
let let

View file

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }: { config, lib, ... }:
with lib; with lib;
let let

View file

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }: { config, lib, ... }:
with lib; with lib;
let let

View file

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }: { config, lib, ... }:
with lib; with lib;
let let

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { pkgs, ... }:
{ {
# Set your time zone. # Set your time zone.

View file

@ -2,15 +2,15 @@
with lib; with lib;
let let
cfg = config.modules.desktop.waydroid; cfg = config.modules.system.waydroid;
in in
{ {
options.modules.desktop.waydroid = { options.modules.system.waydroid = {
enable = mkEnableOption '' enable = mkEnableOption ''
Enable waydroid with my custom configurations Enable waydroid with my custom configurations
''; '';
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
boot.kernelPackages = pkgs.linuxPackages_zen; virtualisation.waydroid.enable = true;
}; };
} }