Files
nix/modules/nixos/config/host.nix
Gustavo "Guz" L. de Mello 25660d75cf feat: home server configuration
2024-01-23 17:34:04 -03:00

91 lines
2.4 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Config shared between all host's configuration.nix (NixOS config)
{ config, pkgs, inputs, lib, ... }:
let
cfg = config.host;
in
{
imports = [
inputs.home-manager.nixosModules.default
inputs.sops-nix.nixosModules.sops
../systems/localization.nix
];
options.host = {
networking = {
hostName = lib.mkOption {
default = "nixos";
type = lib.types.str;
description = "Define the host's network name";
};
wireless.enable = lib.mkOption {
default = false;
type = lib.types.bool;
description = "Enables wireless support";
};
};
time = {
timeZone = lib.mkOption {
type = lib.types.str;
description = "Sets host's time zone";
};
};
};
config = {
# Nix configuration
nix.settings.experimental-features = [ "nix-command" "flakes" ];
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
};
networking = {
networkmanager.enable = true;
hostName = cfg.networking.hostName;
wireless.enable = cfg.networking.wireless.enable;
# Configure network proxy if necessary
# proxy.default = "http://user:password@proxy:port/";
# proxy.noProxy = "127.0.0.1,localhost,internal.domain";
};
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
wireplumber.enable = true;
#jack.enable = true;
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
vim
neovim
git
lazygit
gcc # Added temporally so my neovim config doesn't break
wget
nixpkgs-fmt
nixpkgs-lint
];
environment.sessionVariables = {
EDITOR = "nvim";
};
# 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. Its 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.11"; # Did you read the comment?
};
}