-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
79 lines (70 loc) · 2.06 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs";
home-manager = {
url = "github:nix-community/home-manager/release-22.05";
inputs.nixpkgs.follows = "nixpkgs";
};
elgato = {
url = "github:waxlamp/elgato/flakes";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, elgato }:
let
system = "x86_64-linux";
# Module to set up the flakes registry with the same package sets as the
# system configuration uses.
flake-registry-module = { ... }: {
nix.registry = {
nixpkgs.flake = nixpkgs;
nixpkgs-unstable.flake = nixpkgs-unstable;
elgato.flake = elgato;
};
};
# Config for home-manager module.
home-manager-config = {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.roni = import ./home.nix;
extraSpecialArgs = specialArgs;
};
};
# Overlays.
overlays = [
(final: prev: {
elgato = elgato.defaultPackage.${system};
})
(import ./overlays/frobtads.nix)
];
# Convert a flake into a package set (allow unfree packages by default, and
# accept a list of overlay functions to apply).
unflake = { flake, overlays ? [ ] }: import flake {
inherit system;
config.allowUnfree = true;
overlays = overlays;
};
# Arrange to pass the instantiated package sets into every module (via the
# `specialArgs` value).
nixpkgs' = unflake { flake = nixpkgs; overlays = overlays; };
specialArgs = {
nixpkgs = nixpkgs';
nixpkgs-unstable = unflake { flake = nixpkgs-unstable; };
pkgs = nixpkgs';
};
in {
nixosConfigurations = {
kahless = nixpkgs.lib.nixosSystem {
inherit system;
inherit specialArgs;
modules = [
./machines/kahless/configuration.nix
home-manager.nixosModules.home-manager home-manager-config
flake-registry-module
];
};
};
};
}