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
|
# Build with `nixos-rebuild --flake .#<hostname>` or
|
||||||
# `nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel
|
# `nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel
|
||||||
nixosConfigurations = let
|
nixosConfigurations = let
|
||||||
|
sharedSpecialArgs = {
|
||||||
|
threemaModules = threema.nixosModules;
|
||||||
|
inherit pkgsUnstable;
|
||||||
|
|
||||||
|
};
|
||||||
home-manager-config = {
|
home-manager-config = {
|
||||||
home-manager = {
|
home-manager = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = sharedSpecialArgs // {
|
||||||
inherit pkgsUnstable;
|
|
||||||
threemaModules = threema.nixosModules;
|
|
||||||
pkgsEtaxesSg = fabianhauser-etaxes-sg.packages.${system};
|
pkgsEtaxesSg = fabianhauser-etaxes-sg.packages.${system};
|
||||||
};
|
};
|
||||||
users.fhauser = import ./home/fhauser/default.nix;
|
users.fhauser = import ./home/fhauser/default.nix;
|
||||||
|
@ -49,9 +52,8 @@
|
||||||
mapHostnameToAttr = host:
|
mapHostnameToAttr = host:
|
||||||
nixpkgs-stable.lib.nixosSystem {
|
nixpkgs-stable.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = {
|
specialArgs = sharedSpecialArgs // {
|
||||||
hardwareModules = nixos-hardware.nixosModules;
|
hardwareModules = nixos-hardware.nixosModules;
|
||||||
threemaModules = threema.nixosModules;
|
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
qois-infrastructure.nixosModule
|
qois-infrastructure.nixosModule
|
||||||
|
@ -62,30 +64,20 @@
|
||||||
};
|
};
|
||||||
in pkgsUnstable.lib.genAttrs hosts mapHostnameToAttr;
|
in pkgsUnstable.lib.genAttrs hosts mapHostnameToAttr;
|
||||||
|
|
||||||
homeConfigurations = {
|
# Nix development shell
|
||||||
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";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
devShell.${system} = import ./shell.nix { pkgs = pkgsUnstable; };
|
devShell.${system} = import ./shell.nix { pkgs = pkgsUnstable; };
|
||||||
|
|
||||||
packages.${system}.defaultPackage.${system} = let
|
# Run checks and build all hosts as default package
|
||||||
configs = map (host: self.nixosConfigurations.${host}.config.system.build.toplevel) hosts;
|
packages.${system}.defaultPackage.${system} = with pkgsUnstable.lib;
|
||||||
in pkgsUnstable.linkFarmFromDrvs "allHosts" configs;
|
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} = {
|
apps.${system} = {
|
||||||
|
|
||||||
|
# Execute nixfmt on the repository
|
||||||
format = let
|
format = let
|
||||||
pkgs = pkgsUnstable;
|
pkgs = pkgsUnstable;
|
||||||
formatter = pkgsUnstable.writeShellScriptBin "formatter" ''
|
formatter = pkgsUnstable.writeShellScriptBin "formatter" ''
|
||||||
|
|
Loading…
Add table
Reference in a new issue