refactor(flake): use flake-parts

This commit is contained in:
Oliver Davies 2023-06-23 20:24:04 +01:00
parent db76011b91
commit 5e8b836aa5
2 changed files with 46 additions and 27 deletions

View file

@ -1,39 +1,59 @@
{ {
"nodes": { "nodes": {
"flake-utils": { "flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": { "locked": {
"lastModified": 1676283394, "lastModified": 1685662779,
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", "narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=",
"owner": "numtide", "owner": "hercules-ci",
"repo": "flake-utils", "repo": "flake-parts",
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", "rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "numtide", "id": "flake-parts",
"repo": "flake-utils", "type": "indirect"
"type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1676468895, "lastModified": 1687412861,
"narHash": "sha256-wHxF7WWlhkjI0oHaMd/u5tZ4xde1hCexmOZGVDLf5yM=", "narHash": "sha256-Z/g0wbL68C+mSGerYS2quv9FXQ1RRP082cAC0Bh4vcs=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "fa90359876285998d9e1877c671dc6cadaf9cb2c", "rev": "e603dc5f061ca1d8a19b3ede6a8cf9c9fcba6cdc",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "master", "ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1685564631,
"narHash": "sha256-8ywr3AkblY4++3lIVxmrWZFzac7+f32ZEhH/A8pNscI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4f53efe34b3a8877ac923b9350c874e3dcd5dc0a",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-parts": "flake-parts",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
} }

View file

@ -1,17 +1,16 @@
{ {
inputs = { inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/master";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }: outputs = inputs@{ flake-parts, ... }:
flake-utils.lib.eachDefaultSystem (system: flake-parts.lib.mkFlake { inherit inputs; } {
let systems = [ "x86_64-linux" ];
pkgs = nixpkgs.legacyPackages.${system};
in perSystem = { config, self', inputs', pkgs, system, ... }: {
{ devShells = {
devShell = with pkgs; pkgs.mkShell { default = pkgs.mkShell {
buildInputs = [ php82 ]; buildInputs = with pkgs; [ php82 php82Packages.composer ];
};
};
};
}; };
});
} }