2023-09-19 00:17:43 +00:00
|
|
|
{
|
2023-11-03 15:16:07 +00:00
|
|
|
description = "Guanran928's Flake";
|
|
|
|
|
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-11-03 15:18:31 +00:00
|
|
|
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.05";
|
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-11-03 15:18:31 +00:00
|
|
|
inputs.nvfetcher.follows = "nvfetcher";
|
2023-09-19 00:17:43 +00:00
|
|
|
};
|
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";
|
2023-11-03 15:18:31 +00:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.hyprland-protocols.follows = "hyprland-protocols";
|
|
|
|
inputs.systems.follows = "systems";
|
|
|
|
inputs.wlroots.follows = "wlroots";
|
|
|
|
inputs.xdph.follows = "xdph";
|
2023-09-19 00:17:43 +00:00
|
|
|
};
|
2023-11-03 15:18:31 +00:00
|
|
|
hyprland-plugins = {
|
|
|
|
url = "github:hyprwm/hyprland-plugins";
|
|
|
|
inputs.hyprland.follows = "hyprland";
|
2023-10-15 00:51:56 +00:00
|
|
|
};
|
2023-11-03 15:18:31 +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";
|
2023-11-03 15:18:31 +00:00
|
|
|
inputs.crane.follows = "crane";
|
|
|
|
inputs.flake-compat.follows = "flake-compat";
|
|
|
|
inputs.flake-parts.follows = "flake-parts";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
inputs.pre-commit-hooks-nix.follows = "pre-commit-hooks-nix";
|
|
|
|
inputs.rust-overlay.follows = "rust-overlay";
|
2023-09-19 00:17:43 +00:00
|
|
|
};
|
|
|
|
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";
|
2023-11-03 15:18:31 +00:00
|
|
|
inputs.nixpkgs-stable.follows = "nixpkgs-stable";
|
|
|
|
};
|
|
|
|
|
|
|
|
### De-dupe
|
|
|
|
crane = {
|
|
|
|
url = "github:ipetkov/crane";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
flake-parts = {
|
|
|
|
url = "github:hercules-ci/flake-parts";
|
|
|
|
inputs.nixpkgs-lib.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
flake-utils = {
|
|
|
|
url = "github:numtide/flake-utils";
|
|
|
|
inputs.systems.follows = "systems";
|
|
|
|
};
|
|
|
|
gitignore = {
|
|
|
|
url = "github:hercules-ci/gitignore.nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
hyprland-protocols = {
|
|
|
|
url = "github:hyprwm/hyprland-protocols";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.systems.follows = "systems";
|
2023-10-15 00:51:56 +00:00
|
|
|
};
|
2023-11-03 15:18:31 +00:00
|
|
|
nvfetcher = {
|
|
|
|
url = "github:berberman/nvfetcher";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.flake-compat.follows = "flake-compat";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
};
|
|
|
|
pre-commit-hooks-nix = {
|
|
|
|
url = "github:cachix/pre-commit-hooks.nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.nixpkgs-stable.follows = "nixpkgs-stable";
|
|
|
|
inputs.flake-compat.follows = "flake-compat";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
inputs.gitignore.follows = "gitignore";
|
|
|
|
};
|
|
|
|
rust-overlay = {
|
|
|
|
url = "github:oxalica/rust-overlay";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
};
|
|
|
|
systems.url = "github:nix-systems/default-linux";
|
|
|
|
wlroots = {
|
|
|
|
type = "gitlab";
|
|
|
|
host = "gitlab.freedesktop.org";
|
|
|
|
owner = "wlroots";
|
|
|
|
repo = "wlroots";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
xdph = {
|
|
|
|
url = "github:hyprwm/xdg-desktop-portal-hyprland";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.hyprland-protocols.follows = "hyprland-protocols";
|
|
|
|
inputs.systems.follows = "systems";
|
|
|
|
};
|
|
|
|
|
|
|
|
# TODO: Unused, Soon(TM)
|
|
|
|
#daeuniverse.url = "github:daeuniverse/flake.nix";
|
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-11-04 10:14:42 +00:00
|
|
|
outputs = {
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
|
|
|
berberman,
|
|
|
|
disko,
|
|
|
|
home-manager,
|
|
|
|
hosts,
|
|
|
|
hyprland,
|
|
|
|
lanzaboote,
|
|
|
|
nix-darwin,
|
|
|
|
sops-nix,
|
|
|
|
impermanence,
|
|
|
|
tokyonight,
|
|
|
|
metacubexd,
|
|
|
|
...
|
|
|
|
} @ inputs: {
|
2023-11-04 10:06:51 +00:00
|
|
|
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
|
|
|
|
|
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";
|
2023-11-04 10:14:42 +00:00
|
|
|
specialArgs = {inherit inputs;};
|
2023-09-19 00:17:43 +00:00
|
|
|
modules = [
|
2023-11-04 10:14:42 +00:00
|
|
|
# OS
|
|
|
|
./nixos/presets/desktop.nix
|
2023-11-05 09:35:05 +00:00
|
|
|
./nixos/presets/core/zram-generator.nix
|
2023-11-04 10:02:11 +00:00
|
|
|
./nixos/presets/desktop/gaming.nix
|
|
|
|
./nixos/presets/desktop/virtualbox.nix
|
|
|
|
./nixos/presets/desktop/wayland.nix
|
2023-11-08 15:58:02 +00:00
|
|
|
./nixos/presets/desktop/virt-manager.nix
|
2023-11-04 10:02:11 +00:00
|
|
|
|
2023-11-04 10:14:42 +00:00
|
|
|
# User
|
|
|
|
./users/guanranwang/nixos/presets/desktop.nix
|
|
|
|
./users/guanranwang/nixos/presets/core/clash-meta-client.nix
|
2023-11-04 10:02:11 +00:00
|
|
|
|
2023-11-04 10:14:42 +00:00
|
|
|
# Hardware
|
|
|
|
./machines/nixos/81fw-lenovo-legion-y7000
|
|
|
|
./machines/nixos/81fw-lenovo-legion-y7000/machine-1
|
2023-10-15 00:51:56 +00:00
|
|
|
|
2023-10-26 16:10:04 +00:00
|
|
|
{
|
|
|
|
networking.hostName = "81FW-NixOS"; # Hostname
|
2023-11-04 10:14:42 +00:00
|
|
|
time.timeZone = "Asia/Shanghai"; # Timezone
|
2023-11-07 07:08:34 +00:00
|
|
|
|
|
|
|
### Home-Manager
|
2023-11-08 16:00:18 +00:00
|
|
|
home-manager.users.guanranwang.imports = [
|
|
|
|
./users/guanranwang/home-manager/nixos/presets/desktop/gaming.nix
|
|
|
|
./users/guanranwang/home-manager/nixos/presets/desktop/torrenting.nix
|
|
|
|
];
|
2023-11-07 07:08:34 +00:00
|
|
|
|
|
|
|
### Options
|
2023-11-09 03:55:14 +00:00
|
|
|
myFlake.nixos.boot.noLoaderMenu = true;
|
2023-11-07 07:08:34 +00:00
|
|
|
myFlake.nixos.networking.dns = "alidns";
|
2023-10-26 16:10:04 +00:00
|
|
|
}
|
2023-09-19 00:17:43 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-11-08 16:00:18 +00:00
|
|
|
### nix-darwin
|
2023-10-15 00:51:56 +00:00
|
|
|
darwinConfigurations = {
|
|
|
|
"iMac-macOS" = nix-darwin.lib.darwinSystem {
|
|
|
|
system = "x86_64-darwin";
|
2023-11-04 10:14:42 +00:00
|
|
|
specialArgs = {inherit inputs;};
|
2023-10-15 00:51:56 +00:00
|
|
|
modules = [
|
2023-11-04 10:14:42 +00:00
|
|
|
./darwin/presets/desktop.nix
|
|
|
|
./users/guanranwang/darwin/presets/desktop.nix
|
|
|
|
./users/guanranwang/darwin/presets/core/proxy.nix
|
|
|
|
./machines/darwin/imac-2017
|
2023-10-15 00:51:56 +00:00
|
|
|
|
2023-10-26 16:10:04 +00:00
|
|
|
{
|
2023-11-04 10:02:11 +00:00
|
|
|
#home-manager.users.guanranwang = import ./users/guanranwang/home-manager/darwin/presets/desktop/gaming.nix;
|
|
|
|
|
2023-10-26 16:10:04 +00:00
|
|
|
networking.hostName = "iMac-macOS";
|
|
|
|
time.timeZone = "Asia/Shanghai";
|
|
|
|
}
|
2023-10-15 00:51:56 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-11-08 16:00:18 +00:00
|
|
|
### Standalone Home-Manager
|
|
|
|
#homeConfigurations = {
|
|
|
|
# "guanranwang@81fw-nixos" = home-manager.lib.homeManagerConfiguration {
|
|
|
|
# pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
|
|
|
# extraSpecialArgs = {inherit inputs;};
|
|
|
|
# modules = [
|
|
|
|
# sops-nix.homeManagerModules.sops
|
|
|
|
# hyprland.homeManagerModules.default
|
|
|
|
# ];
|
|
|
|
# };
|
|
|
|
#};
|
2023-09-19 00:17:43 +00:00
|
|
|
};
|
|
|
|
}
|