-
Notifications
You must be signed in to change notification settings - Fork 10
/
flake.nix
115 lines (95 loc) · 3.54 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{
description = ''
Nyx is the personal configuration. This repository holdes .dotfile configuration as well as both nix (with
home-manager) and nixos configurations.
'';
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixos-hardware.url = "github:nixos/nixos-hardware";
home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
darwin.url = "github:lnl7/nix-darwin/master";
darwin.inputs.nixpkgs.follows = "nixpkgs";
nur.url = "github:nix-community/nur";
flake-compat.url = "github:edolstra/flake-compat";
flake-compat.flake = false;
neovim-flake.url = "github:nix-community/neovim-nightly-overlay";
neovim-flake.inputs.nixpkgs.follows = "nixpkgs";
nushell-src.url = "github:nushell/nushell";
nushell-src.flake = false;
rust-overlay.url = "github:oxalica/rust-overlay";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
ghostty-module.url = "github:clo4/ghostty-hm-module";
# eww.url = "github:elkowar/eww";
};
nixConfig = {
extra-substituters = [
"https://edeneast.cachix.org"
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"edeneast.cachix.org-1:a4tKrKZgZXXXYhDytg/Z3YcjJ04oz5ormt0Ow6OpExc="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
outputs = { self, ... }@inputs:
with self.lib;
let
systems = [ "x86_64-linux" "aarch64-darwin" ];
foreachSystem = genAttrs systems;
pkgsBySystem = foreachSystem (
system:
import inputs.nixpkgs {
inherit system;
config = import ./nix/config.nix;
overlays = self.overlays."${system}";
}
);
in
rec {
lib = import ./lib { inherit inputs; } // inputs.nixpkgs.lib;
devShell = foreachSystem (system: import ./shell.nix { pkgs = pkgsBySystem."${system}"; });
templates = import ./nix/templates;
legacyPackages = pkgsBySystem;
packages = foreachSystem (system: import ./nix/pkgs self system);
overlay = foreachSystem (system: _final: _prev: self.packages."${system}");
overlays = foreachSystem (
system: with inputs; let
ovs = attrValues (import ./nix/overlays self);
in
[
(self.overlay."${system}")
(nur.overlay)
(import rust-overlay)
# (_:_: { inherit (eww.packages."${system}") eww; })
] ++ ovs
);
homeManagerConfigurations = mapAttrs' mkHome {
eden = { };
};
nixosConfigurations = mapAttrs' mkSystem {
pride = { };
sloth = { };
wrath = { };
vm-dev = { };
};
darwinConfigurations = mapAttrs' mkDarwin {
theman = { user = "work"; };
};
# Convenience output that aggregates the outputs for home, nixos, and darwin configurations.
# Also used in ci to build targets generally.
top =
let
nixtop = genAttrs
(builtins.attrNames inputs.self.nixosConfigurations)
(attr: inputs.self.nixosConfigurations.${attr}.config.system.build.toplevel);
hometop = genAttrs
(builtins.attrNames inputs.self.homeManagerConfigurations)
(attr: inputs.self.homeManagerConfigurations.${attr}.activationPackage);
darwintop = genAttrs
(builtins.attrNames inputs.self.darwinConfigurations)
(attr: inputs.self.darwinConfigurations.${attr}.system);
in
nixtop // hometop // darwintop;
};
}