flake/flake.nix
Guanran Wang 7314178fa7
home: modify installed packages
### NixOS
- re-added libnotify and jq
  they are needed for my screenshot script and were removed by accident
- removed kvantum, hyprland
- removed unnecessary hyprland options in flake.nix
- configured browsers through home-manager options
- fixed typo in i18n.nix
### Common
- added nix-output-monitor
- configured helix
- fixed indentation at programs.vscode
2023-11-04 00:02:28 +08:00

217 lines
6.1 KiB
Nix
Executable file

{
description = "Guanran928's Flake";
inputs = {
# Flake inputs
## Nixpkgs
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.05";
## Flakes
berberman = {
url = "github:berberman/flakes";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nvfetcher.follows = "nvfetcher";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
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";
inputs.hyprland-protocols.follows = "hyprland-protocols";
inputs.systems.follows = "systems";
inputs.wlroots.follows = "wlroots";
inputs.xdph.follows = "xdph";
};
hyprland-plugins = {
url = "github:hyprwm/hyprland-plugins";
inputs.hyprland.follows = "hyprland";
};
impermanence.url = "github:nix-community/impermanence";
lanzaboote = {
url = "github:nix-community/lanzaboote";
inputs.nixpkgs.follows = "nixpkgs";
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";
};
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
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";
};
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";
#nixos-hardware = {
# url = "github:NixOS/nixos-hardware/master";
# #inputs.nixpkgs.follows = "nixpkgs";
#};
#nixpak = {
# url = "github:nixpak/nixpak";
# inputs.nixpkgs.follows = "nixpkgs";
#};
## 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;
};
};
outputs = { self,
nixpkgs,
berberman,
disko,
home-manager,
hosts,
hyprland,
lanzaboote,
nix-darwin,
sops-nix,
impermanence,
tokyonight,
metacubexd,
... } @ inputs: {
### NixOS
nixosConfigurations = {
"81FW-NixOS" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./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
{
networking.hostName = "81FW-NixOS"; # Hostname
time.timeZone = "Asia/Shanghai"; # Timezone
}
];
};
};
### nix-darwin (macOS)
darwinConfigurations = {
"iMac-macOS" = nix-darwin.lib.darwinSystem {
system = "x86_64-darwin";
specialArgs = { inherit inputs; };
modules = [
./darwin
./users/guanranwang/darwin/presets/desktop.nix
./machines/darwin/imac-2017
{
networking.hostName = "iMac-macOS";
time.timeZone = "Asia/Shanghai";
}
];
};
};
### Home-Manager
# TODO: Actually figure out how this works
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
];
};
};
};
}