diff options
| author | Natasha Moongrave <natasha@256phi.eu> | 2026-03-30 20:46:26 +0200 |
|---|---|---|
| committer | Natasha Moongrave <natasha@256phi.eu> | 2026-03-30 20:46:26 +0200 |
| commit | 67e324107e05f3245ddac034607afd0e1dea478f (patch) | |
| tree | d14a4b6e98fc707c72e24f0879b0e4297aaad78f /flake.nix | |
| parent | 2316eab54de77c351e88c5657eeaaa703ff4c498 (diff) | |
Refactored the entire configuration
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 90 |
1 files changed, 66 insertions, 24 deletions
@@ -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"; }; }; } |
