NixOS-Config/flake.nix

113 lines
3.4 KiB
Nix
Raw Normal View History

2024-08-24 22:16:51 -04:00
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
2024-10-09 03:36:08 -04:00
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
2024-08-24 22:16:51 -04:00
nur.url = "github:nix-community/NUR";
2024-09-23 11:41:28 -04:00
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";
2024-09-23 11:41:28 -04:00
minecraft.url = "github:Infinidoge/nix-minecraft";
hardware.url = "github:nixos/nixos-hardware/master";
2024-08-24 22:16:51 -04:00
2024-10-09 03:36:08 -04:00
# Secure boot
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.1";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-08-24 22:16:51 -04:00
# Home manager
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
2024-10-09 03:36:08 -04:00
unstable,
2024-08-24 22:16:51 -04:00
nur,
2024-09-23 11:41:28 -04:00
mailserver,
2024-08-27 05:14:19 -04:00
blender-bin,
2024-09-23 11:41:28 -04:00
hardware,
2024-10-09 03:36:08 -04:00
lanzaboote,
home-manager,
2024-08-24 22:16:51 -04:00
...
2024-10-12 20:44:05 -04:00
} @inputs: let
inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux"
"x86_64-linux"
];
in rec {
packages = forAllSystems (system: import ./packages nixpkgs.legacyPackages.${system});
2024-08-24 22:16:51 -04:00
2024-10-12 20:44:05 -04:00
# Variables defined so they can be accessed globally
secrets = import ./variables/secrets;
cmd = import ./variables/cmd;
displays = import ./variables/displays;
ips = import ./variables/ips;
look = import ./variables/look;
ws = import ./variables/workspaces;
# NixOS config entrypoint, use 'nixos-rebuild --flake .#your-hostname'
2024-08-24 22:16:51 -04:00
nixosConfigurations = {
2024-10-12 20:44:05 -04:00
firefly = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./hosts/firefly/system
lanzaboote.nixosModules.lanzaboote
];
};
cyberspark = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./system/hosts/JimServer/configuration.nix
mailserver.nixosModule
];
};
shuttleworth = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./system/hosts/JimPine/configuration.nix
hardware.nixosModules.pine64-pinebook-pro
];
};
2024-08-24 22:16:51 -04:00
};
# Home-manager configuration, use 'home-manager --flake .#your-username@your-hostname'
2024-08-24 22:16:51 -04:00
homeConfigurations = {
2024-10-12 20:44:05 -04:00
"jimbo@firefly" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home/hosts/JimDesktop/home.nix
nur.nixosModules.nur
];
};
"jimbo@cyberspark" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home/hosts/JimServer/home.nix
];
};
"jimbo@shuttleworth" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.aarch64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home/hosts/JimPine/home.nix
nur.nixosModules.nur
];
};
# Derivation for ssh envrionments on other people's servers
2024-10-12 20:44:05 -04:00
"jimbo@JimTerminal" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home/hosts/JimTerminal/home.nix
];
};
2024-08-24 22:16:51 -04:00
};
};
}