-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
167 lines (140 loc) · 4.62 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# Based on https://gist.github.com/m1cr0man/8cae16037d6e779befa898bfefd36627
{
description = "My NixOS configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
angrr = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:linyinfeng/angrr";
};
archix = {
inputs = {
nixpkgs.follows = "nixpkgs";
};
url = "github:SamLukeYes/archix";
};
archlinuxcn-keyring = {
flake = false;
url = "github:archlinuxcn/archlinuxcn-keyring";
};
flake-utils-plus.url = "github:gytis-ivaskevicius/flake-utils-plus";
impermanence.url = "github:nix-community/impermanence";
mutter-performance = {
flake = false;
url = "git+https://aur.archlinux.org/mutter-performance.git/?ref=master";
};
nix-index-database = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:nix-community/nix-index-database";
};
nixos-hardware.url = "github:NixOS/nixos-hardware";
shimeji = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:SamLukeYes/Shimeji-Desktop";
};
};
# Outputs can be anything, but the wiki + some commands define their own
# specific keys. Wiki page: https://nixos.wiki/wiki/Flakes#Output_schema
outputs = { self, nixpkgs, flake-utils-plus, ... }@inputs:
let
system = "x86_64-linux";
channel-patches = [
# Add nixpkgs patches here
./patches/354733.patch # xontribs
];
nixpkgs-patched =
flake-utils-plus.lib.patchChannel system nixpkgs channel-patches;
in flake-utils-plus.lib.mkFlake rec {
inherit (nixpkgs) lib;
inherit self inputs;
channelsConfig = {
allowlistedLicenses = with lib.licenses; [
virtualbox-puel
];
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"charles"
"code"
"vscode"
];
};
sharedOverlays = [
inputs.angrr.overlays.default
self.overlays.default
];
supportedSystems = [ system ];
channels = {
nixos-unstable = {
input = nixpkgs;
patches = channel-patches;
};
};
hostDefaults = {
inherit system;
channelName = "nixos-unstable";
specialArgs = { inherit inputs; };
modules = [
inputs.angrr.nixosModules.angrr
inputs.archix.nixosModules.default
inputs.nix-index-database.nixosModules.nix-index
{ environment.etc."nix/inputs/nixpkgs-patched".source = nixpkgs-patched; }
inputs.impermanence.nixosModules.impermanence
self.nixosModules.impermanent-users
];
};
hosts = let
absolute-modules = [
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-l13-yoga
./machines/absolute/configuration.nix
];
in {
absolute-gnome.modules = absolute-modules ++ [
./optional/desktop/gnome.nix
];
absolute-plasma.modules = absolute-modules ++ [
./optional/desktop/plasma.nix
];
nixos-iso.modules = [
./iso.nix
];
};
defaultPackage.${system} =
self.nixosConfigurations.nixos-iso.config.system.build.isoImage;
legacyPackages.${system} = import nixpkgs-patched {
inherit system;
config = channelsConfig;
overlays = sharedOverlays;
};
overlays.default = final: prev: {
archix = import inputs.archix { pkgs = final; };
archlinuxcn-keyring = inputs.archlinuxcn-keyring;
celluloid = prev.celluloid.overrideAttrs (old: {
src = final.fetchFromGitHub {
owner = "celluloid-player";
repo = "celluloid";
rev = "efc1e4e6c33b7a6684090ffa20bf75a070171cf6";
hash = "sha256-8mmfLhHUDQyGaTPuFGqhNmwRo0LpIkTNdZIaIGCKds8=";
};
});
# https://github.com/NixOS/nixpkgs/pull/350152
gnomeExtensions = prev.gnomeExtensions // {
todotxt = prev.gnomeExtensions.todotxt.overrideAttrs (old: {
postPatch = ''
for js in libs/*.js; do
substituteInPlace $js \
--replace-quiet "import Clutter from 'gi://Clutter'" "imports.gi.GIRepository.Repository.prepend_search_path('${final.mutter.passthru.libdir}'); const Clutter = (await import('gi://Clutter')).default"
done
'';
});
};
jdk = final.jetbrains.jdk-no-jcef;
mutter = prev.mutter.overrideAttrs (old: {
patches = (old.patches or []) ++ [
"${inputs.mutter-performance}/mr1441.patch"
"${inputs.mutter-performance}/mr3751.patch"
];
});
shimeji = inputs.shimeji.packages.${system};
};
nixosModules.impermanent-users = import ./modules/impermanent-users.nix;
};
}