-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
52 lines (46 loc) · 1.23 KB
/
flake.nix
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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs }:
let
forAllSystems = generate: nixpkgs.lib.genAttrs [
"aarch64-darwin"
"x86_64-darwin"
"aarch64-linux"
"x86_64-linux"
]
(system: generate (
let
pkgs = nixpkgs.legacyPackages.${system};
callPackage = pkgs.lib.callPackageWith
(pkgs // {
version =
if self ? rev
then self.rev
else "dirty";
});
in
{
inherit pkgs callPackage;
}
));
packages = forAllSystems ({ callPackage, ... }: {
default = callPackage ./. { };
});
in
{
inherit packages;
formatter = forAllSystems ({ pkgs, ... }: pkgs.nixpkgs-fmt);
apps = forAllSystems ({ callPackage, ... }: {
default = {
type = "app";
program = callPackage ./. { };
};
});
devShells = forAllSystems ({ callPackage, ... }: {
default = callPackage ./shell.nix { };
});
nixosModules.homeManager = import ./home-manager-module { inherit packages; };
};
}