forked from EmergentMind/nix-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
137 lines (119 loc) · 4.16 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
{
description = "EmergentMind's Nix-Config";
inputs = {
#################### Official NixOS and HM Package Sources ####################
nixpkgs.url = "github:NixOS/nixpkgs/release-23.11";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; # also see 'unstable-packages' overlay at 'overlays/default.nix"
hardware.url = "github:nixos/nixos-hardware";
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
#################### Utilities ####################
# Declarative partitioning and formatting
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
# Secrets management. See ./docs/secretsmgmt.md
sops-nix = {
url = "github:mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# vim4LMFQR!
nixvim = {
url = "github:nix-community/nixvim/nixos-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
# Windows management
# for now trying to avoid this one because I want stability for my wm
# this is the hyprland development flake package / unstable
# hyprland = {
# url = "github:hyprwm/hyprland";
# inputs.nixpkgs.follows = "nixpkgs";
# };
# hyprland-plugins = {
# url = "github:hyprwm/hyprland-plugins";
# inputs.hyprland.follows = "hyprland";
# };
#################### Personal Repositories ####################
# Private secrets repo. See ./docs/secretsmgmt.md
# Authenticate via ssh and use shallow clone
nix-secrets = {
url = "git+ssh://[email protected]/emergentmind/nix-secrets.git?ref=main&shallow=1";
flake = false;
};
};
outputs = { self, disko, nixpkgs, home-manager, ... } @ inputs:
let
inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
#"aarch64-darwin"
];
inherit (nixpkgs) lib;
configVars = import ./vars { inherit inputs lib; };
configLib = import ./lib { inherit lib; };
specialArgs = { inherit inputs outputs configVars configLib nixpkgs; };
in
{
# Custom modules to enable special functionality for nixos or home-manager oriented configs.
nixosModules = import ./modules/nixos;
homeManagerModules = import ./modules/home-manager;
# Custom modifications/overrides to upstream packages.
overlays = import ./overlays { inherit inputs outputs; };
# Custom packages to be shared or upstreamed.
packages = forAllSystems
(system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./pkgs { inherit pkgs; }
);
# TODO change this to something that has better looking output rules
# Nix formatter available through 'nix fmt' https://nix-community.github.io/nixpkgs-fmt
formatter = forAllSystems
(system:
nixpkgs.legacyPackages.${system}.nixpkgs-fmt
);
# Shell configured with packages that are typically only needed when working on or with nix-config.
devShells = forAllSystems
(system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./shell.nix { inherit pkgs; }
);
#################### NixOS Configurations ####################
#
# Building configurations available through `just rebuild` or `nixos-rebuild --flake .#hostname`
nixosConfigurations = {
# Qemu VM dev lab
grief = lib.nixosSystem {
inherit specialArgs;
modules = [
home-manager.nixosModules.home-manager{
home-manager.extraSpecialArgs = specialArgs;
}
./hosts/grief
];
};
# Qemu VM deployment test lab
guppy = lib.nixosSystem {
inherit specialArgs;
modules = [
home-manager.nixosModules.home-manager{
home-manager.extraSpecialArgs = specialArgs;
}
./hosts/guppy
];
};
# Theatre - ASUS VivoPC VM40B-S081M
gusto = lib.nixosSystem {
inherit specialArgs;
modules = [
home-manager.nixosModules.home-manager{
home-manager.extraSpecialArgs = specialArgs;
}
./hosts/gusto
];
};
};
};
}