-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
106 lines (86 loc) · 3.24 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
{
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, ... }@inputs:
let
stateVersion = "24.11";
in
{
darwinConfigurations."pro" = inputs.darwin.lib.darwinSystem {
system = "x86_64-darwin";
specialArgs = {
dotfiles = inputs.dotfiles;
};
modules = [
./hosts/darwin/N4FQ62JR/configuration.nix
inputs.home-manager.darwinModules.home-manager
(
{ config, pkgs, ... }:
{
nixpkgs.overlays = [
inputs.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);
nixosModule = {
imports = builtins.attrValues self.nixosModules;
};
nixosConfigurations = import ./hosts/nixos {
inherit nixpkgs inputs stateVersion;
nixosModule = self.nixosModule;
};
packages = inputs.flake-utils.lib.eachDefaultSystem (
system: import ./pkgs nixpkgs.legacyPackages.${system}
);
# devShells = inputs.flake-utils.lib.eachDefaultSystem (
# system: import ./shell.nix nixpkgs.legacyPackages.${system}
# );
devShells.x86_64-linux = import ./shell.nix nixpkgs.legacyPackages.x86_64-linux;
devShells.x86_64-darwin = import ./shell.nix nixpkgs.legacyPackages.x86_64-darwin;
overlays = import ./overlays { inherit inputs; };
# TODO: Figure out why flake-utils eachDefaultSystem does not return the expected an attribute set of systems.
# formatter = inputs.flake-utils.lib.eachDefaultSystem (
# system: nixpkgs.legacyPackages."${system}".nixfmt-rfc-style
# );
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
};
}