{ description = "NixOS configuration"; inputs = { # NixOS official package source nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; home-manager = { url = "github:nix-community/home-manager/release-25.05"; # The `follows` keyword in inputs is used for inheritance. # Here, `inputs.nixpkgs` of home-manager is kept consistent with # the `inputs.nixpkgs` of the current flake, # to avoid problems caused by different versions of nixpkgs. inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, home-manager, ... }@inputs: { nixosConfigurations.case = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs; }; modules = [ # Import the previous configuration.nix we used, # so the old configuration file still takes effect ./configuration.nix # make home-manager as a module of nixos so that home-manager # configuration will be deployed automatically when executing # `nixos-rebuild switch` home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.alex = import ./home.nix; # Optionally, use home-manager.extraSpecialArgs to pass arguments to # home.nix } ]; }; }; }