NixOS-Config/flake.nix
2024-10-13 11:56:39 -04:00

98 lines
2.8 KiB
Nix

{
description = "Jimbo's systems as a flake";
inputs = {
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.9.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
mkNixos = modules: nixpkgs.lib.nixosSystem {
inherit modules;
specialArgs = { inherit (self) inputs outputs; };
};
mkHome = modules: pkgs: home-manager.lib.homeManagerConfiguration {
inherit modules pkgs;
extraSpecialArgs = { inherit (self) inputs outputs; };
};
in {
# Your custom packages and modifications, exported as overlays
overlays = import ./extras/overlays.nix { inherit inputs; };
# Variables defined so they can be accessed globally
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;
# NixOS configuration: 'nixos-rebuild --flake .#hostname'
nixosConfigurations = {
JimDesktop = mkNixos [
./system/hosts/JimDesktop/configuration.nix
lanzaboote.nixosModules.lanzaboote
];
JimServer = mkNixos [
./system/hosts/JimServer/configuration.nix
mailserver.nixosModule
];
JimPine = mkNixos [
./system/hosts/JimPine/configuration.nix
hardware.nixosModules.pine64-pinebook-pro
];
};
# Home-manager configuration: 'home-manager --flake .#username@hostname'
homeConfigurations = {
"jimbo@JimDesktop" = mkHome [
./home/hosts/JimDesktop/home.nix
nur.nixosModules.nur
] nixpkgs.legacyPackages.x86_64-linux;
"jimbo@JimServer" = mkHome [
./home/hosts/JimServer/home.nix
] nixpkgs.legacyPackages.x86_64-linux;
"jimbo@JimPine" = mkHome [
./home/hosts/JimPine/home.nix
nur.nixosModules.nur
] nixpkgs.legacyPackages.aarch64-linux;
# Profile for ssh envrionments on different non-root systems
"jimbo@JimTerminal" = mkHome [
./home/hosts/JimTerminal/home.nix
] nixpkgs.legacyPackages.x86_64-linux;
};
};
}