aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix90
1 files changed, 66 insertions, 24 deletions
diff --git a/flake.nix b/flake.nix
index 6388760..4d2faae 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,46 +1,88 @@
{
- description = "A very basic flake";
+ description = "NixOS configuration for multiple machines with modular home-manager and rice support";
inputs = {
+ # Core
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
+ nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
+
+ # Home Manager
home-manager = {
url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
+
+ # Theming - centralized color management
+ stylix = {
+ url = "github:danth/stylix/release-25.11";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+
+ # Rust toolchain (optional, for development)
+ fenix = {
+ url = "github:nix-community/fenix";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
};
outputs = {
self,
nixpkgs,
+ nixpkgs-unstable,
home-manager,
+ stylix,
+ fenix,
...
} @ inputs: let
- hmModule = {
- home-manager.useGlobalPkgs = true;
- home-manager.useUserPackages = true;
- home-manager.users.mun = import ./mun.nix;
+ system = "x86_64-linux";
+
+ # Overlays for the system
+ overlays = [
+ # Access unstable packages via pkgs.unstable.*
+ (final: prev: {
+ unstable = import nixpkgs-unstable {
+ inherit system;
+ config.allowUnfree = true;
+ };
+ })
+ # Fenix Rust overlay
+ fenix.overlays.default
+ ];
+
+ # Shared home-manager configuration
+ homeManagerModule = {
+ home-manager = {
+ useGlobalPkgs = true;
+ useUserPackages = true;
+ extraSpecialArgs = {inherit inputs;};
+ users.mun = import ./home/mun;
+ };
+ };
+
+ # Helper to create a NixOS system
+ mkSystem = hostname: nixpkgs.lib.nixosSystem {
+ inherit system;
+ specialArgs = {inherit inputs;};
+ modules = [
+ # Apply overlays via nixpkgs module
+ {
+ nixpkgs = {
+ inherit overlays;
+ config.allowUnfree = true;
+ };
+ }
+ ./hosts/${hostname}/configuration.nix
+ ./system
+ home-manager.nixosModules.home-manager
+ stylix.nixosModules.stylix
+ homeManagerModule
+ ];
};
+
in {
nixosConfigurations = {
- kronos = nixpkgs.lib.nixosSystem {
- system = "x86_64-linux";
- specialArgs = {inherit inputs;};
- modules = [
- ./hosts/kronos/configuration.nix
- home-manager.nixosModules.home-manager
- hmModule # ← use shared module
- ];
- };
-
- herra = nixpkgs.lib.nixosSystem {
- system = "x86_64-linux";
- specialArgs = {inherit inputs;};
- modules = [
- ./hosts/herra/configuration.nix
- home-manager.nixosModules.home-manager
- hmModule
- ];
- };
+ kronos = mkSystem "kronos";
+ herra = mkSystem "herra";
};
};
}