forked from MatthiasBenaets/nix-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
87 lines (75 loc) · 3.41 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
#
# G'Day
# Behold is my personal Nix, NixOS and Darwin Flake.
# I'm not the sharpest tool in the shed, so this build might not be the best out there.
# I refer to the README and other org document on how to use these files.
# Currently and possibly forever a Work In Progress.
#
# flake.nix *
# ├─ ./hosts
# │ └─ default.nix
# ├─ ./darwin
# │ └─ default.nix
# └─ ./nix
# └─ default.nix
#
{
description = "My Personal NixOS and Darwin System Flake Configuration";
inputs = # All flake references used to build my NixOS setup. These are dependencies.
{
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # Nix Packages
home-manager = { # User Package Management
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
darwin = {
url = "github:lnl7/nix-darwin/master"; # MacOS Package Management
inputs.nixpkgs.follows = "nixpkgs";
};
nur = {
url = "github:nix-community/NUR"; # NUR Packages
};
nixgl = { # OpenGL
url = "github:guibou/nixGL";
inputs.nixpkgs.follows = "nixpkgs";
};
emacs-overlay = { # Emacs Overlays
url = "github:nix-community/emacs-overlay";
flake = false;
};
doom-emacs = { # Nix-community Doom Emacs
url = "github:nix-community/nix-doom-emacs";
inputs.nixpkgs.follows = "nixpkgs";
inputs.emacs-overlay.follows = "emacs-overlay";
};
hyprland = { # Official Hyprland flake
url = "github:vaxerski/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ { self, nixpkgs, home-manager, darwin, nur, nixgl, doom-emacs, hyprland, ... }: # Function that tells my flake which to use and what do what to do with the dependencies.
let # Variables that can be used in the config files.
user = "matthias";
location = "$HOME/.setup";
in # Use above variables in ...
{
nixosConfigurations = ( # NixOS configurations
import ./hosts { # Imports ./hosts/default.nix
inherit (nixpkgs) lib;
inherit inputs nixpkgs home-manager nur user location doom-emacs hyprland; # Also inherit home-manager so it does not need to be defined here.
}
);
darwinConfigurations = ( # Darwin Configurations
import ./darwin {
inherit (nixpkgs) lib;
inherit inputs nixpkgs home-manager darwin user;
}
);
homeConfigurations = ( # Non-NixOS configurations
import ./nix {
inherit (nixpkgs) lib;
inherit inputs nixpkgs home-manager nixgl user;
}
);
};
}