I have just noticed that my home.nix is not running since I upgraded to flakes and I can’t work out why.
Effectively I have the following flake.nix file:
{
description = ''
jamesla flake
'';
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-2205.url = "github:nixos/nixpkgs/nixos-22.05";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ {
self,
nixpkgs,
nixpkgs-2205,
home-manager,
...
}: let
system = "x86_64-linux";
inherit (nixpkgs) lib;
oldpkgs = import nixpkgs-2205 {
inherit system;
config.allowUnfree = true;
};
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in {
nixosConfigurations = {
carverlinux-pc = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit oldpkgs;
};
modules = [
{ nixpkgs.pkgs = pkgs; }
./computers/pc/hardware-configuration.nix
./configuration.nix
];
};
carverlinux-prl = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit oldpkgs;
};
modules = [
{ nixpkgs.pkgs = pkgs; }
./computers/parallels/hardware-configuration.nix
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.vagrant = import ./home.nix;
# Optionally, use home-manager.extraSpecialArgs to pass
# arguments to home.nix
}
];
};
};
};
nixConfig = {
# enable new nix command and flakes
extra-experimental-features = "nix-command flakes";
# use four cores for enableParallelBuilding
cores = 4;
# continue building derivations if one fails
#keep-going = true;
# show more log lines for failed builds
log-lines = 20;
# instances of cachix for package derivations
extra-substituters = [
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
}
I run it like this (or you can check the makefile):
sudo nixos-rebuild switch --flake ".#carverlinux-prl"
However it’s just ignoring the home.nix reference altogether and just runs the nixos stuff. Even if I purposely put invalid syntax in my home.nix it doesn’t even notice.
I’ve shared my repo here: GitHub - jamesla/nixos: my nixos configuration
How can I make it so when I update my nixos it also runs my home manager configuration?