-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
44 lines (41 loc) · 1.55 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
{
description = "NixOS configuration for my personal hosts.";
inputs = {
# nixpkgs.url = "nixpkgs/nixos-23.05";
# nixpkgs.url = "nixpkgs/nixos-23.11";
nixpkgs.url = "nixpkgs/nixos-unstable";
unstable.url = "nixpkgs/nixos-unstable";
hardware.url = "github:NixOS/nixos-hardware/master";
hyprpanel.url = "github:Jas-SinghFSU/HyprPanel";
# hyprland = {
# url = "github:hyprwm/hyprland?submodules=1";
# inputs.nixpkgs.follows = "nixpkgs";
# };
};
outputs = { self, nixpkgs, unstable, hardware, hyprpanel }:
let
overlay = final: prev: {
unstable = import unstable { inherit (prev) system; config.allowUnfree = true; };
};
# Overlays-module makes "pkgs.unstable" available in configuration.nix
overlayModule = ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay hyprpanel.overlay ]; });
# To generate host configurations for all hosts.
hostnames = builtins.attrNames (builtins.readDir ./hosts);
# Some hosts are ARM64
systemForHost = hostname:
if builtins.elem hostname ["host1" "host2"] then "aarch64-linux"
else "x86_64-linux";
in {
nixosConfigurations = builtins.listToAttrs (builtins.map (host: {
name = host;
value = nixpkgs.lib.nixosSystem {
system = systemForHost host;
specialArgs = {
# inherit hyprland;
channels = { inherit nixpkgs unstable hardware; };
};
modules = [ overlayModule ./hosts/${host}/configuration.nix ];
};
}) hostnames);
};
}