Add devshell and process-compose

This commit is contained in:
Greg Hellings
2024-04-22 01:38:32 -05:00
parent 7a8a5c891f
commit a373a69ca5
2 changed files with 115 additions and 12 deletions
Generated
+90 -5
View File
@@ -1,5 +1,24 @@
{ {
"nodes": { "nodes": {
"devshell": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1713532798,
"narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=",
"owner": "numtide",
"repo": "devshell",
"rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
@@ -33,13 +52,31 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1682960002, "lastModified": 1704161960,
"narHash": "sha256-5Zjh4pT3lAjFGN1gVrjqj1LLJHKCAlGdLD8raU7oEMc=", "narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8670e496ffd093b60e74e7fa53526aa5920d09eb", "rev": "63143ac2c9186be6d9da6035fa22620018c85932",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -68,6 +105,22 @@
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1682960002,
"narHash": "sha256-5Zjh4pT3lAjFGN1gVrjqj1LLJHKCAlGdLD8raU7oEMc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8670e496ffd093b60e74e7fa53526aa5920d09eb",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1708475490, "lastModified": 1708475490,
"narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=", "narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=",
@@ -83,17 +136,49 @@
"type": "github" "type": "github"
} }
}, },
"process-compose": {
"locked": {
"lastModified": 1713665906,
"narHash": "sha256-kuOJ5pK03axDx4F5GBhNMn6ZtTG3V4Cd85iHUsu5eWk=",
"owner": "Platonic-Systems",
"repo": "process-compose-flake",
"rev": "128a50fb7bb03eb41c8f65923c355ad4d7a57935",
"type": "github"
},
"original": {
"owner": "Platonic-Systems",
"repo": "process-compose-flake",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"devshell": "devshell",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"flake-root": "flake-root", "flake-root": "flake-root",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_2",
"process-compose": "process-compose",
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
} }
}, },
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": { "treefmt-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1711963903, "lastModified": 1711963903,
+25 -7
View File
@@ -1,16 +1,21 @@
# github.com/brianmcgee has lots of great ideas for going above and beyond for this
{ {
description = "Greg's homepage"; description = "Greg's homepage";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
devshell.url = "github:numtide/devshell";
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
flake-root.url = "github:srid/flake-root"; flake-root.url = "github:srid/flake-root";
process-compose.url = "github:Platonic-Systems/process-compose-flake";
treefmt-nix.url = "github:numtide/treefmt-nix"; treefmt-nix.url = "github:numtide/treefmt-nix";
}; };
outputs = { flake-parts, flake-root, treefmt-nix, ... }@inputs: outputs = { devshell, flake-parts, flake-root, process-compose, treefmt-nix, ... }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } { flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ imports = [
inputs.devshell.flakeModule
inputs.flake-root.flakeModule inputs.flake-root.flakeModule
inputs.process-compose.flakeModule
inputs.treefmt-nix.flakeModule inputs.treefmt-nix.flakeModule
]; ];
flake = { flake = {
@@ -20,13 +25,26 @@
"x86_64-linux" "x86_64-linux"
"aarch64-linux" "aarch64-linux"
]; ];
perSystem = { config, pkgs, ... }: { perSystem = { config, pkgs, self', ... }: {
devShells.default = pkgs.mkShell { devshells.default = {
nativeBuildInputs = [ commands = [
pkgs.bashInteractive {
pkgs.hugo package = pkgs.hugo;
category = "server";
}
{
package = self'.packages.dev-server;
category = "server";
help = "Start the development server";
}
]; ];
buildInputs = [ ]; #devshell.startup.server.text = "${pkgs.hugo}/bin/hugo serve";
};
process-compose = {
dev-server.settings.processes = {
hugo.command = "${pkgs.hugo}/bin/hugo serve";
};
}; };
treefmt.config = { treefmt.config = {