Compare commits

..

2 Commits

Author SHA1 Message Date
willifan
5176e7cdf8 added individual host variables and pkgs-unstable 2024-06-27 19:03:36 +02:00
willifan
41224a66a9 removed unnecessary home-manager-unstable arguments 2024-06-27 18:30:20 +02:00
6 changed files with 42 additions and 30 deletions

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
{ pkgs, home-manager-unstable, ... }: { pkgs, ... }:
{ {

View File

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

View File

@ -1,4 +1,4 @@
{ pkgs, home-manager-unstable, ... }: { pkgs, ... }:
{ {
imports = [ imports = [