This repository has been archived by the owner on Nov 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
flake.nix
60 lines (56 loc) · 1.92 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
{
description = "jkachmar's personal dotfiles and machine configurations.";
inputs = {
################
# PACKAGE SETS #
################
# Stable NixOS package set; pinned to the latest 23.05 release.
nixosPkgs.url = "github:nixos/nixpkgs/nixos-23.05";
# Unstable (rolling-release) NixOS package set.
unstable.url = "github:nixos/nixpkgs";
#############
# UTILITIES #
#############
# Declarative user configuration for NixOS systems.
nixosHome = {
inputs.nixpkgs.follows = "nixosPkgs";
url = "github:nix-community/home-manager/release-23.05";
};
};
outputs = inputs@{ self, nixosPkgs, unstable, ... }:
let
# Utility function to construct a package set based on the given system
# along with the shared `nixpkgs` configuration defined in this repo.
mkPkgsFor = system: pkgset:
import pkgset {
inherit system;
config = import ./config/system/nixpkgs/config.nix;
};
# Utility function to construct a NixOS configuration for arbitrary
# systems.
#
# TODO: Push more of this functionality down down into the
# `./config/machines` modules to avoid cluttering up `flake.nix` any
# more than is necessary.
mkNixOSConfiguration = hostname: system: nixosPkgs.lib.nixosSystem {
inherit system;
modules = [
nixosPkgs.nixosModules.notDetected
inputs.nixosHome.nixosModule
# XXX: Nix needs to believe we have an absolute path here.
(./. + "/hosts/${hostname}")
];
specialArgs = {
inherit inputs;
pkgs = mkPkgsFor system nixosPkgs;
unstable = mkPkgsFor system inputs.unstable;
};
};
in
{
nixosConfigurations = {
enigma = mkNixOSConfiguration "enigma" "x86_64-linux";
star-platinum = mkNixOSConfiguration "star-platinum" "x86_64-linux";
};
};
}