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 | |
parent | de2d2f1321ed1c52c97afe1cbab07e33d3231021 (diff) | |
download | myconfigs-3d76346b0b5ecf6a08f8dbe68582aec5464dbfdc.tar.gz myconfigs-3d76346b0b5ecf6a08f8dbe68582aec5464dbfdc.tar.bz2 myconfigs-3d76346b0b5ecf6a08f8dbe68582aec5464dbfdc.zip |
Add simple script to create flake for development environment
-rwxr-xr-x | install | 1 | ||||
-rwxr-xr-x | local/bin/new-flake-dev | 29 |
2 files changed, 30 insertions, 0 deletions
@@ -60,6 +60,7 @@ if ask "dev" "Development tools configuration"; then inst flake8 ~/.flake8 inst pylintrc ~/.pylintrc inst config/mypy/ ~/.config/mypy + inst local/bin/new-flake-dev ~/.local/bin/new-flake-dev fi if ask "sync" "Install synchronization"; then 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 |