diff --git a/cli/review-vm.nix b/cli/review-vm.nix deleted file mode 100644 index ddb8721..0000000 --- a/cli/review-vm.nix +++ /dev/null @@ -1,92 +0,0 @@ -{ - config, - pkgs, - ... -}: - -{ - microvm = { - hypervisor = "qemu"; - mem = 15360; - vcpu = 12; - - interfaces = [ - { - type = "user"; - id = "qemu"; - mac = "02:00:00:00:00:01"; - } - ]; - - writableStoreOverlay = "/nix/.rw-store"; - - shares = [ - { - proto = "9p"; - tag = "nixpkgs"; - source = "/home/duskyelf/Projects/nixpkgs"; - mountPoint = "/home/reviewer/nixpkgs-host"; - readOnly = true; - } - ]; - }; - - # Automatically log in the reviewer user on the serial console - services.getty.autologinUser = "reviewer"; - - users.users.reviewer = { - isNormalUser = true; - uid = 1000; - extraGroups = [ "wheel" ]; - password = ""; # No password for local login - }; - - # Ensure the reviewer user doesn't need a password for sudo just in case - security.sudo.wheelNeedsPassword = false; - - # Increase root tmpfs size to prevent "No space left on device" errors during large builds - fileSystems."/" = { - device = "tmpfs"; - fsType = "tmpfs"; - options = [ "size=12G" "mode=755" ]; - }; - - # Setup reviewer environment - systemd.services.setup-reviewer = { - wantedBy = [ "multi-user.target" ]; - after = [ "local-fs.target" ]; - serviceConfig.Type = "oneshot"; - script = '' - # Create a fast, native git clone that shares the object database with the host - # This completely bypasses all 9p permission/metadata issues while using zero extra RAM/disk - if [ ! -d /home/reviewer/nixpkgs/.git ]; then - ${pkgs.sudo}/bin/sudo -u reviewer ${pkgs.git}/bin/git clone --shared /home/reviewer/nixpkgs-host /home/reviewer/nixpkgs - fi - ''; - }; - - # Enable Nix flakes - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - - # Enable zram swap to survive heavy nix evaluation - zramSwap.enable = true; - zramSwap.memoryPercent = 100; - - environment.systemPackages = with pkgs; [ - nixpkgs-review - gh - ]; - - programs.git = { - enable = true; - config = { - safe.directory = "*"; - }; - }; - - # Microvm requires a state version - system.stateVersion = "25.11"; -} diff --git a/cli/sh.nix b/cli/sh.nix index 147b8b7..6020190 100644 --- a/cli/sh.nix +++ b/cli/sh.nix @@ -15,7 +15,6 @@ in home.shellAliases = { btw = "echo I use NixOS, btw"; get-nob = "curl -o nob.h https://raw.githubusercontent.com/tsoding/nob.h/main/nob.h"; - review-vm = "nix run /home/duskyelf/dotfiles#nixosConfigurations.review-vm.config.microvm.declaredRunner"; }; xdg.configFile."scripts" = { diff --git a/flake.nix b/flake.nix index 50e8105..228b19b 100644 --- a/flake.nix +++ b/flake.nix @@ -28,8 +28,6 @@ url = "sourcehut:~alexdavid/jail.nix"; }; - microvm = { - url = "github:astro/microvm.nix"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -83,11 +81,15 @@ # (Test-Kwalitee, Finance-Quote, etc.) will use the overridden version internally. (final: prev: { perl5 = prev.perl5.override { - overrides = _: prev.perl5.pkgs.overrideScope (finalself: prevself: { - ModuleCPANTSAnalyse = prevself.ModuleCPANTSAnalyse.overrideAttrs (old: { - doCheck = false; - }); - }); + overrides = + _: + prev.perl5.pkgs.overrideScope ( + finalself: prevself: { + ModuleCPANTSAnalyse = prevself.ModuleCPANTSAnalyse.overrideAttrs (old: { + doCheck = false; + }); + } + ); }; }) ]; @@ -145,17 +147,6 @@ ]; }; - nixosConfigurations.review-vm = nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit inputs pkgs-unstable; - }; - modules = [ - inputs.microvm.nixosModules.microvm - ./cli/review-vm.nix - ]; - }; - homeConfigurations."duskyelf@asus" = home-manager.lib.homeManagerConfiguration { inherit pkgs; modules = [ @@ -170,7 +161,12 @@ inputs.zen-browser.homeModules.beta ]; extraSpecialArgs = { - inherit inputs pkgs-unstable pkgs-unstable-small jail; + inherit + inputs + pkgs-unstable + pkgs-unstable-small + jail + ; }; };