-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
87 lines (73 loc) · 2.08 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
# SPDX-FileCopyrightText: 2021-2024 Noah Fontes
#
# SPDX-License-Identifier: CC-BY-NC-SA-4.0
{
inputs = {
dns = {
url = "github:kirelagin/dns.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
dwarffs = {
url = "https://flakehub.com/f/edolstra/dwarffs/1.0.1.tar.gz";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-flatpak = {
url = "https://flakehub.com/f/gmodena/nix-flatpak/*.tar.gz";
};
nix-sops = {
url = "github:impl/nix-sops";
};
nixpkgs = {
url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
nixpkgs_2311 = {
url = "github:nixos/nixpkgs/nixos-23.11";
};
nur = {
url = "github:nix-community/NUR";
};
systemd-user-sleep = {
url = "github:impl/systemd-user-sleep";
};
};
outputs = inputs@{ self, home-manager, nixpkgs, ... }:
let
lib = import ./lib {
inherit inputs;
lib = nixpkgs.lib;
};
machines = lib.importDir ./machines;
homes = lib.importDir ./home;
nixosConfigurations = lib.mkNixosConfigurations machines;
homeConfigurations = lib.mkHomeConfigurations homes nixosConfigurations;
in
{
inherit lib nixosConfigurations homeConfigurations;
# Create installer packages for each system type we define.
packages = with nixpkgs.lib; mapAttrs'
(_: nixosConfiguration:
let
system = nixosConfiguration.config.nixpkgs.system;
installerConfiguration = lib.mkNixosConfiguration (build: build "23.11" {
inherit system;
modules = [
./installer
];
});
in
nameValuePair system {
installer = installerConfiguration.config.system.build.isoImage;
})
nixosConfigurations;
templates = rec {
machine = {
description = "A machine to use with the profiles in this repository";
path = ./templates/machine;
};
default = machine;
};
};
}