First work

This commit is contained in:
Florian RICHER 2024-05-27 22:23:32 +02:00
parent be2affebef
commit b86a8b50c7
20 changed files with 138 additions and 148 deletions

View file

@ -40,6 +40,12 @@
./hosts/${s.name}
home-manager.nixosModules.home-manager
agenix.nixosModules.default
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = inputs;
home-manager.users.florian = import ./home;
}
];
};
}) {} systems;

35
home/default.nix Normal file
View file

@ -0,0 +1,35 @@
{ config, pkgs, ... }:
{
imports = [
../modules/home
];
home = {
username = "florian";
homeDirectory = "/home/florian";
stateVersion = "24.05";
};
programs.home-manager.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
homeModules = {
apps = {
chromium.enable = true;
flatpak.enable = true;
jetbrainsToolbox.enable = true;
kitty.enable = true;
vscode.enable = true;
};
shell = {
zsh.enable = true;
atuin.enable = true;
direnv.enable = true;
git.enable = true;
};
};
}

View file

@ -23,30 +23,19 @@
};
};
# Define a user account. Don't forget to set a password with passwd.
users.users.florian = {
isNormalUser = true;
initialPassword = "test";
description = "florian";
extraGroups = [ "networkmanager" "wheel" ];
};
home-manager.users.florian = {
home = {
username = "florian";
homeDirectory = "/home/florian";
networking.hostName = "nixos-vm"; # Define your hostname.
users.users.florian.initialPassword = "test";
stateVersion = "24.05";
# Configure for testing in vm
virtualisation.vmVariant = {
# following configuration is added only when building VM with build-vm
virtualisation = {
memorySize = 8192; # Use 8192MiB memory.
cores = 8;
};
programs.home-manager.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
};
modules = {
home.users.florian = {
};
desktop = {
plasma.enable = true;
};
@ -67,15 +56,4 @@
waydroid.enable = true;
};
};
# Configure for testing in vm
virtualisation.vmVariant = {
# following configuration is added only when building VM with build-vm
virtualisation = {
memorySize = 8192; # Use 8192MiB memory.
cores = 8;
};
};
networking.hostName = "nixos-vm"; # Define your hostname.
}

View file

@ -17,23 +17,22 @@
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.florian = {
isNormalUser = true;
description = "florian";
extraGroups = [ "networkmanager" "wheel" ];
};
home-manager.users.florian = {
home = {
username = "florian";
homeDirectory = "/home/florian";
networking.hostName = "nixos-desktop-perso"; # Define your hostname.
stateVersion = "24.05";
modules = {
desktop = {
plasma.enable = true;
};
programs.home-manager.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
system = {
bluetooth.enable = true;
gamingKernel.enable = true;
keymaps.layout = "us";
nvidia.enable = true;
pipewire.enable = true;
plymouth.enable = true;
printing.enable = true;
waydroid.enable = true;
};
};
networking.hostName = "nixos-desktop-perso"; # Define your hostname.
}

View file

@ -17,24 +17,6 @@
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.florian = {
isNormalUser = true;
description = "florian";
extraGroups = [ "networkmanager" "wheel" ];
};
home-manager.users.florian = {
home = {
username = "florian";
homeDirectory = "/home/florian";
stateVersion = "24.05";
};
programs.home-manager.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
};
networking.hostName = "nixos-laptop-perso"; # Define your hostname.
hardware.nvidia.prime = {
@ -50,5 +32,20 @@
nvidiaBusId = "PCI:1:0:0";
};
# customModules.gpuPassthrough.enable = true;
modules = {
desktop = {
plasma.enable = true;
};
system = {
bluetooth.enable = true;
gamingKernel.enable = true;
keymaps.layout = "us";
nvidia.enable = true;
pipewire.enable = true;
plymouth.enable = true;
printing.enable = true;
waydroid.enable = true;
};
};
}

View file

@ -17,24 +17,6 @@
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.florian = {
isNormalUser = true;
description = "florian";
extraGroups = [ "networkmanager" "wheel" ];
};
home-manager.users.florian = {
home = {
username = "florian";
homeDirectory = "/home/florian";
stateVersion = "24.05";
};
programs.home-manager.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
};
networking.hostName = "nixos-laptop-pro"; # Define your hostname.
hardware.nvidia.prime = {
@ -49,4 +31,21 @@
# information bus: pci@0000:01:00.0
nvidiaBusId = "PCI:1:0:0";
};
modules = {
desktop = {
plasma.enable = true;
};
system = {
bluetooth.enable = true;
gamingKernel.enable = true;
keymaps.layout = "us";
nvidia.enable = true;
pipewire.enable = true;
plymouth.enable = true;
printing.enable = true;
waydroid.enable = true;
};
};
}

View file

@ -3,7 +3,6 @@
{
imports = [
./desktop
./home
./server
./system
];

View file

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

View file

@ -1,17 +1,19 @@
{ config, pkgs, lib, ... }:
{ config, pkgs, lib, nix-flatpak, ... }:
with lib;
let
cfg = config.modules.desktop.flatpak;
cfg = config.homeModules.apps.flatpak;
in
{
options.modules.desktop.flatpak = {
imports = [ nix-flatpak.homeManagerModules.nix-flatpak ];
options.homeModules.apps.flatpak = {
enable = mkEnableOption ''
Enable flatpak with my custom configurations
'';
};
config = mkIf cfg.enable {
imports = [ nix-flatpak.homeManagerModules.nix-flatpak ];
services.flatpak = {
enable = true;

View file

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

View file

@ -2,16 +2,16 @@
with lib;
let
cfg = config.modules.desktop.kitty;
cfg = config.homeModules.apps.kitty;
in
{
options.modules.desktop.kitty = {
options.homeModules.apps.kitty = {
enable = mkEnableOption ''
Enable kitty with my custom configurations
'';
enableBlur = mkOption {
default = !config.desktop.hyprland.enable; # Disable by default if hyprland is enabled (Hyprland enable own blur)
default = !config.homeModules.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.modules.home.vscode;
cfg = config.homeModules.apps.vscode;
in
{
options.modules.home.vscode = {
options.homeModules.apps.vscode = {
enable = mkEnableOption ''
Enable vscode with my custom configurations
'';

View file

@ -1,43 +1,10 @@
inputs@{ config, pkgs, lib, ... }:
{ config, pkgs, ... }:
with lib;
let
cfg = config.modules.home;
userOpts = { name, userconfig, ... }: {
options = {};
config = {
# home = {
# username = name;
# homeDirectory = "/home/${name}";
# stateVersion = "24.05";
# };
};
};
in
{
options.modules.home = {
users = mkOption {
default = {};
type = with types; attrsOf (submodule userOpts);
example = {
alice = {
shell.atuin.enable = true;
shell.direnv.enable = true;
shell.git.enable = true;
shell.zsh.enable = true;
};
};
description = ''
Additional user home configuration
'';
};
};
config = {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = inputs;
home-manager.users = mapAttrs (name: userconfig: import ./home.nix) cfg.users;
};
imports = [
./apps
./desktop
./shell
];
}

View file

@ -2,7 +2,6 @@
{
imports = [
# ./apps
# ./shell
./hyprland
];
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -28,6 +28,15 @@
nixd
];
# Define a user account. Don't forget to set a password with passwd.
users.users.florian = {
isNormalUser = true;
description = "florian";
extraGroups = [ "networkmanager" "wheel" ];
};
services.flatpak.enable = true; # Important can't be enabled from home-manager
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary