this repo has no description

build with nix

altagos.dev 40b82314 f8ef1e2d

verified
+180
+1
.gitattributes
··· 1 + * text=auto eol=lf
+95
flake.lock
··· 1 + { 2 + "nodes": { 3 + "flake-utils": { 4 + "inputs": { 5 + "systems": "systems" 6 + }, 7 + "locked": { 8 + "lastModified": 1731533236, 9 + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 10 + "owner": "numtide", 11 + "repo": "flake-utils", 12 + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 13 + "type": "github" 14 + }, 15 + "original": { 16 + "owner": "numtide", 17 + "repo": "flake-utils", 18 + "type": "github" 19 + } 20 + }, 21 + "nixpkgs": { 22 + "locked": { 23 + "lastModified": 1754498491, 24 + "narHash": "sha256-erbiH2agUTD0Z30xcVSFcDHzkRvkRXOQ3lb887bcVrs=", 25 + "owner": "NixOS", 26 + "repo": "nixpkgs", 27 + "rev": "c2ae88e026f9525daf89587f3cbee584b92b6134", 28 + "type": "github" 29 + }, 30 + "original": { 31 + "owner": "NixOS", 32 + "ref": "nixos-unstable", 33 + "repo": "nixpkgs", 34 + "type": "github" 35 + } 36 + }, 37 + "nixpkgs_2": { 38 + "locked": { 39 + "lastModified": 1754531935, 40 + "narHash": "sha256-Y9qoYxg7waoMhiRhEmG+mDs6Jx2yk5eB7MlGDPMNs8E=", 41 + "owner": "nixos", 42 + "repo": "nixpkgs", 43 + "rev": "41752cc1a38a8c993cf4e92ab8df640803554c7a", 44 + "type": "github" 45 + }, 46 + "original": { 47 + "owner": "nixos", 48 + "repo": "nixpkgs", 49 + "type": "github" 50 + } 51 + }, 52 + "root": { 53 + "inputs": { 54 + "nixpkgs": "nixpkgs", 55 + "zig2nix": "zig2nix" 56 + } 57 + }, 58 + "systems": { 59 + "locked": { 60 + "lastModified": 1681028828, 61 + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 62 + "owner": "nix-systems", 63 + "repo": "default", 64 + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 65 + "type": "github" 66 + }, 67 + "original": { 68 + "owner": "nix-systems", 69 + "repo": "default", 70 + "type": "github" 71 + } 72 + }, 73 + "zig2nix": { 74 + "inputs": { 75 + "flake-utils": "flake-utils", 76 + "nixpkgs": "nixpkgs_2" 77 + }, 78 + "locked": { 79 + "lastModified": 1754532129, 80 + "narHash": "sha256-nScPs0Hzm71rXe6H6jVy9Gp+t7MEOQcm3gjAj/L0Qvg=", 81 + "owner": "Cloudef", 82 + "repo": "zig2nix", 83 + "rev": "f656a4a84e2182fb0c99132b214d136ebc087388", 84 + "type": "github" 85 + }, 86 + "original": { 87 + "owner": "Cloudef", 88 + "repo": "zig2nix", 89 + "type": "github" 90 + } 91 + } 92 + }, 93 + "root": "root", 94 + "version": 7 95 + }
+84
flake.nix
··· 1 + { 2 + description = "Zig project flake"; 3 + 4 + inputs = { 5 + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 6 + zig2nix.url = "github:Cloudef/zig2nix"; 7 + }; 8 + 9 + outputs = { 10 + nixpkgs, 11 + zig2nix, 12 + ... 13 + }: let 14 + flake-utils = zig2nix.inputs.flake-utils; 15 + in (flake-utils.lib.eachDefaultSystem (system: let 16 + # Zig flake helper 17 + # Check the flake.nix in zig2nix project for more options: 18 + # <https://github.com/Cloudef/zig2nix/blob/master/flake.nix> 19 + env = zig2nix.outputs.zig-env.${system} {zig = zig2nix.outputs.packages.${system}.zig-master;}; 20 + pkgs = nixpkgs.legacyPackages.${system}; 21 + in 22 + with builtins; 23 + with env.pkgs.lib; rec { 24 + # Produces clean binaries meant to be ship'd outside of nix 25 + # nix build .#foreign 26 + packages.foreign = env.package { 27 + src = cleanSource ./.; 28 + 29 + # Packages required for compiling 30 + nativeBuildInputs = with pkgs; [dart-sass]; 31 + 32 + # Packages required for linking 33 + buildInputs = with env.pkgs; []; 34 + 35 + # Smaller binaries and avoids shipping glibc. 36 + zigPreferMusl = true; 37 + }; 38 + 39 + # nix build . 40 + packages.default = packages.foreign.override (attrs: { 41 + # Prefer nix friendly settings. 42 + zigPreferMusl = false; 43 + 44 + # Executables required for runtime 45 + # These packages will be added to the PATH 46 + zigWrapperBins = with env.pkgs; []; 47 + 48 + # Libraries required for runtime 49 + # These packages will be added to the LD_LIBRARY_PATH 50 + zigWrapperLibs = attrs.buildInputs or []; 51 + }); 52 + 53 + # For bundling with nix bundle for running outside of nix 54 + # example: https://github.com/ralismark/nix-appimage 55 + # apps.bundle = { 56 + # type = "app"; 57 + # program = "${packages.foreign}/bin/master"; 58 + # }; 59 + 60 + # nix run . 61 + apps.default = env.app [] "zig build serve -- \"$@\""; 62 + 63 + # nix run .#build 64 + apps.build = env.app [] "zig build \"$@\""; 65 + 66 + # nix run .#stylesheet 67 + apps.test = env.app [] "zig build stylesheet -- \"$@\""; 68 + 69 + # nix run .#zig2nix 70 + apps.zig2nix = env.app [] "zig2nix \"$@\""; 71 + 72 + # nix develop 73 + devShells.default = env.mkShell { 74 + # Packages required for compiling, linking and running 75 + # Libraries added here will be automatically added to the LD_LIBRARY_PATH and PKG_CONFIG_PATH 76 + nativeBuildInputs = 77 + [] 78 + ++ packages.default.nativeBuildInputs 79 + ++ packages.default.buildInputs 80 + ++ packages.default.zigWrapperBins 81 + ++ packages.default.zigWrapperLibs; 82 + }; 83 + })); 84 + }