You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
My problem is that before flakes I would add all of the NixOS modules that I wanted to sync, except for hardware-configuration.nix which I don't want to upload to GitHub or wherever, and configuration.nix which I use for scratch configuration that I don't want to synchronise. Flakes, using them how you would normally in /etc/nixos/flake.nix breaks this workflow, because it always considers a directory with a .git subdirectory a git repository and then won't copy files that aren't added to the git index to the store.
Describe the solution you'd like
A way to force Nix to ignore .git (or .hg, for that matter) when given a path: input, inside the flake file. I would think it would look something like this:
I think making it a command line option would be a poor idea, because you end up having to remember to specify them every single time.
Describe alternatives you've considered
Currently I use a trick to confuse Nix into not following into the git repository where I store my configuration by using two flake files. One simple one that exports modules in nixosModules, and another that specifies nixpkgs input and imports that flake, which I then hard link into /etc/nixos so Nix doesn't know it's inside a git repository.
Additional context
N/A? I think I could work on this myself, but I would have to bring myself up to speed on how the Nix source expects me to access the parsed information from the flake file.
The text was updated successfully, but these errors were encountered:
I don't think this is really useful, because you're really doing this the entirely wrong way.
You want a flake for your modules which you can upload, then another per-machine flake. You can also use Git for both then. The per-machine flake would have the shared flake as a flake input.
Is your feature request related to a problem? Please describe.
My problem is that before flakes I would add all of the NixOS modules that I wanted to sync, except for hardware-configuration.nix which I don't want to upload to GitHub or wherever, and configuration.nix which I use for scratch configuration that I don't want to synchronise. Flakes, using them how you would normally in
/etc/nixos/flake.nix
breaks this workflow, because it always considers a directory with a.git
subdirectory a git repository and then won't copy files that aren't added to the git index to the store.Describe the solution you'd like
A way to force Nix to ignore
.git
(or.hg
, for that matter) when given apath:
input, inside the flake file. I would think it would look something like this:I think making it a command line option would be a poor idea, because you end up having to remember to specify them every single time.
Describe alternatives you've considered
Currently I use a trick to confuse Nix into not following into the git repository where I store my configuration by using two flake files. One simple one that exports modules in
nixosModules
, and another that specifies nixpkgs input and imports that flake, which I then hard link into/etc/nixos
so Nix doesn't know it's inside a git repository.Additional context
N/A? I think I could work on this myself, but I would have to bring myself up to speed on how the Nix source expects me to access the parsed information from the flake file.
The text was updated successfully, but these errors were encountered: