flake stuff

This commit is contained in:
rhiannon morris 2022-05-26 18:03:14 +02:00
parent d8e8a95ef4
commit ea0ae8f127
2 changed files with 35 additions and 44 deletions

View file

@ -127,21 +127,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": {
"locked": {
"lastModified": 1638122382,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"frex": { "frex": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -264,7 +249,9 @@
"dot-parse": "dot-parse", "dot-parse": "dot-parse",
"effect": "effect", "effect": "effect",
"elab-util": "elab-util", "elab-util": "elab-util",
"flake-utils": "flake-utils_2", "flake-utils": [
"flake-utils"
],
"frex": "frex", "frex": "frex",
"fvect": "fvect", "fvect": "fvect",
"hashable": "hashable", "hashable": "hashable",
@ -278,7 +265,9 @@
"json": "json", "json": "json",
"katla": "katla", "katla": "katla",
"lsp": "lsp", "lsp": "lsp",
"nixpkgs": "nixpkgs", "nixpkgs": [
"nixpkgs"
],
"odf": "odf", "odf": "odf",
"pretty-show": "pretty-show", "pretty-show": "pretty-show",
"python": "python", "python": "python",
@ -401,18 +390,17 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1639213685, "lastModified": 1638239011,
"narHash": "sha256-Evuobw7o9uVjAZuwz06Al0fOWZ5JMKOktgXR0XgWBtg=", "narHash": "sha256-AjhmbT4UBlJWqxY0ea8a6GU2C2HdKUREkG43oRr3TZg=",
"owner": "nixos", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "453bcb8380fd1777348245b3c44ce2a2b93b2e2d", "rev": "a7ecde854aee5c4c7cd6177f54a99d2c1ff28a31",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "id": "nixpkgs",
"ref": "nixpkgs-21.11-darwin", "ref": "21.11",
"repo": "nixpkgs", "type": "indirect"
"type": "github"
} }
}, },
"odf": { "odf": {
@ -499,10 +487,7 @@
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"idris2-pkgs": "idris2-pkgs", "idris2-pkgs": "idris2-pkgs",
"nixpkgs": [ "nixpkgs": "nixpkgs"
"idris2-pkgs",
"nixpkgs"
]
} }
}, },
"snocvect": { "snocvect": {

View file

@ -1,36 +1,42 @@
{ description = "basic test framework for idris 2"; { description = "basic test framework for idris 2";
inputs = { inputs = {
flake-utils.url = "github:numtide/flake-utils"; nixpkgs.url = "nixpkgs/21.11";
idris2-pkgs.url = "github:claymager/idris2-pkgs";
nixpkgs.follows = "idris2-pkgs/nixpkgs"; flake-utils = {
url = "github:numtide/flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
idris2-pkgs = {
url = "github:claymager/idris2-pkgs";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
}; };
outputs = { self, nixpkgs, idris2-pkgs, flake-utils }: outputs = { self, nixpkgs, idris2-pkgs, flake-utils }:
let systems = with flake-utils.lib.system; flake-utils.lib.eachDefaultSystem (system:
[ x86_64-darwin x86_64-linux i686-linux ];
in
flake-utils.lib.eachSystem systems (system:
let let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
overlays = [ idris2-pkgs.overlay ]; overlays = [ idris2-pkgs.overlay ];
}; };
inherit (pkgs.idris2-pkgs._builders) idrisPackage devEnv; builders = pkgs.idris2-pkgs._builders;
packages = rec { packages = let ipkg = builders.idrisPackage; in rec {
tap = idrisPackage ./. { }; tap = ipkg ./. { };
tap-example = idrisPackage ./example { extraPkgs = packages; }; tap-example = ipkg ./example { extraPkgs = packages; };
}; };
devShells = devShells =
let mkDevShell = _: pkg: let mkDevShell = _: pkg:
pkgs.mkShell { buildInputs = [ (devEnv pkg) ]; }; pkgs.mkShell { buildInputs = [ (builders.devEnv pkg) ]; };
shells = packages // (with packages; { example = tap-example; }); in builtins.mapAttrs mkDevShell packages;
in builtins.mapAttrs mkDevShell shells;
in { in {
inherit packages devShells; inherit packages devShells;
defaultPackage = packages.tap; defaultPackage = packages.tap;
devShell = devShells.tap; devShell = devShells.tap;
} }
); );
} }