-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
102 lines (83 loc) · 2.91 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
{
description = "A declarative NixOS configuration with Home Manager";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
nixos-wsl.url = "github:nix-community/nixos-wsl";
xremap-flake.url = "github:xremap/nix-flake";
darwin.url = "github:lnl7/nix-darwin/master";
darwin.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
dotfiles = {
flake = false;
url = "https://github.com/Buttars/.dotfiles.git";
type = "git";
};
};
outputs = { self, nixpkgs, darwin, nixos-wsl, dotfiles, ... } @ inputs:
let
systems = [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
stateVersion = "24.11";
in
{
darwinConfigurations."pro" = darwin.lib.darwinSystem
{
system = "x86_64-darwin";
specialArgs = { inherit dotfiles; };
modules = [
./hosts/darwin-x86/configuration.nix
inputs.home-manager.darwinModules.home-manager
({ config, pkgs, ... }: {
nixpkgs.overlays = [
darwin.overlays.default
inputs.self.overlays.additions
inputs.self.overlays.modifications
inputs.self.overlays.unstable-packages
];
})
];
};
nixosModules =
{
home-manager = inputs.home-manager.nixosModules.home-manager;
xremap = inputs.xremap-flake.nixosModules.default;
sops-nix = inputs.sops-nix.nixosModules.sops;
wsl = inputs.nixos-wsl.nixosModules.default;
disko = inputs.disko.nixosModules.disko;
} //
nixpkgs.lib.mapAttrs'
(name: type: {
name = nixpkgs.lib.removeSuffix ".nix" name;
value = import (./modules + "/${name}");
})
(builtins.readDir ./modules) //
nixpkgs.lib.mapAttrs'
(name: type: {
name = nixpkgs.lib.removeSuffix ".nix" name;
value = import (./profiles + "/${name}");
})
(builtins.readDir ./profiles);
nixosModule = {
imports = builtins.attrValues self.nixosModules;
};
nixosConfigurations = import ./hosts {
inherit nixpkgs inputs stateVersion;
nixosModule = self.nixosModule;
};
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
overlays = import ./overlays { inherit inputs; };
};
}