Skip to content

Instantly share code, notes, and snippets.

@mingaleg
Created June 29, 2023 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mingaleg/1ab429744887f2c86b5e25fa8fc9b990 to your computer and use it in GitHub Desktop.
Save mingaleg/1ab429744887f2c86b5e25fa8fc9b990 to your computer and use it in GitHub Desktop.
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running `nixos-help`).
{ config, pkgs, callPackage, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./vbox-guest.nix
];
nixpkgs.config.allowUnfree = true;
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "minganix";
# Set your time zone.
time.timeZone = "Europe/London";
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
useXkbConfig = true; # use xkbOptions in tty.
};
services.xserver = {
enable = true;
layout = "us";
# xkbOptions = "eurosign:e,caps:escape";
desktopManager = {
xterm.enable = false;
xfce = {
enable = true;
noDesktop = true;
enableXfwm = false;
};
};
displayManager.defaultSession = "none+i3";
windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [
dmenu
i3status
i3lock
i3blocks
];
};
};
sound.enable = true;
hardware.pulseaudio.enable = true;
users.users.mingaleg = {
isNormalUser = true;
extraGroups = [ "wheel" ];
packages = with pkgs; [
google-chrome
firefox
tree
];
};
environment = {
systemPackages = with pkgs; [
htop
vim
wget
];
pathsToLink = [ "/libexec" ];
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
system.copySystemConfiguration = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
}
{ config, pkgs, lib, ... }:
{
# TODO: remove me after https://github.com/NixOS/nixpkgs/pull/86473 is applied
services.xserver.videoDrivers = lib.mkForce [ "vmware" "virtualbox" "modesetting" ];
systemd.services.virtualbox-resize = {
description = "VirtualBox Guest Screen Resizing";
wantedBy = [ "multi-user.target" ];
requires = [ "dev-vboxguest.device" ];
after = [ "dev-vboxguest.device" ];
unitConfig.ConditionVirtualization = "oracle";
serviceConfig.ExecStart = "${config.boot.kernelPackages.virtualboxGuestAdditions}/bin/VBoxClient -fv --vmsvga";
};
virtualisation.virtualbox.guest = {
enable = true;
x11 = true;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment