From ae7d7de11129c1d4e0605fc47bcedb55061da33d Mon Sep 17 00:00:00 2001 From: Kat Inskip Date: Thu, 1 Dec 2022 22:32:06 +0100 Subject: [PATCH] feat: home manager configurations basis --- default.nix | 22 +++++++++++++++++++--- home/base/default.nix | 2 ++ home/common.nix | 7 +++++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 home/base/default.nix create mode 100644 home/common.nix diff --git a/default.nix b/default.nix index aa416aab..8ca0d583 100644 --- a/default.nix +++ b/default.nix @@ -1,4 +1,4 @@ -{ nixpkgs, darwin, ... }@inputs: let +{ nixpkgs, darwin, home-manager, ... }@inputs: let tree = (inputs.tree.tree { inherit inputs; folder = ./.; @@ -9,30 +9,46 @@ "default" ]; }; + "home/*" = { + functor.enable = true; + }; }; }).impure; lib = inputs.nixpkgs.lib; inherit (lib.attrsets) mapAttrs; in { inherit tree; - nixosConfigurations = mapAttrs (_: path: nixpkgs.lib.nixosSystem { + nixosConfigurations = mapAttrs (name: path: nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs tree; machine = name; }; system = "x86_64-linux"; modules = [ + home-manager.nixosModules.home-manager path ]; } ) tree.nixos.systems; - darwinConfigurations = mapAttrs (_: path: darwin.lib.darwinSystem { + darwinConfigurations = mapAttrs (name: path: darwin.lib.darwinSystem { specialArgs = { inherit inputs tree; machine = name; }; system = "aarch64-darwin"; modules = [ + home-manager.nixosModules.home-manager path ]; } ) tree.darwin.systems; + homeManagerConfigurations = mapAttrs (name: path: home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = { + inherit inputs tree; + machine = name; + }; + modules = [ + tree.home.common + path + ]; + }) tree.home; } diff --git a/home/base/default.nix b/home/base/default.nix new file mode 100644 index 00000000..efe70297 --- /dev/null +++ b/home/base/default.nix @@ -0,0 +1,2 @@ +{ config, ... }: { +} diff --git a/home/common.nix b/home/common.nix new file mode 100644 index 00000000..06d04660 --- /dev/null +++ b/home/common.nix @@ -0,0 +1,7 @@ +{ config, ... }: { + home = { + username = "kat"; + stateVersion = "22.11"; + homeDirectory = "/home/kat"; + }; +}