aboutsummaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
Diffstat (limited to 'nixos')
-rw-r--r--nixos/amd_gpu.nix20
-rw-r--r--nixos/bluetooth.nix4
-rw-r--r--nixos/default.nix95
-rw-r--r--nixos/docker.nix15
-rw-r--r--nixos/extrahosts.nix29
-rw-r--r--nixos/flatpak.nix3
-rw-r--r--nixos/fonts.nix19
-rw-r--r--nixos/fprintd.nix11
-rw-r--r--nixos/intel_gpu.nix10
-rw-r--r--nixos/kde.nix38
-rw-r--r--nixos/localization.nix24
-rw-r--r--nixos/mergerfs.nix5
-rw-r--r--nixos/ollama.nix5
-rw-r--r--nixos/opensmtpd.nix35
-rw-r--r--nixos/pipewire.nix8
-rw-r--r--nixos/printing.nix16
-rw-r--r--nixos/restic.nix31
-rw-r--r--nixos/steam.nix3
-rw-r--r--nixos/systemd-boot.nix12
-rw-r--r--nixos/users-home.nix35
-rw-r--r--nixos/users.nix22
-rw-r--r--nixos/vim.nix92
-rw-r--r--nixos/virt-manager.nix6
-rw-r--r--nixos/zramswap.nix11
24 files changed, 549 insertions, 0 deletions
diff --git a/nixos/amd_gpu.nix b/nixos/amd_gpu.nix
new file mode 100644
index 0000000..6cf6d87
--- /dev/null
+++ b/nixos/amd_gpu.nix
@@ -0,0 +1,20 @@
+{pkgs, ...}: {
+ hardware.graphics = {
+ enable = true;
+ enable32Bit = true;
+ extraPackages = with pkgs; [
+ libvdpau-va-gl
+ #rocmPackages.clr.icd
+ #rocmPackages.rocm-runtime
+ vaapiVdpau
+ ];
+ };
+
+ environment.systemPackages = with pkgs; [
+ amdgpu_top
+ clinfo
+ lact
+ #rocmPackages.rocminfo
+ #rocmPackages.rocm-smi
+ ];
+}
diff --git a/nixos/bluetooth.nix b/nixos/bluetooth.nix
new file mode 100644
index 0000000..5278615
--- /dev/null
+++ b/nixos/bluetooth.nix
@@ -0,0 +1,4 @@
+{
+ hardware.bluetooth.enable = true;
+ hardware.bluetooth.powerOnBoot = true;
+}
diff --git a/nixos/default.nix b/nixos/default.nix
new file mode 100644
index 0000000..fd5467a
--- /dev/null
+++ b/nixos/default.nix
@@ -0,0 +1,95 @@
+{pkgs, ...}: {
+ imports = [
+ ./localization.nix
+ ./users.nix
+ ./vim.nix
+ ];
+
+ nix = {
+ # weekly gc
+ gc = {
+ automatic = true;
+ dates = "weekly";
+ options = "--delete-older-than 1w";
+ };
+
+ settings = {
+ # optimize store (run manually with `nix-store --optimise`)
+ auto-optimise-store = true;
+ download-buffer-size = 524288000; #500MiB
+
+ # enable flakes
+ experimental-features = ["nix-command" "flakes"];
+ };
+ };
+
+ # allow unfree packages globally
+ nixpkgs.config.allowUnfree = true;
+
+
+
+ nixpkgs.config.permittedInsecurePackages = [
+ "qtwebengine-5.15.19"
+ ];
+
+ # timezone
+ time.timeZone = "Europe/Athens";
+
+ # default packages
+ environment = {
+ systemPackages = with pkgs; [
+ bc
+ cifs-utils
+ linuxPackages_latest.cpupower
+ comma
+ curl
+ efibootmgr
+ ethtool
+ file
+ git
+ gnumake
+ lesspipe
+ lsof
+ moreutils
+ nettools
+ nvme-cli
+ openssl
+ pciutils
+ smartmontools
+ somo
+ usbutils
+ ];
+
+ # add zsh completion for system packages
+ pathsToLink = ["/share/zsh"];
+
+ # add ~/bin to PATH
+ homeBinInPath = true;
+ };
+
+ # enable zsh
+ programs.zsh.enable = true;
+
+ # add lesspipe support for less
+ programs.less = {
+ enable = true;
+ lessopen = "|${pkgs.lesspipe}/bin/lesspipe.sh %s";
+ };
+
+ services = {
+ envfs = {
+ enable = true;
+ };
+
+ fwupd = {
+ enable = true;
+ };
+
+ openssh = {
+ enable = true;
+ settings = {
+ PasswordAuthentication = false;
+ };
+ };
+ };
+}
diff --git a/nixos/docker.nix b/nixos/docker.nix
new file mode 100644
index 0000000..35258d3
--- /dev/null
+++ b/nixos/docker.nix
@@ -0,0 +1,15 @@
+{pkgs, ...}: {
+ virtualisation.docker = {
+ enable = true;
+ autoPrune.enable = true;
+ liveRestore = false;
+ };
+
+ users.users.grm.extraGroups = ["docker"];
+
+ environment = {
+ systemPackages = with pkgs; [
+ ctop
+ ];
+ };
+}
diff --git a/nixos/extrahosts.nix b/nixos/extrahosts.nix
new file mode 100644
index 0000000..de20195
--- /dev/null
+++ b/nixos/extrahosts.nix
@@ -0,0 +1,29 @@
+{
+ networking.extraHosts = ''
+
+ # lw devsetup hosts
+ 127.0.0.1 api.learnworlds.develop
+ 127.0.0.1 apitasks-scheduler.learnworlds.develop
+ 127.0.0.1 account.learnworlds.develop
+ 127.0.0.1 adminer.learnworlds.develop
+ 127.0.0.1 analytics.learnworlds.develop
+ 127.0.0.1 assets.learnworlds.develop
+ 127.0.0.1 aurora.learnworlds.develop
+ 127.0.0.1 client.learnworlds.develop
+ 127.0.0.1 client-canary.learnworlds.develop
+ 127.0.0.1 companion.learnworlds.develop
+ 127.0.0.1 kafka-ui.learnworlds.develop
+ 127.0.0.1 profiler.learnworlds.develop
+ 127.0.0.1 string-is.learnworlds.develop
+ 127.0.0.1 www.learnworlds.develop
+ 127.0.0.1 urlshortener.learnworlds.develop
+ 127.0.0.1 mailpit.learnworlds.develop
+
+ # local dev hosts
+ 127.0.0.1 adminer.local
+ 127.0.0.1 akyriaki.local
+ 127.0.0.1 alfa3.local
+ 127.0.0.1 aris.local
+ 127.0.0.1 proteins.local
+ '';
+}
diff --git a/nixos/flatpak.nix b/nixos/flatpak.nix
new file mode 100644
index 0000000..1ff0c53
--- /dev/null
+++ b/nixos/flatpak.nix
@@ -0,0 +1,3 @@
+{
+ services.flatpak.enable = true;
+}
diff --git a/nixos/fonts.nix b/nixos/fonts.nix
new file mode 100644
index 0000000..b7a922e
--- /dev/null
+++ b/nixos/fonts.nix
@@ -0,0 +1,19 @@
+{pkgs, ...}: {
+ fonts = {
+ packages = with pkgs; [
+ dejavu_fonts
+ departure-mono
+ roboto
+ nerd-fonts.jetbrains-mono
+ noto-fonts
+ noto-fonts-cjk-sans
+ noto-fonts-emoji
+ ubuntu_font_family
+ ];
+
+ fontconfig = {
+ subpixel.rgba = "rgb";
+ hinting.style = "slight";
+ };
+ };
+}
diff --git a/nixos/fprintd.nix b/nixos/fprintd.nix
new file mode 100644
index 0000000..b530edc
--- /dev/null
+++ b/nixos/fprintd.nix
@@ -0,0 +1,11 @@
+{pkgs, ...}: {
+ environment.systemPackages = with pkgs; [
+ fprintd
+ ];
+
+ services.fprintd = {
+ enable = true;
+ };
+
+ security.pam.services.login.fprintAuth = false;
+}
diff --git a/nixos/intel_gpu.nix b/nixos/intel_gpu.nix
new file mode 100644
index 0000000..006bbb3
--- /dev/null
+++ b/nixos/intel_gpu.nix
@@ -0,0 +1,10 @@
+{pkgs, ...}: {
+ hardware.graphics = {
+ enable = true;
+ extraPackages = with pkgs; [
+ intel-media-driver
+ intel-ocl
+ intel-vaapi-driver
+ ];
+ };
+}
diff --git a/nixos/kde.nix b/nixos/kde.nix
new file mode 100644
index 0000000..c5f6a68
--- /dev/null
+++ b/nixos/kde.nix
@@ -0,0 +1,38 @@
+{pkgs, ...}: {
+ programs.dconf.enable = true;
+
+ services = {
+ colord.enable = true;
+ desktopManager.plasma6.enable = true;
+ displayManager = {
+ sddm = {
+ enable = true;
+ wayland.enable = true;
+ };
+ defaultSession = "plasma";
+ };
+ };
+
+ environment = {
+ # extra kde packages
+ systemPackages = with pkgs.kdePackages; [
+ colord-kde
+ kcalc
+ kclock
+ kdeconnect-kde
+ kdenlive
+ krecorder
+ ksshaskpass
+ kweather
+ mlt
+ sddm-kcm
+ skanlite
+ xwaylandvideobridge
+ ];
+
+ # skip default packages
+ plasma6.excludePackages = with pkgs.kdePackages; [
+ elisa
+ ];
+ };
+}
diff --git a/nixos/localization.nix b/nixos/localization.nix
new file mode 100644
index 0000000..f05278b
--- /dev/null
+++ b/nixos/localization.nix
@@ -0,0 +1,24 @@
+{
+ # locale
+ i18n = {
+ defaultLocale = "en_US.UTF-8";
+ extraLocaleSettings = {
+ LC_TIME = "el_GR.UTF-8";
+ LC_MONETARY = "el_GR.UTF-8";
+ LC_ADDRESS = "el_GR.UTF-8";
+ LC_TELEPHONE = "el_GR.UTF-8";
+ LC_MEASUREMENT = "el_GR.UTF-8";
+ };
+ };
+
+ # console font and keyboard layout
+ console = {
+ useXkbConfig = true;
+ };
+
+ # X11 keyboard layout
+ services.xserver.xkb = {
+ layout = "us,gr";
+ options = "grp:alt_shift_toggle,ctrl:nocaps,grp_led:caps,terminate:ctrl_alt_bksp";
+ };
+}
diff --git a/nixos/mergerfs.nix b/nixos/mergerfs.nix
new file mode 100644
index 0000000..50d0063
--- /dev/null
+++ b/nixos/mergerfs.nix
@@ -0,0 +1,5 @@
+{pkgs, ...}: {
+ environment.systemPackages = with pkgs; [
+ mergerfs
+ ];
+}
diff --git a/nixos/ollama.nix b/nixos/ollama.nix
new file mode 100644
index 0000000..19087de
--- /dev/null
+++ b/nixos/ollama.nix
@@ -0,0 +1,5 @@
+{
+ services.ollama = {
+ enable = true;
+ };
+}
diff --git a/nixos/opensmtpd.nix b/nixos/opensmtpd.nix
new file mode 100644
index 0000000..57db251
--- /dev/null
+++ b/nixos/opensmtpd.nix
@@ -0,0 +1,35 @@
+{pkgs, ...}: {
+ environment = {
+ systemPackages = with pkgs; [
+ mailutils
+ ];
+
+ etc."smtpd/aliases" = {
+ text = ''
+ root: manolis@netriin.net
+ abuse: root
+ noc: root
+ security: root
+ postmaster: root
+ hostmaster: root
+ webmaster: root
+ www: webmaster
+ ftp: root
+ '';
+ mode = "0644";
+ };
+ };
+
+ services.opensmtpd = {
+ enable = true;
+ serverConfiguration = ''
+ listen on 0.0.0.0
+ table aliases file:/etc/smtpd/aliases
+ action "local" maildir alias <aliases>
+ action "relay" relay
+ match for local action "local"
+ match from local for any action "relay"
+ match from any for any action "relay"
+ '';
+ };
+}
diff --git a/nixos/pipewire.nix b/nixos/pipewire.nix
new file mode 100644
index 0000000..24e9fb5
--- /dev/null
+++ b/nixos/pipewire.nix
@@ -0,0 +1,8 @@
+{
+ services.pipewire = {
+ enable = true;
+ alsa.enable = true;
+ alsa.support32Bit = true;
+ pulse.enable = true;
+ };
+}
diff --git a/nixos/printing.nix b/nixos/printing.nix
new file mode 100644
index 0000000..9eefaa8
--- /dev/null
+++ b/nixos/printing.nix
@@ -0,0 +1,16 @@
+{pkgs, ...}: {
+ services = {
+ avahi = {
+ enable = true;
+ nssmdns4 = true;
+ openFirewall = true;
+ };
+
+ printing = {
+ enable = true;
+ drivers = with pkgs; [
+ cups-brother-hl1210w
+ ];
+ };
+ };
+}
diff --git a/nixos/restic.nix b/nixos/restic.nix
new file mode 100644
index 0000000..46f0631
--- /dev/null
+++ b/nixos/restic.nix
@@ -0,0 +1,31 @@
+{
+ services.restic.backups = {
+ periodic = {
+ initialize = true;
+ environmentFile = "/root/.config/restic/env";
+ repositoryFile = "/root/.config/restic/repository";
+ passwordFile = "/root/.config/restic/password";
+
+ timerConfig = {
+ OnCalendar = "0/4:00";
+ };
+
+ exclude = [
+ "lost+found"
+ ];
+
+ paths = [
+ "/home"
+ "/root"
+ ];
+
+ pruneOpts = [
+ "--keep-hourly 6"
+ "--keep-daily 7"
+ "--keep-weekly 2"
+ "--keep-monthly 12"
+ "--keep-yearly 1"
+ ];
+ };
+ };
+}
diff --git a/nixos/steam.nix b/nixos/steam.nix
new file mode 100644
index 0000000..05f296d
--- /dev/null
+++ b/nixos/steam.nix
@@ -0,0 +1,3 @@
+{
+ programs.steam.enable = true;
+}
diff --git a/nixos/systemd-boot.nix b/nixos/systemd-boot.nix
new file mode 100644
index 0000000..cb3cd23
--- /dev/null
+++ b/nixos/systemd-boot.nix
@@ -0,0 +1,12 @@
+{
+ boot = {
+ loader = {
+ grub.device = "/dev/vda";
+# efi.canTouchEfiVariables = true;
+# systemd-boot = {
+# enable = true;
+# configurationLimit = 5;
+# };
+ };
+ };
+}
diff --git a/nixos/users-home.nix b/nixos/users-home.nix
new file mode 100644
index 0000000..baa5d91
--- /dev/null
+++ b/nixos/users-home.nix
@@ -0,0 +1,35 @@
+{pkgs, ...}: {
+ users = {
+ groups = {
+ anthi = {
+ gid = 1001;
+ };
+
+ aris = {
+ gid = 1002;
+ };
+ };
+
+ users = {
+ anthi = {
+ isNormalUser = true;
+ uid = 1001;
+ group = "anthi";
+ createHome = true;
+ home = "/home/anthi";
+ initialPassword = "password";
+ shell = pkgs.zsh;
+ };
+
+ aris = {
+ isNormalUser = true;
+ uid = 1002;
+ group = "aris";
+ createHome = true;
+ home = "/home/aris";
+ initialPassword = "password";
+ shell = pkgs.zsh;
+ };
+ };
+ };
+}
diff --git a/nixos/users.nix b/nixos/users.nix
new file mode 100644
index 0000000..2327203
--- /dev/null
+++ b/nixos/users.nix
@@ -0,0 +1,22 @@
+{pkgs, ...}: {
+ users = {
+ groups = {
+ grm = {
+ gid = 1000;
+ };
+ };
+
+ users = {
+ grm = {
+ isNormalUser = true;
+ uid = 1000;
+ group = "grm";
+ extraGroups = ["wheel"];
+ createHome = true;
+ home = "/home/grm";
+ initialPassword = "password";
+ shell = pkgs.zsh;
+ };
+ };
+ };
+}
diff --git a/nixos/vim.nix b/nixos/vim.nix
new file mode 100644
index 0000000..4613390
--- /dev/null
+++ b/nixos/vim.nix
@@ -0,0 +1,92 @@
+{pkgs, ...}: {
+ environment = {
+ systemPackages = with pkgs; [
+ (
+ (vim_configurable.override {}).customize {
+ name = "vim";
+ vimrcConfig.packages.myplugins = with pkgs.vimPlugins; {
+ start = [
+ nerdcommenter
+ vim-airline
+ vim-airline-themes
+ vim-colors-solarized
+ vim-sleuth
+ vim-surround
+ undotree
+ ];
+ opt = [];
+ };
+ vimrcConfig.customRC = ''
+ filetype off
+ set nocompatible
+ set modelines=0
+ set encoding=utf-8
+ set scrolloff=3
+ set wildmode=list:longest
+ set visualbell
+ set backspace=indent,eol,start
+ set laststatus=2
+ set number
+ set history=1000
+ set title
+ set ignorecase
+ set smartcase
+ set gdefault
+ set incsearch
+ set showmatch
+ set hlsearch
+
+ let mapleader = ","
+ nmap <silent> <leader><space> :silent :nohlsearch<CR>
+
+ set wrap
+ set textwidth=0
+ set list
+ set listchars=tab:▸\ ,eol:¬
+ set mousehide
+ set mouse=a
+ set cursorline
+ set cursorcolumn
+
+ set backupdir=~/.local/vim/backup
+ set directory=~/.local/vim/swap
+ set undodir=~/.local/vim/undo
+
+ for _dir in ["backup", "swap", "undo"]
+ let target_path = expand("~/.local/vim/" . _dir)
+ if !isdirectory(target_path)
+ call mkdir(target_path, "p", 0700)
+ endif
+ endfor
+
+ au VimResized * exe "normal! \<c-w>="
+
+ augroup vimrc_autocmd
+ autocmd!
+
+ " jump to the last position when reopening a file
+ autocmd BufReadPost *
+ \ if line("'\"") > 1 && line("'\"") <= line("$") |
+ \ exe "normal! g`\"" |
+ \ endif
+ augroup END
+
+ syn on
+ set background=dark
+ colorscheme solarized
+
+ nnoremap <F5> :UndotreeToggle<CR>
+ if has("persistent_undo")
+ set undofile
+ endif
+ '';
+ }
+ )
+ ];
+
+ variables = {
+ EDITOR = "vim";
+ VISUAL = "vim";
+ };
+ };
+}
diff --git a/nixos/virt-manager.nix b/nixos/virt-manager.nix
new file mode 100644
index 0000000..fe4b5ed
--- /dev/null
+++ b/nixos/virt-manager.nix
@@ -0,0 +1,6 @@
+{
+ virtualisation.libvirtd.enable = true;
+ programs.virt-manager.enable = true;
+
+ users.users.grm.extraGroups = ["libvirtd"];
+}
diff --git a/nixos/zramswap.nix b/nixos/zramswap.nix
new file mode 100644
index 0000000..61c2961
--- /dev/null
+++ b/nixos/zramswap.nix
@@ -0,0 +1,11 @@
+{
+ # enable zram swap
+ zramSwap.enable = true;
+
+ boot.kernel.sysctl = {
+ "vm.page-cluster" = 0;
+ "vm.swappiness" = 180;
+ "vm.watermark_boost_factor" = 0;
+ "vm.watermark_scale_factor" = 125;
+ };
+}