diff --git a/flake.nix b/flake.nix index e3d5d546..c294c2a8 100644 --- a/flake.nix +++ b/flake.nix @@ -22,8 +22,7 @@ nixos-hardware.url = "github:NixOS/nixos-hardware/master"; # Encrypted secrets in Nix configuration files - # https://github.com/Mic92/sops-nix - sops-nix.url = "github:Mic92/sops-nix"; + sops-nix.url = "github:Mic92/sops-nix"; }; outputs = { @@ -58,8 +57,8 @@ }; modules = [ # Configuration Imports - ./configuration.nix { inherit pkgs hostname config; }# Common NixOS Configuration - ./hosts/${hostname}/flake.nix { inherit pkgs hostname config; }# Hardware-specific Configuration + ./configuration.nix # Common NixOS Configuration + ./hosts/${hostname} # Hardware-specific Configuration # Flake Imports sops-nix.nixosModules.sops # Handle secrets @@ -69,18 +68,20 @@ # Home Manager settings home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.albert.imports = [ - ({ config, ... }: import ./users/albert/home.nix { - inherit config pkgs hostname; - }) - ]; - home-manager.users.root.imports = [ - ({ config, ... }: import ./users/root/home.nix { - inherit config pkgs hostname; - }) - ]; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.albert.imports = [ + ({ config, ... }: import ./users/albert/home.nix { + inherit config pkgs hostname; + }) + ]; + users.root.imports = [ + ({ config, ... }: import ./users/root/home.nix { + inherit config pkgs hostname; + }) + ]; + }; # home-manager nixpkgs.overlays = [ nur.overlay ]; @@ -88,5 +89,5 @@ ]; # modules }; # lib.nixosSystem - ${hostname} }; # nixosConfiguration - }; + }; # in } diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix new file mode 100644 index 00000000..b953517a --- /dev/null +++ b/hosts/nixos-laptop/default.nix @@ -0,0 +1,7 @@ +{ imports, ... }: { + imports = [ + imports.nixos-hardware.nixosModules.lenovo-thinkpad-p1 + ./home-manager + ./nixos + ]; +} \ No newline at end of file diff --git a/hosts/nixos-laptop/flake.nix b/hosts/nixos-laptop/flake.nix deleted file mode 100644 index 099e98fc..00000000 --- a/hosts/nixos-laptop/flake.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - # INFORMATION - # When building for a system, remember to change the hostname variable below - description = "nixos-laptop flake"; - - inputs = { - # Hardware support - nixos-hardware.url = "github:NixOS/nixos-hardware/master"; - }; - - outputs = { hostname, nixos-hardware, ... }@inputs: { - # NixOS Configuration files: - nixosConfigurations = { - # Declare a generic configuration using the $hostname variable: - "nixos-laptop" = unstable-nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit hostname; - }; - modules = [ - # Configuration Imports - ./nixos/configuration.nix - # Flake Imports - nixos-hardware.nixosModules.lenovo-thinkpad-p1 - ]; # modules - }; # lib.nixosSystem - "nixos-laptop" - }; # nixosConfiguration - }; # outputs -} # flake diff --git a/hosts/nixos-laptop/nixos/default.nix b/hosts/nixos-laptop/nixos/default.nix new file mode 100644 index 00000000..8c798b1d --- /dev/null +++ b/hosts/nixos-laptop/nixos/default.nix @@ -0,0 +1,7 @@ +{ config, pkgs, hostname, ... }: { + imports = [ + ./hardware-configuration.nix + ./configuration.nix + ./networking.nix + ]; +} \ No newline at end of file