Reorganize flake.nix to not require changing variables to install a fresh system
This commit is contained in:
parent
da423c8565
commit
c681e1ce5f
26
flake.nix
26
flake.nix
|
|
@ -46,13 +46,14 @@
|
|||
}@inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
host = "vm";
|
||||
profile = "desktop";
|
||||
username = "josh";
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
nixos = nixpkgs.lib.nixosSystem {
|
||||
vm = let
|
||||
host = "vm";
|
||||
profile = "desktop";
|
||||
username = "josh";
|
||||
in nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
|
|
@ -65,12 +66,16 @@
|
|||
];
|
||||
};
|
||||
|
||||
live = nixpkgs.lib.nixosSystem {
|
||||
live = let
|
||||
host = "installation-iso";
|
||||
profile = "desktop";
|
||||
username = "josh";
|
||||
in nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
host = "installation-iso";
|
||||
profile = "desktop";
|
||||
inherit host;
|
||||
inherit profile;
|
||||
inherit username;
|
||||
};
|
||||
modules = [
|
||||
|
|
@ -81,7 +86,10 @@
|
|||
};
|
||||
};
|
||||
|
||||
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
|
||||
homeConfigurations.josh = let
|
||||
profile = "desktop";
|
||||
username = "josh";
|
||||
in home-manager.lib.homeManagerConfiguration {
|
||||
extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
inherit profile;
|
||||
|
|
@ -89,7 +97,7 @@
|
|||
};
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
modules = [
|
||||
./homes/${username}/home.nix
|
||||
./homes/josh/home.nix
|
||||
stylix.homeModules.stylix
|
||||
];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ echo "Removing old qcow2 disk ..."
|
|||
rm -f ./vm.qcow2
|
||||
|
||||
echo "Building new VM ..."
|
||||
nix build .#nixosConfigurations.nixos.config.system.build.vm
|
||||
nix build .#nixosConfigurations.vm.config.system.build.vm
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to build VM"
|
||||
|
|
|
|||
Loading…
Reference in New Issue