-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
163 lines (137 loc) · 4.97 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
# Copyright (c) 2024 tsrk. <tsrk@tsrk.me>
# This file is licensed under the MIT License.
# See the LICENSE file in the repository root for more info.
# SPDX-License-Identifier: MIT
{
description = ''
Opinionated NixOS base configuration.
'';
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
nixpkgsUnstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
# nixpkgsMaster.url = "github:NixOS/nixpkgs/master";
nixgl = {
url = "github:nix-community/nixGL";
inputs.nixpkgs.follows = "nixpkgs";
};
futils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
nix-gaming.url = "github:fufexan/nix-gaming";
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim/nixos-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
spotify-notifyx = {
url = "github:ItsShamed/spotify-dbus-enhancer/master";
};
agenix.url = "github:ryantm/agenix";
devenv.url = "github:cachix/devenv";
umu = {
url = "github:Open-Wine-Components/umu-launcher?dir=packaging/nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixpkgsUnstable
# , nixpkgsMaster
, nixgl
, futils, nixvim, devenv, ... }@inputs:
let
inherit (nixpkgs) lib;
inherit (futils.lib) eachDefaultSystem;
importPkgs = pkgs: system: withOverlays:
import pkgs {
inherit system;
config = {
allowUnfree = true;
android_sdk.accept_license = true;
# TODO: Rider is currently fucking up things, remove on new releases
permittedInsecurePackages = [
"dotnet-sdk-wrapped-7.0.410"
"dotnet-sdk-7.0.410"
"dotnet-runtime-6.0.36"
"dotnet-sdk-6.0.36"
"dotnet-sdk-wrapped-6.0.36"
"dotnet-sdk-wrapped-6.0.428"
"dotnet-sdk-6.0.428"
"dotnet-runtime-6.0.428"
"dotnet-runtime-wrapped-6.0.36"
];
};
overlays = [ nixgl.overlay ] ++ (builtins.attrValues
(builtins.removeAttrs (import ./pkgs/as-overlays.nix) [
"all"
"default"
])) ++ (lib.lists.optionals withOverlays
(builtins.attrValues (import ./overlays { inherit lib; })));
};
pkgSet = system: {
pkgs = importPkgs nixpkgs system true;
pkgsUnstable = importPkgs nixpkgsUnstable system false;
# pkgsMaster = importPkgs nixpkgsMaster system false;
};
linuxOutputs = let
system = "x86_64-linux";
baseOverlays = (import ./pkgs/as-overlays.nix)
// (import ./overlays { inherit lib; });
allOverlays = self: super:
builtins.attrValues
(builtins.mapAttrs (_: overlay: overlay self super) baseOverlays);
commonArgs = { inherit lib self inputs; };
in {
nixosModules = (import ./modules/system commonArgs)
// (import ./profiles/system commonArgs) // {
all = lib.modules.importApply ./modules/system/all.nix commonArgs;
default = self.nixosModules.all;
};
homeManagerModules = (import ./modules/home commonArgs)
// (import ./profiles/home commonArgs) // {
all = lib.modules.importApply ./modules/home/all.nix commonArgs;
default = self.homeManagerModules.all;
};
nixvimModules.default = import ./modules/nvim;
lspHints = import ./lsp-hints.nix commonArgs;
lib = import ./lib {
inherit lib self;
pkgSet = pkgSet system;
inherit inputs;
};
homeConfigurations = import ./homes { inherit lib self; };
nixosConfigurations = import ./hosts (lib.recursiveUpdate inputs {
inherit lib system;
pkgSet = pkgSet system;
});
overlays = baseOverlays // {
all = allOverlays;
default = self.overlays.all;
};
};
allOutputs = eachDefaultSystem (system:
let inherit (pkgSet system) pkgs;
in {
formatter = pkgs.nixfmt-classic;
packages = (import ./pkgs { inherit lib pkgs; }) // {
devenv-up = self.devShells.${system}.default.config.procfileScript;
devenv-test = self.devShells.${system}.default.config.test;
nvim-cirno = nixvim.legacyPackages.${system}.makeNixvimWithModule {
inherit pkgs;
module = self.nixvimModules.default;
};
};
devShells.default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [ ./devenv.nix ];
};
});
in lib.recursiveUpdate linuxOutputs allOutputs;
}