Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
106 lines (98 loc) · 2.7 KB
/
Copy pathflake.nix
File metadata and controls
106 lines (98 loc) · 2.7 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
102
103
104
105
106
{
description = "Skylar's dotfiles and home-manager configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# TPM - Tmux Plugin Manager
tpm = {
url = "github:tmux-plugins/tpm";
flake = false;
};
# Stylix - system-wide theming
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
home-manager,
tpm,
stylix,
}:
let
lib = nixpkgs.lib;
# Per-machine specs. Add a new machine by creating machines/<name>.nix
# and adding an entry here. The selector for `home-manager switch
# --flake .#<user>@<name>` is the attribute key below.
machines = {
workstation = {
file = ./machines/workstation.nix;
system = "x86_64-linux";
isDarwin = false;
};
rog = {
file = ./machines/rog.nix;
system = "x86_64-linux";
isDarwin = false;
};
hh = {
file = ./machines/hh.nix;
system = "aarch64-darwin";
isDarwin = true;
};
mini = {
file = ./machines/mini.nix;
system = "aarch64-darwin";
isDarwin = true;
};
};
# Build a homeManagerConfiguration for one machine spec.
mkHome =
m:
let
userConfig = import m.file;
in
home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${m.system};
extraSpecialArgs = {
inherit userConfig tpm;
isDarwin = m.isDarwin;
};
modules = [ ./home.nix ];
};
in
{
# One homeConfiguration per machine: <user>@<machine>.
homeConfigurations = lib.mapAttrs' (
name: m: lib.nameValuePair "${(import m.file).username}@${name}" (mkHome m)
) machines;
# NixOS system configuration (rog box).
nixosConfigurations.nixos =
let
userConfig = import ./machines/rog.nix;
in
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit userConfig tpm; };
modules = [
./configuration.nix
stylix.nixosModules.stylix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit userConfig tpm;
isDarwin = false;
};
}
];
};
};
}