dev: init env

This commit is contained in:
GlennWSo 2024-03-25 14:42:21 +01:00
commit cdb11b2a48
5 changed files with 102 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.direnv

60
flake.lock Normal file
View file

@ -0,0 +1,60 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1711371852,
"narHash": "sha256-lC5eiopclTw7MuJV/UEHZ6H7ZPvVl5tSU+SjpmEh1R0=",
"owner": "NixOs",
"repo": "nixpkgs",
"rev": "973ce720b3126836a9d5cea1e2f89d603dea7a87",
"type": "github"
},
"original": {
"owner": "NixOs",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

28
flake.nix Normal file
View file

@ -0,0 +1,28 @@
{
inputs.nixpkgs.url = "github:NixOs/nixpkgs";
inputs.flake-utils.url = "github:numtide/flake-utils";
# inputs.flake-utils.inputs.nixpkgs.follows = "nixpkgs";
outputs = {
flake-utils,
nixpkgs,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
};
dev_serve = pkgs.writeShellScriptBin "serve" ''
${pkgs.simple-http-server}/bin/simple-http-server -i $@ ${./static}
'';
in {
# ...
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
pkgs.vscode-langservers-extracted # html, css lsp
simple-http-server
dev_serve
];
};
});
}

12
static/index.html Normal file
View file

@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap demo</title>
</head>
<body>
<h1>Hello, World!</h1>
</body>
</html>