Migrate to flake.parts

This commit is contained in:
Oliver Davies 2025-06-22 23:52:17 +01:00
parent fbd7c1866f
commit 5505524dd4
2 changed files with 54 additions and 25 deletions

21
flake.lock generated
View file

@ -1,5 +1,25 @@
{ {
"nodes": { "nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1749398372,
"narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1750365781, "lastModified": 1750365781,
@ -18,6 +38,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
} }

View file

@ -1,33 +1,41 @@
{ {
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; inputs = {
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = outputs =
{ nixpkgs, ... }: inputs@{ flake-parts, ... }:
let flake-parts.lib.mkFlake { inherit inputs; } {
system = "x86_64-linux"; systems = [ "x86_64-linux" ];
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) callPackage; perSystem =
{ config, pkgs, ... }:
let
inherit (pkgs) callPackage;
commonPhpPackages = with pkgs; [ commonPhpPackages = with pkgs; [
phpactor phpactor
]; ];
in in
{ {
devShells.${system} = { devShells = {
default = pkgs.mkShell { default = pkgs.mkShell {
packages = with pkgs; [ nixd ]; packages = with pkgs; [ nixd ];
};
nodejs = callPackage ./modules/nodejs.nix { };
php82 = callPackage ./modules/php82.nix { inherit commonPhpPackages; };
php83 = callPackage ./modules/php83.nix { inherit commonPhpPackages; };
tailwindcss = callPackage ./modules/tailwindcss.nix { };
};
formatter = pkgs.nixfmt-rfc-style;
}; };
nodejs = callPackage ./modules/nodejs.nix { };
php82 = callPackage ./modules/php82.nix { inherit commonPhpPackages; };
php83 = callPackage ./modules/php83.nix { inherit commonPhpPackages; };
tailwindcss = callPackage ./modules/tailwindcss.nix { };
};
formatter.${system} = pkgs.nixfmt-rfc-style;
}; };
} }