-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
128 lines (115 loc) · 3.47 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
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-24.11";
nixpkgs_legacy.url = "nixpkgs/nixos-24.05";
nixpkgs_unstable.url = "nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nix-alien.url = "github:thiagokokada/nix-alien";
# ecsls.url = "github:Sigmapitech/ecsls";
hyprqtile.url = "github:drawbu/hyprqtile";
};
outputs =
{ self, ... }@inputs:
let
cfg = {
system = "x86_64-linux";
config.allowUnfree = true;
config.android_sdk.accept_license = true;
};
pkgs = import inputs.nixpkgs (
cfg
// {
overlays = [
(final: prev: {
# Other nixpkgs
unstable = import inputs.nixpkgs_unstable cfg;
legacy = import inputs.nixpkgs_legacy cfg;
# Softwares
# inherit (inputs.ecsls.packages.${cfg.system}) ecsls;
inherit (inputs.nix-alien.packages.${cfg.system}) nix-alien;
inherit (inputs.hyprqtile.packages.${cfg.system}) hyprqtile;
nix-direnv = prev.nix-direnv.override { enableFlakes = true; };
})
];
}
);
hardware = inputs.nixos-hardware.nixosModules;
specialArgs = {
inherit pkgs;
finputs = inputs;
graphical = false;
};
defaultNixOS =
{
args ? { },
override ? (_: { }),
}:
let
completeArgs = specialArgs // args;
system = {
inherit (cfg) system;
specialArgs = completeArgs;
modules = [
inputs.home-manager.nixosModules.home-manager
{
home-manager = {
extraSpecialArgs = completeArgs;
backupFileExtension = "backup";
};
}
];
};
in
system // (override system);
in
{
formatter.${cfg.system} = pkgs.nixfmt-rfc-style;
hydraJobs = {
nixos = pkgs.lib.mapAttrs (
name: config: config.config.system.build.toplevel
) self.nixosConfigurations;
};
homeConfigurations = {
"home-generic" = inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = specialArgs;
backupFileExtension = "backup";
modules = [ ./home/clement ];
};
};
nixosConfigurations = {
# Home PC
"pain-de-mie" = inputs.nixpkgs.lib.nixosSystem (defaultNixOS {
args.graphical = true;
override = cfg: {
modules = cfg.modules ++ [
./hosts/pain-de-mie
# hardware.common-gpu-nvidia
hardware.common-cpu-intel
hardware.common-pc
hardware.common-pc-ssd
];
};
});
# Laptop
"pancake" = inputs.nixpkgs.lib.nixosSystem (defaultNixOS {
args.graphical = true;
override = cfg: {
modules = cfg.modules ++ [
./hosts/pancake
hardware.dell-xps-13-9315
];
};
});
# Home server
"waffle" = inputs.nixpkgs.lib.nixosSystem (defaultNixOS {
args.graphical = false;
override = cfg: { modules = cfg.modules ++ [ ./hosts/waffle ]; };
});
};
};
}