diff --git a/flake.nix b/flake.nix index a4fcfbb..533dbcb 100644 --- a/flake.nix +++ b/flake.nix @@ -68,7 +68,6 @@ flake-parts.lib.mkFlake {inherit inputs;} { imports = [ inputs.agenix-rekey.flakeModule - ./vm.nix ./formatter.nix ./hosts ]; diff --git a/justfile b/justfile index f02094a..21f5a47 100644 --- a/justfile +++ b/justfile @@ -5,48 +5,6 @@ nixcmd := "nix --experimental-features 'nix-command flakes'" @_default: just --list -[group('vm')] -vm-build: - git add . - echo "Building VM..." - {{ nixcmd }} build .#vm - echo "VM built." - sudo chmod 777 result/nixos.qcow2 - echo "VM permissions set." - -[group('vm')] -vm-reload: - echo "Reloading VM..." - virsh destroy nixos - virsh start nixos - echo "VM reloaded." - -[group('vm')] -vm-switch: vm-build vm-reload - -[group('vm')] -vm-init: - virsh pool-define-as nixos dir - - - - $HOME/.local/libvirt/images/nixos - virsh pool-build nixos - virsh pool-start nixos - virt-install \ - --name nixos \ - --os-variant=nixos-24.05 \ - --memory 8192 \ - --vcpus=4,maxvcpus=8 \ - --cpu host \ - --disk result/nixos.qcow2 \ - --network user \ - --virt-type kvm \ - --import \ - --graphics spice - -[group('vm')] -vm-destroy: - virsh destroy nixos - virsh pool-destroy nixos - virsh pool-undefine nixos - [doc("Build a flake output")] build target='': @{{ nixcmd }} run nixpkgs#nix-output-monitor -- build {{ justfile_directory() }}#{{ target }} diff --git a/vm.nix b/vm.nix deleted file mode 100644 index 60af985..0000000 --- a/vm.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - hostname, - version, - inputs, - ... -}: let - username = "vm"; -in { - perSystem = { - system, - pkgs, - ... - }: { - packages.vm = inputs.nixos-generators.nixosGenerate { - specialArgs = { - inherit inputs system pkgs hostname version username; - }; - - modules = [ - inputs.home-manager.nixosModules.home-manager - inputs.agenix.nixosModules.default - inputs.agenix-rekey.nixosModules.default - ./modules/base/user.nix - ./modules/required.nix - ./modules/shell.nix - ./modules/graphical.nix - { - users.users.${username} = { - isNormalUser = true; - extraGroups = ["wheel" "networkmanager" "libvirt" "kvm"]; - }; - monitors = [{resolution = "1920x1080";}]; - services.qemuGuest.enable = true; - services.spice-vdagentd.enable = true; - } - ]; - inherit system; - format = "qcow"; - }; - }; -}