Format every file

This commit is contained in:
Vili Sinervä 2024-06-02 16:18:19 +03:00
parent 4787fea598
commit cbe88024dd
No known key found for this signature in database
GPG key ID: DF8FEAF54EFAC996
13 changed files with 1034 additions and 932 deletions

View file

@ -1,37 +1,37 @@
#Basic system config #Basic system config
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
#################### Packages #################### #################### Packages ####################
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
rxvt-unicode-emoji rxvt-unicode-emoji
tmux tmux
git git
unison
nano nano
p7zip p7zip
tree tree
]; ];
#################### ZSH configuration #################### #################### ZSH configuration ####################
users.defaultUserShell = pkgs.zsh; users.defaultUserShell = pkgs.zsh;
environment.shells = with pkgs; [ zsh ]; environment.shells = with pkgs; [ zsh ];
programs.zsh = { programs.zsh = {
enable = true; enable = true;
autosuggestions.enable = true; autosuggestions.enable = true;
syntaxHighlighting.enable = true; syntaxHighlighting.enable = true;
ohMyZsh = { ohMyZsh = {
enable = true; enable = true;
plugins = [ "history-substring-search" "tmux" ]; plugins = [
"history-substring-search"
"tmux"
];
theme = "af-magic"; theme = "af-magic";
}; };
interactiveShellInit = interactiveShellInit = ''
''
ZSH_TMUX_AUTOSTART=false ZSH_TMUX_AUTOSTART=false
ZSH_TMUX_AUTOQUIT=false ZSH_TMUX_AUTOQUIT=false
ZSH_TMUX_CONFIG=/etc/tmux.conf ZSH_TMUX_CONFIG=/etc/tmux.conf
''; '';
promptInit = promptInit = ''
''
if [ -n "$IN_NIX_SHELL" ]; then if [ -n "$IN_NIX_SHELL" ]; then
setopt PROMPT_SUBST setopt PROMPT_SUBST
RPROMPT+='[nix]' RPROMPT+='[nix]'
@ -39,11 +39,9 @@ programs.zsh = {
''; '';
}; };
#################### tmux configuration ####################
#################### tmux configuration #################### programs.tmux.enable = true;
programs.tmux.enable = true; programs.tmux.extraConfig = ''
programs.tmux.extraConfig =
''
unbind C-b unbind C-b
set -g prefix M-w set -g prefix M-w
bind M-w send-prefix bind M-w send-prefix
@ -82,38 +80,39 @@ programs.tmux.extraConfig =
# unbind -n tab # unbind -n tab
''; '';
#################### SSH configuration #################### #################### SSH configuration ####################
services.openssh.enable = true; services.openssh.enable = true;
services.openssh.settings.PasswordAuthentication = false; services.openssh.settings.PasswordAuthentication = false;
users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBbGREoK1uVny1s8FK3KZ74Wmaf0VtifhqPyK69C/Gez vili@helium" ]; users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBbGREoK1uVny1s8FK3KZ74Wmaf0VtifhqPyK69C/Gez vili@helium"
];
#################### BASE #################### #################### BASE ####################
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
users.mutableUsers = false; # Force all user management to happen throught nix-files users.mutableUsers = false; # Force all user management to happen throught nix-files
# Select internationalisation properties. # Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
services.xserver.xkb = { services.xserver.xkb = {
layout = "us,"; layout = "us,";
variant = "de_se_fi,"; variant = "de_se_fi,";
}; };
console = pkgs.lib.mkForce { console = pkgs.lib.mkForce {
font = "Lat2-Terminus16"; font = "Lat2-Terminus16";
useXkbConfig = true; # use xkbOptions in tty. useXkbConfig = true; # use xkbOptions in tty.
}; };
time.timeZone = "Europe/Helsinki"; time.timeZone = "Europe/Helsinki";
#################### Housekeeping ####################
#################### Housekeeping #################### system.autoUpgrade = {
system.autoUpgrade = {
enable = true; enable = true;
dates = "04:00"; dates = "04:00";
randomizedDelaySec = "30min"; randomizedDelaySec = "30min";
}; };
nix = { nix = {
settings = { settings = {
auto-optimise-store = true; auto-optimise-store = true;
tarball-ttl = 0; tarball-ttl = 0;
@ -124,10 +123,10 @@ nix = {
dates = "05:00"; dates = "05:00";
randomizedDelaySec = "30min"; randomizedDelaySec = "30min";
}; };
}; };
# Copy the NixOS configuration file and link it from the resulting system # Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you # (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix. # accidentally delete configuration.nix.
system.copySystemConfiguration = true; system.copySystemConfiguration = true;
} }

View file

