Set up lima VM running nixos
Alan Pearce alan@alanpearce.eu
Sun, 23 Jul 2023 09:10:18 +0200
3 files changed, 35 insertions(+), 0 deletions(-)
M flake.nix → flake.nix
@@ -75,6 +75,15 @@ nix-index-database.hmModules.nix-index (secrets + "/default.nix") ]; }; + homeConfigurations."alan@nixos" = home-manager.lib.homeManagerConfiguration { + pkgs = aarch64LinuxPackages; + extraSpecialArgs = { inherit attrs; }; + modules = [ + ./user/lima.nix + nix-index-database.hmModules.nix-index + (secrets + "/default.nix") + ]; + }; homeConfigurations."alan@pappel" = home-manager.lib.homeManagerConfiguration { pkgs = nixosPkgs; extraSpecialArgs = { inherit attrs; };
A user/lima.nix
@@ -0,0 +1,24 @@+{ pkgs, ... }: +{ + imports = [ + ./modules/tabnine.nix + ./settings/base.nix + ./settings/development/base.nix + ./settings/git.nix + ./settings/nix.nix + ./settings/nixos.nix + ./settings/ssh.nix + ./settings/zsh.nix + ]; + home = { + username = "alan"; + homeDirectory = "/home/alan.linux"; + stateVersion = "22.11"; + }; + # home-manager complains when setting nix.conf otherwise + nix.package = pkgs.nix; + nix.settings = { + max-jobs = 4; + experimental-features = "nix-command flakes"; + }; +}
M user/settings/development/base.nix → user/settings/development/base.nix
@@ -37,6 +37,7 @@ if !stdenv.isDarwin then [ httping ] else [ + lima-bin colima docker-client ] @@ -48,6 +49,7 @@ }) ]; home.sessionVariables = { FLY_NO_UPDATE_CHECK = "1"; + LIMA_INSTANCE = "nixos"; }; programs.direnv = {