-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
111 lines (97 loc) · 2.66 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
{
description = "ooesili's NixOS configurations";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
nixos-hardware,
rust-overlay,
}: let
overlays = [rust-overlay.overlays.default] ++ import ./overlays;
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
inherit overlays;
};
overlayModule.nixpkgs = {
inherit overlays;
config.allowUnfree = true;
};
in {
devShells.x86_64-linux.rustybox = pkgs.mkShell {
buildInputs = [
pkgs.rust-bin.stable.latest.default
];
};
templates = {
rust = {
description = "Rust template using the oxalica Rust overlay.";
path = ./templates/rust;
};
};
lib = {
nixosSystem = args @ {modules, ...}:
nixpkgs.lib.nixosSystem (args
// {
modules = args.modules ++ [overlayModule];
});
extendConfig = name: args @ {
modules,
system ? "x86_64-linux",
...
}:
self.lib.nixosSystem (args
// {
inherit system;
modules = modules ++ [(builtins.getAttr name self.nixosModules.base)];
});
};
apps.x86_64-linux.nvim = {
type = "app";
program = "${pkgs.neovim}/bin/nvim";
};
packages.x86_64-linux = {
inherit (pkgs) neovim rustybox;
};
# These are turned into NixOS configurations by a private flake with some
# additional bits I don't want to share with the world.
nixosModules = {
base.nixbox.imports = [
./system/nixbox/configuration.nix
];
base.framework.imports = [
nixos-hardware.nixosModules.framework-11th-gen-intel
./system/framework/configuration.nix
];
};
nixosConfigurations = {
pinix = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [overlayModule ./system/pinix/configuration.nix];
};
pi-installer = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [
overlayModule
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix"
./system/pi-installer.nix
];
};
iso = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
overlayModule
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
./modules/trusts.nix
];
};
};
};
}