Add initial Nix flake configuration for PC and Laptop with Home Manager support

- Create flake.nix to define NixOS configurations for PC and Laptop
- Add README.md with setup instructions and layout overview
- Implement common NixOS settings in modules/common.nix
- Configure Home Manager for user-specific settings in home/users/user/home.nix
- Set up hardware configurations for both PC and Laptop
- Enable Home Manager integration in host configurations
- Introduce Zen Browser package definition
This commit is contained in:
2025-10-05 03:17:28 +01:00
commit b0dacb2bcf
9 changed files with 401 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
{ config, lib, pkgs, inputs, user, ... }:
{
imports = [
../../modules/common.nix
./hardware-configuration.nix
inputs.home-manager.nixosModules.home-manager
];
networking.hostName = "laptop";
# Host-specific tweaks
powerManagement.powertop.enable = true; # example: laptop power savings
services.tlp.enable = true;
users.users.${user} = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
};
# Home Manager user wiring
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${user} = import ../../home/users/${user}/home.nix;
};
}

View File

@@ -0,0 +1,19 @@
# NOTE: Replace with the actual generated hardware config from the laptop.
# Generate on the laptop with:
# sudo nixos-generate-config --show-hardware-config > hardware-configuration.nix
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/11111111-1111-1111-1111-111111111111";
fsType = "ext4";
};
swapDevices = [ ];
}

View File

@@ -0,0 +1,25 @@
{ config, lib, pkgs, inputs, user, ... }:
{
imports = [
../../modules/common.nix
./hardware-configuration.nix
inputs.home-manager.nixosModules.home-manager
];
networking.hostName = "pc";
# Host-specific tweaks
services.printing.enable = true; # example: enable printing on PC
users.users.${user} = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
};
# Home Manager user wiring
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${user} = import ../../home/users/${user}/home.nix;
};
}

View File

@@ -0,0 +1,19 @@
# NOTE: Replace with the actual generated hardware config from the PC.
# Generate on the PC with:
# sudo nixos-generate-config --show-hardware-config > hardware-configuration.nix
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/00000000-0000-0000-0000-000000000000";
fsType = "ext4";
};
swapDevices = [ ];
}