-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
139 lines (115 loc) · 3.78 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
# 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";
nix-index-database = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:nix-community/nix-index-database";
};
nixos-hardware.url = "github:NixOS/nixos-hardware";
# https://github.com/nix-community/preservation/pull/12
preservation.url = "github:Sporif/preservation/user-paths";
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
];
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.preservation.nixosModules.preservation
self.nixosModules.impermanent-users
];
};
hosts = {
absolute.modules = [
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-l13-yoga
./machines/absolute/configuration.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;
# 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;
shimeji = inputs.shimeji.packages.${system};
};
nixosModules.impermanent-users = import ./modules/impermanent-users.nix;
};
}