flake/flake.nix

145 lines
3.7 KiB
Nix
Raw Normal View History

2023-09-19 00:17:43 +00:00
{
inputs = {
2023-10-14 07:53:25 +00:00
# Flake inputs
## Nixpkgs
2023-09-19 00:17:43 +00:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
2023-10-14 07:53:25 +00:00
## Flakes
2023-09-19 00:17:43 +00:00
berberman = {
url = "github:berberman/flakes";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-10-15 00:51:56 +00:00
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-09-19 00:17:43 +00:00
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
hosts = {
url = "github:StevenBlack/hosts";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland = {
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs"; # MESA/OpenGL HW workaround
};
2023-10-15 00:51:56 +00:00
impermanence = {
url = "github:nix-community/impermanence";
};
2023-09-19 00:17:43 +00:00
lanzaboote = {
url = "github:nix-community/lanzaboote";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-10-15 00:51:56 +00:00
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# TODO: Unused
2023-09-19 22:16:32 +00:00
#nixos-hardware = {
# url = "github:NixOS/nixos-hardware/master";
# #inputs.nixpkgs.follows = "nixpkgs";
#};
#nixpak = {
# url = "github:nixpak/nixpak";
# inputs.nixpkgs.follows = "nixpkgs";
#};
2023-10-14 07:53:25 +00:00
## Non-Flake
### Color scheme files
tokyonight = {
# TODO: base16.nix/Stylix when?
url = "github:folke/tokyonight.nvim";
flake = false;
};
### Clash WebUI
metacubexd = {
url = "github:MetaCubeX/metacubexd/gh-pages";
flake = false;
};
2023-09-19 00:17:43 +00:00
};
2023-10-12 14:21:14 +00:00
outputs = { self,
nixpkgs,
berberman,
2023-10-15 00:51:56 +00:00
disko,
2023-10-12 14:21:14 +00:00
home-manager,
hosts,
hyprland,
lanzaboote,
nix-darwin,
sops-nix,
impermanence,
2023-10-14 07:53:25 +00:00
tokyonight,
metacubexd,
2023-10-12 14:21:14 +00:00
... } @ inputs: {
2023-10-15 00:51:56 +00:00
### NixOS
2023-09-19 00:17:43 +00:00
nixosConfigurations = {
2023-10-15 00:51:56 +00:00
"81FW-NixOS" = nixpkgs.lib.nixosSystem {
2023-09-19 00:17:43 +00:00
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
2023-10-16 08:26:06 +00:00
./nixos/presets/gaming.nix # OS-specific (with presets)
./users/guanranwang/nixos/presets/gaming.nix # User-specific (with presets)
./machines/nixos/81fw-lenovo-legion-y7000 # Hardware-specific
./machines/nixos/81fw-lenovo-legion-y7000/machine-1 # Machine-specific
2023-10-15 00:51:56 +00:00
{
networking.hostName = "81FW-NixOS"; # Hostname
time.timeZone = "Asia/Shanghai"; # Timezone
}
2023-09-19 00:17:43 +00:00
];
};
};
2023-10-15 00:51:56 +00:00
### nix-darwin (macOS)
darwinConfigurations = {
"iMac-macOS" = nix-darwin.lib.darwinSystem {
system = "x86_64-darwin";
specialArgs = { inherit inputs; };
modules = [
./darwin
2023-10-16 08:26:06 +00:00
./users/guanranwang/darwin/presets/desktop.nix
2023-10-15 00:51:56 +00:00
./machines/darwin/imac-2017
{
networking.hostName = "iMac-macOS";
time.timeZone = "Asia/Shanghai";
}
2023-10-15 00:51:56 +00:00
];
};
};
### Home-Manager
# TODO: Actually figure out how this works
2023-09-19 00:17:43 +00:00
homeConfigurations = {
"guanranwang@81fw-nixos" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs; };
2023-09-19 00:17:43 +00:00
modules = [
sops-nix.homeManagerModules.sops
hyprland.homeManagerModules.default
{
wayland.windowManager.hyprland = {
enable = true;
#enableNvidiaPatches = true;
xwayland = {
enable = true;
};
};
}
];
};
};
};
}