-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
71 lines (60 loc) · 1.8 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
/*
INFO:
`./flake.lock` file captures dependency versions and locks them
It's important for consistent deployment of Nix across multiple hosts
https://nixos.wiki/wiki/Flakes
NOTE:
Prefer `nix <commmand>` commands rather than `nix-<something>` commmands if flake setup exists
*/
{
description = "Foo the Frog's Nix flake";
# Specify dependencies in `inputs` attribute
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# INFO: Nix flake for "too much bleeding-edge" and unreleased packages
nyxpkgs.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
home-manager = {
/*
INFO:
`inputs.nixpkgs` attribute for Home Manager is consistent with `input.nixpkgs` of this flake
This avoids issues caused by different versions of packages
`follows` is a special keyword used for inheritance in Nix expressions
*/
inputs.nixpkgs.follows = "nixpkgs";
};
niri = {
url = "github:YaLTeR/niri";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
nixpkgs,
home-manager,
nyxpkgs,
...
}: {
nixosConfigurations = {
foobar = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./hosts/foobar/systemwide.nix
# Deploy default Chaotic-Nyx module
nyxpkgs.nixosModules.default
/*
INFO:
Including Home Manager as a module automatically deploys it during rebuild
Thus removing the need to rebuild Home Manager config seperately
*/
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.foo = import ./hosts/foobar/userspace.nix;
};
}
];
};
};
};
}