206 lines
5.3 KiB
Nix
206 lines
5.3 KiB
Nix
# This is your system's configuration file.
|
|
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
|
|
{
|
|
inputs,
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}: {
|
|
# You can import other NixOS modules here
|
|
imports = [
|
|
# If you want to use modules your own flake exports (from modules/nixos):
|
|
# inputs.self.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
|
|
];
|
|
|
|
nixpkgs = {
|
|
# You can add overlays here
|
|
overlays = [
|
|
# Add overlays your own flake exports (from overlays and pkgs dir):
|
|
inputs.self.overlays.additions
|
|
inputs.self.overlays.modifications
|
|
inputs.self.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 = "";
|
|
download-buffer-size = 524288000;
|
|
# Workaround for https://github.com/NixOS/nix/issues/9574
|
|
nix-path = config.nix.nixPath;
|
|
};
|
|
# Opinionated: disable channels
|
|
channel.enable = false;
|
|
gc = {
|
|
automatic = true;
|
|
dates = "weekly";
|
|
options = "--delete-older-than 1w";
|
|
};
|
|
# 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;
|
|
extraOptions = ''
|
|
trusted-users = root catalin
|
|
'';
|
|
};
|
|
|
|
# FIXME: Add the rest of your current configuration
|
|
|
|
nixpkgs.config.allowBroken = true;
|
|
nixpkgs.config.permittedInsecurePackages = [ "electron-33.4.11" "mono-5.20.1.34" "qtwebengine-5.15.19" ];
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
boot.supportedFilesystems = [ "ntfs" ];
|
|
|
|
|
|
networking.networkmanager.enable = true;
|
|
services.mullvad-vpn.enable = true;
|
|
|
|
|
|
environment.sessionVariables.MOZ_ENABLE_WAYLAND = 0;
|
|
|
|
time.timeZone = "Europe/Madrid";
|
|
i18n.defaultLocale = "en_US.UTF-8";
|
|
i18n.extraLocaleSettings = {
|
|
LC_ADDRESS = "es_ES.UTF-8";
|
|
LC_IDENTIFICATION = "es_ES.UTF-8";
|
|
LC_MEASUREMENT = "es_ES.UTF-8";
|
|
LC_MONETARY = "es_ES.UTF-8";
|
|
LC_NAME = "es_ES.UTF-8";
|
|
LC_NUMERIC = "es_ES.UTF-8";
|
|
LC_PAPER = "es_ES.UTF-8";
|
|
LC_TELEPHONE = "es_ES.UTF-8";
|
|
LC_TIME = "es_ES.UTF-8";
|
|
};
|
|
|
|
networking.firewall = rec {
|
|
allowedTCPPortRanges = [ { from = 1714; to = 1764; } ];
|
|
allowedUDPPortRanges = allowedTCPPortRanges;
|
|
};
|
|
|
|
|
|
services.xserver = {
|
|
enable = true;
|
|
displayManager.gdm.enable = true;
|
|
desktopManager.gnome.enable = true;
|
|
windowManager.openbox.enable = true;
|
|
|
|
xkb = {
|
|
layout = "us";
|
|
variant = "";
|
|
};
|
|
};
|
|
|
|
services.printing.enable = true;
|
|
hardware.pulseaudio.enable = false;
|
|
security.rtkit.enable = true;
|
|
hardware.graphics.enable = true;
|
|
services.pipewire = {
|
|
enable = true;
|
|
alsa.enable = true;
|
|
alsa.support32Bit = true;
|
|
pulse.enable = true;
|
|
};
|
|
|
|
programs.firefox.enable = true;
|
|
programs = {
|
|
fish.enable = true;
|
|
steam = {
|
|
enable = true;
|
|
package = pkgs.steam.override {
|
|
extraLibraries = p: with p; [ (lib.getLib networkmanager) ];
|
|
};
|
|
};
|
|
};
|
|
|
|
xdg.portal.enable = true;
|
|
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
|
xdg.portal.config.common.default = "gtk";
|
|
|
|
programs.mtr.enable = true;
|
|
programs.dconf.enable = true;
|
|
programs.gnupg.agent = {
|
|
enable = true;
|
|
enableSSHSupport = true;
|
|
};
|
|
|
|
systemd.services.flatpak-repo = {
|
|
wantedBy = [ "multi-user.target" ];
|
|
path = [ pkgs.flatpak ];
|
|
script = ''
|
|
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
'';
|
|
};
|
|
|
|
|
|
fonts.packages = with pkgs; [
|
|
atkinson-hyperlegible
|
|
];
|
|
|
|
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
|
|
services.tailscale.enable = true;
|
|
virtualisation.docker.enable = true;
|
|
networking.nameservers = [ "192.168.1.7" "1.1.1.1" ];
|
|
|
|
|
|
system.autoUpgrade.enable = true;
|
|
|
|
environment.systemPackages = import ./packages.nix pkgs;
|
|
|
|
networking.hostName = "limgrave";
|
|
|
|
users.users = {
|
|
catalin = {
|
|
isNormalUser = true;
|
|
description = "catalin";
|
|
shell = pkgs.fish;
|
|
useDefaultShell = true;
|
|
extraGroups = [ "networkmanager" "wheel" "docker" "nas" ];
|
|
packages = with pkgs; [ flatpak ];
|
|
};
|
|
};
|
|
users.groups.nas.gid = 568;
|
|
|
|
|
|
services.openssh = {
|
|
enable = true;
|
|
settings = {
|
|
PermitRootLogin = "no";
|
|
PasswordAuthentication = true;
|
|
};
|
|
};
|
|
|
|
system.stateVersion = "24.11";
|
|
}
|