-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
103 lines (101 loc) · 2.99 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
101
102
103
{
description = "Saurav Nix Environment";
inputs = {
# All packages should follow latest nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
# core
darwin = {
url = "github:LnL7/nix-darwin/master";
inputs.nixpkgs.follows = "unstable";
};
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "unstable";
};
};
outputs = { self, nixpkgs, darwin, home-manager, ... }@inputs:
let
myLib = import ./lib nixpkgs.lib;
constants = import ./constants.nix;
darwin-overlays = [ ];
linux-overlays = [ ];
username = "ricky_saurav";
mkHomeManagerConfig =
{ system
, username
, ...
}@args: home-manager.lib.homeManagerConfiguration (args // {
configuration = import ./modules/home-manager;
stateVersion = "22.05";
inherit system username;
homeDirectory = myLib.homeDirectory {
inherit system;
username = username;
};
});
config = { allowUnfree = true; };
in
{
darwinConfigurations."saurav-macbook" =
let
system = constants.aarch64-darwin;
username = constants.ricky_saurav;
in
let
pkgs = import nixpkgs {
inherit config system;
overlays = darwin-overlays;
};
in
darwin.lib.darwinSystem {
inherit system pkgs;
modules = [
home-manager.darwinModule
./modules/nix-opts.nix
./modules/darwin
./modules/common.nix
];
specialArgs = { overlays = darwin-overlays; inherit inputs myLib nixpkgs system username; };
};
homeConfigurations."saurav-linux-config" =
let
system = constants.x86_64-linux;
in
let
username = constants.ricky_saurav;
pkgs = import nixpkgs {
inherit config system;
overlays = linux-overlays;
};
in
mkHomeManagerConfig {
inherit system pkgs username;
extraSpecialArgs = { inherit inputs myLib nixpkgs system constants; };
extraModules = [ ./modules/nix-opts.nix ];
};
homeConfigurations."saurav-linux-arm-config" =
let
system = constants.aarch64-linux;
in
let
username = constants.ricky_saurav;
pkgs = import nixpkgs {
inherit config system;
overlays = linux-overlays;
};
in
mkHomeManagerConfig {
inherit system pkgs username;
extraSpecialArgs = { inherit inputs myLib nixpkgs system constants; };
extraModules = [ ./modules/nix-opts.nix ];
};
# #TODO: Fix this later
# devShell.aarch64-darwin =
# with pkgs;
# mkShell {
# nativeBuildInputs = [ unpkg undmg ];
# }
# ;
};
}