diff --git a/flake.nix b/flake.nix index bd302b4..c932460 100755 --- a/flake.nix +++ b/flake.nix @@ -74,13 +74,22 @@ }; }; - outputs = inputs@{ self, nixpkgs, colmena, nix-on-droid, ... }: let + outputs = inputs@{ self, nixpkgs, home-manager, colmena, nix-on-droid, ... }: let utils = import ./utils { inherit inputs; secrets = import ./secrets.nix; }; in { - # Setup nixos-rebuild configurations + # Setup home-manager configurations + # Mines Isengard + homeConfigurations.tyler_beckman = utils.createHomeManagerConfig { + meta = { + preset = "cli"; + username = "tyler_beckman"; + } + }; + + # Setup NixOS configurations nixosConfigurations = { "ty-nixos" = utils.createNixosSystem { entrypoint = ./hosts/laptop; }; "ty-laptop-server" = utils.createNixosSystem { entrypoint = ./hosts/laptop-server; }; diff --git a/home-manager/default.nix b/home-manager/default.nix index 6b0db01..95a4053 100755 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -26,7 +26,6 @@ sharedModules = [ # Import plasma manager and all of my custom modules for use inputs.plasma-manager.homeManagerModules.plasma-manager - inputs.flatpaks.homeManagerModules.declarative-flatpak ./modules ]; # Inherit all of my nixos config custom arguments diff --git a/home-manager/meta.nix b/home-manager/meta.nix index 365864c..b17a8ce 100644 --- a/home-manager/meta.nix +++ b/home-manager/meta.nix @@ -31,6 +31,13 @@ rescrobbled.enable = lib.mkEnableOption "rescrobbled configuration"; vscode.enable = lib.mkEnableOption "vscode configuration"; + username = lib.mkOption { + type = lib.types.str; + default = "ty"; + defaultText = lib.literalExpression ''"ty"''; + description = "The username to apply the config as"; + } + interface = lib.mkOption { type = lib.types.enum [ "nixos" "nix-on-droid" ]; default = "nixos"; diff --git a/home-manager/standalone.nix b/home-manager/standalone.nix new file mode 100644 index 0000000..a3112ed --- /dev/null +++ b/home-manager/standalone.nix @@ -0,0 +1,18 @@ +{ ... }: +{ + imports = [ + # Import plasma manager and all of my custom modules for use + inputs.plasma-manager.homeManagerModules.plasma-manager + ./modules + # Import main config + ./meta.nix + ./config + ]; + + home = { + stateVersion = "24.11"; + + username = meta.home-manager.username; + homeDirectory = /. + "/home/${meta.home-manager.username}"; + }; +} diff --git a/utils/default.nix b/utils/default.nix index 82b271b..4242ca1 100644 --- a/utils/default.nix +++ b/utils/default.nix @@ -1,5 +1,17 @@ { inputs, secrets }: { + createHomeManagerConfig = { + system ? "x86_64-linux", + entrypoint + }: inputs.home-manager.lib.homeManagerConfiguration { + pkgs = inputs.nixpkgs.legacyPackages.${system}; + modules = [ ./home-manager/standalone.nix ]; + extraSpecialArgs = { + inherit input system secrets; + pkgs-stable = inputs.nixpkgs-stable.legacyPackages.${system}; + }; + } + createNixosSystem = { system ? "x86_64-linux", entrypoint