Skip to content

Instantly share code, notes, and snippets.

@malev
Last active October 10, 2024 21:29
Show Gist options
  • Save malev/1ba8c09a0d63704b15b222f28a0f424f to your computer and use it in GitHub Desktop.
Save malev/1ba8c09a0d63704b15b222f28a0f424f to your computer and use it in GitHub Desktop.
Nix flakes
{ pkgs, ... }: {
imports = [ ./hardware-configuration.nix ];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "eva04"; # Define your hostname.
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "America/Chicago";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.malev = {
isNormalUser = true;
description = "malev";
extraGroups = [ "docker" "networkmanager" "wheel" ];
shell = pkgs.zsh;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN3TfkWl/U0TJwQYi686C3/aQ5rKQpjts27uo1cGdb5K [email protected]"
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDRV8R+3ThZ82C/1dSc7x0IwyxGmjA9kPY2rVNLEUMcPS8jomZNB0TCqaD0ppZmVx19ePLKAmIUigukKM6V47WO0C7Ospwt2JLJhEfLrhWl+7n1fS/BbfIxLSb6JI3FmrkMfxYC3oZUMCqg6siephqM3r3O8p2JKgoBln6CLeMqhNL0TjJV+NPfCQ/kLWqYhz8P1R+UZjyOBQoBfOjLm2XI2JSZ527QAGs4oGbwTjNrfPqhH/GhknMXIh2j0Jx3eGFlsL7wC5+H9jpVid4VIvAAa60AFznJz0rc3NKEiItO5+oqJI9vnBJ+0zKXsIpkZpzcX2eFsryNYTRCDzROVUSDm9GpfpADTgSgwrj6kgAwmz5rmpDVUIWEVxcLOAExSsUImlRlLrsPWVPG9rN7Fx6RN5kgT1oTgf3Psb5slQ2PhBuJDVa2MlLC3dkAkwd4EKOJMwAOxsS8k1hSJJLTKyqiGONZ36Si3wNv9UguMfAurbq/YNZnGKJKczp/l+ut6GU= [email protected]"
];
};
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
git
htop
k3s
kubectx
kubectl
kubernetes-helm
neovim
];
programs.zsh.enable = true;
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.openssh.settings.PasswordAuthentication = false;
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
system.stateVersion = "24.05"; # Did you read the comment?
}
{
description = "NixOS flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, ... }@inputs:
let inherit (self) outputs;
in {
nixosConfigurations = {
eva04 = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = [ ./configuration.nix ];
};
};
};
}
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/c8e0f417-0bb2-49dd-bc32-8602e3111d51";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/999B-F740";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp2s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment