nix-config/flake.nix
2024-07-28 16:10:57 +02:00

127 lines
3.2 KiB
Nix

{
description = "My NixOS desktop and server configs";
inputs = {
# NixOS official package source, using the nixos-23.11 branch here
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:nixos/nixos-hardware";
# Declarative dotfile management
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
# Declarative partitioning and formatting
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
# # Secrets management. See ./docs/secretsmgmt.md
# sops-nix = {
# url = "github:mic92/sops-nix";
# inputs.nixpkgs.follows = "nixpkgs";
# };
};
outputs = { self, nixpkgs, nixpkgs-unstable, ... }@attrs:
let
system = "x86_64-linux";
lib = nixpkgs.lib;
pkgs = nixpkgs.legacyPackages.${system};
pkgs-unstable = nixpkgs-unstable.legacyPackages.${system};
in
{
nixosConfigurations = {
Lenni = let
system = "x86_64-linux";
in
lib.nixosSystem {
specialArgs = {
hostname = "Lenni";
type = "desktop";
inherit pkgs-unstable;
inherit system;
};
modules = [
attrs.home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
attrs.disko.nixosModules.disko
attrs.nixos-hardware.nixosModules.framework-12th-gen-intel
./hosts
./users/willifan
];
};
Puenktchen = let
system = "x86_64-linux";
in
lib.nixosSystem {
specialArgs = {
hostname = "Puenktchen";
type = "desktop";
inherit pkgs-unstable;
inherit system;
};
modules = [
attrs.home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
attrs.disko.nixosModules.disko
attrs.nixos-hardware.nixosModules.common-cpu-amd
attrs.nixos-hardware.nixosModules.common-cpu-amd-pstate
attrs.nixos-hardware.nixosModules.common-cpu-amd-zenpower
attrs.nixos-hardware.nixosModules.common-gpu-amd
./hosts
./users/willifan
];
};
Anton = let
system = "x86_64-linux";
in
lib.nixosSystem {
specialArgs = {
hostname = "Anton";
type = "server";
inherit pkgs-unstable;
inherit system;
};
modules = [
attrs.home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
attrs.disko.nixosModules.disko
attrs.nixos-hardware.nixosModules.common-cpu-amd
attrs.nixos-hardware.nixosModules.common-cpu-amd-pstate
attrs.nixos-hardware.nixosModules.common-cpu-amd-zenpower
./hosts
./users/willifan
];
};
};
};
}