added individual host variables and pkgs-unstable

This commit is contained in:
willifan 2024-06-27 19:03:36 +02:00
parent 41224a66a9
commit 5176e7cdf8
4 changed files with 40 additions and 28 deletions

View File

@ -1,5 +1,5 @@
{
description = "A simple NixOS flake";
description = "My NixOS desktop and server configs";
inputs = {
@ -28,47 +28,59 @@
};
outputs = { self, nixpkgs, home-manager, disko, nixos-hardware, ... }@inputs:
outputs = { self, nixpkgs, nixpkgs-unstable, ... }@attrs:
let
inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
];
inherit (nixpkgs) lib;
configVars = import /home/willifan/.nix-config/vars { inherit inputs lib; };
specialArgs = { inherit inputs outputs configVars nixpkgs; };
supportedSystems = [ "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
forAllSystemsUnstable = nixpkgs-unstable.lib.genAttrs supportedSystems;
pkgs = forAllSystems (system: import nixpkgs { inherit system; });
pkgs-unstable = forAllSystemsUnstable (system: import nixpkgs-unstable { inherit system; });
in
{
nixosConfigurations = {
Lenni = lib.nixosSystem {
inherit specialArgs;
Lenni = let
system = "x86_64-linux";
in
nixpkgs.lib.nixosSystem {
specialArgs = {
hostname = "Lenni";
inherit system;
};
modules = [
home-manager.nixosModules.home-manager
attrs.home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
disko.nixosModules.disko
nixos-hardware.nixosModules.framework-12th-gen-intel
attrs.disko.nixosModules.disko
attrs.nixos-hardware.nixosModules.framework-12th-gen-intel
./hosts
./users/willifan
];
};
Puenktchen = lib.nixosSystem {
inherit specialArgs;
Puenktchen = let
system = "x86_64-linux";
in
nixpkgs.lib.nixosSystem {
specialArgs = {
hostname = "Puenktchen";
inherit system;
};
modules = [
home-manager.nixosModules.home-manager
attrs.home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
disko.nixosModules.disko
nixos-hardware.nixosModules.common-cpu-amd
nixos-hardware.nixosModules.common-cpu-amd-pstate
nixos-hardware.nixosModules.common-cpu-amd-zenpower
nixos-hardware.nixosModules.common-gpu-amd
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
];

View File

@ -1,6 +1,6 @@
{ pkgs, configVars, ... }:
{ pkgs, hostname, ... }:
{
networking.hostName = configVars.hostname;
networking.hostName = hostname;
imports = [
./nix-ld.nix
./boot.nix

View File

@ -1,7 +1,7 @@
{ pkgs, configVars, ... }:
{ pkgs, hostname, ... }:
{
imports = [
./common
./${configVars.hostname}
./${hostname}
];
}

View File

@ -1,7 +1,7 @@
{ pkgs, configVars, ... }:
{ pkgs, hostname, ... }:
{
imports = [
./common
./${configVars.hostname}
./${hostname}
];
}