diff --git a/flake.nix b/flake.nix index b508f7c..1fa040b 100644 --- a/flake.nix +++ b/flake.nix @@ -37,14 +37,29 @@ }; outputs = { nixpkgs, self, ...} @ inputs: - let - selfPkgs = import ./pkgs; - username = "frostphoenix"; - in - { - overlays.default = selfPkgs.overlay; - nixosConfigurations = import ./modules/core/default.nix { - inherit self nixpkgs inputs username; + let + selfPkgs = import ./pkgs; + username = "frostphoenix"; + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + lib = nixpkgs.lib; + in + { + overlays.default = selfPkgs.overlay; + nixosConfigurations = { + desktop = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ (import ./hosts/desktop) ]; + specialArgs = { host="desktop"; inherit self inputs username ; }; + }; + laptop = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ (import ./hosts/laptop) ]; + specialArgs = { host="laptop"; inherit self inputs username ; }; }; }; + }; } diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix new file mode 100644 index 0000000..7c71fe3 --- /dev/null +++ b/hosts/desktop/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + imports = [ + ./hardware-configuration.nix + ./../../modules/core + ]; +} \ No newline at end of file diff --git a/hosts/nixos/hardware-configuration.nix b/hosts/desktop/hardware-configuration.nix similarity index 100% rename from hosts/nixos/hardware-configuration.nix rename to hosts/desktop/hardware-configuration.nix diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix new file mode 100644 index 0000000..7c71fe3 --- /dev/null +++ b/hosts/laptop/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + imports = [ + ./hardware-configuration.nix + ./../../modules/core + ]; +} \ No newline at end of file diff --git a/modules/core/default.nix b/modules/core/default.nix index e69b6fa..5be24f7 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -1,29 +1,16 @@ -{ inputs, nixpkgs, self, username, ...}: -let - system = "x86_64-linux"; - pkgs = import nixpkgs { - inherit system; - config.allowUnfree = true; - }; - lib = nixpkgs.lib; -in +{ inputs, nixpkgs, self, username, host, ...}: { - nixos = nixpkgs.lib.nixosSystem { - specialArgs = { inherit self inputs username; }; - modules = - [ (import ./bootloader.nix) ] - ++ [ (import ./hardware.nix) ] - ++ [ (import ./xserver.nix) ] - ++ [ (import ./network.nix) ] - ++ [ (import ./pipewire.nix) ] - ++ [ (import ./program.nix) ] - ++ [ (import ./security.nix) ] - ++ [ (import ./services.nix) ] - ++ [ (import ./system.nix) ] - ++ [ (import ./user.nix) ] - ++ [ (import ./wayland.nix) ] - ++ [ (import ./virtualization.nix) ] - ++ [ (import ./../../hosts/desktop/hardware-configuration.nix) ] - ; - }; + imports = + [ (import ./bootloader.nix) ] + ++ [ (import ./hardware.nix) ] + ++ [ (import ./xserver.nix) ] + ++ [ (import ./network.nix) ] + ++ [ (import ./pipewire.nix) ] + ++ [ (import ./program.nix) ] + ++ [ (import ./security.nix) ] + ++ [ (import ./services.nix) ] + ++ [ (import ./system.nix) ] + ++ [ (import ./user.nix) ] + ++ [ (import ./wayland.nix) ] + ++ [ (import ./virtualization.nix) ]; } diff --git a/modules/core/user.nix b/modules/core/user.nix index b438f8c..57c6e0a 100644 --- a/modules/core/user.nix +++ b/modules/core/user.nix @@ -1,9 +1,4 @@ -{ pkgs, inputs, username, ...}: -let - packages = with pkgs; [ - fish - ]; -in +{ pkgs, inputs, username, host, ...}: { imports = [ inputs.home-manager.nixosModules.home-manager ]; home-manager = { @@ -11,7 +6,10 @@ in useGlobalPkgs = true; extraSpecialArgs = { inherit inputs username; }; users.${username} = { - imports = [ (import ./../home) ]; + imports = + if (host == "desktop") then + [ ./../home/default.desktop.nix ] + else [ ./../home ]; home.username = "${username}"; home.homeDirectory = "/home/${username}"; home.stateVersion = "22.11"; diff --git a/modules/home/default.desktop.nix b/modules/home/default.desktop.nix new file mode 100644 index 0000000..302c7ce --- /dev/null +++ b/modules/home/default.desktop.nix @@ -0,0 +1,7 @@ +{inputs, username, ...}: { + imports = + [(import ./default.nix)] + ++ [(import ./rider.nix)] # C# JetBrain editor + # ++ [ (import ./steam.nix) ] + ++ [(import ./unity.nix)]; +} diff --git a/modules/home/default.nix b/modules/home/default.nix index e10a4a3..a7ca47c 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -16,12 +16,9 @@ ++ [(import ./micro.nix)] # nano replacement ++ [(import ./nvim.nix)] ++ [(import ./packages.nix)] - ++ [(import ./rider.nix)] # C# JetBrain editor ++ [(import ./scripts/scripts.nix)] # personal scripts ++ [(import ./starship.nix)] - # ++ [ (import ./steam.nix) ] ++ [(import ./swaylock.nix)] - ++ [(import ./unity.nix)] ++ [(import ./vscodium.nix)] ++ [(import ./waybar)] ++ [(import ./wofi.nix)]