-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
68 lines (54 loc) · 1.63 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
{
nixConfig = {
extra-substituters = [ "https://m-bdf.cachix.org" ];
extra-trusted-public-keys =
[ "m-bdf.cachix.org-1:7Uae6pLA5GHDKSM1vvp0jX/8D5jRJOqXxL/dFIef55s=" ];
};
inputs = {
systems.url = "github:nix-systems/default-linux";
nixpkgs.url = "nixpkgs/nixos-unstable";
impermanence.url = "github:nix-community/impermanence";
nix-index-database = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
dracula-fuzzel = {
url = "github:dracula/fuzzel";
flake = false;
};
};
outputs = { self, nixpkgs, nixos-hardware, ... }@ inputs:
with self.lib;
{
lib = nixpkgs.lib.extend (final: prev: {
mkAliasOptionModule = mkRenamedOptionModule;
listDir = dir: mapAttrs' (entry: type:
nameValuePair (head (splitString "." entry)) /${dir}/${entry}
) (builtins.readDir dir);
});
nixosModules = mapAttrs (name: path:
setDefaultModuleLocation path path
) (listDir ./config);
nixosConfigurations =
let
mkSystem = name: modules: nixosSystem {
specialArgs = self;
modules = attrValues self.nixosModules;
extraModules = modules ++ [ ./hardware/${name}.nix ];
};
in
mapAttrs mkSystem {
qemu = [];
t480 = with nixos-hardware.nixosModules; [
lenovo-thinkpad-t480
common-gpu-nvidia-disable
];
fw13 = with nixos-hardware.nixosModules; [
framework-13-7040-amd {
hardware.framework.amd-7040.preventWakeOnAC = true;
}
];
};
checks = import ./tests.nix inputs;
};
}