diff --git a/configuration.nix b/configuration/desktop.nix similarity index 100% rename from configuration.nix rename to configuration/desktop.nix diff --git a/configuration/vm.nix b/configuration/vm.nix new file mode 100755 index 0000000..45e4473 --- /dev/null +++ b/configuration/vm.nix @@ -0,0 +1,87 @@ +{ + pkgs, + ... +}: + +{ + # NixOS version. + system.stateVersion = "25.05"; + + # Enable flakes. + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + # Allow unfree packages. + nixpkgs.config.allowUnfree = true; + + # Configure the bootloader. + boot.loader.grub = { + enable = true; + device = "/dev/sda"; + }; + + # Set time zone. + time.timeZone = "Australia/Perth"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_AU.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_AU.UTF-8"; + LC_IDENTIFICATION = "en_AU.UTF-8"; + LC_MEASUREMENT = "en_AU.UTF-8"; + LC_MONETARY = "en_AU.UTF-8"; + LC_NAME = "en_AU.UTF-8"; + LC_NUMERIC = "en_AU.UTF-8"; + LC_PAPER = "en_AU.UTF-8"; + LC_TELEPHONE = "en_AU.UTF-8"; + LC_TIME = "en_AU.UTF-8"; + }; + + # Configure keymap in X11. + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + # Define a user account. + users.users.docker = { + isNormalUser = true; + extraGroups = [ + "wheel" + "docker" + ]; + }; + + # Install some packages. + programs.git.enable = true; + + programs.neovim = { + enable = true; + defaultEditor = true; # Use neovim as default terminal editor. + configure = { + customRC = '' + set expandtab + set shiftwidth=2 + set tabstop=8 + set softtabstop=2 + set number + colorscheme kanagawa-dragon + ''; + packages.myVimPackage = with pkgs.vimPlugins; { + start = [ kanagawa-nvim ]; + }; + }; + }; + + # Enable SSH server + services.openssh.enable = true; + + # Enable avahi hostname resolution. + services.avahi = { + enable = true; + nssmdns4 = true; + }; +} diff --git a/flake.nix b/flake.nix index 967e3b5..faa523a 100755 --- a/flake.nix +++ b/flake.nix @@ -34,9 +34,18 @@ lanzaboote.nixosModules.lanzaboote nixos-hardware.nixosModules.lenovo-thinkpad-t480 - ./configuration.nix + ./configuration/desktop.nix ./hardware-configuration/muskduck.nix # Include the results of the hardware scan. ]; }; + + nixosConfigurations.vm = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + + modules = [ + ./configuration/vm.nix + ./hardware-configuration/vm.nix # Include the results of the hardware scan. + ]; + }; }; }