From 1f0b119fac141d362094740328ce5f60dd47ad28 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Thu, 10 Mar 2022 23:33:18 -0600 Subject: Add sys and home platform dirs --- flake.nix | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 660ee66..65941a9 100644 --- a/flake.nix +++ b/flake.nix @@ -11,8 +11,9 @@ nur.url = "github:nix-community/NUR"; }; - outputs = { self, nixpkgs, home-manager, nur, ... }: let + outputs = { self, nixpkgs, home-manager, nur, ... }: with nixpkgs.lib; let util = import ./util; + inherit (util nixpkgs.lib) importAll; pkgSet = pkgs: import ./pkgs { inherit pkgs; @@ -26,30 +27,38 @@ }; nixosConfigurations = with nixpkgs.lib; let - hostUtil = util nixpkgs.lib; hostConfig = host: (makeOverridable nixosSystem) { system = "x86_64-linux"; modules = [ (import ./sys self) host ]; }; - in mapAttrs (_: hostConfig) (hostUtil.importAll { root = ./platform; }); + in mapAttrs (_: hostConfig) (importAll { root = ./sys/platform; }); - homeConfigurations."ale@p-user" = home-manager.lib.homeManagerConfiguration { - system = "x86_64-linux"; - configuration = { - imports = [ ./home ]; - nixpkgs.overlays = [ nur.overlay self.overlay ]; - }; + homeConfigurations = let + home = platform: home-manager.lib.homeManagerConfiguration { + system = "x86_64-linux"; - username = "ale"; - homeDirectory = "/home/ale"; + configuration = import ./home; + extraModules = [ platform ]; - # Update the state version as needed. - # See the changelog here: - # https://nix-community.github.io/home-manager/release-notes.html#sec-release-21.05 - stateVersion = "21.11"; + username = "ale"; + homeDirectory = "/home/ale"; - # Optionally use extraSpecialArgs - # to pass through arguments to home.nix - }; + # Update the state version as needed. + # See the changelog here: + # https://nix-community.github.io/home-manager/release-notes.html#sec-release-21.05 + stateVersion = "21.11"; + + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + extraSpecialArgs = { + inherit nur self; + }; + }; + + homeConfig = id: platform: { + name = "ale@${id}"; + value = home platform; + }; + in mapAttrs' homeConfig (importAll { root = ./home/platform; }); }; } -- cgit v1.2.3