dotfiles/flake.nix

105 lines
3.5 KiB
Nix

{
description = "A Very Flakey Home Manager";
# Initial layout shamelessly stolen from:
# - https://github.com/Misterio77/nix-starter-configs/
# - https://github.com/Misterio77/nix-config/
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
# You can access packages and modules from different nixpkgs revs
# at the same time. Here's a working example:
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Also see the 'unstable-packages' overlay at 'overlays/default.nix'.
# Home manager
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
# Hardware
hardware.url = "github:nixos/nixos-hardware";
# Firefox add-ons
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
# nixvim
nixvim = {
url = "github:nix-community/nixvim/nixos-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
# NixGL
nixgl = {
url = "github:nix-community/nixGL";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, nixgl, nixvim, ... }@inputs:
let
inherit (self) outputs;
lib = nixpkgs.lib // home-manager.lib;
systems = [ "x86_64-linux" "aarch64-linux" ];
forEachSystem = f: lib.genAttrs systems (sys: f pkgsFor.${sys});
pkgsFor = nixpkgs.legacyPackages;
in
{
inherit lib;
nixosModules = import ./modules/nixos;
homeManagerModules = import ./modules/home-manager;
overlays = import ./overlays { inherit inputs outputs; };
packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; });
devShells = forEachSystem (pkgs: import ./shell.nix { inherit pkgs; });
formatter = forEachSystem (pkgs: pkgs.nixpkgs-fmt);
nixosConfigurations = {
# Pixelbook converted to NixOS
pixnix = lib.nixosSystem {
modules = [ ./nixos/pixnix ];
specialArgs = { inherit inputs outputs; };
};
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"john@penguin-duet" = lib.homeManagerConfiguration {
modules = [ ./home/hosts/penguin-duet.nix ];
pkgs = pkgsFor.aarch64-linux;
extraSpecialArgs = { inherit inputs outputs; };
};
"john@penguin-fw" = lib.homeManagerConfiguration {
modules = [ ./home/hosts/penguin-fw.nix ];
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
};
"john@pixnix" = lib.homeManagerConfiguration {
modules = [ ./home/hosts/pixnix.nix ];
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
};
"john@volly" = lib.homeManagerConfiguration {
modules = [ ./home/hosts/generic.nix ];
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
};
"john@immich" = lib.homeManagerConfiguration {
modules = [ ./home/hosts/generic.nix ];
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
};
"john@doc" = lib.homeManagerConfiguration {
modules = [ ./home/hosts/generic.nix ];
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
};
};
};
}