NixOS-Config/flake.nix
2024-10-09 23:52:50 -04:00

144 lines
4.3 KiB
Nix

{
inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nur.url = "github:nix-community/NUR";
mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05";
blender-bin.url = "https://flakehub.com/f/edolstra/blender-bin/1.0.8.tar.gz";
minecraft.url = "github:Infinidoge/nix-minecraft";
hardware.url = "github:nixos/nixos-hardware/master";
# Secure boot
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.1";
inputs.nixpkgs.follows = "nixpkgs";
};
# Home manager
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
unstable,
nur,
mailserver,
blender-bin,
hardware,
lanzaboote,
home-manager,
...
} @inputs:
let
channels = {
master = import nixpkgs {
inherit (flake) system overlays;
config.allowUnfree = true;
};
unstable = import unstable { inherit (flake) system; };
nur = import nur { nurpkgs = import nixpkgs { inherit (flake) system; }; };
};
flake = {
overlays = [
nur.overlay
minecraft.overlay
(import ./overlays/mpv { inherit (self) inputs channels; })
];
packages = import ./packages/default.nix { inherit (nix) pkgs; };
secrets = import ./extras/secrets.nix;
cmd = import ./extras/cmd.nix;
displays = import ./extras/displays.nix;
ips = import ./extras/ips.nix;
look = import ./extras/look.nix;
ws = import ./extras/workspaces.nix;
};
nix = rec {
pkgs = channels.master // flake.packages;
inherit (pkgs) lib;
inherit (flake) channels-config;
};
in {
# NixOS config entrypoint, use 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
JimDesktop = nixpkgs.lib.nixosSystem {
inherit (nix) pkgs;
specialArgs = { inherit inputs outputs; };
modules = [
./system/hosts/JimDesktop/configuration.nix
lanzaboote.nixosModules.lanzaboote
];
};
JimServer = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = [
./system/hosts/JimServer/configuration.nix
mailserver.nixosModule
];
};
JimPine = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = [
./system/hosts/JimPine/configuration.nix
hardware.nixosModules.pine64-pinebook-pro
];
};
JimLenovo = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = [
./system/hosts/JimLenovo/configuration.nix
];
};
};
# Home-manager configuration, use 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"jimbo@JimDesktop" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
modules = [
./home/hosts/JimDesktop/home.nix
nur.nixosModules.nur
];
};
"jimbo@JimServer" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
modules = [
./home/hosts/JimServer/home.nix
];
};
"jimbo@JimPine" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.aarch64-linux;
extraSpecialArgs = { inherit inputs outputs; };
modules = [
./home/hosts/JimPine/home.nix
nur.nixosModules.nur
];
};
"jimbo@JimLenovo" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
modules = [
./home/hosts/JimLenovo/home.nix
nur.nixosModules.nur
];
};
# Derivation for ssh envrionments on other people's servers
"jimbo@JimTerminal" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
modules = [
./home/hosts/JimTerminal/home.nix
];
};
};
};
}