Skip to content

Commit

Permalink
flake: replaced shell nix with flake
Browse files Browse the repository at this point in the history
Signed-off-by: aserowy <[email protected]>
  • Loading branch information
aserowy committed Apr 25, 2024
1 parent 63e9c5e commit bec904c
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use_nix
use flake
61 changes: 61 additions & 0 deletions flake.lock

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

54 changes: 54 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
description = "tmux.nvim env";

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

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
with pkgs; {
devShell =
pkgs.mkShell {
buildInputs = [
gh
lua51Packages.busted
lua51Packages.luacov
lua51Packages.luacheck
nixpkgs-fmt
nodePackages.dockerfile-language-server-nodejs
nodePackages.markdownlint-cli
nodePackages.prettier
stylua
sumneko-lua-language-server
];
shellHook = ''
export LUA_PATH="$PWD/?.lua;$PWD/lua/?/init.lua;$PWD/lua/?.lua;$LUA_PATH"
FULLPATH=$(realpath $0)
BASEDIR=$(dirname $FULLPATH)
# test environment
alias tb="docker build -t tmnv-te $BASEDIR/.dev"
alias te="docker run -it -v $BASEDIR:/workspace tmnv-te"
# format and check -> fac :)
alias fac="prettier --write README.md \
&& stylua .dev/ \
&& luacheck .dev/ \
&& stylua lua/ \
&& luacheck lua/ \
&& stylua spec/ \
&& luacheck spec/ \
&& busted --verbose -c"
'';
};
});
}
35 changes: 0 additions & 35 deletions shell.nix

This file was deleted.

0 comments on commit bec904c

Please sign in to comment.