3The 'assets.nix' file contains nix expressions that are a mutually
4recursive set of attributes used to create static asset directories
5with hashable file encodings. This file should be incorporated within
6your project's 'default.nix' file. (See ./example/default.nix , line 2)
8{assets ? import ./../assets.nix { inherit nixpkgs; }
12The 'mkAssets' and 'mkAssetsWith' functions within 'assets.nix' only
13need to be passed an encoding('zopfliEncodings', 'gzipEncodings',
14'noEncodings') and a static directory of your choice as arguments.
16In this example, 'mkAssets' is used on a directory that has a .png
17file inside of it. (See ./example/default.nix, line 11)
19myAssets = assets.mkAssets ./static;
22Once you have successfully incorporated 'assets.nix' into your
23project's nix file(s), use nix-build to generate a symlink of
24your 'mkAssets' expression. The following command from
25example/run-example (line 3) will generate an immutable symlink
26that holds hashed static assets.
28nix-build -o static.assets -A myAssets
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list