diff --git a/flake.nix b/flake.nix index 52c1253..6c8ec48 100644 --- a/flake.nix +++ b/flake.nix @@ -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 ]; diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 177ce5b..d8784f3 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -1,6 +1,6 @@ -{ pkgs, configVars, ... }: +{ pkgs, hostname, ... }: { - networking.hostName = configVars.hostname; + networking.hostName = hostname; imports = [ ./nix-ld.nix ./boot.nix diff --git a/hosts/default.nix b/hosts/default.nix index c7f8050..10ae784 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,7 +1,7 @@ -{ pkgs, configVars, ... }: +{ pkgs, hostname, ... }: { imports = [ ./common - ./${configVars.hostname} + ./${hostname} ]; } \ No newline at end of file diff --git a/users/willifan/graphical/hyprland/default.nix b/users/willifan/graphical/hyprland/default.nix index c7f8050..10ae784 100644 --- a/users/willifan/graphical/hyprland/default.nix +++ b/users/willifan/graphical/hyprland/default.nix @@ -1,7 +1,7 @@ -{ pkgs, configVars, ... }: +{ pkgs, hostname, ... }: { imports = [ ./common - ./${configVars.hostname} + ./${hostname} ]; } \ No newline at end of file