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:
|
}@inputs:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
host = "vm";
|
|
||||||
profile = "desktop";
|
|
||||||
username = "josh";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
nixos = nixpkgs.lib.nixosSystem {
|
vm = let
|
||||||
|
host = "vm";
|
||||||
|
profile = "desktop";
|
||||||
|
username = "josh";
|
||||||
|
in nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit inputs;
|
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;
|
inherit system;
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
host = "installation-iso";
|
inherit host;
|
||||||
profile = "desktop";
|
inherit profile;
|
||||||
inherit username;
|
inherit username;
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
|
|
@ -81,7 +86,10 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
|
homeConfigurations.josh = let
|
||||||
|
profile = "desktop";
|
||||||
|
username = "josh";
|
||||||
|
in home-manager.lib.homeManagerConfiguration {
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
inherit profile;
|
inherit profile;
|
||||||
|
|
@ -89,7 +97,7 @@
|
||||||
};
|
};
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
modules = [
|
modules = [
|
||||||
./homes/${username}/home.nix
|
./homes/josh/home.nix
|
||||||
stylix.homeModules.stylix
|
stylix.homeModules.stylix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ echo "Removing old qcow2 disk ..."
|
||||||
rm -f ./vm.qcow2
|
rm -f ./vm.qcow2
|
||||||
|
|
||||||
echo "Building new VM ..."
|
echo "Building new VM ..."
|
||||||
nix build .#nixosConfigurations.nixos.config.system.build.vm
|
nix build .#nixosConfigurations.vm.config.system.build.vm
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Failed to build VM"
|
echo "Failed to build VM"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue