-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathflake.nix
86 lines (76 loc) · 2.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
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
{
description = "Nix for macOS configuration";
# format https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#examples
inputs = {
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-23.11-darwin";
darwin = {
url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs-darwin";
};
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs-darwin";
};
# upgrade with
# nix flake lock --update-input nixpkgs-firefox-darwin
nixpkgs-firefox-darwin.url = "github:bandithedoge/nixpkgs-firefox-darwin";
mkAlias = {
url = "github:cdmistman/mkAlias";
inputs.nixpkgs.follows = "nixpkgs-darwin";
};
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-locked.url =
"github:NixOS/nixpkgs/1042fd8b148a9105f3c0aca3a6177fd1d9360ba5";
nix-home-manager.url = "github:torgeir/nix-home-manager";
dotfiles.url = "github:torgeir/dotfiles";
};
outputs = inputs@{ self, nixpkgs, darwin, home-manager, nix-home-manager
, dotfiles, ... }: {
darwinConfigurations."bekk-mac-03257" = darwin.lib.darwinSystem {
system = "aarch64-darwin"; # apple silicon
specialArgs = { inherit inputs; };
modules = [
{
nixpkgs.overlays = [
# pkgs.firefox-bin
inputs.nixpkgs-firefox-darwin.overlay
# use selected unstable packages with pkgs.unstable.xyz
# https://discourse.nixos.org/t/how-to-use-nixos-unstable-for-some-packages-only/36337
# "https://github.com/ne9z/dotfiles-flake/blob/d3159df136294675ccea340623c7c363b3584e0d/configuration.nix"
(final: prev: {
unstable =
import inputs.nixpkgs-unstable { system = prev.system; };
})
(final: prev: {
# pkgs.unstable-locked.<something>
unstable-locked =
import inputs.nixpkgs-locked { system = prev.system; };
})
(final: prev: {
# https://github.com/nix-community/home-manager/issues/1341#issuecomment-1468889352
mkAlias =
inputs.mkAlias.outputs.apps.${prev.system}.default.program;
})
];
}
./modules/nix-core.nix
./modules/system.nix
./modules/apps.nix
./modules/host-users.nix
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.torgeir = import ./home;
home-manager.extraSpecialArgs = {
inherit inputs;
dotfiles = dotfiles;
# hack around nix-home-manager causing infinite recursion
isLinux = false;
};
}
];
};
};
};
}