@ -9,21 +9,21 @@ let
ref = "main"; ref = "main";
}; };
in in
{ {
# Verification will be available soon, so keeping this here as a reminder # Verification will be available soon, so keeping this here as a reminder
# publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBbGREoK1uVny1s8FK3KZ74Wmaf0VtifhqPyK69C/Gez vili@helium"; # publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBbGREoK1uVny1s8FK3KZ74Wmaf0VtifhqPyK69C/Gez vili@helium";
# nix.settings.experimental-features = "verified-fetches"; # nix.settings.experimental-features = "verified-fetches";
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
"${repo}/machine-confs/${host}.nix" "${repo}/machine-confs/${host}.nix"
]; ];
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions # settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave # 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. # this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = stateVersion; # Did you read the comment? system.stateVersion = stateVersion; # Did you read the comment?
} }

View file

@ -1,15 +1,14 @@
#Config for graphical desktop #Config for graphical desktop
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
i3status-conf = "${pkgs.writeText "i3status-conf" i3status-conf = "${pkgs.writeText "i3status-conf" ''
'' # i3status configuration file.
# i3status configuration file. # see "man i3status" for documentation.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8. # It is important that this file is edited as UTF-8.
# The following line should contain a sharp s: # The following line should contain a sharp s:
# ß # ß
# If the above line is not correctly displayed, fix your editor first! # If the above line is not correctly displayed, fix your editor first!
general { general {
output_format = "i3bar" output_format = "i3bar"
@ -34,7 +33,7 @@ let
} }
disk "/" { disk "/" {
# format = " hdd %avail " # format = " hdd %avail "
format = " %avail " format = " %avail "
} }
@ -49,20 +48,20 @@ let
} }
battery all { battery all {
# format = "%status %percentage %remaining %emptytime" # format = "%status %percentage %remaining %emptytime"
format = " bat %status %percentage (%remaining left) " format = " bat %status %percentage (%remaining left) "
format_down = "" format_down = ""
last_full_capacity = true last_full_capacity = true
integer_battery_capacity = true integer_battery_capacity = true
# status_chr = "" # status_chr = ""
status_chr = "" status_chr = ""
# status_bat = "bat" # status_bat = "bat"
# status_bat = "☉" # status_bat = "☉"
# status_bat = "" # status_bat = ""
status_bat = "" status_bat = ""
# status_unk = "?" # status_unk = "?"
status_unk = "" status_unk = ""
# status_full = "" # status_full = ""
status_full = "" status_full = ""
low_threshold = 30 low_threshold = 30
threshold_type = time threshold_type = time
@ -82,16 +81,15 @@ let
timezone = "Europe/Helsinki" timezone = "Europe/Helsinki"
hide_if_equals_localtime = true hide_if_equals_localtime = true
} }
''}"; ''}";
i3-conf = "${pkgs.writeText "i3config" i3-conf = "${pkgs.writeText "i3config" ''
'' # Set mod key (Mod1=<Alt>, Mod4=<Super>)
# Set mod key (Mod1=<Alt>, Mod4=<Super>)
set $mod Mod4 set $mod Mod4
# Workspace names # Workspace names
# to display names or symbols instead of plain workspace numbers you can use # to display names or symbols instead of plain workspace numbers you can use
# something like: set $ws1 1:mail # something like: set $ws1 1:mail
# set $ws2 2: # set $ws2 2:
set $ws1 1 set $ws1 1
set $ws2 2 set $ws2 2
set $ws3 3 set $ws3 3
@ -113,7 +111,7 @@ i3-conf = "${pkgs.writeText "i3config"
set $ws19 19 set $ws19 19
set $ws20 20 set $ws20 20
# switch to workspace # switch to workspace
bindsym $mod+1 workspace $ws1 bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2 bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3 bindsym $mod+3 workspace $ws3
@ -135,7 +133,7 @@ i3-conf = "${pkgs.writeText "i3config"
bindsym $mod+Mod1+9 workspace $ws19 bindsym $mod+Mod1+9 workspace $ws19
bindsym $mod+Mod1+0 workspace $ws20 bindsym $mod+Mod1+0 workspace $ws20
# Move focused container to workspace # Move focused container to workspace
bindsym $mod+Ctrl+1 move container to workspace $ws1 bindsym $mod+Ctrl+1 move container to workspace $ws1
bindsym $mod+Ctrl+2 move container to workspace $ws2 bindsym $mod+Ctrl+2 move container to workspace $ws2
bindsym $mod+Ctrl+3 move container to workspace $ws3 bindsym $mod+Ctrl+3 move container to workspace $ws3
@ -157,7 +155,7 @@ i3-conf = "${pkgs.writeText "i3config"
bindsym $mod+Mod1+Ctrl+9 move container to workspace $ws19 bindsym $mod+Mod1+Ctrl+9 move container to workspace $ws19
bindsym $mod+Mod1+Ctrl+0 move container to workspace $ws20 bindsym $mod+Mod1+Ctrl+0 move container to workspace $ws20
# Move to workspace with focused container # Move to workspace with focused container
bindsym $mod+Shift+1 move container to workspace $ws1; workspace $ws1 bindsym $mod+Shift+1 move container to workspace $ws1; workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2; workspace $ws2 bindsym $mod+Shift+2 move container to workspace $ws2; workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3; workspace $ws3 bindsym $mod+Shift+3 move container to workspace $ws3; workspace $ws3
@ -179,91 +177,91 @@ i3-conf = "${pkgs.writeText "i3config"
bindsym $mod+Mod1+Shift+9 move container to workspace $ws19; workspace $ws19 bindsym $mod+Mod1+Shift+9 move container to workspace $ws19; workspace $ws19
bindsym $mod+Mod1+Shift+0 move container to workspace $ws20; workspace $ws20 bindsym $mod+Mod1+Shift+0 move container to workspace $ws20; workspace $ws20
# Configure border style <normal|1pixel|pixel xx|none|pixel> # Configure border style <normal|1pixel|pixel xx|none|pixel>
default_border pixel 3 default_border pixel 3
default_floating_border normal default_floating_border normal
# Hide borders # Hide borders
hide_edge_borders none hide_edge_borders none
# Font for window titles. Will also be used by the bar unless a different font # Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below. # is used in the bar {} block below.
font xft:URWGothic-Book 14 font xft:URWGothic-Book 14
# Use Mouse+$mod to drag floating windows # Use Mouse+$mod to drag floating windows
floating_modifier $mod floating_modifier $mod
# start a terminal # start a terminal
bindsym $mod+Return exec urxvt bindsym $mod+Return exec urxvt
# kill focused window # kill focused window
bindsym $mod+Shift+q kill bindsym $mod+Shift+q kill
# start program launcher # start program launcher
bindsym $mod+d exec --no-startup-id "rofi -theme 'Arc-Dark' -show combi -combi-modes 'run,ssh' -modes combi" bindsym $mod+d exec --no-startup-id "rofi -theme 'Arc-Dark' -show combi -combi-modes 'run,ssh' -modes combi"
# change focus # change focus
# bindsym $mod+i focus left # bindsym $mod+i focus left
# bindsym $mod+n focus down # bindsym $mod+n focus down
# bindsym $mod+e focus up # bindsym $mod+e focus up
# bindsym $mod+o focus right # bindsym $mod+o focus right
bindsym $mod+h focus left bindsym $mod+h focus left
bindsym $mod+j focus down bindsym $mod+j focus down
bindsym $mod+k focus up bindsym $mod+k focus up
bindsym $mod+l focus right bindsym $mod+l focus right
# MARK! # MARK!
# alternatively, you can use the cursor keys: # alternatively, you can use the cursor keys:
bindsym $mod+Left focus left bindsym $mod+Left focus left
bindsym $mod+Down focus down bindsym $mod+Down focus down
bindsym $mod+Up focus up bindsym $mod+Up focus up
bindsym $mod+Right focus right bindsym $mod+Right focus right
# move focused window # move focused window
# bindsym $mod+Shift+i move left # bindsym $mod+Shift+i move left
# bindsym $mod+Shift+n move down # bindsym $mod+Shift+n move down
# bindsym $mod+Shift+e move up # bindsym $mod+Shift+e move up
# bindsym $mod+Shift+o move right # bindsym $mod+Shift+o move right
bindsym $mod+Shift+h move left bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right bindsym $mod+Shift+l move right
# MARK! # MARK!
# alternatively, you can use the cursor keys: # alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right bindsym $mod+Shift+Right move right
# split orientation # split orientation
# bindsym $mod+h split h;exec notify-send 'tile horizontally' # bindsym $mod+h split h;exec notify-send 'tile horizontally'
bindsym $mod+e split h;exec notify-send 'tile horizontally' bindsym $mod+e split h;exec notify-send 'tile horizontally'
# MARK! # MARK!
bindsym $mod+v split v;exec notify-send 'tile vertically' bindsym $mod+v split v;exec notify-send 'tile vertically'
# toggle fullscreen mode for the focused container # toggle fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split) # change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed bindsym $mod+w layout tabbed
# bindsym $mod+l layout toggle split # bindsym $mod+l layout toggle split
# MARK! # MARK!
# toggle tiling / floating # toggle tiling / floating
bindsym $mod+Shift+space floating toggle bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows # change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle bindsym $mod+space focus mode_toggle
# reload the configuration file # reload the configuration file
bindsym $mod+Shift+c reload bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) # restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart bindsym $mod+Shift+r restart
# Resize window (you can also use the mouse for that) # Resize window (you can also use the mouse for that)
bindsym $mod+r mode "resize" bindsym $mod+r mode "resize"
mode "resize" { mode "resize" {
bindsym h resize shrink width 5 px or 5 ppt bindsym h resize shrink width 5 px or 5 ppt
@ -274,31 +272,31 @@ i3-conf = "${pkgs.writeText "i3config"
# bindsym n resize grow height 5 px or 5 ppt # bindsym n resize grow height 5 px or 5 ppt
# bindsym e resize shrink height 5 px or 5 ppt # bindsym e resize shrink height 5 px or 5 ppt
# bindsym o resize grow width 5 px or 5 ppt # bindsym o resize grow width 5 px or 5 ppt
# MARK! # MARK!
# same bindings, but for the arrow keys # same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt bindsym Right resize grow width 10 px or 10 ppt
# exit resize mode: Enter or Escape # exit resize mode: Enter or Escape
bindsym Return mode "default" bindsym Return mode "default"
bindsym Escape mode "default" bindsym Escape mode "default"
} }
# Color palette used for the terminal ( ~/.Xresources file ) # Color palette used for the terminal ( ~/.Xresources file )
# Colors are gathered based on the documentation: # Colors are gathered based on the documentation:
# https://i3wm.org/docs/userguide.html#xresources # https://i3wm.org/docs/userguide.html#xresources
# Change the variable name at the place you want to match the color # Change the variable name at the place you want to match the color
# of your terminal like this: # of your terminal like this:
# [example] # [example]
# If you want your bar to have the same background color as your # If you want your bar to have the same background color as your
# terminal background change the line 362 from: # terminal background change the line 362 from:
# background #14191D # background #14191D
# to: # to:
# background $term_background # background $term_background
# Same logic applied to everything else. # Same logic applied to everything else.
set_from_resource $term_background background set_from_resource $term_background background
set_from_resource $term_foreground foreground set_from_resource $term_foreground foreground
set_from_resource $term_color0 color0 set_from_resource $term_color0 color0
@ -318,13 +316,13 @@ i3-conf = "${pkgs.writeText "i3config"
set_from_resource $term_color14 color14 set_from_resource $term_color14 color14
set_from_resource $term_color15 color15 set_from_resource $term_color15 color15
# Start i3bar to display a workspace bar (plus the system information i3status if available) # Start i3bar to display a workspace bar (plus the system information i3status if available)
bar { bar {
i3bar_command i3bar i3bar_command i3bar
status_command i3status status_command i3status
position bottom position bottom
## please set your primary output first. Example: 'xrandr --output eDP1 --primary' ## please set your primary output first. Example: 'xrandr --output eDP1 --primary'
tray_output primary tray_output primary
bindsym button4 nop bindsym button4 nop
@ -336,7 +334,7 @@ i3-conf = "${pkgs.writeText "i3config"
statusline #F9FAF9 statusline #F9FAF9
separator #454947 separator #454947
# border backgr. text # border backgr. text
focused_workspace #F9FAF9 #16a085 #292F34 focused_workspace #F9FAF9 #16a085 #292F34
active_workspace #595B5B #353836 #FDF6E3 active_workspace #595B5B #353836 #FDF6E3
inactive_workspace #595B5B #222D31 #EEE8D5 inactive_workspace #595B5B #222D31 #EEE8D5
@ -345,8 +343,8 @@ i3-conf = "${pkgs.writeText "i3config"
} }
} }
# Theme colors # Theme colors
# class border backgr. text indic. child_border # class border backgr. text indic. child_border
client.focused #556064 #556064 #80FFF9 #FDF6E3 client.focused #556064 #556064 #80FFF9 #FDF6E3
client.focused_inactive #2F3D44 #2F3D44 #1ABC9C #454948 client.focused_inactive #2F3D44 #2F3D44 #1ABC9C #454948
client.unfocused #2F3D44 #2F3D44 #1ABC9C #454948 client.unfocused #2F3D44 #2F3D44 #1ABC9C #454948
@ -355,27 +353,27 @@ i3-conf = "${pkgs.writeText "i3config"
client.background #2B2C2B client.background #2B2C2B
############################# #############################
### settings for i3-gaps: ### ### settings for i3-gaps: ###
############################# #############################
# Set inner/outer gaps # Set inner/outer gaps
gaps inner 2 gaps inner 2
gaps outer 0 gaps outer 0
# Smart gaps (gaps used if only more than one container on the workspace) # Smart gaps (gaps used if only more than one container on the workspace)
smart_gaps on smart_gaps on
# Smart borders (draw borders around container only if it is not the only container on this workspace) # Smart borders (draw borders around container only if it is not the only container on this workspace)
smart_borders on smart_borders on
# Screen brightness controls # Screen brightness controls
bindcode 232 exec brightnessctl set 5%- bindcode 232 exec brightnessctl set 5%-
bindcode 233 exec --no-startup-id brightnessctl set 5%+ bindcode 233 exec --no-startup-id brightnessctl set 5%+
exec --no-startup-id nm-applet --sm-disable exec --no-startup-id nm-applet --sm-disable
''}"; ''}";
Xresources = "${pkgs.writeText "Xresources" '' Xresources = "${pkgs.writeText "Xresources" ''
Xft.dpi: 96 Xft.dpi: 96
Xft.antialias: true Xft.antialias: true
Xft.hinting: true Xft.hinting: true
@ -469,17 +467,28 @@ Xresources = "${pkgs.writeText "Xresources" ''
URxvt.keysym.Shift-Control-Up: \033[1;6A URxvt.keysym.Shift-Control-Up: \033[1;6A
URxvt.keysym.Control-Down: \033[1;5B URxvt.keysym.Control-Down: \033[1;5B
URxvt.keysym.Shift-Control-Down: \033[1;6B URxvt.keysym.Shift-Control-Down: \033[1;6B
''}"; ''}";
in in
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
i3status rofi arandr btop i3status
rofi
arandr
btop
firefox firefox
telegram-desktop telegram-desktop
signal-desktop discord signal-desktop
tidal-hifi vlc pavucontrol viewnior discord
xfce.mousepad pcmanfm libreoffice evince tidal-hifi
brightnessctl networkmanagerapplet vlc
pavucontrol
viewnior
xfce.mousepad
pcmanfm
libreoffice
evince
brightnessctl
networkmanagerapplet
zotero zotero
flameshot flameshot
speedcrunch speedcrunch
@ -554,4 +563,4 @@ in
}; };
security.polkit.enable = true; security.polkit.enable = true;
} }

View file

@ -1,8 +1,8 @@
#Development setup #Development setup
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
#################### Git configuration #################### #################### Git configuration ####################
programs.git = { programs.git = {
enable = true; enable = true;
lfs.enable = true; lfs.enable = true;
config = { config = {
@ -20,35 +20,45 @@ programs.git = {
gpg.format = "ssh"; gpg.format = "ssh";
commit.gpgsign = "true"; commit.gpgsign = "true";
}; };
}; };
#################### Packages #################### #################### Packages ####################
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
cmake cmake
gnumake gnumake
gcc gcc
gdb gdb
nodejs-slim nodejs-slim
clang clang-tools clang-analyzer clang
docker-compose docker clang-tools
clang-analyzer
docker-compose
docker
python311 python311
python311Packages.pip python311Packages.pip
pypy3 pypy3
rustup rustup
]; nixfmt-rfc-style
];
#################### Neovim configuration #################### #################### Neovim configuration ####################
programs.neovim = { programs.neovim = {
enable = true; enable = true;
defaultEditor = true; defaultEditor = true;
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
configure = { configure = {
packages.myVimPackage = with pkgs.vimPlugins; { packages.myVimPackage = with pkgs.vimPlugins; {
start = [ nerdtree nerdtree-git-plugin start = [
vim-gitgutter vim-fugitive vim-tmux-navigator nerdtree
coc-nvim coc-pairs nerdtree-git-plugin
coc-clangd coc-cmake vim-gitgutter
vim-fugitive
vim-tmux-navigator
coc-nvim
coc-pairs
coc-clangd
coc-cmake
coc-docker coc-docker
coc-json coc-json
coc-ltex coc-ltex
@ -59,13 +69,11 @@ programs.neovim = {
coc-pyright coc-pyright
coc-tsserver coc-tsserver
coc-rust-analyzer coc-rust-analyzer
vim-nix
]; ];
}; };
customRC = customRC =
let let
coc-config = "${pkgs.writeTextDir "coc-settings.json" coc-config = "${pkgs.writeTextDir "coc-settings.json" ''
''
{ {
"workspace.ignoredFolders": [ "workspace.ignoredFolders": [
"$HOME", "$HOME",
@ -81,7 +89,6 @@ programs.neovim = {
rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames: true rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames: true
} }
''}"; ''}";
in in
'' ''
syntax on syntax on
@ -103,7 +110,6 @@ programs.neovim = {
set shiftwidth=3 set shiftwidth=3
set tabstop=3 set tabstop=3
" Some servers have issues with backup files, see #649 " Some servers have issues with backup files, see #649
set nobackup set nobackup
set nowritebackup set nowritebackup
@ -132,34 +138,16 @@ programs.neovim = {
let g:coc_config_home = "${coc-config}" let g:coc_config_home = "${coc-config}"
let g:tmux_navigator_no_mappings = 1 let g:tmux_navigator_no_mappings = 1
" noremap <silent> <C-i> :<C-U>TmuxNavigateLeft<cr>
" noremap <silent> <C-n> :<C-U>TmuxNavigateDown<cr>
" noremap <silent> <C-e> :<C-U>TmuxNavigateUp<cr>
" noremap <silent> <C-o> :<C-U>TmuxNavigateRight<cr>
noremap <silent> <C-h> :<C-U>TmuxNavigateLeft<cr> noremap <silent> <C-h> :<C-U>TmuxNavigateLeft<cr>
noremap <silent> <C-j> :<C-U>TmuxNavigateDown<cr> noremap <silent> <C-j> :<C-U>TmuxNavigateDown<cr>
noremap <silent> <C-k> :<C-U>TmuxNavigateUp<cr> noremap <silent> <C-k> :<C-U>TmuxNavigateUp<cr>
noremap <silent> <C-l> :<C-U>TmuxNavigateRight<cr> noremap <silent> <C-l> :<C-U>TmuxNavigateRight<cr>
augroup nixcmd
" Noremap i h autocmd!
" Noremap <S-i> <S-h> autocmd BufWritePre *.nix %!nixfmt
" Noremap n j augroup END
" Noremap <S-n> <S-j>
" Noremap e k
" Noremap <S-e> <S-k>
" Noremap o l
" Noremap <S-o> <S-l>
" Noremap h i
" Noremap <S-h> <S-i>
" Noremap l o
" Noremap <S-l> <S-o>
" Noremap j e
" Noremap <S-j> <S-e>
" Nnoremap k n
" Nnoremap <S-k> <S-n>
" Let NERDTreeMapOpenExpl='\e'
''; '';
};
}; };
} };
}

View file

@ -1,13 +1,24 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
{ {
networking = { networking = {
hostName = "helium"; hostName = "helium";
firewall.allowedUDPPorts = [ 51820 51821 ]; firewall.allowedUDPPorts = [
51820
51821
];
wg-quick.interfaces = { wg-quick.interfaces = {
wg0 = { wg0 = {
autostart = false; autostart = false;
address = [ "172.16.0.2/24" ]; address = [ "172.16.0.2/24" ];
dns = [ "192.168.0.1" "vsinerva.fi" ]; dns = [
"192.168.0.1"
"vsinerva.fi"
];
privateKeyFile = "/root/wireguard-keys/privatekey-home"; privateKeyFile = "/root/wireguard-keys/privatekey-home";
listenPort = 51820; listenPort = 51820;
@ -29,7 +40,10 @@
peers = [ peers = [
{ {
publicKey = "XSYHg0utIR1j7kRsWFwuWNo4RPD47KP53cVa6qDPtRE="; publicKey = "XSYHg0utIR1j7kRsWFwuWNo4RPD47KP53cVa6qDPtRE=";
allowedIPs = [ "0.0.0.0/0" "192.168.0.0/24" ]; allowedIPs = [
"0.0.0.0/0"
"192.168.0.0/24"
];
endpoint = "netflix.vsinerva.fi:51821"; endpoint = "netflix.vsinerva.fi:51821";
} }
]; ];
@ -52,35 +66,37 @@
]; ];
disabledModules = [ "services/hardware/libinput.nix" ]; disabledModules = [ "services/hardware/libinput.nix" ];
nixpkgs.overlays = nixpkgs.overlays = [
[ (final: prev: {
(final: prev:
{
moonlight-qt = prev.moonlight-qt.overrideAttrs (old: { moonlight-qt = prev.moonlight-qt.overrideAttrs (old: {
patches = (old.patches or []) ++ [ ../misc/mouse-accel.patch ]; patches = (old.patches or [ ]) ++ [ ../misc/mouse-accel.patch ];
}); });
}) })
]; ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
zenmonitor moonlight-qt parsec-bin via zenmonitor
moonlight-qt
parsec-bin
via
]; ];
# HARDWARE SPECIFIC # HARDWARE SPECIFIC
boot.initrd.kernelModules = [ "amdgpu" ]; boot.initrd.kernelModules = [ "amdgpu" ];
hardware = { hardware = {
opengl.extraPackages = with pkgs; [ opengl.extraPackages = with pkgs; [ rocmPackages.clr.icd ];
rocmPackages.clr.icd
];
logitech.wireless = { logitech.wireless = {
enable = true; enable = true;
enableGraphical = true; enableGraphical = true;
}; };
}; };
services = { services = {
xserver = { xserver = {
videoDrivers = [ "amdgpu" "modesetting" ]; videoDrivers = [
"amdgpu"
"modesetting"
];
deviceSection = '' deviceSection = ''
Option "DRI" "2" Option "DRI" "2"
Option "TearFree" "true" Option "TearFree" "true"
@ -93,8 +109,61 @@ services = {
libinput.mouse = { libinput.mouse = {
accelProfile = "custom"; accelProfile = "custom";
accelPointsMotion = [ 0.00000 0.02000 0.04000 0.06000 0.08000 0.10000 0.12000 0.14000 0.16000 0.18000 0.20000 0.25250 0.31000 0.37250 0.44000 0.51250 0.59000 0.67250 0.76000 0.85250 0.95000 1.15500 1.37000 1.59500 1.83000 2.07500 2.33000 2.59500 2.87000 3.15500 3.45000 3.75500 4.07000 4.39500 4.73000 5.07500 5.43000 5.79500 6.17000 6.55500 6.95000 7.35500 7.77000 8.19500 8.63000 9.07500 9.53000 9.99500 10.47000 10.95500 11.45000 11.95000 ]; accelPointsMotion = [
accelStepMotion = 0.05; 0.0
2.0e-2
4.0e-2
6.0e-2
8.0e-2
0.1
0.12
0.14
0.16
0.18
0.2
0.2525
0.31
0.3725
0.44
0.5125
0.59
0.6725
0.76
0.8525
0.95
1.155
1.37
1.595
1.83
2.075
2.33
2.595
2.87
3.155
3.45
3.755
4.07
4.395
4.73
5.075
5.43
5.795
6.17
6.555
6.95
7.355
7.77
8.195
8.63
9.075
9.53
9.995
10.47
10.955
11.45
11.95
];
accelStepMotion = 5.0e-2;
}; };
redshift = { redshift = {
@ -113,31 +182,31 @@ services = {
devmon.enable = true; devmon.enable = true;
gvfs.enable = true; gvfs.enable = true;
udisks2.enable = true; udisks2.enable = true;
}; };
location = { location = {
latitude = 60.17; latitude = 60.17;
longitude = 24.94; longitude = 24.94;
}; };
# Swap + hibernate # Swap + hibernate
swapDevices = [ swapDevices = [
{ {
device = "/var/lib/swapfile"; device = "/var/lib/swapfile";
size = 16*1024; size = 16 * 1024;
} }
]; ];
boot.resumeDevice = "/dev/mapper/luks-f6e1979b-0dee-4ee9-8170-10490019854b"; boot.resumeDevice = "/dev/mapper/luks-f6e1979b-0dee-4ee9-8170-10490019854b";
boot.kernelParams = [ "resume_offset=44537856" ]; boot.kernelParams = [ "resume_offset=44537856" ];
services.logind = { services.logind = {
lidSwitch = "hibernate"; lidSwitch = "hibernate";
}; };
# Keychron Q11 # Keychron Q11
services.udev.extraRules = '' services.udev.extraRules = ''
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="3434", ATTRS{idProduct}=="01e0", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl" KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="3434", ATTRS{idProduct}=="01e0", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"
''; '';
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
} }

View file

@ -7,11 +7,11 @@
../nextcloud.nix ../nextcloud.nix
]; ];
# HARDWARE SPECIFIC # HARDWARE SPECIFIC
services.qemuGuest.enable = true; services.qemuGuest.enable = true;
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
} }

View file

@ -9,11 +9,10 @@
../syncthing.nix ../syncthing.nix
]; ];
# HARDWARE SPECIFIC # HARDWARE SPECIFIC
services.qemuGuest.enable = true; services.qemuGuest.enable = true;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
} }

View file

@ -7,11 +7,11 @@
../vaultwarden.nix ../vaultwarden.nix
]; ];
# HARDWARE SPECIFIC # HARDWARE SPECIFIC
services.qemuGuest.enable = true; services.qemuGuest.enable = true;
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
} }

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
SSID = "ENTER_SSID"; SSID = "ENTER_SSID";
SSIDpassword = "ENTER_PASSWORD"; SSIDpassword = "ENTER_PASSWORD";
@ -6,12 +11,15 @@ let
wg_interface = "end0"; wg_interface = "end0";
hostname = "netflix-huijaus"; hostname = "netflix-huijaus";
ddPassFile = "/root/wg-conf/ddPassFile"; ddPassFile = "/root/wg-conf/ddPassFile";
in { in
imports = [ {
../base.nix imports = [ ../base.nix ];
];
environment.systemPackages = with pkgs; [ git wireguard-tools qrencode ]; environment.systemPackages = with pkgs; [
git
wireguard-tools
qrencode
];
# enable NAT # enable NAT
networking.nat.enable = true; networking.nat.enable = true;
@ -41,7 +49,6 @@ in {
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.100.0.0/24 -o ${wg_interface} -j MASQUERADE ${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.100.0.0/24 -o ${wg_interface} -j MASQUERADE
''; '';
# Path to the private key file. # Path to the private key file.
# #
# Note: The private key can also be included inline via the privateKey option, # Note: The private key can also be included inline via the privateKey option,
@ -50,27 +57,33 @@ in {
privateKeyFile = "/root/wg-conf/private"; privateKeyFile = "/root/wg-conf/private";
peers = [ peers = [
{ # Vili Android {
# Vili Android
publicKey = "niKpC3+Pi4HrYITlzROzqRcxzfzRw1rjpxeJVOr/WAw="; publicKey = "niKpC3+Pi4HrYITlzROzqRcxzfzRw1rjpxeJVOr/WAw=";
allowedIPs = [ "10.100.0.2/32" ]; allowedIPs = [ "10.100.0.2/32" ];
} }
{ # Miika Puhelin {
# Miika Puhelin
publicKey = "mcOs94W9jqn3SGgc8uWbnmUv0tja/P6tAvaCg3WYKlY="; publicKey = "mcOs94W9jqn3SGgc8uWbnmUv0tja/P6tAvaCg3WYKlY=";
allowedIPs = [ "10.100.0.3/32" ]; allowedIPs = [ "10.100.0.3/32" ];
} }
{ # Miika Kone {
# Miika Kone
publicKey = "7m7wnwNlmxZfUNvUOYNh4mTNbOsig7z2K/svUhDHFDY="; publicKey = "7m7wnwNlmxZfUNvUOYNh4mTNbOsig7z2K/svUhDHFDY=";
allowedIPs = [ "10.100.0.4/32" ]; allowedIPs = [ "10.100.0.4/32" ];
} }
{ # Silja Puhelin {
# Silja Puhelin
publicKey = "f6wWd6KD63xwnKkre/ZgZxPJv9GfAXK9Zx/EQEq8cik="; publicKey = "f6wWd6KD63xwnKkre/ZgZxPJv9GfAXK9Zx/EQEq8cik=";
allowedIPs = [ "10.100.0.5/32" ]; allowedIPs = [ "10.100.0.5/32" ];
} }
{ # Silja Kone {
# Silja Kone
publicKey = "t9cmHc6/+0njdzsTFnnhEGKfhCa2VXFrTH9hF1jOCXw="; publicKey = "t9cmHc6/+0njdzsTFnnhEGKfhCa2VXFrTH9hF1jOCXw=";
allowedIPs = [ "10.100.0.6/32" ]; allowedIPs = [ "10.100.0.6/32" ];
} }
{ # Vili helium {
# Vili helium
publicKey = "iGO375NT9EK5LH+E9vjPRRJp+UM4rZ2d1RMVR3f5R0c="; publicKey = "iGO375NT9EK5LH+E9vjPRRJp+UM4rZ2d1RMVR3f5R0c=";
allowedIPs = [ "10.100.0.7/32" ]; allowedIPs = [ "10.100.0.7/32" ];
} }
@ -86,11 +99,15 @@ in {
username = "VSinerva"; username = "VSinerva";
passwordFile = ddPassFile; passwordFile = ddPassFile;
}; };
#################### EVERYTHING BELOW THIS SHOULD NOT NEED TO CHANGE #################### #################### EVERYTHING BELOW THIS SHOULD NOT NEED TO CHANGE ####################
boot = { boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_rpi4; kernelPackages = pkgs.linuxKernel.packages.linux_rpi4;
initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ]; initrd.availableKernelModules = [
"xhci_pci"
"usbhid"
"usb_storage"
];
loader = { loader = {
grub.enable = false; grub.enable = false;
generic-extlinux-compatible.enable = true; generic-extlinux-compatible.enable = true;

View file

@ -1,7 +1,10 @@
# Nextcloud instance # Nextcloud instance
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [
80
443
];
networking.firewall.allowedUDPPorts = [ 443 ]; networking.firewall.allowedUDPPorts = [ 443 ];
services.nextcloud = { services.nextcloud = {
@ -19,8 +22,7 @@
}; };
}; };
services.nginx.virtualHosts = services.nginx.virtualHosts = {
{
${config.services.nextcloud.hostName} = { ${config.services.nextcloud.hostName} = {
forceSSL = true; forceSSL = true;
kTLS = true; kTLS = true;
@ -28,8 +30,9 @@
sslCertificateKey = "/var/lib/nextcloud/nextcloud_privkey.pem"; sslCertificateKey = "/var/lib/nextcloud/nextcloud_privkey.pem";
locations = { locations = {
"/".proxyWebsockets = true; "/".proxyWebsockets = true;
"~ ^\/nextcloud\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/)" = {}; "~ ^\/nextcloud\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/)" =
{ };
}; };
}; };
}; };
} }

View file

@ -25,7 +25,10 @@
folders = folders =
let let
default = { default = {
devices = [ "helium" "nixos-cpu" ]; devices = [
"helium"
"nixos-cpu"
];
versioning = { versioning = {
type = "trashcan"; type = "trashcan";
params.cleanoutDays = "30"; params.cleanoutDays = "30";
@ -34,7 +37,13 @@
}; };
in in
{ {
"~/Documents" = default // { devices = [ "helium" "nixos-cpu" "phone" ]; } ; "~/Documents" = default // {
devices = [
"helium"
"nixos-cpu"
"phone"
];
};
"~/Downloads" = default; "~/Downloads" = default;
"~/Music" = default; "~/Music" = default;
"~/Pictures" = default; "~/Pictures" = default;
@ -56,4 +65,4 @@
#TCP/UDP 22000 for transfers and UDP 21027 for discovery #TCP/UDP 22000 for transfers and UDP 21027 for discovery
openDefaultPorts = true; openDefaultPorts = true;
}; };
} }

View file

@ -1,7 +1,10 @@
# Nextcloud instance # Nextcloud instance
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [
80
443
];
networking.firewall.allowedUDPPorts = [ 443 ]; networking.firewall.allowedUDPPorts = [ 443 ];
services = { services = {

View file

@ -6,8 +6,14 @@
home = "/home/vili"; home = "/home/vili";
description = "Vili Sinervä"; description = "Vili Sinervä";
uid = 1000; uid = 1000;
extraGroups = [ "wheel" "networkmanager" "audio" ]; extraGroups = [
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBbGREoK1uVny1s8FK3KZ74Wmaf0VtifhqPyK69C/Gez vili@helium" ]; "wheel"
"networkmanager"
"audio"
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBbGREoK1uVny1s8FK3KZ74Wmaf0VtifhqPyK69C/Gez vili@helium"
];
hashedPasswordFile = "/home/vili/.hashedPasswordFile"; hashedPasswordFile = "/home/vili/.hashedPasswordFile";
}; };