forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

nix: use filesets instead of gitignore.nix

This allows us to easily do things like ignoring Nix source files within our
source tree (also done in this commit), which prevents unnecessary rebuilds.

Signed-off-by: Winter <winter@winter.cafe>

authored by winter.bsky.social and committed by Tangled 3c8332c6 a73e3189

-21
flake.lock
··· 18 "type": "github" 19 } 20 }, 21 - "gitignore": { 22 - "inputs": { 23 - "nixpkgs": [ 24 - "nixpkgs" 25 - ] 26 - }, 27 - "locked": { 28 - "lastModified": 1709087332, 29 - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", 30 - "owner": "hercules-ci", 31 - "repo": "gitignore.nix", 32 - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", 33 - "type": "github" 34 - }, 35 - "original": { 36 - "owner": "hercules-ci", 37 - "repo": "gitignore.nix", 38 - "type": "github" 39 - } 40 - }, 41 "gomod2nix": { 42 "inputs": { 43 "flake-utils": "flake-utils", ··· 156 }, 157 "root": { 158 "inputs": { 159 - "gitignore": "gitignore", 160 "gomod2nix": "gomod2nix", 161 "htmx-src": "htmx-src", 162 "htmx-ws-src": "htmx-ws-src",
··· 18 "type": "github" 19 } 20 }, 21 "gomod2nix": { 22 "inputs": { 23 "flake-utils": "flake-utils", ··· 136 }, 137 "root": { 138 "inputs": { 139 "gomod2nix": "gomod2nix", 140 "htmx-src": "htmx-src", 141 "htmx-ws-src": "htmx-ws-src",
+7 -6
flake.nix
··· 37 url = "https://sqlite.org/2024/sqlite-amalgamation-3450100.zip"; 38 flake = false; 39 }; 40 - gitignore = { 41 - url = "github:hercules-ci/gitignore.nix"; 42 - inputs.nixpkgs.follows = "nixpkgs"; 43 - }; 44 }; 45 46 outputs = { ··· 51 htmx-src, 52 htmx-ws-src, 53 lucide-src, 54 - gitignore, 55 inter-fonts-src, 56 sqlite-lib-src, 57 ibm-plex-mono-src, ··· 62 63 mkPackageSet = pkgs: 64 pkgs.lib.makeScope pkgs.newScope (self: { 65 - inherit (gitignore.lib) gitignoreSource; 66 buildGoApplication = 67 (self.callPackage "${gomod2nix}/builder" { 68 gomod2nix = gomod2nix.legacyPackages.${pkgs.system}.gomod2nix;
··· 37 url = "https://sqlite.org/2024/sqlite-amalgamation-3450100.zip"; 38 flake = false; 39 }; 40 }; 41 42 outputs = { ··· 47 htmx-src, 48 htmx-ws-src, 49 lucide-src, 50 inter-fonts-src, 51 sqlite-lib-src, 52 ibm-plex-mono-src, ··· 57 58 mkPackageSet = pkgs: 59 pkgs.lib.makeScope pkgs.newScope (self: { 60 + src = let 61 + fs = pkgs.lib.fileset; 62 + in 63 + fs.toSource { 64 + root = ./.; 65 + fileset = fs.difference (fs.intersection (fs.gitTracked ./.) (fs.fileFilter (file: !(file.hasExt "nix")) ./.)) (fs.maybeMissing ./.jj); 66 + }; 67 buildGoApplication = 68 (self.callPackage "${gomod2nix}/builder" { 69 gomod2nix = gomod2nix.legacyPackages.${pkgs.system}.gomod2nix;
+2 -3
nix/pkgs/appview.nix
··· 8 ibm-plex-mono-src, 9 tailwindcss, 10 sqlite-lib, 11 - gitignoreSource, 12 }: 13 buildGoApplication { 14 pname = "appview"; 15 version = "0.1.0"; 16 - src = gitignoreSource ../..; 17 - inherit modules; 18 19 postUnpack = '' 20 pushd source
··· 8 ibm-plex-mono-src, 9 tailwindcss, 10 sqlite-lib, 11 + src, 12 }: 13 buildGoApplication { 14 pname = "appview"; 15 version = "0.1.0"; 16 + inherit src modules; 17 18 postUnpack = '' 19 pushd source
+2 -3
nix/pkgs/genjwks.nix
··· 1 { 2 - gitignoreSource, 3 buildGoApplication, 4 modules, 5 }: 6 buildGoApplication { 7 pname = "genjwks"; 8 version = "0.1.0"; 9 - src = gitignoreSource ../..; 10 - inherit modules; 11 subPackages = ["cmd/genjwks"]; 12 doCheck = false; 13 CGO_ENABLED = 0;
··· 1 { 2 + src, 3 buildGoApplication, 4 modules, 5 }: 6 buildGoApplication { 7 pname = "genjwks"; 8 version = "0.1.0"; 9 + inherit src modules; 10 subPackages = ["cmd/genjwks"]; 11 doCheck = false; 12 CGO_ENABLED = 0;
+2 -3
nix/pkgs/knot-unwrapped.nix
··· 2 buildGoApplication, 3 modules, 4 sqlite-lib, 5 - gitignoreSource, 6 }: 7 buildGoApplication { 8 pname = "knot"; 9 version = "0.1.0"; 10 - src = gitignoreSource ../..; 11 - inherit modules; 12 13 doCheck = false; 14
··· 2 buildGoApplication, 3 modules, 4 sqlite-lib, 5 + src, 6 }: 7 buildGoApplication { 8 pname = "knot"; 9 version = "0.1.0"; 10 + inherit src modules; 11 12 doCheck = false; 13
+2 -3
nix/pkgs/spindle.nix
··· 2 buildGoApplication, 3 modules, 4 sqlite-lib, 5 - gitignoreSource, 6 }: 7 buildGoApplication { 8 pname = "spindle"; 9 version = "0.1.0"; 10 - src = gitignoreSource ../..; 11 - inherit modules; 12 13 doCheck = false; 14
··· 2 buildGoApplication, 3 modules, 4 sqlite-lib, 5 + src, 6 }: 7 buildGoApplication { 8 pname = "spindle"; 9 version = "0.1.0"; 10 + inherit src modules; 11 12 doCheck = false; 13