2024-06-10 14:52:15 +00:00
|
|
|
{
|
2024-06-19 13:03:15 +00:00
|
|
|
description = "Madmin's system's nix Config";
|
|
|
|
|
|
|
|
# ===================================================================== #
|
|
|
|
# ============================== INPUTS =============================== #
|
|
|
|
# ===================================================================== #
|
2024-06-10 14:52:15 +00:00
|
|
|
inputs = {
|
2024-06-19 13:03:15 +00:00
|
|
|
# ============= Official NixOS and HM Package Sources ============= #
|
|
|
|
|
2024-07-09 07:58:02 +00:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
2024-06-19 13:03:15 +00:00
|
|
|
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
|
|
|
};
|
2024-06-19 13:03:15 +00:00
|
|
|
|
|
|
|
# ------------- Secrets mngmt. C ./docs/secretsmgmt.md ------------ #
|
|
|
|
#sops-nix = {
|
|
|
|
# url = "github:mic92/sops-nix";
|
|
|
|
# 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
|
2024-07-18 18:01:21 +00:00
|
|
|
nix-colors = {
|
|
|
|
url = "github:misterio77/nix-colors";
|
|
|
|
};
|
|
|
|
|
|
|
|
# ---------------------------- Stylix ----------------------------- #
|
|
|
|
stylix = {
|
|
|
|
url = "github:danth/stylix";
|
|
|
|
};
|
2024-06-19 13:03:15 +00:00
|
|
|
# ====================== Personal Repositories ====================== #
|
|
|
|
|
|
|
|
# Private secrets repo. See ./docs/secretsmgmt.md
|
|
|
|
# Authenticate via ssh and use shallow clone
|
|
|
|
#nix-secrets = {
|
|
|
|
# url = "git+ssh://git@gitlab.com/emergentmind/nix-secrets.git?ref=main&shallow=1";
|
|
|
|
# flake = false;
|
|
|
|
#};
|
|
|
|
};
|
|
|
|
|
|
|
|
# ===================================================================== #
|
|
|
|
# ============================== OUTPUTS ============================== #
|
|
|
|
# ===================================================================== #
|
2024-07-17 21:56:40 +00:00
|
|
|
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, disko, ... }@inputs:
|
2024-06-19 13:03:15 +00:00
|
|
|
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; };
|
|
|
|
specialArgs = { inherit inputs outputs configVars configLib nixpkgs; };
|
2024-07-17 21:56:40 +00:00
|
|
|
in
|
2024-06-19 13:03:15 +00:00
|
|
|
{
|
|
|
|
# ============================ 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
|
2024-07-17 21:56:40 +00:00
|
|
|
import ./shell.nix { inherit pkgs; }
|
2024-06-19 13:03:15 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
# ======================= 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;
|
2024-07-20 09:19:00 +00:00
|
|
|
home-manager.backupFileExtension = "backup";
|
2024-06-19 13:03:15 +00:00
|
|
|
}
|
|
|
|
./systems/jeroboam
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-06-10 14:52:15 +00:00
|
|
|
};
|
|
|
|
}
|
2024-06-19 13:03:15 +00:00
|
|
|
|