{ description = "Unified Nix Configuration"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixos-wsl = { url = "github:nix-community/NixOS-WSL"; inputs.nixpkgs.follows = "nixpkgs"; }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; 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, nixos-wsl, home-manager, 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.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 = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit self inputs; }; home-manager.users.pan = import ./hosts/work/nixos/home.nix; } ]; }; # Home home = nixpkgs.lib.nixosSystem { system = linuxAarchSystem; specialArgs = { inherit self inputs; }; modules = [ ./hosts/home/nixos/configuration.nix home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit self inputs; }; 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 = pkgsLinux; extraSpecialArgs = { inherit self inputs; }; modules = [ ./hosts/work/nix/home.nix ]; }; "martin@mac" = home-manager.lib.homeManagerConfiguration { pkgs = pkgsDarwin; extraSpecialArgs = { inherit self inputs; }; modules = [ ./hosts/home/nix/home.nix ]; }; }; }; }