aboutsummaryrefslogtreecommitdiff
path: root/local/bin/new-flake-dev
blob: a45c86d913a41121b342e8adc70531303c59b070 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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