-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
76 lines (70 loc) · 2.45 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
description = "NexusSocial/identity repo";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
# Linux
nixos-24_05.url = "github:NixOS/nixpkgs/nixos-24.05";
nixos-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-generators = {
url = "github:nix-community/nixos-generators/7c60ba4bc8d6aa2ba3e5b0f6ceb9fc07bc261565";
inputs.nixpkgs.follows = "nixos-24_05";
};
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixos-24_05";
};
#Darwin
nixpkgs-24_05-darwin.url = "github:NixOS/nixpkgs/nixpkgs-24.05-darwin";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
# For accessing `deploy-rs`'s utility Nix functions
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
};
outputs = inputs-raw@{ flake-utils, ... }:
let
# All systems we may care about evaluating nixpkgs for
systems = with flake-utils.lib.system; [ x86_64-linux aarch64-linux aarch64-darwin x86_64-darwin ];
perSystem = (system: rec {
inputs = import ./nix/inputs.nix { inherit inputs-raw system; };
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
((import nix/overlays/nixpkgs-unstable.nix) { inherit inputs; })
];
config = {
# allowUnfree = true;
};
};
});
# This `s` helper variable caches each system we care about in one spot
inherit (flake-utils.lib.eachSystem systems (system: { s = perSystem system; })) s;
in
# System-specific stuff goes in here, by using the flake-utils helper functions
flake-utils.lib.eachSystem systems
(system:
let
inherit (s.${system}) pkgs inputs;
in
{
devShells = import ./nix/devShells.nix { inherit system pkgs inputs; };
packages = {
deploy-rs = inputs.deploy-rs.packages.${system}.deploy-rs;
};
formatter = pkgs.nixpkgs-fmt;
}
)
# Next, concatenate deploy-rs stuff to the flake
// import ./nix/deploy-rs.nix {
inputs = s."x86_64-linux".inputs;
}
# Concatenate NixOS stuff
// {
nixosConfigurations = import ./nix/nixos/nixosConfigurations.nix { inherit s; };
};
}