From 2ad769ccdd46763a5b0bedc0bde5d905338575a6 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 4 Jan 2023 16:15:18 +0100 Subject: tv nix: auto-optimise-store via settings --- tv/2configs/default.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tv/2configs') diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix index 9babb92c2..f780709f0 100644 --- a/tv/2configs/default.nix +++ b/tv/2configs/default.nix @@ -45,9 +45,7 @@ with import ./lib; } { - nix.extraOptions = '' - auto-optimise-store = true - ''; + nix.settings.auto-optimise-store = true; # TODO check if both are required: nix.settings.extra-sandbox-paths = [ -- cgit v1.2.3 From 7a45a35a58c1dca19bdd3102f6fa700ec52a38bf Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 4 Jan 2023 16:17:42 +0100 Subject: tv: move nix settings to separate file --- tv/2configs/default.nix | 10 +--------- tv/2configs/nix.nix | 9 +++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 tv/2configs/nix.nix (limited to 'tv/2configs') diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix index f780709f0..4e2fd517d 100644 --- a/tv/2configs/default.nix +++ b/tv/2configs/default.nix @@ -16,6 +16,7 @@ with import ./lib; ./nets/hkw.nix ./networkd.nix ./nginx + ./nix.nix ./pki ./ssh.nix ./sshd.nix @@ -44,15 +45,6 @@ with import ./lib; time.timeZone = "Europe/Berlin"; } - { - nix.settings.auto-optimise-store = true; - - # TODO check if both are required: - nix.settings.extra-sandbox-paths = [ - "/etc/protocols" - pkgs.iana-etc.outPath - ]; - } { nixpkgs.config.allowUnfree = false; } diff --git a/tv/2configs/nix.nix b/tv/2configs/nix.nix new file mode 100644 index 000000000..fa96d459f --- /dev/null +++ b/tv/2configs/nix.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: { + nix.settings.auto-optimise-store = true; + + # TODO check if both are required: + nix.settings.extra-sandbox-paths = [ + "/etc/protocols" + pkgs.iana-etc.outPath + ]; +} -- cgit v1.2.3 From fbd33d19895dac77056af04595c2a22ca7552517 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 6 Jan 2023 21:27:58 +0100 Subject: tv AO753: use nix.settings --- tv/2configs/hw/AO753.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tv/2configs') diff --git a/tv/2configs/hw/AO753.nix b/tv/2configs/hw/AO753.nix index b998fcf7c..f2268a9b2 100644 --- a/tv/2configs/hw/AO753.nix +++ b/tv/2configs/hw/AO753.nix @@ -4,8 +4,8 @@ with import ./lib; ../smartd.nix { - nix.buildCores = 2; - nix.maxJobs = 2; + nix.settings.cores = 2; + nix.settings.max-jobs = 2; } (if lib.versionAtLeast (lib.versions.majorMinor lib.version) "21.11" then { nix.daemonCPUSchedPolicy = "batch"; -- cgit v1.2.3 From ab8139704a331b88d72d533ac4206464ae069f7c Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 11 Jan 2023 16:53:26 +0100 Subject: tv bash: optionally source $BASH_EXTRA_INIT --- tv/2configs/bash/default.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tv/2configs') diff --git a/tv/2configs/bash/default.nix b/tv/2configs/bash/default.nix index e38566b78..57801d964 100644 --- a/tv/2configs/bash/default.nix +++ b/tv/2configs/bash/default.nix @@ -39,6 +39,10 @@ with import ./lib; esac ${pkgs.bash-fzf-history.bind} + + if test -n "''${BASH_EXTRA_INIT-}"; then + . "$BASH_EXTRA_INIT" + fi ''; promptInit = /* sh */ '' case $UID in -- cgit v1.2.3 From 99eafa9d79c06219e3e1145bb3434f7d14a57e83 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 11 Jan 2023 19:50:44 +0100 Subject: tv winmax2: init --- tv/2configs/hw/winmax2.nix | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tv/2configs/hw/winmax2.nix (limited to 'tv/2configs') diff --git a/tv/2configs/hw/winmax2.nix b/tv/2configs/hw/winmax2.nix new file mode 100644 index 000000000..bda349e96 --- /dev/null +++ b/tv/2configs/hw/winmax2.nix @@ -0,0 +1,32 @@ +{ pkgs, ... }: { + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" ]; + boot.initrd.kernelModules = [ "amdgpu" ]; + boot.kernelModules = [ "kvm-amd" ]; + + hardware.cpu.amd.updateMicrocode = true; + hardware.enableRedistributableFirmware = true; + + hardware.opengl.enable = true; + hardware.opengl.extraPackages = [ + pkgs.amdvlk + pkgs.rocm-opencl-icd + pkgs.rocm-opencl-runtime + ]; + + hardware.video.hidpi.enable = true; + + networking.wireless.enable = true; + networking.wireless.interfaces = [ + "wlp1s0" + ]; + networking.interfaces.wlp1s0.useDHCP = true; + + nixpkgs.hostPlatform = "x86_64-linux"; + + services.illum.enable = true; + + tv.lidControl.enable = true; + + tv.hw.screens.primary.width = 2560; + tv.hw.screens.primary.height = 1600; +} -- cgit v1.2.3 From 82589eef82d0af4237ad6747d2576659bba3e0b8 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 11 Jan 2023 20:03:07 +0100 Subject: tv: put ~/bin into PATH by default --- tv/2configs/default.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tv/2configs') diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix index 4e2fd517d..540587254 100644 --- a/tv/2configs/default.nix +++ b/tv/2configs/default.nix @@ -49,6 +49,8 @@ with import ./lib; nixpkgs.config.allowUnfree = false; } { + environment.homeBinInPath = true; + environment.profileRelativeEnvVars.PATH = mkForce [ "/bin" ]; environment.systemPackages = with pkgs; [ -- cgit v1.2.3 From 3fc184a22607952db257c9c76a6f8f1d7afd16d6 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 11 Jan 2023 20:08:56 +0100 Subject: tv alacritty: automatically select hidpi variant --- tv/2configs/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tv/2configs') diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix index 540587254..d1384845a 100644 --- a/tv/2configs/default.nix +++ b/tv/2configs/default.nix @@ -129,4 +129,11 @@ with import ./lib; ]; } ]; + + nixpkgs.overlays = + mkAfter (optional config.hardware.video.hidpi.enable (self: super: { + alacritty-tv = super.alacritty-tv.override { + variant = "hidpi"; + }; + })); } -- cgit v1.2.3 From 983b993e4c764e4e9f8071c23d9ede13b8eedf67 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 14 Jan 2023 00:39:35 +0100 Subject: tv vim: scroll linewise when there's a touchscreen --- tv/2configs/vim.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tv/2configs') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index b8819ee36..a0225807c 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -140,5 +140,16 @@ with import ./lib; " edit alternate buffer " For some reason neither putting 6 nor ^ works here... nnoremap a  + + if $TOUCHSCREEN == 1 + nnoremap + nnoremap + nnoremap 3 + nnoremap 3 + nnoremap 3 + nnoremap 3 + nnoremap + nnoremap + endif ''; } -- cgit v1.2.3 From 2c05d17476932ecd23e3ce902366d4c3d08dcaca Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 15 Jan 2023 01:50:04 +0100 Subject: tv vim: split plugins into base and extra --- tv/2configs/vim.nix | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'tv/2configs') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index a0225807c..f3986e4f2 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -11,18 +11,31 @@ with import ./lib; environment.variables.VIMINIT = ":so /etc/vimrc"; }; - extra-runtimepath = pkgs.tv.vim.makeRuntimePath [ - pkgs.tv.vimPlugins.elixir + base-plugins = [ pkgs.tv.vimPlugins.file-line - pkgs.tv.vimPlugins.fzf pkgs.tv.vimPlugins.hack + pkgs.vimPlugins.undotree + (pkgs.tv.vim.makePlugin (pkgs.write "vim-tv-base" { + "/ftplugin/haskell.vim".text = '' + if exists("g:vim_tv_ftplugin_haskell_loaded") + finish + endif + let g:vim_tv_ftplugin_haskell_loaded = 1 + + setlocal iskeyword+=' + ''; + })) + ]; + + extra-plugins = [ + pkgs.tv.vimPlugins.elixir + pkgs.tv.vimPlugins.fzf pkgs.tv.vimPlugins.jq pkgs.tv.vimPlugins.nix pkgs.tv.vimPlugins.showsyntax pkgs.tv.vimPlugins.tv pkgs.tv.vimPlugins.vim pkgs.vimPlugins.fzfWrapper - pkgs.vimPlugins.undotree pkgs.vimPlugins.vim-nftables ]; @@ -71,7 +84,7 @@ with import ./lib; set mouse=a set noruler set pastetoggle= - set runtimepath=${extra-runtimepath},$VIMRUNTIME + set runtimepath=${pkgs.tv.vim.makeRuntimePath base-plugins},$VIMRUNTIME set shortmess+=I set showcmd set showmatch @@ -88,13 +101,15 @@ with import ./lib; set wildmenu set wildmode=longest,full + set runtimepath^=${pkgs.tv.vim.makeRuntimePath extra-plugins} + syntax on + set et ts=2 sts=2 sw=2 filetype plugin indent on set t_Co=256 colorscheme hack - syntax on au Syntax * syn match Garbage containedin=ALL /\s\+$/ \ | syn match TabStop containedin=ALL /\t\+/ -- cgit v1.2.3 From 0a3ad1b7c361897e7bf965424ab59e0cffe6673e Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 15 Jan 2023 16:02:32 +0100 Subject: tv br: use modulesPath --- tv/2configs/br.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tv/2configs') diff --git a/tv/2configs/br.nix b/tv/2configs/br.nix index 4a8db2e38..47d657c46 100644 --- a/tv/2configs/br.nix +++ b/tv/2configs/br.nix @@ -1,8 +1,8 @@ with import ./lib; -{ config, pkgs, ... }: { +{ config, modulesPath, pkgs, ... }: { imports = [ - + (modulesPath + "/services/hardware/sane_extra_backends/brscan4.nix") ]; krebs.nixpkgs.allowUnfreePredicate = pkg: any (eq (packageName pkg)) [ -- cgit v1.2.3 From 21f878d929fdfb0f277aa33c2fa32c5a63f3018a Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 16 Jan 2023 11:04:51 +0100 Subject: tv vim: DRY F{1,2} mapping --- tv/2configs/vim.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tv/2configs') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index f3986e4f2..fde66d777 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -130,8 +130,8 @@ with import ./lib; nnoremap :tabp nnoremap :tabn - inoremap :tabp - inoremap :tabn + imap + imap noremap :ShowSyntax -- cgit v1.2.3 From 250a394da48120bd2deb791eb4c7fb6232a342bb Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 16 Jan 2023 11:05:41 +0100 Subject: tv vim: tabm with S-F{1,2} --- tv/2configs/vim.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tv/2configs') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index fde66d777..2b5cd8d21 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -133,6 +133,11 @@ with import ./lib; imap imap + nnoremap :tabm -1 + nnoremap :tabm +1 + imap + imap + noremap :ShowSyntax " -- cgit v1.2.3 From dc3f5c683822d177001b71cc9ee6afa49f3b9969 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 17 Jan 2023 01:04:45 +0100 Subject: tv vimrc: rewrite to vim9script --- tv/2configs/vim.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'tv/2configs') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 2b5cd8d21..2c17fbc74 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -71,7 +71,9 @@ with import ./lib; ]; }; - vimrc = pkgs.writeText "vimrc" '' + vimrc = pkgs.writeText "vimrc" /* vim */ '' + vim9script + set nocompatible set autoindent @@ -140,28 +142,28 @@ with import ./lib; noremap :ShowSyntax - " + # noremap Oa | noremap! Oa noremap Ob | noremap! Ob noremap Oc | noremap! Oc noremap Od | noremap! Od - " <[C]S-{Up,Down,Right,Left> + # <[C]S-{Up,Down,Right,Left}> noremap [a | noremap! [a noremap [b | noremap! [b noremap [c | noremap! [c noremap [d | noremap! [d vnoremap u - " fzf + # fzf nnoremap q :Buffers nnoremap f :Files nnoremap w :Rg - " edit alternate buffer - " For some reason neither putting 6 nor ^ works here... + # edit alternate buffer + # For some reason neither putting 6 nor ^ works here... nnoremap a  - if $TOUCHSCREEN == 1 + if $TOUCHSCREEN == "1" nnoremap nnoremap nnoremap 3 -- cgit v1.2.3 From ab43821bb1b084228146c47eb5f529415e617392 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 17 Jan 2023 01:05:26 +0100 Subject: tv vim: remember last position --- tv/2configs/vim.nix | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tv/2configs') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 2c17fbc74..8aee31082 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -173,5 +173,11 @@ with import ./lib; nnoremap nnoremap endif + + # remember last position + autocmd BufReadPost * + \ if line("'\"") > 0 && line("'\"") <= line("$") | + \ exe "normal! g`\"" | + \ endif ''; } -- cgit v1.2.3 From ad56590a707b3c7b4738fdd1a53546e9e30aca52 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 18 Jan 2023 17:29:27 +0100 Subject: tv configs: remove unused urxvt module --- tv/2configs/urxvt.nix | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 tv/2configs/urxvt.nix (limited to 'tv/2configs') diff --git a/tv/2configs/urxvt.nix b/tv/2configs/urxvt.nix deleted file mode 100644 index 89bb421aa..000000000 --- a/tv/2configs/urxvt.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ pkgs, ... }: - -with builtins; - -let - users = [ "tv" ]; - urxvt = pkgs.rxvt_unicode; - mkService = user: { - description = "urxvt terminal daemon"; - wantedBy = [ "multi-user.target" ]; - restartIfChanged = false; - serviceConfig = { - Restart = "always"; - User = user; - ExecStart = "${urxvt}/bin/urxvtd"; - }; - }; - -in - -{ - environment.systemPackages = [ urxvt ]; - systemd.services = listToAttrs (map (u: { name = "${u}-urxvtd"; value = mkService u; }) users); -} -- cgit v1.2.3 From 23fdaa1eedc330d28eaa0111dba65f33d586824e Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 18 Jan 2023 22:33:02 +0100 Subject: tv winmax2: retab --- tv/2configs/hw/winmax2.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tv/2configs') diff --git a/tv/2configs/hw/winmax2.nix b/tv/2configs/hw/winmax2.nix index bda349e96..0a207f231 100644 --- a/tv/2configs/hw/winmax2.nix +++ b/tv/2configs/hw/winmax2.nix @@ -8,9 +8,9 @@ hardware.opengl.enable = true; hardware.opengl.extraPackages = [ - pkgs.amdvlk - pkgs.rocm-opencl-icd - pkgs.rocm-opencl-runtime + pkgs.amdvlk + pkgs.rocm-opencl-icd + pkgs.rocm-opencl-runtime ]; hardware.video.hidpi.enable = true; -- cgit v1.2.3