diff options
author | Karel Kočí <cynerd@email.cz> | 2022-07-21 10:44:13 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2022-07-21 10:44:13 +0200 |
commit | 3d76346b0b5ecf6a08f8dbe68582aec5464dbfdc (patch) | |
tree | de550cd0190bf81ebd955fd141948ef233776ecf /local/bin | |
parent | de2d2f1321ed1c52c97afe1cbab07e33d3231021 (diff) | |
download | myconfigs-3d76346b0b5ecf6a08f8dbe68582aec5464dbfdc.tar.gz myconfigs-3d76346b0b5ecf6a08f8dbe68582aec5464dbfdc.tar.bz2 myconfigs-3d76346b0b5ecf6a08f8dbe68582aec5464dbfdc.zip |
Add simple script to create flake for development environment
Diffstat (limited to 'local/bin')
-rwxr-xr-x | local/bin/new-flake-dev | 29 |
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 |