-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
67 lines (63 loc) · 1.68 KB
/
flake.nix
File metadata and controls
67 lines (63 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Managed by copier — changes may be overwritten by `copier update`
{
description = "Swiss-army project template managed by Copier";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
copier-flake.url = "github:gordon-code/copier-flake/66a3c653cb91e6caaec4605a58a7e3f0e866424d"; # v2.0.1
};
outputs =
inputs@{
nixpkgs,
...
}:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forEachSupportedSystem =
f:
nixpkgs.lib.genAttrs supportedSystems (
system:
f {
inherit system;
pkgs = nixpkgs.legacyPackages.${system};
}
);
in
let
cfgFor =
pkgs:
(nixpkgs.lib.evalModules {
specialArgs = {
inherit pkgs;
inherit (nixpkgs) lib;
flakeInputs = inputs;
};
modules =
let
dir = builtins.readDir ./lib/nix;
nixFiles = builtins.filter (n: builtins.match ".*\\.nix" n != null) (builtins.attrNames dir);
in
map (f: ./lib/nix + "/${f}") nixFiles;
}).config;
in
{
devShells = forEachSupportedSystem (
{ pkgs, ... }:
let
cfg = cfgFor pkgs;
in
{
default = pkgs.mkShell {
packages = cfg.devPkgs;
inherit (cfg) shellHook env inputsFrom;
};
}
);
formatter = forEachSupportedSystem ({ pkgs, ... }: (cfgFor pkgs).formatter);
}
// (cfgFor nixpkgs.legacyPackages.${builtins.head supportedSystems}).extraFlakeOutputs;
}