Heyo peeps,
I started creating a motherflake for my configuration, using home-manager to handle my packages and dotfiles:
flake.nix:
description = "The master flake for Loutre Telecom";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
home-manager.url = github:nix-community/home-manager;
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ nixpkgs, home-manager, ... }: {
nixosConfigurations.axolotl = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./nixos_configurations/common/workstation.nix
./nixos_configurations/hosts/axolotl.nix
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.chewie = import ./users/chewie.nix;
};
}
];
};
};
}
users/chewie.nix (the home.nix):
{ config, pkgs, ... }:
{
home.username = "chewie";
home.homeDirectory = "/home/chewie";
home.stateVersion = "22.05";
programs.home-manager.enable = true;
home.packages = with pkgs; [
vim
htop
wget
rxvt-unicode
];
# This line fails
home.file.".vimrc".source = ./dotfiles/vim/.vimrc;
xsession.enable = true;
xsession.windowManager.awesome.enable = true;
}
However, when running sudo nixos-rebuild switch --flake '.#axolotl'
, I get the following error:
error: getting status of '/nix/store/37dbp92g4089bcs7chsp5x6qkhcc9mq0-source/users/dotfiles': No such file or directory
It seems that, since chewie.nix exists in the users directory, it expects my dotfiles directory to exist there instead of the root of my repo, which is hell on my OCD brain.
Any idea on how to make that file reference relative to the root of the flake?
Cheers,