mirror of
https://github.com/sbrow/nix.git
synced 2026-08-26 18:53:32 -04:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ae24200249 | |||
| c5a05d47ac |
@@ -14,6 +14,10 @@
|
|||||||
path = ./templates/default;
|
path = ./templates/default;
|
||||||
description = "A simple boilerplate for running Laravel with nix run.";
|
description = "A simple boilerplate for running Laravel with nix run.";
|
||||||
};
|
};
|
||||||
|
crawler = {
|
||||||
|
path = ./templates/crawler;
|
||||||
|
description = "Boilerplate for using playwright with Node.js.";
|
||||||
|
};
|
||||||
go = {
|
go = {
|
||||||
path = ./templates/go;
|
path = ./templates/go;
|
||||||
description = "A simple boilerplate for building Go apps.";
|
description = "A simple boilerplate for building Go apps.";
|
||||||
@@ -28,6 +32,10 @@
|
|||||||
description =
|
description =
|
||||||
"A simple boilerplate for running PHP apps in a nix shell.";
|
"A simple boilerplate for running PHP apps in a nix shell.";
|
||||||
};
|
};
|
||||||
|
playwright = {
|
||||||
|
path = ./templates/playwright;
|
||||||
|
description = "Boilerplate for using playwright with python.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
checks."x86_64-linux".vagrant =
|
checks."x86_64-linux".vagrant =
|
||||||
|
|||||||
@@ -98,7 +98,7 @@
|
|||||||
mail.command = "${pkgs.mailhog}/bin/MailHog";
|
mail.command = "${pkgs.mailhog}/bin/MailHog";
|
||||||
web.command = "${pkgs.caddy}/bin/caddy run";
|
web.command = "${pkgs.caddy}/bin/caddy run";
|
||||||
web.is_elevated = true;
|
web.is_elevated = true;
|
||||||
docs.command = "${pkgs.pkgsite}/bin/pkgsite --http localhost:6060";
|
docs.command = "${pkgs.unstable.pkgsite}/bin/pkgsite --http localhost:6060";
|
||||||
};
|
};
|
||||||
|
|
||||||
devShells.default = pkgs.mkShell
|
devShells.default = pkgs.mkShell
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
use flake
|
||||||
|
|
||||||
|
export PATH="$PATH:./vendor/bin"
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
.direnv
|
||||||
|
node_modules
|
||||||
|
vendor
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
(cors) {
|
||||||
|
@origin header Origin {args[0]}
|
||||||
|
header @origin Access-Control-Allow-Origin "{args[0]}"
|
||||||
|
header @origin Access-Control-Allow-Methods "OPTIONS,HEAD,GET,POST,PUT,PATCH,DELETE"
|
||||||
|
}
|
||||||
|
|
||||||
|
wp.test {
|
||||||
|
root * .
|
||||||
|
|
||||||
|
encode zstd gzip
|
||||||
|
file_server
|
||||||
|
php_fastcgi 127.0.0.1:9009
|
||||||
|
|
||||||
|
tls internal
|
||||||
|
}
|
||||||
|
|
||||||
|
laravel.test {
|
||||||
|
# import cors laravel.test
|
||||||
|
|
||||||
|
respond /caddy/live OK
|
||||||
|
|
||||||
|
root * ./public
|
||||||
|
|
||||||
|
try_files {path} page-cache/{path}.html page-cache/{path}.json page-cache/{path}.xml
|
||||||
|
|
||||||
|
encode zstd gzip
|
||||||
|
file_server
|
||||||
|
php_fastcgi 127.0.0.1:9009
|
||||||
|
|
||||||
|
# Uncomment for Laravel Octane
|
||||||
|
# reverse_proxy :8000
|
||||||
|
|
||||||
|
tls internal
|
||||||
|
}
|
||||||
Generated
+115
@@ -0,0 +1,115 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"flake-parts": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1785627969,
|
||||||
|
"narHash": "sha256-4dtXQk/NMePegK/nWp5NSeuZKLATItOq61lpEvmXqGw=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"rev": "427bf4bd9435fdf21321c8cc628c24efc14c0f7a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1785858998,
|
||||||
|
"narHash": "sha256-fKCq5jphd6l/Ms6gc3dptkw/TcKLYub9lQE5g6rbbkc=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "04607e1165ac22c5fde6dcc54c9e0b3c0487c555",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-26.05",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-lib": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1785031560,
|
||||||
|
"narHash": "sha256-OmshNvn2vupOFpYinLUu+1Dnpu4n7Q5N3ggGVNHpkUI=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"rev": "0e79af5e3d4dcfcd676ab5ba3f95d2e3352e078c",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-unstable": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1785747939,
|
||||||
|
"narHash": "sha256-D740uKsMbgsfK2oaDenJLLPIZfq7W0/g4KN/Fls8eKs=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "104240a772428cc2e20d8fd86c9ddbb886bbaff2",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"process-compose-flake": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1782060835,
|
||||||
|
"narHash": "sha256-Q8HH2t1l3MITtWCWY4ytcH5F/Q7aAHo3Iq/QTMAKTe0=",
|
||||||
|
"owner": "Platonic-Systems",
|
||||||
|
"repo": "process-compose-flake",
|
||||||
|
"rev": "464ff6880737f063c3f0d3d2c7781fda9190868f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "Platonic-Systems",
|
||||||
|
"repo": "process-compose-flake",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-parts": "flake-parts",
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
|
"process-compose-flake": "process-compose-flake",
|
||||||
|
"treefmt-nix": "treefmt-nix"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"treefmt-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1785945821,
|
||||||
|
"narHash": "sha256-NLSyTCW4K4ofhNBllt3omPasm6QpralXH1DBZOc91Dw=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"rev": "ae7910970dddc408fe6ab1c8e4b277bb21d72dc0",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
{
|
||||||
|
description = "A dev environment for web crawling";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
|
||||||
|
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
|
||||||
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
|
process-compose-flake.url = "github:Platonic-Systems/process-compose-flake";
|
||||||
|
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||||
|
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
inputs@{ self
|
||||||
|
, flake-parts
|
||||||
|
, nixpkgs
|
||||||
|
, nixpkgs-unstable
|
||||||
|
, process-compose-flake
|
||||||
|
, treefmt-nix
|
||||||
|
}:
|
||||||
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||||
|
imports = [
|
||||||
|
inputs.treefmt-nix.flakeModule
|
||||||
|
# inputs.process-compose-flake.flakeModule
|
||||||
|
];
|
||||||
|
systems = [ "x86_64-linux" ];
|
||||||
|
|
||||||
|
perSystem =
|
||||||
|
{ pkgs, system, inputs', ... }: {
|
||||||
|
_module.args.pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
|
||||||
|
overlays = [
|
||||||
|
(final: prev: { unstable = inputs'.nixpkgs-unstable.legacyPackages; })
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
treefmt = {
|
||||||
|
# Used to find the project root
|
||||||
|
projectRootFile = "flake.nix";
|
||||||
|
settings.global.excludes = [
|
||||||
|
".direnv/**"
|
||||||
|
".jj/**"
|
||||||
|
".env"
|
||||||
|
".envrc"
|
||||||
|
".env.local"
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
# Format nix files
|
||||||
|
programs.nixpkgs-fmt.enable = true;
|
||||||
|
programs.deadnix.enable = true;
|
||||||
|
|
||||||
|
# Format js, json, and yaml files
|
||||||
|
programs.prettier.enable = true;
|
||||||
|
settings.formatter.prettier =
|
||||||
|
{
|
||||||
|
excludes = [
|
||||||
|
"public/**"
|
||||||
|
"resources/js/modernizr.js"
|
||||||
|
"storage/app/caniuse.json"
|
||||||
|
"*.md"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
process-compose.default.settings.processes = {
|
||||||
|
web.command = "sudo ${pkgs.caddy}/bin/caddy run";
|
||||||
|
mail.command = "${pkgs.mailhog}/bin/MailHog";
|
||||||
|
php.command = "${php}/bin/php-fpm -F -y php-fpm.conf";
|
||||||
|
redis.command = "${$pks.redis}/bin/redis-server";
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
|
devShells.default = pkgs.mkShell
|
||||||
|
{
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
playwright
|
||||||
|
playwright-driver.browsers
|
||||||
|
|
||||||
|
(python3.withPackages (ps: [
|
||||||
|
ps.playwright
|
||||||
|
ps.python-dotenv
|
||||||
|
|
||||||
|
ps.pytest-playwright
|
||||||
|
ps.pytest
|
||||||
|
]))
|
||||||
|
|
||||||
|
# IDE
|
||||||
|
unstable.helix
|
||||||
|
typescript-language-server
|
||||||
|
vscode-langservers-extracted
|
||||||
|
ty # python LSP
|
||||||
|
];
|
||||||
|
|
||||||
|
shellHook = ''
|
||||||
|
export PLAYWRIGHT_BROWSERS_PATH=${pkgs.playwright-driver.browsers}
|
||||||
|
export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true
|
||||||
|
# May or may not be necessary
|
||||||
|
export PLAYWRIGHT_HOST_PLATFORM_OVERRIDE="ubuntu-24.04"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user