Last active
November 9, 2021 08:28
-
-
Save joncol/043b75f8fe5866c9c6c84ce8ad481aa6 to your computer and use it in GitHub Desktop.
Basic NixOS configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ | |
./hardware-configuration.nix | |
]; | |
boot.kernelPackages = pkgs.linuxPackages_latest; | |
# Use the systemd-boot EFI boot loader. | |
boot.loader.systemd-boot.enable = true; | |
boot.loader.efi.canTouchEfiVariables = true; | |
networking.hostName = "nixos-i5"; | |
# Set your time zone. | |
time.timeZone = "Europe/Stockholm"; | |
# The global useDHCP flag is deprecated, therefore explicitly set to false here. | |
# Per-interface useDHCP will be mandatory in the future, so this generated config | |
# replicates the default behaviour. | |
networking.useDHCP = false; | |
networking.interfaces.enp3s0.useDHCP = true; | |
# Configure network proxy if necessary | |
# networking.proxy.default = "http://user:password@proxy:port/"; | |
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; | |
# Select internationalisation properties. | |
i18n.defaultLocale = "en_US.UTF-8"; | |
console = { | |
# font = "Lat2-Terminus16"; | |
keyMap = "colemak"; | |
}; | |
# 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.layout = "us"; | |
# services.xserver.xkbOptions = "eurosign:e"; | |
# Enable CUPS to print documents. | |
# services.printing.enable = true; | |
# Enable sound. | |
# sound.enable = true; | |
# hardware.pulseaudio.enable = true; | |
# Enable touchpad support (enabled default in most desktopManager). | |
# services.xserver.libinput.enable = true; | |
# Define a user account. Don't forget to set a password with ‘passwd’. | |
users.users.jco = { | |
isNormalUser = true; | |
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. | |
openssh.authorizedKeys.keys = [ | |
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICeNAO7sQRzLW3vp2lGfLAAL2P5aioMsaE+PbawB92hC jco@arch-desktop" | |
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDC8+wltwfq5RHa+ZxfBWmwc6L3fPutBIPy4BgKePgCVwYQ9agt9QecoAb3Z6sPKFv3WfdWssRKfKW3vg8nhVFLwtw5vhTneEny5XprS/biSqX66hbR/yRXNQV17pd86knqyfQmlf7d5yvEdmWg775fsa6YrntGbFrZS1RT+Q3hhBbVtApxVHn0r+ZuBWLKFFU0rqQXRxABw10gRSBNKJlsoqTEO08KJMbiaNR79nne0Za48YTf5OmiXiNfx6SmgADx5BM6Wf0Xtj/04COCmWn1OZLXmVQT8jR3Agnd477T8PLcXFHcnc4nTXc/GuoPe/O4tIbBItATyYgKQ9YetZCn jco@arch-thinkpad" | |
]; | |
}; | |
# List packages installed in system profile. To search, run: | |
# $ nix search wget | |
environment.systemPackages = with pkgs; [ | |
direnv | |
git | |
git-crypt | |
gnupg | |
jq | |
nix_2_4 | |
nix-direnv | |
ripgrep | |
stow | |
tmux | |
pinentry | |
vim | |
wget | |
google-chrome | |
]; | |
# List services that you want to enable: | |
# Enable the OpenSSH daemon. | |
services.openssh = { | |
enable = true; | |
passwordAuthentication = false; | |
permitRootLogin = "no"; | |
challengeResponseAuthentication = true; | |
}; | |
# Open ports in the firewall. | |
# networking.firewall.allowedTCPPorts = [ ... ]; | |
# networking.firewall.allowedUDPPorts = [ ... ]; | |
# Or disable the firewall altogether. | |
# networking.firewall.enable = false; | |
# 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 = "21.05"; # Did you read the comment? | |
nixpkgs.config.allowUnfree = true; | |
nix.package = pkgs.nixUnstable; | |
nix.extraOptions = '' | |
experimental-features = nix-command flakes | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment