treesummaryrefslogcommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorPatrick2026-09-26 12:48:51 +0200
committerPatrick2026-09-26 12:48:51 +0200
commita58717ae1a2451635c7dee0970e6ee82b9cb4ac2 (patch)
tree65ba99ba7dd471433ae30a415ae50fa88023c1db /flake.nix
downloadsg3-a58717ae1a2451635c7dee0970e6ee82b9cb4ac2.tar.gz
sg3-a58717ae1a2451635c7dee0970e6ee82b9cb4ac2.zip
add all
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..5cd834c
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,38 @@
+{
+ inputs = {
+ nixpkgs.url = "nixpkgs";
+ zig.url = "github:silversquirl/zig-flake";
+ zig.inputs.nixpkgs.follows = "nixpkgs";
+ };
+
+ outputs = {
+ nixpkgs,
+ zig,
+ ...
+ }: let
+ forAllSystems = f:
+ builtins.mapAttrs
+ (system: pkgs: f pkgs zig.packages.${system}.zig_0_16_0)
+ nixpkgs.legacyPackages;
+ in {
+ devShells = forAllSystems (pkgs: zig: {
+ default = pkgs.mkShellNoCC {
+ packages = [pkgs.bash pkgs.tmux zig zig.zls];
+ shellHook = ''
+ tmux set-option -g default-shell '${pkgs.bashInteractive}/bin/bash' ';' new-session -s sporegirl
+ exit
+ '';
+ };
+ });
+
+ packages = forAllSystems (pkgs: zig: {
+ default = zig.makePackage {
+ pname = "zig-flake-template";
+ version = "0.0.0";
+ src = ./.;
+ zigReleaseMode = "fast";
+ # depsHash = "<replace this with the hash Nix provides in its error message>"
+ };
+ });
+ };
+}