-
Notifications
You must be signed in to change notification settings - Fork 3
/
flake.nix
107 lines (98 loc) · 2.95 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 = "Diogo Correia's Nix(OS) configuration for PCs and servers";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
impermanence.url = "github:nix-community/impermanence/master";
home = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix/main";
inputs.nixpkgs.follows = "nixpkgs";
};
spicetify-nix = {
url = "github:Gerg-L/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
lanzaboote = {
url = "github:nix-community/lanzaboote?ref=v0.4.1";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
lidl-to-grocy = {
url = "github:diogotcorreia/lidl-to-grocy?ref=v1.3.0";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ {...}: let
inherit (lib.my) mkHosts mkOverlays mkPkgs mkProfiles mkSecrets;
systemFlakePath = "github:diogotcorreia/dotfiles/nixos";
user = "dtc";
userFullName = "Diogo Correia";
extraArgs = {
inherit
systemFlakePath # TODO move to profile
user
userFullName
;
configDir = ./config;
};
lib = inputs.nixpkgs.lib.extend (self: super:
import ./lib ({
inherit inputs nixosConfigurations profiles pkgs secrets;
lib = self;
}
// extraArgs));
extraPackages = {system, ...}: {
agenix = inputs.agenix.packages.${system}.default;
lidl-to-grocy = inputs.lidl-to-grocy.packages.${system}.default;
spicetify = inputs.spicetify-nix.legacyPackages.${system};
};
overlays =
(mkOverlays ./overlays)
// {
extraPkgs = self: super: (extraPackages {system = "x86_64-linux";});
};
pkgs = mkPkgs overlays;
nixosConfigurations = mkHosts ./hosts {
inherit extraArgs;
# TODO move to profiles
extraModules = [
{
hardware.enableRedistributableFirmware = true;
}
inputs.home.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
sharedModules = [inputs.spicetify-nix.homeManagerModules.default];
};
}
inputs.impermanence.nixosModules.impermanence
inputs.agenix.nixosModules.default
inputs.lanzaboote.nixosModules.lanzaboote
];
};
profiles = mkProfiles ./profiles;
secrets = mkSecrets ./secrets;
in {
inherit nixosConfigurations lib overlays;
# Packages are here so they are built by CI and cached
packages = {
x86_64-linux =
pkgs.my
// {
attic = pkgs.attic-client;
};
};
formatter = {
x86_64-linux = inputs.nixpkgs.legacyPackages.x86_64-linux.alejandra;
};
};
}