-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
101 lines (85 loc) · 3.53 KB
/
flake.nix
File metadata and controls
101 lines (85 loc) · 3.53 KB
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
{
description = "Your new nix config";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
# nix-doom-emacs.url = "github:nix-community/nix-doom-emacs";
spicetify-nix.url = "github:the-argus/spicetify-nix";
nixgl.url = "github:guibou/nixGL";
};
outputs = { self, nixpkgs, nix-darwin, home-manager, ... }@inputs:
let
inherit (self) outputs;
lib = nixpkgs.lib // home-manager.lib;
systems = [ "x86_64-linux" "aarch64-linux" ];
forEachSystem = f: lib.genAttrs systems (sys: f pkgsFor.${sys});
pkgsFor = nixpkgs.legacyPackages;
in
rec {
# Your custom packages
# Acessible through 'nix build', 'nix shell', etc
packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; });
# Devshell for bootstrapping
# Acessible through 'nix develop' or 'nix-shell' (legacy)
devShells = forEachSystem (pkgs: import ./shell.nix { inherit pkgs; });
formatter = forEachSystem (pkgs: pkgs.nixpkgs-fmt);
# Your custom packages and modifications, exported as overlays
overlays = import ./overlays { inherit inputs; };
# Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs
nixosModules = import ./modules/nixos;
# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
homeManagerModules = import ./modules/home-manager;
templates = import ./templates;
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
y7000 = lib.nixosSystem {
specialArgs = { inherit inputs outputs; username = "zijun"; };
modules = [ ./hosts/y7000 ];
};
};
darwinConfigurations = {
Zijuns-MBP = nix-darwin.lib.darwinSystem {
specialArgs = { inherit inputs outputs; username = "zyu"; };
modules = [ ./hosts/mbp ];
};
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"zijun@y7000" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgsFor.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = { inherit inputs outputs; username = "zijun"; };
modules = [
./home/y7000.nix
];
};
"zijun@archlinux" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgsFor.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = { inherit inputs outputs; username = "zijun"; };
modules = [
./home/arch.nix
];
};
"zijun@ZIJUN-R7000" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgsFor.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = { inherit inputs outputs; username = "zijun"; };
modules = [
./home/wsl.nix
];
};
"zyu@Zijuns-MBP" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgsFor.aarch64-darwin;
extraSpecialArgs = { inherit inputs outputs; username = "zyu"; };
modules = [
./home/mbp.nix
];
};
};
};
}