nix/flake.nix
2023-09-29 14:41:59 +09:00

70 lines
No EOL
3.7 KiB
Nix

{
description = "NixOS System Config";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
# nixpkgs-wayland - Wayland-specific packages not in nixpkgs
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
# home-manager - Dotfile mnagement
home-manager.url = "github:nix-community/home-manager/master";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
# lanzaboote - Secureboot Configuration
lanzaboote.url = "github:nix-community/lanzaboote";
lanzaboote.inputs.nixpkgs.follows = "nixpkgs";
# nur - Nix User Repository - user-submitted / maintained packages
nur.url = "github:nix-community/NUR";
# sops-nix - Secret Management with SOPS using GPG Keys
sops-nix.url = "github:Mic92/sops-nix";
# doom-emacs - The Doom Emacs distribution`
doom-emacs.url = "github:nix-community/nix-doom-emacs";
# nixos-hardware - Hardware Configurations
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
# nixos-generators - Automated Image / ISO Creation
nixos-generators.url = "github:nix-community/nixos-generators";
nixos-generators.inputs.nixpkgs.follows = "nixpkgs";
# disko - Declarative Disk Partitioning
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, nixpkgs-wayland, home-manager, lanzaboote, nur, sops-nix, doom-emacs, nixos-generators, ... } @inputs:
let
inherit (self) outputs;
stateVersion = "unstable";
hmStateVersion = "23.11";
libx = import ./lib { inherit inputs outputs stateVersion hmStateVersion; };
in {
nixosConfigurations = {
# Virtual Machines
nixos-vm-01 = libx.mkHost { hostname = "nixos-vm-01"; };
nixos-vm-02 = libx.mkHost { hostname = "nixos-vm-02"; desktop = "gnome"; gpu = "intel"; theme = "gruvbox"; };
# Physical Machines
nixos-laptop = libx.mkHost { hostname = "nixos-laptop"; desktop = "hyprland"; gpu = "intel"; theme = "gruvbox"; };
nixos-framework = libx.mkHost { hostname = "nixos-framework"; desktop = "hyprland"; gpu = "intel"; theme = "gruvbox"; };
nixos-rpi4-01 = libx.mkHost { hostname = "nixos-rpi4-01"; platform = "aarch64-linux"; };
nixos-rpi4-02 = libx.mkHost { hostname = "nixos-rpi4-02"; platform = "aarch64-linux"; };
nixos-rpi4-03 = libx.mkHost { hostname = "nixos-rpi4-03"; platform = "aarch64-linux"; };
};
homeConfigurations = {
# Virtual Machines
"albert@nixos-vm-01" = libx.mkHome { hostname = "nixos-vm-01"; };
"albert@nixos-vm-02" = libx.mkHome { hostname = "nixos-vm-02"; desktop = "gnome"; theme = "gruvbox"; };
# Physical Machines
"albert@nixos-laptop" = libx.mkHome { hostname = "nixos-laptop"; desktop = "hyprland"; theme = "gruvbox"; };
"albert@nixos-framework" = libx.mkHome { hostname = "nixos-framework"; desktop = "hyprland"; theme = "gruvbox"; };
"albert@nixos-rpi4-01" = libx.mkHome { hostname = "nixos-rpi4-01"; platform = "aarch64-linux"; };
"albert@nixos-rpi4-02" = libx.mkHome { hostname = "nixos-rpi4-02"; platform = "aarch64-linux"; };
"albert@nixos-rpi4-03" = libx.mkHome { hostname = "nixos-rpi4-03"; platform = "aarch64-linux"; };
};
imageConfigurations = {
nixos-rpi4-img = libx.mkImage { hostname = "nixos-rpi4-img"; platform = "aarch64-linux"; format = "sd-aarch64"; };
nixos-iso-console = libx.mkImage { hostname = "nixos-iso-console"; format = "iso"; };
nixos-linode-img = libx.mkMinImage { hostname = "nixos-linode-img"; format = "linode"; };
};
# Devshell for bootstrapping; acessible via 'nix develop'
devShells = libx.forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./shell.nix { inherit pkgs sops-nix; }
);
};
}