mirror of
https://github.com/heyitschloehawthorne/nix-config.git
synced 2025-12-15 10:48:39 +11:00
144 lines
3.9 KiB
Nix
144 lines
3.9 KiB
Nix
# This is your system's configuration file.
|
|
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
|
|
{
|
|
inputs,
|
|
outputs,
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}: {
|
|
# You can import other NixOS modules here
|
|
imports = [
|
|
|
|
# If you want to use modules your own flake exports (from modules/nixos):
|
|
# outputs.nixosModules.example
|
|
|
|
# Or modules from other flakes (such as nixos-hardware):
|
|
# inputs.hardware.nixosModules.common-cpu-amd
|
|
# inputs.hardware.nixosModules.common-ssd
|
|
|
|
# You can also split up your configuration and import pieces of it here:
|
|
# ./users.nix
|
|
|
|
# Import your generated (nixos-generate-config) hardware configuration
|
|
./hardware-configuration.nix
|
|
|
|
# Import system packages
|
|
./pkgs.nix
|
|
];
|
|
|
|
nixpkgs = {
|
|
# You can add overlays here
|
|
overlays = [
|
|
# Add overlays your own flake exports (from overlays and pkgs dir):
|
|
outputs.overlays.additions
|
|
outputs.overlays.modifications
|
|
outputs.overlays.unstable-packages
|
|
|
|
# You can also add overlays exported from other flakes:
|
|
# neovim-nightly-overlay.overlays.default
|
|
|
|
# Or define it inline, for example:
|
|
# (final: prev: {
|
|
# hi = final.hello.overrideAttrs (oldAttrs: {
|
|
# patches = [ ./change-hello-to-hi.patch ];
|
|
# });
|
|
# })
|
|
];
|
|
# Configure your nixpkgs instance
|
|
config = {
|
|
# Disable if you don't want unfree packages
|
|
allowUnfree = true;
|
|
};
|
|
};
|
|
|
|
|
|
nix = let
|
|
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
|
|
in {
|
|
settings = {
|
|
# Enable flakes and new 'nix' command
|
|
experimental-features = "nix-command flakes";
|
|
# Opinionated: disable global registry
|
|
flake-registry = "";
|
|
# Workaround for https://github.com/NixOS/nix/issues/9574
|
|
nix-path = config.nix.nixPath;
|
|
};
|
|
# Opinionated: disable channels
|
|
channel.enable = false;
|
|
|
|
# Opinionated: make flake registry and nix path match flake inputs
|
|
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
|
|
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
|
|
};
|
|
|
|
# Bootloader.
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
boot.loader.timeout = 0;
|
|
|
|
#Networking
|
|
networking.hostName = "xenia";
|
|
networking.networkmanager.enable = true;
|
|
|
|
#Time Zone and Locale
|
|
time.timeZone = "Australia/Sydney";
|
|
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";
|
|
};
|
|
|
|
#Display Server and Desktop Environment
|
|
services.xserver.enable = true;
|
|
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;
|
|
};
|
|
|
|
# TODO: Configure your system-wide user settings (groups, etc), add more users as needed.
|
|
users.users = {
|
|
chloe = {
|
|
isNormalUser = true;
|
|
openssh.authorizedKeys.keys = [
|
|
# TODO: Add your SSH public key(s) here, if you plan on using SSH to connect
|
|
];
|
|
extraGroups = ["networkmanager" "wheel"];
|
|
};
|
|
};
|
|
|
|
# This setups a SSH server. Very important if you're setting up a headless system.
|
|
# Feel free to remove if you don't need it.
|
|
services.openssh = {
|
|
enable = true;
|
|
settings = {
|
|
PermitRootLogin = "no";
|
|
PasswordAuthentication = false;
|
|
};
|
|
};
|
|
|
|
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
|
system.stateVersion = "23.05";
|
|
}
|