Simplify flake.nix

This commit is contained in:
Joshua Yuen 2026-09-11 22:55:03 -04:00
parent 2937154e38
commit 8f0ca00343
Signed by: josh
GPG Key ID: 530DA0331EFE99F5
1 changed files with 38 additions and 64 deletions

102
flake.nix
View File

@ -47,98 +47,72 @@
}@inputs:
let
system = "x86_64-linux";
username = "josh";
profile = "desktop";
homePath = ./. + "/homes/${username}/home.nix";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [ nix-vscode-extensions.overlays.default ];
};
mkHost =
{
host,
extraModules ? [ ],
}:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit
homePath
host
inputs
profile
username
;
};
inherit pkgs;
modules = [ ./hosts/${host} ] ++ extraModules;
};
in
{
nixosConfigurations = {
laptop = let
host = "laptop";
profile = "desktop";
username = "josh";
in nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
inherit host;
inherit profile;
inherit username;
};
pkgs = pkgs;
modules = [
./hosts/${host}
];
};
laptop = mkHost { host = "laptop"; };
vm = let
host = "vm";
profile = "desktop";
username = "josh";
in nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
inherit host;
inherit profile;
inherit username;
};
pkgs = pkgs;
modules = [
./hosts/${host}
];
};
vm = mkHost { host = "vm"; };
live = let
live = mkHost {
host = "installation-iso";
profile = "desktop";
username = "josh";
in nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
inherit host;
inherit profile;
inherit username;
};
pkgs = pkgs;
modules = [
extraModules = [
(nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix")
{ environment.systemPackages = [ install-system.packages.${system}.default ]; }
./hosts/installation-iso
];
};
};
homeConfigurations.josh = let
profile = "desktop";
username = "josh";
gpgSigningKey = null;
in home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = {
inherit inputs;
inherit profile;
inherit username;
};
pkgs = pkgs;
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = {
inherit inputs profile username;
};
inherit pkgs;
modules = [
{
modules.gpg.signingKey = gpgSigningKey;
modules.gpg.signingKey = null;
}
./homes/josh/home.nix
homePath
stylix.homeModules.stylix
];
};
devShell.${system} = nixpkgs.legacyPackages.${system}.pkgs.mkShell {
packages = with nixpkgs.legacyPackages.${system}.pkgs; [
devShell.${system} = pkgs.mkShell {
packages = with pkgs; [
nil
nixd
];
};
formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-tree;
formatter.${system} = pkgs.nixfmt-tree;
};
}