{ description = "Nix Config"; # ===================================================================== # # ============================== INPUTS =============================== # # ===================================================================== # inputs = { # ============= Official NixOS and HM Package Sources ============= # nixpkgs.url = "github:NixOS/nixpkgs/release-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"; }; # ------------- 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 ------------------------ # 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 --------------------------- # # https://github.com/Misterio77/nix-colors nix-colors = { url = "github:misterio77/nix-colors"; inputs.nixpkgs.follows = "nixpkgs"; }; # ====================== 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 ============================== # # ===================================================================== # outputs = { self, nixpkgs, home-manager, ... } @ inputs: let inherit (self) outputs; forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" #"aarch64-darwin" ]; inherit (nixpkgs) lib; configVars = import ./vars { inherit inputs lib; }; configLib = import ./lib { inherit lib; }; specialArgs = { inherit inputs outputs configVars configLib nixpkgs; }; 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 -------------------------- # # 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; } ); # ======================= Configurations ========================== # # # Building configurations available through `just rebuild` or `nixos-rebuild --flake .#hostname` nixosConfigurations = { # Jedidiah - the # jedidiah # 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 { modules = [ ./systems/jeroboam ]; specialArgs = { inherit inputs outputs;}; } }; homeConfigurations = { "sunzi@rehoboam" = lib.homeManagerConfiguration { modules = [ ./home/sunzi/rehoboam.nix ]; pkgs = pkgsFor.x86_64-linux; extraSpecialArgs = {inherit inputs nix-colors outputs;}; }; "sunzi@jeroboam" = lib.homeManagerConfiguration { modules = [ ./home/sunzi/jeroboam.nix ]; pkgs = pkgsFor.x86_64-linux; extraSpecialArgs = {inherit inputs nix-colors outputs;}; }; "laozi@rehoboam" = lib.homeManagerConfiguration { modules = [ ./home/laozi/rehoboam.nix ]; pkgs = pkgsFor.x86_64-linux; extraSpecialArgs = {inherit inputs nix-colors outputs;}; }; }; } }