diff --git a/.config/filegen-manifest.json b/.config/filegen-manifest.json deleted file mode 100644 index 715da83..0000000 --- a/.config/filegen-manifest.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "clobber-by-default": true, - "files": [ - { - "clobber": null, - "deactivate": null, - "ignore-modification": null, - "permissions": "600", - "source": "/nix/store/i9wgm4ljangrsv39rjdqyq9j96hj29zm-pre-commit-config.yaml", - "target": "./.pre-commit-config.yaml", - "type": "copy" - }, - { - "clobber": null, - "deactivate": null, - "ignore-modification": null, - "permissions": "600", - "source": "/nix/store/wyggpw11mkdvbcgbqzs80py8z8khjk9i-check-pre-commit-hooks.yml", - "target": "./.github/workflows/check-pre-commit-hooks.yml", - "type": "copy" - }, - { - "clobber": null, - "deactivate": null, - "ignore-modification": null, - "permissions": "600", - "source": "/nix/store/mv9zlzz043051izx92fxk6ibz6fn21yd-gitattributes", - "target": ".gitattributes", - "type": "copy" - } - ], - "version": 3 -} diff --git a/.gitattributes b/.gitattributes index 5daa663..f2ec25b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,3 @@ .pre-commit-config.yaml linguist-generated .github/workflows/check-pre-commit-hooks.yml linguist-generated .gitattributes linguist-generated -.config/filegen-manifest.json linguist-generated diff --git a/.gitignore b/.gitignore index f418f1a..42e9235 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ .devenv/ + +# filegen activation state — contains machine-specific /nix/store source +# paths, so it must not be committed (would cause cross-system drift). +.config/filegen-manifest.json diff --git a/nix/modules/filegen.nix b/nix/modules/filegen.nix index 0e43339..e1a2b7b 100644 --- a/nix/modules/filegen.nix +++ b/nix/modules/filegen.nix @@ -169,6 +169,9 @@ in { pkgs, config, ... }: let cfg = config.filegen; + # The manifest records absolute /nix/store source paths, which differ + # per system. It is therefore local activation state (gitignored), not a + # committed artifact — committing it would cause cross-system drift. new-manifest = pkgs.writers.writeJSON "filegen-manifest.json" ( config.filegen.settings // { inherit (smfh) version; } ); @@ -185,7 +188,7 @@ in target = ".gitattributes"; source = pkgs.writeTextFile { name = ".gitattributes"; - text = lib.pipe (cfg.settings.files ++ [ { target = ".config/filegen-manifest.json"; } ]) [ + text = lib.pipe cfg.settings.files [ (map (file: lib.removePrefix "./" file.target)) (map (target: "${target} linguist-generated")) lib.concatLines