So I have encountered something strange with NixOS. I have my config in a flake, in git, and I have git added and git commit and git pushed everything, and yet, when I run
nixos-rebuild switch --use-remote-sudo --flake path:///home/wilnil/Code/dotfiles/nixos#thinkwillardthink
or
nixos-rebuild switch --use-remote-sudo --flake ~/Code/dotfiles/nixos
I get this error, which according to the internet…
- New flake, error: path ... does not exist
- Reddit - The heart of the internet
- https://stackoverflow.com/questions/78651957/nix-darwin-rebuild-fails-when-inside-a-git-repository
- Flakes: Not including untracked files is confusing for unaware users. · Issue #7107 · NixOS/nix · GitHub
…is because I am not tracking everything in git, but I am. This happened the other week, at first, with another file I added to the flake, then mysteriously stopped. Now, I am trying to change that file name (willard-sway.nix → desktop-sway.nix) and add a new file (vpn-wireguard.nix), and the error is back.
error:
… while calling the 'seq' builtin
at /nix/store/ka13k2zhk09q32ip9aidyd20v48g90jk-source/lib/modules.nix:359:18:
358| options = checked options;
359| config = checked (removeAttrs config [ "_module" ]);
| ^
360| _module = checked (config._module);
… while evaluating a branch condition
at /nix/store/ka13k2zhk09q32ip9aidyd20v48g90jk-source/lib/modules.nix:295:9:
294| checkUnmatched =
295| if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [ ] then
| ^
296| let
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: path '/nix/store/rw1rbl3izwi81qf8ps5c0g7a51lkz4f1-source/destop-sway.nix' does not exist
Here’s my config, if anyone could take a look and let me know what I am doing wrong, that would be much appreciated!
flake.nix
{
description = "Willard's sick laptop config";
inputs = {
# NixOS official package source, using the nixos-25.05 branch here
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
disko.url = "github:nix-community/disko/latest";
disko.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, disko, nixpkgs, ... }@inputs: {
# Please replace my-nixos with your hostname
nixosConfigurations.thinkwillardthink = nixpkgs.lib.nixosSystem {
modules = [
disko.nixosModules.disko
./configuration.nix
./hardware-configuration.nix
./luks-btrfs-subvolumes.nix
./desktop-sway.nix
./vpn-wireguard.nix
];
};
};
}
vpn-wireguard.nix
{ config, pkgs, lib, ... }:
{
# environment.systemPackages = with pkgs; [];
networking.wg-quick.interfaces.nycmesh0.configFile = "/etc/nixos/files/wireguard/nycmesh0.conf";
networking.wg-quick.interfaces.wgal0.configFile = "/etc/nixos/files/wireguard/wgal0.conf";
}
Links if they are helpful: