nix/system/global/system.nix
2023-04-15 13:55:16 +01:00

149 lines
3.2 KiB
Nix

# https://search.nixos.org/options
{ config, pkgs, ... }:
{
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
};
nix.settings.trusted-users = [ "root" "tristan" ];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.networkmanager.enable = true;
time.timeZone = "Europe/London";
console = {
font = "Lat2-Terminus16";
useXkbConfig = true;
};
# use pipewire
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
security.pam.services.swaylock = {};
security.doas.enable = true;
i18n.defaultLocale = "en_GB.UTF-8";
# Configure graphical stuff
services.xserver = {
enable = true;
layout = "gb";
libinput.enable = true;
# the only display manager that works?
displayManager.gdm.enable = true;
displayManager.autoLogin = {
enable = true;
user = "tristan";
};
};
qt.enable = true;
qt.platformTheme = "gtk2";
qt.style = "gtk2";
services.printing.enable = true;
# services.flatpak.enable = true;
xdg.portal.enable = true;
users.users.tristan = {
isNormalUser = true;
extraGroups = [ "wheel" "video" ];
initialPassword = "pass";
shell = pkgs.fish;
};
programs.fish.enable = true;
environment.variables = {
EDITOR = "nvim";
VISUAL = "nvim";
TERMINAL = "foot";
};
environment.systemPackages = with pkgs; [
foot
brave
tealdeer
alsa-utils
wofi
waybar
swaylock-effects
swayidle
swaybg
pcmanfm
pavucontrol
trash-cli
(neovim.override {
vimAlias = true;
configure = {
packages.myPlugins = with pkgs.vimPlugins; {
start = [ vim-surround vim-commentary vim-nix ];
opt = [];
};
customRC = ''
vnoremap * y/\V<C-R>=escape(@",'/\')<CR><CR>
vnoremap <C-R> "ry:%s/<C-R>=escape(@r,'/\')<CR>
vnoremap A :norm A
set number
set rnu
set ignorecase
set smartcase
set mouse=a
set path=.,**
let g:netrw_banner=0
let g:netrw_liststyle=3
set undofile
set undodir=~/.local/share/nvim/undo
'';
};
})
];
services.dbus.enable = true;
programs.light.enable = true;
programs.dconf.enable = true;
programs.hyprland.enable = true;
programs.tmux.enable = true;
programs.tmux.extraConfig = ''
set escape-time 0
set -g default-terminal screen
bind -n M-s split-window -v
bind -n M-v split-window -h
bind -n M-Enter split-window -h
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
bind -n M-q kill-pane
bind -n M-< resize-pane -L 10
bind -n M-> resize-pane -R 10
bind -n M-- resize-pane -D 10
bind -n M-+ resize-pane -U 10
bind -n M-u copy-mode
bind -n M-p paste-buffer
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
'';
}