Merge pull request #176 from srid/flake-parts

Switch to `flake-parts`
This commit is contained in:
Jonas Chevalier 2022-08-23 19:13:03 +02:00 committed by GitHub
commit ef8f965344
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 30 deletions

View File

@ -1,27 +1,32 @@
{
"nodes": {
"flake-utils": {
"flake-parts": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1649676176,
"narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678",
"lastModified": 1661009076,
"narHash": "sha256-phAE40gctVygRq3G3B6LhvD7u2qdQT21xsz8DdRDYFo=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "850d8a76026127ef02f040fb0dcfdb8b749dd9d9",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1651545648,
"narHash": "sha256-7f1JYFHtfTOvois5LdXrKXthjb6rE9i8ZxWDQyzYKAk=",
"lastModified": 1661239106,
"narHash": "sha256-C5OCLnrv2c4CHs9DMEtYKkjJmGL7ySAZ1PqPkHBonxQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "24c33ab7952544ad355d0677c9eea931b23f371c",
"rev": "963d27a0767422be9b8686a8493dcade6acee992",
"type": "github"
},
"original": {
@ -33,7 +38,7 @@
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
}
}

View File

@ -3,24 +3,24 @@
# To update all inputs:
# $ nix flake update --recreate-lock-file
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.flake-parts.url = "github:hercules-ci/flake-parts";
inputs.flake-parts.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, flake-utils }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
nixpkgs' = nixpkgs.legacyPackages.${system};
pkgs = import self {
inherit system;
inputs = null;
nixpkgs = nixpkgs';
outputs = { self, nixpkgs, flake-parts }@inputs:
flake-parts.lib.mkFlake { inherit self; } {
systems = nixpkgs.lib.systems.flakeExposed;
perSystem = { system, pkgs, ... }:
let
packages = import ./. {
inherit system;
inputs = null;
nixpkgs = pkgs;
};
in
{
inherit packages;
devShells.default = packages.devShell;
};
in
{
defaultPackage = pkgs.default;
packages = pkgs;
devShell = pkgs.devShell;
}
);
};
}