flake/flake.nix
2024-12-14 09:08:02 -05:00

225 lines
6.6 KiB
Nix

{
description = "System Configuration @ cswimr 2024";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
staging-next.url = "github:NixOS/nixpkgs/staging-next";
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
nur = {
url = "github:nix-community/NUR";
inputs.nixpkgs.follows = "nixpkgs";
};
plasma-manager = {
url = "github:nix-community/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.1";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-flatpak.url = "github:gmodena/nix-flatpak";
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
compose2nix = {
url = "github:aksiksi/compose2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
catppuccin-vsc.url = "https://flakehub.com/f/catppuccin/vscode/*.tar.gz";
};
outputs =
{
self,
nixpkgs,
home-manager,
...
}@inputs:
let
user = "cswimr";
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
overlays = [
inputs.catppuccin-vsc.overlays.default
inputs.nur.overlays.default
];
config.allowUnfree = true;
};
stagingNextPkgs = import inputs.staging-next {
inherit system;
config.allowUnfree = true;
};
in
{
nixosConfigurations = {
eclipse = nixpkgs.lib.nixosSystem {
system = system;
specialArgs = {
inherit inputs;
inherit pkgs;
inherit stagingNextPkgs;
system = system;
hostname = "eclipse";
user = user;
};
modules = [
# imports
./hosts/eclipse.nix
./nixos/catppuccin.nix
./nixos/configuration.nix
./nixos/development.nix
./nixos/environment.nix
./nixos/flatpak.nix
./nixos/gaming.nix
./nixos/git.nix
./nixos/gui-pkgs.nix
./nixos/nvidia.nix
./nixos/nvim.nix
./nixos/pkg.nix
./nixos/shell.nix
./nixos/sops.nix
./nixos/sudo.nix
./nixos/symlinks.nix
./nixos/tailscale.nix
./nixos/tpm.nix
{
# enable bluetooth
hardware.bluetooth.enable = true;
}
inputs.sops-nix.nixosModules.sops
inputs.nixvim.nixosModules.nixvim
inputs.nur.modules.nixos.default
inputs.nix-flatpak.nixosModules.nix-flatpak
inputs.lanzaboote.nixosModules.lanzaboote
(
{ lib, ... }:
{
boot.loader.systemd-boot.enable = lib.mkForce false;
boot.lanzaboote = {
enable = true;
pkiBundle = "/etc/secureboot";
};
}
)
inputs.nix-index-database.nixosModules.nix-index
{ programs.nix-index-database.comma.enable = true; }
# Home Manager
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
sharedModules = [
inputs.nur.modules.homeManager.default
inputs.plasma-manager.homeManagerModules.plasma-manager
];
backupFileExtension = "bak";
extraSpecialArgs = {
inherit inputs;
inherit pkgs;
inherit stagingNextPkgs;
system = system;
hostname = "eclipse";
user = user;
};
users.${user} = {
imports = [
./home-manager/browser.nix
./home-manager/plasma.nix
./home-manager/tpm.nix
./home-manager/user.nix
./home-manager/vscode.nix
{
programs.git.extraConfig.user.signingkey = "0EC431A8DA8F8087";
}
];
};
};
}
];
};
nebula = nixpkgs.lib.nixosSystem {
system = system;
specialArgs = {
inherit inputs;
inherit pkgs;
system = system;
hostname = "nebula";
};
modules = [
# imports
./hosts/nebula.nix
./nixos/catppuccin.nix
./nixos/configuration.nix
./nixos/development.nix
./nixos/environment.nix
./nixos/gaming.nix
./nixos/git.nix
./nixos/gui-pkgs.nix
./nixos/nvim.nix
./nixos/pkg.nix
./nixos/shell.nix
./nixos/sudo.nix
./nixos/symlinks.nix
./nixos/tailscale.nix
{
# enable bluetooth
hardware.bluetooth.enable = true;
}
inputs.nixvim.nixosModules.nixvim
inputs.nix-flatpak.nixosModules.nix-flatpak
# Home Manager
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
sharedModules = [ inputs.plasma-manager.homeManagerModules.plasma-manager ];
backupFileExtension = "bak";
extraSpecialArgs = {
inherit inputs;
inherit pkgs;
system = system;
hostname = "nebula";
user = user;
};
users.${user} = {
imports = [
./home-manager/plasma.nix
./home-manager/user.nix
./home-manager/vscode.nix
{
programs.git.extraConfig.user.signingkey = "082F226A1D8C0860";
}
];
};
};
}
];
};
};
};
}