-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
126 lines (121 loc) · 3.74 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
{
description = "hakanssn Nixos configuration";
inputs = {
# Core
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05";
nur.url = "github:nix-community/NUR";
home-manager = {
url = "github:nix-community/home-manager";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence.url =
"github:nix-community/impermanence"; # bind-mount directories
# Extras
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
nixpkgs-stable.follows = "nixpkgs-stable";
};
};
hyprland = {
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
plasma-manager = {
url = "github:pjones/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
nixos-mailserver = {
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};
outputs =
{ self
, nixpkgs
, agenix
, home-manager
, impermanence
, nur
, emacs-overlay
, hyprland
, plasma-manager
, nixos-mailserver
, ...
}@inputs:
let
inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
sharedModules =
[
({ ... }: { nix.extraOptions = "experimental-features = nix-command flakes"; })
({ inputs, outputs, lib, config, pkgs, ... }: {
nixpkgs = {
overlays = [
(import ./overlays { inherit inputs; }).additions
(import ./overlays { inherit inputs; }).modifications
nur.overlay
emacs-overlay.overlay
];
};
})
agenix.nixosModules.age
impermanence.nixosModule
nixos-mailserver.nixosModule
home-manager.nixosModule
{ home-manager.sharedModules = [ hyprland.homeManagerModules.default plasma-manager.homeManagerModules.plasma-manager ]; }
./modules
];
in
{
packages = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system}; in import ./pkgs { inherit pkgs; });
devShells = forAllSystems
(system:
let pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.mkShell {
# Enable experimental features without having to specify the argument
NIX_CONFIG = "experimental-features = nix-command flakes";
nativeBuildInputs = [ pkgs.nix pkgs.home-manager pkgs.git agenix.packages.x86_64-linux.default ];
};
});
formatter = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in pkgs.nixpkgs-fmt);
overlays = import ./overlays { inherit inputs; };
nixosConfigurations = {
falconia = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = sharedModules ++ [ ./machines/falconia/default.nix ];
};
gattsu = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = sharedModules ++ [ ./machines/gattsu/default.nix ];
};
rickert = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = sharedModules ++ [ ./machines/rickert/default.nix ];
};
};
templates = import ./templates;
};
}