Remove separate homeConfiguration from flake and minor cleanup
This commit is contained in:
parent
31e4a7f56f
commit
5add79250b
1 changed files with 17 additions and 25 deletions
42
flake.nix
42
flake.nix
|
@ -34,13 +34,16 @@
|
|||
# Build with `nixos-rebuild --flake .#<hostname>` or
|
||||
# `nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel
|
||||
nixosConfigurations = let
|
||||
sharedSpecialArgs = {
|
||||
threemaModules = threema.nixosModules;
|
||||
inherit pkgsUnstable;
|
||||
|
||||
};
|
||||
home-manager-config = {
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
extraSpecialArgs = {
|
||||
inherit pkgsUnstable;
|
||||
threemaModules = threema.nixosModules;
|
||||
extraSpecialArgs = sharedSpecialArgs // {
|
||||
pkgsEtaxesSg = fabianhauser-etaxes-sg.packages.${system};
|
||||
};
|
||||
users.fhauser = import ./home/fhauser/default.nix;
|
||||
|
@ -49,9 +52,8 @@
|
|||
mapHostnameToAttr = host:
|
||||
nixpkgs-stable.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = {
|
||||
specialArgs = sharedSpecialArgs // {
|
||||
hardwareModules = nixos-hardware.nixosModules;
|
||||
threemaModules = threema.nixosModules;
|
||||
};
|
||||
modules = [
|
||||
qois-infrastructure.nixosModule
|
||||
|
@ -62,30 +64,20 @@
|
|||
};
|
||||
in pkgsUnstable.lib.genAttrs hosts mapHostnameToAttr;
|
||||
|
||||
homeConfigurations = {
|
||||
fhauser = home-manager.lib.homeManagerConfiguration rec {
|
||||
inherit system;
|
||||
username = "fhauser";
|
||||
configuration = import ./home/${username}/default.nix;
|
||||
extraSpecialArgs = {
|
||||
inherit pkgsUnstable;
|
||||
threemaModules = threema.nixosModules;
|
||||
};
|
||||
|
||||
# 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";
|
||||
};
|
||||
};
|
||||
# Nix development shell
|
||||
devShell.${system} = import ./shell.nix { pkgs = pkgsUnstable; };
|
||||
|
||||
packages.${system}.defaultPackage.${system} = let
|
||||
configs = map (host: self.nixosConfigurations.${host}.config.system.build.toplevel) hosts;
|
||||
in pkgsUnstable.linkFarmFromDrvs "allHosts" configs;
|
||||
|
||||
# Run checks and build all hosts as default package
|
||||
packages.${system}.defaultPackage.${system} = with pkgsUnstable.lib;
|
||||
let
|
||||
checks = attrValues self.checks.${system};
|
||||
nixosConfigs = mapAttrsToList (n: v: v.config.system.build.toplevel)
|
||||
self.nixosConfigurations;
|
||||
in pkgsUnstable.linkFarmFromDrvs "allHosts" (checks ++ nixosConfigs);
|
||||
|
||||
apps.${system} = {
|
||||
|
||||
# Execute nixfmt on the repository
|
||||
format = let
|
||||
pkgs = pkgsUnstable;
|
||||
formatter = pkgsUnstable.writeShellScriptBin "formatter" ''
|
||||
|
|
Loading…
Add table
Reference in a new issue