aboutsummaryrefslogtreecommitdiff
path: root/local/bin
diff options
context:
space:
mode:
Diffstat (limited to 'local/bin')
-rwxr-xr-xlocal/bin/new-flake-dev29
1 files changed, 29 insertions, 0 deletions
diff --git a/local/bin/new-flake-dev b/local/bin/new-flake-dev
new file mode 100755
index 0000000..a45c86d
--- /dev/null
+++ b/local/bin/new-flake-dev
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+set -eu
+if [ -f ./flake.nix ]; then
+ echo "There is already existing flake.nix file!" >&2
+ exit 1
+fi
+cat >./flake.nix <<EOF
+{
+ outputs = { self, nixpkgs, flake-utils, personal }:
+ with flake-utils.lib;
+ eachDefaultSystem (system: let
+ pkgs = nixpkgs.legacyPackages.${system};
+ in {
+ devShells = filterPackages system {
+ default = pkgs.mkShell {
+ packages = with pkgs; [
+ clang-tools
+ gcc gdb pkg-config
+ cppcheck flawfinder bear
+ meson
+ ];
+ inputsFrom = with pkgs; [
+ personal.devShells.${system}.default
+ ];
+ };
+ };
+ });
+}
+EOF