NixOS-Config/flake.nix

98 lines
2.8 KiB
Nix
Raw Normal View History

2024-08-24 22:16:51 -04:00
{
description = "Jimbo's systems as a flake";
2024-08-24 22:16:51 -04:00
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
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
# 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,
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,
lanzaboote,
home-manager,
2024-08-24 22:16:51 -04:00
...
}@inputs: let
2024-10-12 21:14:55 -04:00
mkNixos = modules: nixpkgs.lib.nixosSystem {
inherit modules;
specialArgs = { inherit (self) inputs outputs; };
2024-10-12 21:14:55 -04:00
};
mkHome = modules: pkgs: home-manager.lib.homeManagerConfiguration {
inherit modules pkgs;
extraSpecialArgs = { inherit (self) inputs outputs; };
2024-10-12 21:14:55 -04:00
};
in {
2024-08-24 22:16:51 -04:00
# Your custom packages and modifications, exported as overlays
2024-10-12 17:35:29 -04:00
overlays = import ./extras/overlays.nix { inherit inputs; };
2024-08-24 22:16:51 -04:00
2024-09-23 16:22:01 -04:00
# 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'
2024-08-24 22:16:51 -04:00
nixosConfigurations = {
2024-10-12 21:14:55 -04:00
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
];
2024-08-24 22:16:51 -04:00
};
# Home-manager configuration: 'home-manager --flake .#username@hostname'
2024-08-24 22:16:51 -04:00
homeConfigurations = {
2024-10-12 21:14:55 -04:00
"jimbo@JimDesktop" = mkHome [
./home/hosts/JimDesktop/home.nix
nur.nixosModules.nur
] nixpkgs.legacyPackages.x86_64-linux;
2024-10-12 21:14:55 -04:00
"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
2024-10-12 21:14:55 -04:00
"jimbo@JimTerminal" = mkHome [
./home/hosts/JimTerminal/home.nix
] nixpkgs.legacyPackages.x86_64-linux;
2024-08-24 22:16:51 -04:00
};
};
}