Switch to flake-parts

This commit is contained in:
Sridhar Ratnakumar 2022-08-23 11:03:29 -04:00
parent e2b2f65b3c
commit 3a042bf97b
2 changed files with 48 additions and 32 deletions

View File

@ -1,27 +1,45 @@
{
"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",
"type": "github"
"id": "flake-parts",
"type": "indirect"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1651545648,
"narHash": "sha256-7f1JYFHtfTOvois5LdXrKXthjb6rE9i8ZxWDQyzYKAk=",
"lastModified": 1653581809,
"narHash": "sha256-Uvka0V5MTGbeOfWte25+tfRL3moECDh1VwokWSZUdoY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "24c33ab7952544ad355d0677c9eea931b23f371c",
"rev": "83658b28fe638a170a19b8933aa008b30640fbd1",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1661239106,
"narHash": "sha256-C5OCLnrv2c4CHs9DMEtYKkjJmGL7ySAZ1PqPkHBonxQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "963d27a0767422be9b8686a8493dcade6acee992",
"type": "github"
},
"original": {
@ -33,8 +51,8 @@
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs_2"
}
}
},

View File

@ -3,24 +3,22 @@
# 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";
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;
}
);
};
}