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:
78
flake.nix
Normal file
78
flake.nix
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
description = "NixOS system configuration flake with ricing and application management";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||
|
||||
# Home Manager for user-level configuration and dotfiles
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-25.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Optional: Hyprland (if you want a tiling Wayland compositor)
|
||||
# hyprland.url = "github:hyprwm/Hyprland";
|
||||
|
||||
# Optional: Other useful inputs
|
||||
# nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, ... }@inputs: {
|
||||
# NixOS configuration for your hostname(s)
|
||||
nixosConfigurations = {
|
||||
# Desktop PC configuration
|
||||
desktop = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
# Your hardware configuration
|
||||
./hosts/desktop/hardware-configuration.nix
|
||||
|
||||
# System-wide configuration
|
||||
./hosts/desktop/configuration.nix
|
||||
|
||||
# Common system configuration shared across all machines
|
||||
./system/common.nix
|
||||
|
||||
# Home Manager NixOS module
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||
|
||||
# Replace "yourusername" with your actual username
|
||||
home-manager.users.yourusername = import ./home/home.nix;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Laptop configuration
|
||||
laptop = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
# Your hardware configuration
|
||||
./hosts/laptop/hardware-configuration.nix
|
||||
|
||||
# System-wide configuration
|
||||
./hosts/laptop/configuration.nix
|
||||
|
||||
# Common system configuration shared across all machines
|
||||
./system/common.nix
|
||||
|
||||
# Home Manager NixOS module
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||
|
||||
# Replace "yourusername" with your actual username
|
||||
home-manager.users.yourusername = import ./home/home.nix;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user