Continue refactoring

This commit is contained in:
Florian RICHER 2024-05-25 15:16:08 +02:00
parent 34c8b954e5
commit edcbfaf379
9 changed files with 95 additions and 68 deletions

View file

@ -37,11 +37,15 @@
${s.name} = nixpkgs.lib.nixosSystem {
inherit (s) system;
modules = [
./lib
./hosts/${s.name}
home-manager.nixosModules.home-manager
agenix.nixosModules.default
(import ./home/common-home-manager.nix { inherit inputs; })
];
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = inputs;
};
}) {} systems;
};

View file

@ -1,8 +0,0 @@
{ inputs, ... }:
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = inputs;
home-manager.users.florian = import ../home;
}

View file

@ -1,14 +0,0 @@
{ config, pkgs, ... }:
{
home = {
username = "florian";
homeDirectory = "/home/florian";
stateVersion = "24.05";
};
programs.home-manager.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
}

View file

@ -7,6 +7,8 @@
{
imports =
[
../../modules
# Include the results of the hardware scan.
./hardware-configuration.nix
];
@ -21,8 +23,26 @@
};
};
# 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";
stateVersion = "24.05";
};
programs.home-manager.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
};
# Configure for testing in vm
users.users.florian.initialPassword = "test";
virtualisation.vmVariant = {
# following configuration is added only when building VM with build-vm
virtualisation = {

View file

@ -1,8 +0,0 @@
{ config, pkgs, ... }:
{
imports =
[
];
}

View file

@ -7,18 +7,7 @@
{
imports =
[
../../modules/linux_gaming.nix
../../modules/system.nix
../../modules/network.nix
../../modules/nvidia.nix
../../modules/plasma.nix
../../modules/keymaps/us.nix
../../modules/bluetooth.nix
../../modules/pipewire.nix
../../modules/plymouth.nix
../../modules/waydroid.nix
../../modules # Import optional configuration
../../modules
# Include the results of the hardware scan.
./hardware-configuration.nix
@ -28,5 +17,23 @@
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-desktop-perso"; # Define your hostname.
}

View file

@ -7,17 +7,7 @@
{
imports =
[
../../modules/linux_gaming.nix
../../modules/system.nix
../../modules/network.nix
../../modules/nvidia.nix
../../modules/plasma.nix
../../modules/keymaps/fr.nix
../../modules/bluetooth.nix
../../modules/pipewire.nix
../../modules/plymouth.nix
../../modules # Import optional configuration
../../modules
# Include the results of the hardware scan.
./hardware-configuration.nix
@ -27,6 +17,24 @@
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 = {

View file

@ -7,17 +7,7 @@
{
imports =
[
../../modules/linux_gaming.nix
../../modules/system.nix
../../modules/network.nix
../../modules/nvidia.nix
../../modules/plasma.nix
../../modules/keymaps/fr.nix
../../modules/bluetooth.nix
../../modules/pipewire.nix
../../modules/plymouth.nix
../../modules # Import optional configuration
../../modules
# Include the results of the hardware scan.
./hardware-configuration.nix
@ -27,6 +17,24 @@
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 = {

View file

@ -1,5 +1,15 @@
{ config, ... }:
{ 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;
}