diff --git a/flake.nix b/flake.nix index 6c8ec48..52c1253 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "My NixOS desktop and server configs"; + description = "A simple NixOS flake"; inputs = { @@ -28,59 +28,47 @@ }; - outputs = { self, nixpkgs, nixpkgs-unstable, ... }@attrs: + outputs = { self, nixpkgs, home-manager, disko, nixos-hardware, ... }@inputs: let - 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; }); - + 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; }; in { nixosConfigurations = { - Lenni = let - system = "x86_64-linux"; - in - nixpkgs.lib.nixosSystem { - specialArgs = { - hostname = "Lenni"; - inherit system; - }; + Lenni = lib.nixosSystem { + inherit specialArgs; modules = [ - attrs.home-manager.nixosModules.home-manager + 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 + disko.nixosModules.disko + nixos-hardware.nixosModules.framework-12th-gen-intel ./hosts ./users/willifan ]; }; - Puenktchen = let - system = "x86_64-linux"; - in - nixpkgs.lib.nixosSystem { - specialArgs = { - hostname = "Puenktchen"; - inherit system; - }; + Puenktchen = lib.nixosSystem { + inherit specialArgs; modules = [ - attrs.home-manager.nixosModules.home-manager + 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 + 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 ./hosts ./users/willifan ]; diff --git a/hosts/common/default.nix b/hosts/common/default.nix index d8784f3..177ce5b 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -1,6 +1,6 @@ -{ pkgs, hostname, ... }: +{ pkgs, configVars, ... }: { - networking.hostName = hostname; + networking.hostName = configVars.hostname; imports = [ ./nix-ld.nix ./boot.nix diff --git a/hosts/default.nix b/hosts/default.nix index 10ae784..c7f8050 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,7 +1,7 @@ -{ pkgs, hostname, ... }: +{ pkgs, configVars, ... }: { imports = [ ./common - ./${hostname} + ./${configVars.hostname} ]; } \ No newline at end of file diff --git a/users/willifan/graphical/default.nix b/users/willifan/graphical/default.nix index 89c737e..456f3ac 100644 --- a/users/willifan/graphical/default.nix +++ b/users/willifan/graphical/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, home-manager-unstable, ... }: { diff --git a/users/willifan/graphical/hyprland/default.nix b/users/willifan/graphical/hyprland/default.nix index 10ae784..c7f8050 100644 --- a/users/willifan/graphical/hyprland/default.nix +++ b/users/willifan/graphical/hyprland/default.nix @@ -1,7 +1,7 @@ -{ pkgs, hostname, ... }: +{ pkgs, configVars, ... }: { imports = [ ./common - ./${hostname} + ./${configVars.hostname} ]; } \ No newline at end of file diff --git a/users/willifan/graphical/theme/default.nix b/users/willifan/graphical/theme/default.nix index 48c8509..8c6e21a 100644 --- a/users/willifan/graphical/theme/default.nix +++ b/users/willifan/graphical/theme/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, home-manager-unstable, ... }: { imports = [