nix-config/flake.nix

127 lines
3.2 KiB
Nix
Raw Normal View History

2024-05-11 15:53:20 +02:00
{
description = "My NixOS desktop and server configs";
2024-05-11 15:53:20 +02:00
inputs = {
2024-05-19 17:02:35 +02:00
2024-05-11 15:53:20 +02:00
# NixOS official package source, using the nixos-23.11 branch here
2024-05-31 23:51:48 +02:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:nixos/nixos-hardware";
2024-05-11 15:53:20 +02:00
2024-05-19 17:02:35 +02:00
# Declarative dotfile management
2024-05-11 15:53:20 +02:00
home-manager = {
2024-05-31 23:51:48 +02:00
url = "github:nix-community/home-manager/release-24.05";
2024-05-12 22:34:32 +02:00
inputs.nixpkgs.follows = "nixpkgs";
2024-05-11 15:53:20 +02:00
};
2024-05-19 17:02:35 +02:00
# Declarative partitioning and formatting
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-05-11 15:53:20 +02:00
2024-05-11 21:26:33 +02:00
# # Secrets management. See ./docs/secretsmgmt.md
# sops-nix = {
# url = "github:mic92/sops-nix";
# inputs.nixpkgs.follows = "nixpkgs";
# };
2024-05-11 15:53:20 +02:00
};
outputs = { self, nixpkgs, nixpkgs-unstable, ... }@attrs:
let
2024-07-28 10:16:48 +02:00
system = "x86_64-linux";
lib = nixpkgs.lib;
pkgs = nixpkgs.legacyPackages.${system};
pkgs-unstable = nixpkgs-unstable.legacyPackages.${system};
2024-05-12 22:34:32 +02:00
in
{
nixosConfigurations = {
2024-05-19 20:11:53 +02:00
Lenni = let
system = "x86_64-linux";
in
2024-07-28 10:16:48 +02:00
lib.nixosSystem {
2024-07-06 21:33:59 +02:00
specialArgs = {
hostname = "Lenni";
2024-07-06 21:33:59 +02:00
type = "desktop";
2024-07-28 10:16:48 +02:00
inherit pkgs-unstable;
inherit system;
};
2024-07-06 21:33:59 +02:00
2024-05-12 22:34:32 +02:00
modules = [
attrs.home-manager.nixosModules.home-manager
2024-05-12 22:34:32 +02:00
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
attrs.disko.nixosModules.disko
attrs.nixos-hardware.nixosModules.framework-12th-gen-intel
2024-05-19 20:11:53 +02:00
./hosts
./users/willifan
];
2024-07-06 21:33:59 +02:00
2024-05-19 20:11:53 +02:00
};
Puenktchen = let
system = "x86_64-linux";
in
2024-07-28 10:16:48 +02:00
lib.nixosSystem {
2024-07-06 21:33:59 +02:00
specialArgs = {
hostname = "Puenktchen";
2024-07-06 21:33:59 +02:00
type = "desktop";
2024-07-28 10:16:48 +02:00
inherit pkgs-unstable;
inherit system;
};
2024-07-06 21:33:59 +02:00
2024-05-19 20:11:53 +02:00
modules = [
attrs.home-manager.nixosModules.home-manager
2024-05-19 20:11:53 +02:00
{
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
2024-05-12 22:34:32 +02:00
./hosts
./users/willifan
];
2024-07-06 21:33:59 +02:00
};
Anton = let
system = "x86_64-linux";
in
2024-07-28 10:16:48 +02:00
lib.nixosSystem {
2024-07-06 21:33:59 +02:00
specialArgs = {
hostname = "Anton";
type = "server";
2024-07-28 10:16:48 +02:00
inherit pkgs-unstable;
2024-07-06 21:33:59 +02:00
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
];
2024-05-12 22:34:32 +02:00
};
2024-05-19 20:11:53 +02:00
2024-05-11 15:53:20 +02:00
};
};
2024-05-13 13:48:17 +02:00
}