+13
-16
flake.nix
+13
-16
flake.nix
···
75
75
};
76
76
genjwks = self.callPackage ./nix/pkgs/genjwks.nix {};
77
77
lexgen = self.callPackage ./nix/pkgs/lexgen.nix {inherit indigo;};
78
-
appview = self.callPackage ./nix/pkgs/appview.nix {
78
+
appview-static-files = self.callPackage ./nix/pkgs/appview-static-files.nix {
79
79
inherit htmx-src htmx-ws-src lucide-src inter-fonts-src ibm-plex-mono-src;
80
80
};
81
+
appview = self.callPackage ./nix/pkgs/appview.nix {};
81
82
spindle = self.callPackage ./nix/pkgs/spindle.nix {};
82
83
knot-unwrapped = self.callPackage ./nix/pkgs/knot-unwrapped.nix {};
83
84
knot = self.callPackage ./nix/pkgs/knot.nix {};
···
93
94
staticPackages = mkPackageSet pkgs.pkgsStatic;
94
95
crossPackages = mkPackageSet pkgs.pkgsCross.gnu64.pkgsStatic;
95
96
in {
96
-
appview = packages.appview;
97
-
lexgen = packages.lexgen;
98
-
knot = packages.knot;
99
-
knot-unwrapped = packages.knot-unwrapped;
100
-
spindle = packages.spindle;
101
-
genjwks = packages.genjwks;
102
-
sqlite-lib = packages.sqlite-lib;
97
+
inherit (packages) appview appview-static-files lexgen genjwks spindle knot knot-unwrapped sqlite-lib;
103
98
104
99
pkgsStatic-appview = staticPackages.appview;
105
100
pkgsStatic-knot = staticPackages.knot;
···
132
127
pkgs.tailwindcss
133
128
pkgs.nixos-shell
134
129
pkgs.redis
130
+
pkgs.coreutils # for those of us who are on systems that use busybox (alpine)
135
131
packages'.lexgen
136
132
];
137
133
shellHook = ''
138
-
mkdir -p appview/pages/static/{fonts,icons}
139
-
cp -f ${htmx-src} appview/pages/static/htmx.min.js
140
-
cp -f ${htmx-ws-src} appview/pages/static/htmx-ext-ws.min.js
141
-
cp -rf ${lucide-src}/*.svg appview/pages/static/icons/
142
-
cp -f ${inter-fonts-src}/web/InterVariable*.woff2 appview/pages/static/fonts/
143
-
cp -f ${inter-fonts-src}/web/InterDisplay*.woff2 appview/pages/static/fonts/
144
-
cp -f ${ibm-plex-mono-src}/fonts/complete/woff2/IBMPlexMono-Regular.woff2 appview/pages/static/fonts/
134
+
mkdir -p appview/pages/static
135
+
# no preserve is needed because watch-tailwind will want to be able to overwrite
136
+
cp -frv --no-preserve=ownership ${packages'.appview-static-files}/* appview/pages/static
145
137
export TANGLED_OAUTH_JWKS="$(${packages'.genjwks}/bin/genjwks)"
146
138
'';
147
139
env.CGO_ENABLED = 1;
···
149
141
});
150
142
apps = forAllSystems (system: let
151
143
pkgs = nixpkgsFor."${system}";
144
+
packages' = self.packages.${system};
152
145
air-watcher = name: arg:
153
146
pkgs.writeShellScriptBin "run"
154
147
''
···
167
160
in {
168
161
watch-appview = {
169
162
type = "app";
170
-
program = ''${air-watcher "appview" ""}/bin/run'';
163
+
program = toString (pkgs.writeShellScript "watch-appview" ''
164
+
echo "copying static files to appview/pages/static..."
165
+
${pkgs.coreutils}/bin/cp -frv --no-preserve=ownership ${packages'.appview-static-files}/* appview/pages/static
166
+
${air-watcher "appview" ""}/bin/run
167
+
'');
171
168
};
172
169
watch-knot = {
173
170
type = "app";
+23
nix/pkgs/appview-static-files.nix
+23
nix/pkgs/appview-static-files.nix
···
1
+
{
2
+
runCommandLocal,
3
+
htmx-src,
4
+
htmx-ws-src,
5
+
lucide-src,
6
+
inter-fonts-src,
7
+
ibm-plex-mono-src,
8
+
sqlite-lib,
9
+
tailwindcss,
10
+
src,
11
+
}:
12
+
runCommandLocal "appview-static-files" {} ''
13
+
mkdir -p $out/{fonts,icons} && cd $out
14
+
cp -f ${htmx-src} htmx.min.js
15
+
cp -f ${htmx-ws-src} htmx-ext-ws.min.js
16
+
cp -rf ${lucide-src}/*.svg icons/
17
+
cp -f ${inter-fonts-src}/web/InterVariable*.woff2 fonts/
18
+
cp -f ${inter-fonts-src}/web/InterDisplay*.woff2 fonts/
19
+
cp -f ${ibm-plex-mono-src}/fonts/complete/woff2/IBMPlexMono-Regular.woff2 fonts/
20
+
# tailwindcss -c $src/tailwind.config.js -i $src/input.css -o tw.css won't work
21
+
# for whatever reason (produces broken css), so we are doing this instead
22
+
cd ${src} && ${tailwindcss}/bin/tailwindcss -i input.css -o $out/tw.css
23
+
''
+3
-14
nix/pkgs/appview.nix
+3
-14
nix/pkgs/appview.nix
···
1
1
{
2
2
buildGoApplication,
3
3
modules,
4
-
htmx-src,
5
-
htmx-ws-src,
6
-
lucide-src,
7
-
inter-fonts-src,
8
-
ibm-plex-mono-src,
9
-
tailwindcss,
4
+
appview-static-files,
10
5
sqlite-lib,
11
6
src,
12
7
}:
···
17
12
18
13
postUnpack = ''
19
14
pushd source
20
-
mkdir -p appview/pages/static/{fonts,icons}
21
-
cp -f ${htmx-src} appview/pages/static/htmx.min.js
22
-
cp -f ${htmx-ws-src} appview/pages/static/htmx-ext-ws.min.js
23
-
cp -rf ${lucide-src}/*.svg appview/pages/static/icons/
24
-
cp -f ${inter-fonts-src}/web/InterVariable*.woff2 appview/pages/static/fonts/
25
-
cp -f ${inter-fonts-src}/web/InterDisplay*.woff2 appview/pages/static/fonts/
26
-
cp -f ${ibm-plex-mono-src}/fonts/complete/woff2/IBMPlexMono-Regular.woff2 appview/pages/static/fonts/
27
-
${tailwindcss}/bin/tailwindcss -i input.css -o appview/pages/static/tw.css
15
+
mkdir -p appview/pages/static
16
+
cp -frv ${appview-static-files}/* appview/pages/static
28
17
popd
29
18
'';
30
19