feat: add flake

This commit is contained in:
Felix Schröter 2022-08-01 18:33:47 +02:00
commit 0452e8fa24
Signed by: felschr
GPG key ID: 671E39E6744C807D
3 changed files with 93 additions and 0 deletions

18
.gitignore vendored Normal file
View file

@ -0,0 +1,18 @@
.DS_Store
node_modules
/dist
# dotenv environment variables file
.env
.env.*
!.env.example
# direnv
.direnv/
.envrc
# nix
/result
# Log files
npm-debug.log*

43
flake.lock generated Normal file
View file

@ -0,0 +1,43 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1656928814,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1659219666,
"narHash": "sha256-pzYr5fokQPHv7CmUXioOhhzDy/XyWOIXP4LZvv/T7Mk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7b9be38c7250b22d829ab6effdee90d5e40c6e5c",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

32
flake.nix Normal file
View file

@ -0,0 +1,32 @@
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
in rec {
devShells = {
default = pkgs.mkShell {
name = "env";
buildInputs = with pkgs; [
nodejs-16_x
# linters & formatters
nixfmt
nodePackages.prettier
# language servers
nodePackages.bash-language-server
nodePackages.typescript-language-server
nodePackages.vscode-langservers-extracted
];
shellHook = ''
export PATH="$PWD/node_modules/.bin:$PATH"
'';
};
};
});
}