flake/flake.nix

223 lines
6.8 KiB
Nix
Raw Normal View History

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-12-17 12:06:05 +00:00
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
2023-09-19 00:17:43 +00:00
home-manager = {
url = "github:nix-community/home-manager";
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";
2023-12-03 08:41:22 +00:00
inputs.systems.follows = "systems-linux";
2023-11-03 15:18:31 +00:00
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-12-16 08:32:13 +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-12-16 08:32:13 +00:00
nixos-hardware = {
url = "github:NixOS/nixos-hardware";
};
nixpak = {
url = "github:nixpak/nixpak";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
inputs.hercules-ci-effects.follows = "hercules-ci-effects";
};
nixpak-pkgs = {
url = "github:nixpak/pkgs";
inputs.nixpak.follows = "nixpak";
inputs.flake-parts.follows = "flake-parts";
inputs.hercules-ci-effects.follows = "hercules-ci-effects";
};
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";
};
2023-11-09 15:43:05 +00:00
spicetify-nix = {
url = "github:the-argus/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
2023-12-03 08:41:22 +00:00
systems.url = "github:nix-systems/default";
systems-linux.url = "github:nix-systems/default-linux";
2023-11-03 15:18:31 +00:00
### De-dupe
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-compat = {
url = "github:edolstra/flake-compat";
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
hercules-ci-effects = {
url = "github:hercules-ci/hercules-ci-effects";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
};
2023-11-03 15:18:31 +00:00
hyprland-protocols = {
url = "github:hyprwm/hyprland-protocols";
inputs.nixpkgs.follows = "nixpkgs";
2023-12-03 08:41:22 +00:00
inputs.systems.follows = "systems-linux";
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";
};
2023-12-03 08:41:22 +00:00
2023-11-03 15:18:31 +00:00
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";
2023-12-03 08:41:22 +00:00
inputs.systems.follows = "systems-linux";
2023-11-03 15:18:31 +00:00
};
# TODO: Unused, Soon(TM)
#daeuniverse.url = "github:daeuniverse/flake.nix";
2023-10-14 07:53:25 +00:00
## Non-Flake
### My NeoVim configuration
nvim = {
url = "github:Guanran928/nvim";
flake = false;
};
2023-09-19 00:17:43 +00:00
};
2023-12-03 08:41:22 +00:00
outputs = inputs: let
2023-12-17 12:06:05 +00:00
inherit (inputs.flake-utils.lib) eachDefaultSystemMap;
2023-12-03 08:41:22 +00:00
in {
2023-12-17 12:06:05 +00:00
formatter = eachDefaultSystemMap (system: inputs.nixpkgs.legacyPackages.${system}.alejandra);
packages = eachDefaultSystemMap (system: import ./pkgs inputs.nixpkgs.legacyPackages.${system});
2023-12-15 18:40:41 +00:00
nixosModules.default = ./nixos/modules;
2023-11-04 10:06:51 +00:00
2023-10-15 00:51:56 +00:00
### NixOS
2023-09-19 00:17:43 +00:00
nixosConfigurations = {
2023-11-18 03:23:06 +00:00
"Aristotle" = inputs.nixpkgs.lib.nixosSystem {
2023-09-19 00:17:43 +00:00
system = "x86_64-linux";
specialArgs = {inherit inputs;};
2023-09-19 00:17:43 +00:00
modules = [
# OS
2023-11-20 12:21:34 +00:00
./nixos/profiles/core
./nixos/profiles/device-type/laptop
2023-11-28 05:42:18 +00:00
./nixos/profiles/opt-in/zram-generator.nix
./nixos/profiles/opt-in/gaming.nix
./nixos/profiles/opt-in/wayland.nix
./nixos/profiles/opt-in/virt-manager.nix
2023-11-04 10:02:11 +00:00
# User
2023-11-20 12:21:34 +00:00
./users/guanranwang/nixos/profiles/core
./users/guanranwang/nixos/profiles/device-type/laptop
2023-11-28 05:42:18 +00:00
./users/guanranwang/nixos/profiles/opt-in/clash-meta-client.nix
2023-12-10 15:56:40 +00:00
./users/guanranwang/nixos/profiles/opt-in/gaming
./users/guanranwang/nixos/profiles/opt-in/torrenting
2023-11-04 10:02:11 +00:00
# Hardware
2023-12-17 10:16:39 +00:00
./nixos/hosts/Aristotle
2023-12-10 15:56:40 +00:00
./nixos/profiles/opt-in/lanzaboote.nix
./nixos/profiles/opt-in/impermanence.nix
./nixos/profiles/opt-in/disko.nix
2023-10-15 00:51:56 +00:00
2023-11-27 12:31:17 +00:00
{
networking.hostName = "Aristotle";
time.timeZone = "Asia/Shanghai";
_module.args.disks = ["/dev/nvme0n1"]; # Disko
2023-11-27 12:31:17 +00:00
}
2023-09-19 00:17:43 +00:00
];
};
};
2023-11-17 05:38:25 +00:00
### Darwin
2023-10-15 00:51:56 +00:00
darwinConfigurations = {
2023-11-18 03:23:06 +00:00
"Plato" = inputs.nix-darwin.lib.darwinSystem {
2023-10-15 00:51:56 +00:00
system = "x86_64-darwin";
specialArgs = {inherit inputs;};
2023-10-15 00:51:56 +00:00
modules = [
2023-11-20 12:21:34 +00:00
./darwin/profiles/core
./darwin/profiles/device-type/desktop
2023-11-17 05:38:25 +00:00
2023-11-20 12:21:34 +00:00
./users/guanranwang/darwin/profiles/core
./users/guanranwang/darwin/profiles/device-type/desktop
2023-11-28 05:42:18 +00:00
./users/guanranwang/darwin/profiles/opt-in/clash-meta-client.nix
2023-11-17 05:38:25 +00:00
./darwin/hardware/apple/imac/18-3
2023-10-15 00:51:56 +00:00
2023-11-27 12:31:17 +00:00
{
networking.hostName = "Plato";
time.timeZone = "Asia/Shanghai";
}
2023-10-15 00:51:56 +00:00
];
};
};
2023-09-19 00:17:43 +00:00
};
}