We extend the one-locus two allele Moran model of fixation in a haploid population to the case where the total size of the population is not fixed. The model is defined as a two-dimensional birth-and-death process for allele number. Changes in allele number occur through density-independent death events and birth events whose per capita rate decreases linearly with the total population density. Uniquely for models of this type, the latter is determined by these same birth-and-death events. This provides a framework for investigating both the effects of fluctuation in total population number through demographic stochasticity, and deterministic density-dependent changes in mean density, on allele fixation. We analyze this model using a combination of asymptotic analytic approximations supported by numerics. We find that for advantageous mutants demographic stochasticity of the resident population does not affect the fixation probability, but that deterministic changes in total density do. In contrast, for deleterious mutants, the fixation probability increases with increasing resident population fluctuation size, but is relatively insensitive to initial density. These phenomena cannot be described by simply using a harmonic mean effective population size.