-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
82 lines (77 loc) · 2.48 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
{
description = "EcmaXp's nix";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/release-24.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
nix-index-database.url = "github:nix-community/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
ragenix.url = "github:yaxitech/ragenix";
ragenix.inputs.nixpkgs.follows = "nixpkgs";
pyproject-nix.url = "github:nix-community/pyproject.nix";
pyproject-nix.inputs.nixpkgs.follows = "nixpkgs";
poetry2nix.url = "github:nix-community/poetry2nix";
poetry2nix.inputs.nixpkgs.follows = "nixpkgs";
uv2nix.url = "github:adisbladis/uv2nix";
uv2nix.inputs.pyproject-nix.follows = "pyproject-nix";
uv2nix.inputs.nixpkgs.follows = "nixpkgs";
krewfile.url = "github:brumhard/krewfile";
krewfile.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ self, ... }:
let
# functions
buildConfigurations = platform: (
stable.nixpkgs.lib.attrsets.mapAttrs
(name: value: platform (value // { hostname = name; }))
);
buildPackages = configurations: (
unstable.nixpkgs.lib.attrsets.mapAttrs
(name: value: value.pkgs)
) configurations;
# channels
stable = inputs // (with inputs; {
nixpkgs-stable = nixpkgs;
});
unstable = stable // (with inputs; {
nixpkgs = nixpkgs-unstable;
});
# platforms
nixos = import ./default/systems/platforms/nixos;
darwin = import ./default/systems/platforms/darwin;
# profiles
default = {
inherit self;
channel = stable;
modules = [
./default
];
};
orbstack = default // {
system = "aarch64-linux";
modules = default.modules ++ [
./default/systems/vendors/orbstack
];
};
desktop = default // {
modules = default.modules ++ [
./desktop
];
};
user = {
user = "user";
};
in
rec {
nixosConfigurations = buildConfigurations nixos {
"host" = orbstack // user;
};
darwinConfigurations = buildConfigurations darwin {
"host" = desktop // user;
};
darwinPackages = buildPackages darwinConfigurations;
};
}