-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
100 lines (85 loc) · 3.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{
description = "NixOS Flake";
inputs = {
# use unstable by default for freshest packages
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/master";
# tell home-manager to use same packages as nixpkgs
inputs.nixpkgs.follows = "nixpkgs";
};
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
apple-silicon-support = {
url = "github:tpwrules/nixos-apple-silicon";
inputs.nixpkgs.follows = "nixpkgs";
inputs.rust-overlay.follows = "rust-overlay";
};
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
# Pin to a nixpkgs revision that doesn't have NixOS/nixpkgs#208103 yet
# inputs.nixpkgs.url =
# "github:nixos/nixpkgs?rev=fad51abd42ca17a60fc1d4cb9382e2d79ae31836";
};
nix-extra.url = "path:/home/karl/src/nix-extra";
nix-extra.flake = false;
};
outputs = { self, home-manager, nixpkgs, nix-darwin, apple-silicon-support
, nix-extra, ... }@inputs:
let
# Overlays is the list of overlays we want to apply from flake inputs.
overlays = [ inputs.neovim-nightly-overlay.overlays.default ];
# Function to render out our hosts
mkHost = import ./lib/mkHost.nix;
# Let 'nixos-version --json' know about the Git revision
configRev = inputs.nixpkgs.lib.mkIf (self ? rev) self.rev;
user = "karl";
extraModules = [ "${nix-extra.outPath}/nixos.nix" ];
appleModules = extraModules
++ [ apple-silicon-support.nixosModules.apple-silicon-support ];
in {
darwinConfigurations = {
karl-mba = mkHost "karl-mba" {
inherit nixpkgs nix-darwin home-manager overlays configRev;
isDarwin = true;
user = "karlskewes";
system = "aarch64-darwin";
stateVersion = "23.11";
};
};
nixosConfigurations = {
blake-laptop = mkHost "blake-laptop" {
inherit nixpkgs home-manager overlays extraModules configRev user;
system = "x86_64-linux";
stateVersion = "22.05";
};
karl-mba = mkHost "karl-mba" {
inherit nixpkgs home-manager configRev user;
system = "aarch64-linux";
stateVersion = "23.11";
extraModules = appleModules;
overlays = [
apple-silicon-support.overlays.apple-silicon-overlay
inputs.neovim-nightly-overlay.overlays.default
];
};
tiny = mkHost "tiny" {
inherit nixpkgs home-manager overlays extraModules configRev user;
system = "x86_64-linux";
stateVersion = "22.05";
};
tl = mkHost "tl" {
inherit nixpkgs home-manager overlays extraModules configRev user;
system = "x86_64-linux";
stateVersion = "22.05";
};
};
};
}