Skip to content

Commit

Permalink
flake: restructure and create sections
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerschtli committed Nov 30, 2021
1 parent f0d7893 commit ba34821
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@
, teamspeak-update-notifier
}:
let
pkgsPerSystem = system: import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [ overlay ];
};
rootPath = ./.;

## overlay config

unstablePerSystem = system: import unstable {
inherit system;
Expand Down Expand Up @@ -104,6 +102,16 @@
]);
};

## configure nixpkgs

pkgsPerSystem = system: import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [ overlay ];
};

## builder helper

customLibPerSystem = system: import ./lib {
inherit (nixpkgs) lib;
pkgs = pkgsPerSystem system;
Expand All @@ -117,30 +125,32 @@
{ lib.custom = customLibPerSystem system; }
];

## builder

buildHome = system: hostName: username: home-manager.lib.homeManagerConfiguration {
inherit username system;

configuration = ./hosts/${hostName}/home-${username}.nix;
homeDirectory = "/home/${username}";
extraModules = homeModulesPerSystem system;
extraSpecialArgs.rootPath = ./.;
extraSpecialArgs = { inherit rootPath; };
pkgs = pkgsPerSystem system;
stateVersion = "21.05";
};

buildNixOnDroid = system: device: nix-on-droid.lib.${system}.nix-on-droid {
config = import (./hosts + "/${device}/nix-on-droid.nix") {
inherit rootPath;
homeModules = homeModulesPerSystem system;
rootPath = ./.;
};
};

buildNixosSystem = system: hostName: nixpkgs.lib.nixosSystem {
inherit system;

specialArgs = {
inherit rootPath;
homeModules = homeModulesPerSystem system;
rootPath = ./.;
};

modules = [
Expand Down

0 comments on commit ba34821

Please sign in to comment.