-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
141 lines (120 loc) · 3.91 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
{
description = "Shared configuration for dev environments";
nixConfig = {
## https://github.com/NixOS/rfcs/blob/master/rfcs/0045-deprecate-url-syntax.md
extra-experimental-features = ["no-url-literals"];
extra-substituters = ["https://cache.garnix.io"];
extra-trusted-public-keys = [
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
## Isolate the build.
sandbox = "relaxed";
use-registries = false;
};
outputs = {
bash-strict-mode,
flake-utils,
garnix-systems,
home-manager,
nixpkgs,
project-manager,
self,
systems,
}: let
sys = flake-utils.lib.system;
supportedSystems = import systems;
localPkgsLib = pkgs: import ./nix/pkgsLib {inherit pkgs self;};
in
{
## These are also consumed by downstream projects, so it may include more
## than is referenced in this flake.
schemas = project-manager.schemas;
overlays = {
default = nixpkgs.lib.composeManyExtensions [
bash-strict-mode.overlays.local
project-manager.overlays.local
self.overlays.dependencies
self.overlays.local
];
local = final: prev:
{lib = prev.lib // self.lib;}
// localPkgsLib final;
elisp-dependencies = import ./nix/elisp-dependencies.nix;
dependencies = final: prev: {
haskellPackages =
prev.haskellPackages.extend
(self.overlays.haskellDependencies final prev);
## One test fails on i686-linux.
nodejs =
if final.system == "i686-linux"
then prev.nodejs.overrideAttrs (old: {doCheck = false;})
else prev.nodejs;
};
haskellDependencies = import ./nix/haskell-dependencies.nix;
};
lib = import ./nix/lib {
inherit
garnix-systems
home-manager
nixpkgs
project-manager
self
supportedSystems
;
inherit (nixpkgs) lib;
};
projectModules = {
## The settings shared across my projects.
default = ./base/.config/project;
bash = ./base/.config/project/bash;
c = ./base/.config/project/c;
dhall = ./base/.config/project/dhall;
emacs-lisp = ./base/.config/project/emacs-lisp;
hacktoberfest = ./base/.config/project/hacktoberfest.nix;
haskell = ./base/.config/project/haskell;
nix = ./base/.config/project/nix;
};
}
// flake-utils.lib.eachSystem supportedSystems
(system: let
pkgs = nixpkgs.legacyPackages.${system}.appendOverlays [
bash-strict-mode.overlays.default
project-manager.overlays.default
self.overlays.dependencies
];
in {
pkgsLib = localPkgsLib pkgs;
devShells =
self.projectConfigurations.${system}.devShells
// {default = self.lib.devShells.default system self [] "";};
projectConfigurations = self.lib.projectConfigurations.nix {
inherit pkgs self;
modules = [self.projectModules.bash];
};
checks = self.projectConfigurations.${system}.checks;
formatter = self.projectConfigurations.${system}.formatter;
});
inputs = {
bash-strict-mode = {
inputs.flaky.follows = "";
url = "github:sellout/bash-strict-mode";
};
flake-utils = {
inputs.systems.follows = "systems";
url = "github:numtide/flake-utils";
};
garnix-systems.url = "github:garnix-io/nix-systems";
home-manager = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:nix-community/home-manager/release-24.11";
};
nixpkgs.url = "github:NixOS/nixpkgs/release-24.11";
project-manager = {
inputs.flaky.follows = "";
url = "github:sellout/project-manager";
};
## See https://github.com/nix-systems/nix-systems#readme for an explanation
## of this input.
systems.url = "github:sellout/nix-systems";
};
}