-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
119 lines (107 loc) · 3.04 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
{
description = "arnarg's NixOS configuration";
############
## INPUTS ##
############
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
utils.url = "github:gytis-ivaskevicius/flake-utils-plus/2bf0f91643c2e5ae38c1b26893ac2927ac9bd82a";
hardware.url = "github:nixos/nixos-hardware/master";
impermanence.url = "github:nix-community/impermanence/master";
home = {
url = "github:nix-community/home-manager/release-22.11";
inputs.nixpkgs.follows = "unstable";
};
};
#############
## OUTPUTS ##
#############
outputs = inputs @ {
self,
utils,
home,
nixpkgs,
unstable,
hardware,
impermanence,
...
}:
utils.lib.mkFlake {
inherit self inputs;
supportedSystems = ["x86_64-linux" "aarch64-linux"];
############
# Channels #
############
sharedOverlays = [
self.overlay
(p: _: {
home-manager = home.packages.${p.system}.home-manager;
tailscale = unstable.legacyPackages.${p.system}.tailscale;
})
];
channelsConfig = {allowUnfree = true;};
#########
# Hosts #
#########
hostDefaults.modules = [
self.nixosModules.base
impermanence.nixosModules.impermanence
];
hosts = {
framework = import ./machines/framework {inherit inputs;};
thinkpad = import ./machines/thinkpad {inherit inputs;};
terramaster = import ./machines/terramaster {inherit inputs;};
r4s = import ./machines/r4s {inherit inputs;};
links = import ./machines/workers/links {inherit inputs;};
rechts = import ./machines/workers/rechts {inherit inputs;};
};
nixosModules = utils.lib.exportModules [
./profiles/base
./profiles/desktop
./profiles/development
./profiles/immutable
./profiles/laptop
./profiles/server
./profiles/tpm
];
########
# HOME #
########
homeConfigurations = let
system = "x86_64-linux";
extraSpecialArgs = {
inherit inputs;
inherit (self) homeModules;
};
generateHome = home.lib.homeManagerConfiguration;
pkgs = import unstable {
inherit system;
overlays = [
self.overlay
];
config.allowUnfree = true;
};
in {
framework = generateHome {
inherit pkgs extraSpecialArgs;
modules = [./home/framework.nix];
};
thinkpad = generateHome {
inherit pkgs extraSpecialArgs;
modules = [./home/thinkpad.nix];
};
};
homeModules = utils.lib.exportModules [
./home/development
./home/desktop
];
overlay = import ./packages/overlay.nix;
outputsBuilder = let
overlays = utils.lib.exportOverlays {inherit (self) inputs pkgs;};
in
channels: {
packages = utils.lib.exportPackages overlays channels;
};
};
}