This repository has been archived by the owner on Apr 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
70 lines (55 loc) · 2.04 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
{
description = "NixOS configuration using Nix Flakes";
inputs = {
hardware.url = "github:nixos/nixos-hardware";
agenix.url = "github:ryantm/agenix";
home.url = "github:nix-community/home-manager";
nur.url = "github:nix-community/NUR";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
stable.url = "github:nixos/nixpkgs/nixos-21.11";
oldstable.url = "github:nixos/nixpkgs/nixos-20.09";
nixpkgs.follows = "unstable";
};
outputs = { self, nixpkgs, hardware, home, nur, agenix, ... } @ inputs:
with nixpkgs.lib;
let
system = "x86_64-linux";
pkgs = mkPkgs nixpkgs [ self.overlay ];
filterNixFiles = k: v: v == "regular" && hasSuffix ".nix" k;
importNixFiles = path: (lists.forEach (mapAttrsToList (name: _: path + ("/" + name))
(filterAttrs filterNixFiles (builtins.readDir path)))) import;
config = {
allowBroken = true;
allowUnfree = true;
};
mkPkgs = pkgs: extraOverlays: import pkgs {
inherit system;
config = config;
};
overlays = with inputs; [
(final: _:
let
system = final.stdenv.hostPlatform.system;
in
{
agenix = agenix.defaultPackage.${system};
unstable = import unstable { inherit config system; };
stable = import stable { inherit config system; };
oldstable = import oldstable { inherit config system; };
})
nur.overlay
] ++ (importNixFiles ./overlays);
in
{
## No vds, vps because they are non-flakes.
nixosConfigurations.ggwp = import ./hosts/ggwp {
inherit config hardware home nur agenix inputs nixpkgs overlays;
};
ggwp = self.nixosConfigurations.ggwp.config.system.build.toplevel;
nixosConfigurations.iso = import ./iso {
inherit config home nur inputs nixpkgs overlays;
};
iso = self.nixosConfigurations.iso.config.system.build.isoImage;
devShells.${system}.default = import ./shell.nix { inherit pkgs; };
};
}