Skip to content

Commit

Permalink
Adds nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix "xq" Queißner committed Mar 26, 2024
1 parent d7ad151 commit cfe5283
Show file tree
Hide file tree
Showing 4 changed files with 213 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use_nix
use flake
146 changes: 146 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
description = "Nerdgruppe build system";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/release-23.05";
flake-utils.url = "github:numtide/flake-utils";

# required for latest zig
zig.url = "github:mitchellh/zig-overlay";

# Used for shell.nix
flake-compat = {
url = github:edolstra/flake-compat;
flake = false;
};
};

outputs =
{ self
, nixpkgs
, flake-utils
, ...
} @ inputs:
let
overlays = [
# Other overlays
(final: prev: {
zigpkgs = inputs.zig.packages.${prev.system};
})
];

# Our supported systems are the same supported systems as the Zig binaries
systems = builtins.attrNames inputs.zig.packages;

in
flake-utils.lib.eachSystem systems (
system:
let
pkgs = import nixpkgs { inherit overlays system; };
in
rec {
devShells.default = pkgs.mkShell {
nativeBuildInputs = [
pkgs.zigpkgs.master
pkgs.pkg-config
];

buildInputs = [
# we need a version of bash capable of being interactive
# as opposed to a bash just used for building this flake
# in non-interactive mode
pkgs.bashInteractive
];

propagatedBuildInputs = [ ];

shellHook = ''
export SHELL=${pkgs.bashInteractive}/bin/bash
'';
};

# For compatibility with older versions of the `nix` binary
devShell = self.devShells.${system}.default;
}
);
}
8 changes: 0 additions & 8 deletions shell.nix

This file was deleted.

0 comments on commit cfe5283

Please sign in to comment.