configs/workstation/configuration.nix

216 lines
4.9 KiB
Nix
Raw Normal View History

2024-05-20 12:24:36 +02:00
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, ... }:
{
imports =
2024-08-06 10:13:59 +02:00
[
2024-05-20 12:24:36 +02:00
./hardware-configuration.nix
./k8s.nix
./podman.nix
2024-07-02 15:02:33 +02:00
./tty.nix
./aliases.nix
./zsh.nix
2024-08-06 10:13:59 +02:00
./incus.nix
./libvirt.nix
2024-05-20 12:24:36 +02:00
];
# Kernel
2024-10-25 08:43:31 +02:00
# boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
2024-08-29 14:23:46 +02:00
# Insecure
nixpkgs.config.permittedInsecurePackages = [
"electron-29.4.6"
];
2024-05-20 12:24:36 +02:00
# Use the systemd-boot EFI boot loader.
boot.loader.grub = {
enable = true;
zfsSupport = true;
efiSupport = true;
efiInstallAsRemovable = true;
mirroredBoots = [
{ devices = [ "nodev"]; path = "/boot"; }
];
};
zramSwap = {
enable = true;
algorithm = "zstd";
};
2024-08-06 10:20:32 +02:00
2024-05-20 12:24:36 +02:00
# firmaware
services.fwupd.enable = true;
2024-08-06 10:20:32 +02:00
2024-05-20 12:24:36 +02:00
# Bluetooth
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
2024-06-24 09:39:36 +02:00
#services.blueman.enable = true;
2024-08-06 10:20:32 +02:00
2024-05-20 12:24:36 +02:00
# enable unfree
nixpkgs.config.allowUnfree = true;
2024-08-06 10:20:32 +02:00
2024-05-20 12:24:36 +02:00
# Network
2024-08-06 10:20:32 +02:00
networking.nftables.enable = true;
2024-05-22 09:42:47 +02:00
networking.hostName = "work";
2024-05-20 12:24:36 +02:00
services.tailscale.enable = true;
networking.networkmanager.enable = true;
networking.hostId = "8425e349";
# Set your time zone.
time.timeZone = "Europe/Oslo";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "no";
};
# TuiGreet
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd sway";
user = "geir";
};
};
};
2024-10-25 08:52:07 +02:00
# Gnome
2024-10-25 09:08:34 +02:00
services.xserver.desktopManager.gnome.enable = true;
services.flatpak.enable = true;
2024-07-04 10:53:25 +02:00
# Emacs
2024-07-04 10:53:25 +02:00
services.emacs.enable = true;
2024-06-19 16:17:22 +02:00
2024-08-19 10:00:55 +02:00
# Enable flakes and other experimental features
nix = {
extraOptions = "experimental-features = nix-command flakes";
2024-10-25 08:52:07 +02:00
#package = pkgs.nixFlakes;
2024-08-19 10:00:55 +02:00
};
2024-05-20 12:24:36 +02:00
# Sway
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
};
services.dbus.enable = true;
xdg.portal = {
enable = true;
wlr.enable = true;
# gtk portal needed to make gtk apps happy
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};
# Configure keymap in X11
services.xserver.xkb.layout = "no";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
fonts.packages = with pkgs; [
noto-fonts
2024-10-25 08:52:07 +02:00
noto-fonts-cjk-sans
2024-05-20 12:24:36 +02:00
noto-fonts-emoji
liberation_ttf
dina-font
proggyfonts
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; })
];
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
};
2024-08-12 11:59:45 +02:00
hardware.pulseaudio.enable = false;
2024-05-20 12:24:36 +02:00
2024-06-11 09:35:50 +02:00
programs.steam.enable = true;
programs.zsh.enable = true;
2024-07-28 15:21:54 +02:00
services.teamviewer.enable = true;
2024-05-20 12:24:36 +02:00
users.users.geir = {
isNormalUser = true;
2024-08-06 10:16:43 +02:00
extraGroups = [ "networkmanager" "wheel" "libvirt" ];
2024-06-11 09:27:36 +02:00
shell = pkgs.zsh;
2024-05-20 12:24:36 +02:00
packages = with pkgs; [
2024-05-22 09:47:22 +02:00
teams-for-linux firefox ncpamixer starship discord fastfetch
2024-08-26 13:56:17 +02:00
emacsPackages.vterm zed-editor heroic virt-manager
2024-10-25 08:52:07 +02:00
chromium pavucontrol
2024-05-20 12:24:36 +02:00
];
};
2024-05-22 09:42:47 +02:00
2024-05-20 12:24:36 +02:00
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
2024-09-16 08:48:41 +02:00
foot kitty terminator
2024-05-20 12:24:36 +02:00
dbus
greetd.tuigreet
wayland
xdg-utils
2024-08-19 09:52:46 +02:00
nix-direnv
2024-09-16 08:48:41 +02:00
du-dust fd bat
2024-08-13 13:07:34 +02:00
# Sway
2024-05-20 12:24:36 +02:00
swaylock swayidle swaybg waybar fuzzel gammastep mako
2024-10-25 08:52:07 +02:00
neovim emacs
2024-08-13 13:07:34 +02:00
2024-05-20 12:24:36 +02:00
neofetch glances inxi htop bottom
wget curl
git
2024-07-02 15:02:33 +02:00
mc eza du-dust ripgrep
nix-direnv
2024-08-06 10:13:59 +02:00
distrobox
2024-08-12 11:57:26 +02:00
# OBS-studio
obs-studio
obs-studio-plugins.wlrobs
obs-studio-plugins.obs-vaapi
2024-07-02 15:02:33 +02:00
# Languages
zig
python3 python3Packages.pip
guile
go gotools golint
rustup
2024-08-13 13:07:34 +02:00
nodejs
2024-07-02 15:02:33 +02:00
# language servers
zls
python3Packages.python-lsp-server
gopls
luajitPackages.lua-lsp
nodePackages.bash-language-server
vimPlugins.cmp-nvim-lsp
ccls
gdb
2024-07-02 15:08:34 +02:00
marksman
2024-08-10 11:20:12 +02:00
# Editor
vscode
2024-07-02 15:02:33 +02:00
];
2024-05-20 12:24:36 +02:00
2024-08-18 15:40:05 +02:00
# Enable the OpenSSH daemon.
2024-05-20 12:24:36 +02:00
services.openssh.enable = true;
# zfs options
services.zfs.autoScrub.enable = true;
services.zfs.trim.enable = true;
# Open ports in the firewall.
2024-08-06 10:20:32 +02:00
2024-05-20 12:24:36 +02:00
networking.firewall.allowedTCPPorts = [ 22 ];
networking.firewall.allowedUDPPorts = [ 22 ];
networking.firewall.enable = true;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "23.11"; # Did you read the comment?
}