-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
107 lines (92 loc) · 3.12 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
{
description = "A new WIP configuration to replace my dotfiles";
inputs = {
# Misc
utils.url = "github:numtide/flake-utils";
st.url = "gitlab:jD91mZM2/st";
# NixOS Modules
home-manager.url = "github:nix-community/home-manager";
nix-exprs.url = "gitlab:jD91mZM2/nix-exprs";
# Required by modules
inc.url = "gitlab:jD91mZM2/inc";
# Required by neovim
ale = { url = "github:dense-analysis/ale"; flake = false; };
neovim-nightly = { url = "github:neovim/neovim/nightly"; flake = false; };
nvim-treesitter = { url = "github:nvim-treesitter/nvim-treesitter"; flake = false; };
vim-mcfunction.url = "gitlab:jD91mZM2/vim-mcfunction";
# Required by server
abottomod.url = "gitlab:jD91mZM2/abottomod";
schedulebot.url = "gitlab:jD91mZM2/schedulebot";
timeywimey.url = "gitlab:jD91mZM2/timeywimey";
mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
};
outputs = { self, nixpkgs, utils, ... } @ inputs:
with nixpkgs.lib;
let
coreModules = [
# Global modules
./modules/globals
# Need to be placed here to avoid infinite recursion
inputs.nix-exprs.nixosModules.zsh-vi
inputs.nix-exprs.nixosModules.powerline-rs
# Home-manager modules
inputs.home-manager.nixosModules.home-manager
# Needed by server
inputs.nix-exprs.nixosModules.custom-services
inputs.mailserver.nixosModules.mailserver
];
args = {
inherit self inputs;
};
in
{
lib = {
makeModule = system: modules: {
imports = coreModules ++ toList modules;
_module.args = args // {
inherit system;
};
};
makeSystem = system: modules: nixosSystem {
inherit system;
modules = coreModules ++ toList modules;
extraArgs = args // {
inherit system;
};
};
};
# NixOS configurations
nixosConfigurations = {
samael-computer = self.lib.makeSystem "x86_64-linux" ./systems/personal-computer;
samael-laptop = self.lib.makeSystem "x86_64-linux" ./systems/laptop;
};
} // (utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
# Used by neovim which relies on tree-sitter which apparently is marked as "broken" in my version of nixpkgs
broken-pkgs = import nixpkgs {
inherit system;
config.allowBroken = true;
};
in
{
packages = {
st = inputs.st.defaultPackage."${system}";
neovim = broken-pkgs.callPackage ./pkgs/neovim {
inherit inputs;
};
firefox = import ./pkgs/firefox {
# Can't use callPackage because that replaces `.override` which we
# need to retain.
inherit pkgs;
};
iso = (self.lib.makeSystem "x86_64-linux" ./systems/iso).config.system.build.isoImage;
};
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
morph
terraform_0_14
];
};
}));
}