Skip to content

Instantly share code, notes, and snippets.

@nekwebdev
Created June 30, 2024 02:49
Show Gist options
  • Save nekwebdev/e2ec4caa93b160fcefc3e72dcedbcced to your computer and use it in GitHub Desktop.
Save nekwebdev/e2ec4caa93b160fcefc3e72dcedbcced to your computer and use it in GitHub Desktop.
desktop install nixos config
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];/
# Bootloader.
boot.loader.grub.enable = true;
boot.loader.grub.efiSupport = true;
# boot.loader.grub.efiInstallAsRemovable = true;
boot.loader.grub.device = "nodev"; # Prevents GRUB from installing to a specific device
# boot.loader.grub.useOSProber = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/efi";
# Networking
networking.hostName = "lotus";
networking.networkmanager.enable = true;
# Set your timezone.
time.timeZone = "Pacific/Tahiti";
# Set internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# i18n.extraLocaleSettings = {
# LC_CTYPE = "en_US.UTF-8";
# LC_NUMERIC = "en_US.UTF-8";
# LC_TIME = "en_US.UTF-8";
# LC_COLLATE = "en_US.UTF-8";
# LC_MONETARY = "en_US.UTF-8";
# LC_MESSAGES = "en_US.UTF-8";
# LC_PAPER = "en_US.UTF-8";
# LC_NAME = "en_US.UTF-8";
# LC_ADDRESS = "en_US.UTF-8";
# LC_TELEPHONE = "en_US.UTF-8";
# LC_MEASUREMENT = "en_US.UTF-8";
# LC_IDENTIFICATION = "en_US.UTF-8";
# };
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# jack.enable = true;
};
users.users.user0 = {
isNormalUser = true;
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
vim
];
};
# Allow unfree packages.
nixpkgs.config.allowUnfree = true;
system.stateVersion = "24.05";
}
@nekwebdev
Copy link
Author

mount /dev/disk/by-label/nixos /mnt
mkdir -p /mnt/efi
mount -o umask=077 /dev/disk/by-label/EFI-NIX /mnt/efi
nixos-generate-config --root /mnt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment