mirror of
https://github.com/zephrynis/nix-flake.git
synced 2026-02-18 20:21:53 +00:00
Initial NixOS flake-based multi-host setup
Add a NixOS system configuration using flakes, supporting multiple hosts (desktop, laptop, my-machine) with shared and per-host settings. Includes Home Manager integration, user-level and system-level package management, and example hardware configuration placeholders. Provides a README with setup instructions and a .gitignore for common Nix and editor artifacts.
This commit is contained in:
54
hosts/my-machine/configuration.nix
Normal file
54
hosts/my-machine/configuration.nix
Normal file
@@ -0,0 +1,54 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Machine-specific configuration
|
||||
|
||||
networking.hostName = "my-machine"; # Change this to your hostname
|
||||
|
||||
# Users configuration
|
||||
users.users.yourusername = { # Change "yourusername" to your actual username
|
||||
isNormalUser = true;
|
||||
description = "Your Name"; # Change this
|
||||
extraGroups = [ "networkmanager" "wheel" "video" "audio" ];
|
||||
shell = pkgs.zsh; # or pkgs.bash
|
||||
};
|
||||
|
||||
# Enable zsh system-wide
|
||||
programs.zsh.enable = true;
|
||||
|
||||
# Display manager and desktop environment / window manager
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
|
||||
# Display manager (choose one)
|
||||
displayManager.gdm.enable = true;
|
||||
# displayManager.sddm.enable = true;
|
||||
# displayManager.lightdm.enable = true;
|
||||
|
||||
# Desktop environment (choose one, or comment all for a standalone WM)
|
||||
# desktopManager.gnome.enable = true;
|
||||
# desktopManager.plasma5.enable = true;
|
||||
# desktopManager.xfce.enable = true;
|
||||
|
||||
# Window manager (uncomment if you want a standalone WM)
|
||||
# windowManager.i3.enable = true;
|
||||
# windowManager.bspwm.enable = true;
|
||||
};
|
||||
|
||||
# Optional: Enable Wayland compositor
|
||||
# programs.hyprland = {
|
||||
# enable = true;
|
||||
# xwayland.enable = true;
|
||||
# };
|
||||
|
||||
# Fonts
|
||||
fonts.packages = with pkgs; [
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-emoji
|
||||
liberation_ttf
|
||||
fira-code
|
||||
fira-code-symbols
|
||||
(nerdfonts.override { fonts = [ "FiraCode" "JetBrainsMono" "Iosevka" ]; })
|
||||
];
|
||||
}
|
||||
31
hosts/my-machine/hardware-configuration.nix
Normal file
31
hosts/my-machine/hardware-configuration.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
# This file should be generated by running:
|
||||
# nixos-generate-config --show-hardware-config > hardware-configuration.nix
|
||||
#
|
||||
# Run this command on your NixOS machine to get the correct hardware configuration
|
||||
# Then copy the output here.
|
||||
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
# PLACEHOLDER: Replace this entire file with your actual hardware configuration
|
||||
# You can generate it by running the command mentioned above on your NixOS system
|
||||
|
||||
boot.initrd.availableKernelModules = [ ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
# Swap configuration
|
||||
# swapDevices = [ ];
|
||||
|
||||
# CPU microcode updates
|
||||
# hardware.cpu.intel.updateMicrocode = true;
|
||||
# hardware.cpu.amd.updateMicrocode = true;
|
||||
}
|
||||
Reference in New Issue
Block a user