{ description = "Unified Nix Configuration"; inputs = { # Unstable for standalone configurations and overlays nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.11"; nixpkgs-wsl-stable.url = "github:nixos/nixpkgs/nixos-25.05"; nixos-wsl = { url = "github:nix-community/NixOS-WSL"; inputs.nixpkgs.follows = "nixpkgs-wsl-stable"; }; home-manager = { url = "github:nix-community/home-manager/release-25.11"; inputs.nixpkgs.follows = "nixpkgs-stable"; }; home-manager-wsl = { url = "github:nix-community/home-manager/release-25.05"; inputs.nixpkgs.follows = "nixpkgs-wsl-stable"; }; nix-darwin = { url = "github:LnL7/nix-darwin"; inputs.nixpkgs.follows = "nixpkgs"; }; sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; tasksquire = { url = "git+ssh://git@git.pander.me/martin/tasksquire.git"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, nixpkgs-stable, nixpkgs-wsl-stable, nixos-wsl, home-manager, home-manager-wsl, nix-darwin, sops-nix, ... }@inputs: let linuxSystem = "x86_64-linux"; linuxAarchSystem = "aarch64-linux"; darwinSystem = "aarch64-darwin"; pkgsLinux = nixpkgs.legacyPackages.${linuxSystem}; pkgsLinuxAarch = nixpkgs.legacyPackages.${linuxAarchSystem}; pkgsDarwin = nixpkgs.legacyPackages.${darwinSystem}; in { # --- NixOS Systems --- nixosConfigurations = { # Work WSL work = nixpkgs-wsl-stable.lib.nixosSystem { system = linuxSystem; specialArgs = { inherit self inputs; }; modules = [ nixos-wsl.nixosModules.wsl ./hosts/work/nixos/configuration.nix home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = false; home-manager.useUserPackages = false; home-manager.extraSpecialArgs = { inherit self inputs; pkgs = import nixpkgs-wsl-stable { system = linuxSystem; config.allowUnfree = true; overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ]; }; }; home-manager.users.pan = import ./hosts/work/nixos/home.nix; } ]; }; # Home home = nixpkgs-stable.lib.nixosSystem { system = linuxAarchSystem; specialArgs = { inherit self inputs; # Provide both stable and unstable pkgs pkgs = import nixpkgs-stable { system = linuxAarchSystem; config.allowUnfree = true; }; }; modules = [ ./hosts/home/nixos/configuration.nix home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = false; home-manager.useUserPackages = false; home-manager.extraSpecialArgs = { inherit self inputs; pkgs = import nixpkgs-stable { system = linuxAarchSystem; config.allowUnfree = true; overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ]; }; }; home-manager.users.martin = import ./hosts/home/nixos/home.nix; } ]; }; }; # --- Darwin Systems (Mac) --- darwinConfigurations."Martins-MacBook-Pro" = nix-darwin.lib.darwinSystem { system = darwinSystem; specialArgs = { inherit self inputs; }; modules = [ ./hosts/home/darwin/configuration.nix ]; }; # --- Standalone Home Manager --- homeConfigurations = { "pan@work" = home-manager.lib.homeManagerConfiguration { pkgs = import nixpkgs-stable { system = linuxSystem; config.allowUnfree = true; overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ]; }; extraSpecialArgs = { inherit self inputs; }; modules = [ ./hosts/work/nix/home.nix ]; }; "martin@mac" = home-manager.lib.homeManagerConfiguration { pkgs = import nixpkgs-stable { system = darwinSystem; config.allowUnfree = true; overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ]; }; extraSpecialArgs = { inherit self inputs; }; modules = [ ./hosts/home/nix/home.nix ]; }; }; }; }