-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
62 lines (59 loc) · 2.17 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
{
description = "NixOS configuration";
# All inputs for the system
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-colors.url = "github:misterio77/nix-colors";
willdooit-dev-cli.url = "git+ssh://[email protected]/WilldooIT-Private/willdooit-dev-cli?ref=main";
willdooit-commitizen.url = "git+ssh://[email protected]/WilldooIT-Private/willdooit-commitizen?ref=flake-fix";
erosanix = {
url = "github:emmanuelrosa/erosanix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
# All outputs for the system (configs)
outputs = {home-manager, ...} @ inputs: let
# This lets us reuse the code to "create" a system
# Credits go to sioodmy on this one!
# https://github.com/sioodmy/dotfiles/blob/main/flake.nix
mkSystem = nixpkgs: system: hostname:
nixpkgs.lib.nixosSystem {
inherit system;
modules = [
{
networking.hostName = hostname;
nixpkgs.overlays = [
(import ./overlay.nix {inherit nixpkgs;})
];
}
# General configuration (users, networking, sound, etc)
./modules/system/configuration.nix
# Hardware config (bootloader, kernel modules, filesystems, etc)
# DO NOT USE MY HARDWARE CONFIG!! USE YOUR OWN!!
(./. + "/hosts/${hostname}/hardware-configuration.nix")
(./. + "/hosts/${hostname}/system-configuration.nix")
home-manager.nixosModules.home-manager
{
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {inherit inputs;};
users.djames = ./. + "/hosts/${hostname}/user.nix";
};
}
];
specialArgs = {inherit inputs;};
};
in {
nixosConfigurations = {
# Now, defining a new system is can be done in one line
# Architecture Hostname
laptop = mkSystem inputs.nixpkgs "x86_64-linux" "laptop";
# desktop = mkSystem inputs.nixpkgs "x86_64-linux" "desktop";
};
};
}