-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
89 lines (85 loc) · 2.84 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
{
description = "dotfiles and configurations for ama";
inputs = {
# nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs.url = "https://flakehub.com/f/DeterminateSystems/nixpkgs-weekly/0.*.tar.gz";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11";
flake-utils.url = "github:numtide/flake-utils";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-homebrew = {
url = "github:zhaofengli-wip/nix-homebrew";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nix-darwin.follows = "nix-darwin";
};
};
outputs = { self, ... }@inputs:
let
env = import ./env.nix;
in
inputs.flake-utils.lib.eachDefaultSystem
(
system:
let
pkgs = import inputs.nixpkgs
{
inherit system;
config.allowUnfree = true;
};
pkgs-stable = import inputs.nixpkgs-stable
{
inherit system;
config.allowUnfree = true;
};
dot = import ./dot/default.nix { inherit pkgs; };
in
{
########################################
# Package sets
########################################
packages = {
nix-darwin = inputs.nix-darwin.packages.${system}.default;
########################################
# Darwin configuration with nix-homebrew
########################################
darwinConfigurations.${env.hostname} = inputs.nix-darwin.lib.darwinSystem
{
modules = [
({ pkgs, ... }: import ./darwin.nix { inherit pkgs system; })
(inputs.nix-homebrew.darwinModules.nix-homebrew {
lib = inputs.nix-darwin.lib;
nix-homebrew = {
enable = true;
enableRosetta = true;
user = env.username;
autoMigrate = true;
};
})
];
};
########################################
# Home manager configuration
########################################
homeConfigurations.${env.username} = inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
({ config, ... }: import ./home.nix {
inherit config pkgs pkgs-stable;
})
];
};
default = dot;
};
apps = rec {
dot-app = inputs.flake-utils.lib.mkApp { drv = dot; };
default = dot-app;
};
}
);
}