nix-config/flake.nix

191 lines
6.8 KiB
Nix
Raw Permalink Normal View History

2024-06-10 14:52:15 +00:00
{
description = "Madmin's system's nix Config";
# ===================================================================== #
# ============================== INPUTS =============================== #
# ===================================================================== #
2024-06-10 14:52:15 +00:00
inputs = {
# ============= Official NixOS and HM Package Sources ============= #
2024-07-09 07:58:02 +00:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; # also see 'unstable-packages' overlay at 'overlays/default.nix"
hardware.url = "github:nixos/nixos-hardware";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
# =========================== Utilities =========================== #
# -------------------------- Lanzaboote --------------------------- #
#lanzabote = {
# url = "github:nix-community/lanzaboote";
# inputs.nixpkgs.follows = "unstable";
#};
# ------------ Declarative partitioning and formatting ------------ #
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
2024-06-10 14:52:15 +00:00
};
# ------------- Secrets mngmt. C ./docs/secretsmgmt.md ------------ #
#sops-nix = {
# url = "github:mic92/sops-nix";
# inputs.nixpkgs.follows = "nixpkgs";
#};
2024-08-27 08:45:09 +00:00
# ------------ Wireguard namespaces for VPN ------------ #
wg-namespace-flake = {
url = "github:VTimofeenko/wg-namespace-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
# ------------------------------ VIM ------------------------------ #
nixvim = {
url = "github:nix-community/nixvim/nixos-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
# ------------------------ Windows manager ------------------------ #
# TODO
#hyprland = {
# url = "github:hyprwm/hyprland";
# inputs.nixpkgs.follows = "nixpkgs";
#};
#hyprland-plugins = {
# url = "github:hyprwm/hyprland-plugins";
# inputs.hyprland.follows = "hyprland";
#};
#hyprland-themes = {
# url = "github:hyprwm/hyprland-themes";
# inputs.hyprland.follows = "hyprland";
#};
# ------------------------------ ZSH ------------------------------ #
#nix-zsh-completions = {
# url = "github:nix-community/nix-zsh-completions";
# inputs.nixpkgs.follows = "nixpkgs";
#};
# -------------------------- Nix-Colors --------------------------- #
# TODO
# https://github.com/Misterio77/nix-colors
nix-colors = {
url = "github:misterio77/nix-colors";
};
# ---------------------------- Stylix ----------------------------- #
stylix = {
url = "github:danth/stylix";
};
# ====================== Personal Repositories ====================== #
# Private secrets repo. See ./docs/secretsmgmt.md
# Authenticate via ssh and use shallow clone
2024-08-27 08:45:09 +00:00
nix-secrets = {
#url = "git+ssh://git@git.mattmor.in/Nix/nix-secrets.git?ref=main&shallow=1";
#TODO: Switch to remote git repo up from local
url = "path:/home/laozi/nix-secrets";
flake = false;
};
# A better way to manage arkenfox user.js on nixos
arkenfox = {
url = "github:dwarfmaster/arkenfox-nixos";
inputs.arkenfox.inputs.nixpkgs.follows = "nixpkgs";
};
# declarative addons
firefox-addons = {
url = "sourcehut:~rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs = {
nixpkgs.follows = "nixpkgs";
#FIX? flake-utils.follows = "nixos-wsl/flake-utils";
};
};
};
# ===================================================================== #
# ============================== OUTPUTS ============================== #
# ===================================================================== #
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, disko, ... }@inputs:
let
inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
];
inherit (nixpkgs) lib;
configVars = import ./vars { inherit inputs lib; };
configLib = import ./lib { inherit lib; };
2024-08-27 08:45:09 +00:00
specialArgs = { inherit inputs outputs configVars configLib nixpkgs; };#TODO: consider adding self
in
{
# ============================ CUSTOM ============================= #
# ---------------------------- Modules ---------------------------- #
# Custom modules to enable special functionality for nixos or home-manager oriented configs.
nixosModules = import ./modules/nixos;
homeManagerModules = import ./modules/home-manager;
# ---------------------------- Overlays --------------------------- #
# Custom modifications/overrides to upstream packages.
overlays = import ./overlays { inherit inputs outputs; };
# ---------------------------- Packages --------------------------- #
# Custom packages to be shared or upstreamed.
packages = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
import ./pkgs { inherit pkgs; }
);
# ============================= Tools ============================= #
# --------------------------- Formatter --------------------------- #
# Nix formatter available through 'nix fmt' https://nix-community.github.io/nixpkgs-fmt
formatter = forAllSystems
(system:
nixpkgs.legacyPackages.${system}.nixpkgs-fmt
);
# -------------------------- INIT Shell -------------------------- #
# Devshell for bootstrapping
# Acessible through 'nix develop' or 'nix-shell' (legacy)
# Shell configured with packages that are typically only needed when working on or with nix-config.
devShells = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
import ./shell.nix { inherit pkgs; }
);
# ======================= Nixos Configurations ========================== #
#
# Building configurations available through `just rebuild` or `nixos-rebuild --flake .#hostname`
nixosConfigurations = {
# Jedidiah - the
# jedidiah
# TODO: The one who listened too much
#rehoboam = lib.nixosSystem {
# modules = [ ./system/rehoboam ];
# specialArgs = { inherit inputs outputs;};
#};
# The rebel who worships the golden calf
jeroboam = lib.nixosSystem {
inherit specialArgs;
modules = [
home-manager.nixosModules.home-manager{
home-manager.extraSpecialArgs = specialArgs;
home-manager.backupFileExtension = "backup";
}
./systems/jeroboam
];
};
};
2024-06-10 14:52:15 +00:00
};
}