From: Patrick Date: Mon, 6 Oct 2025 20:19:00 +0000 (+0200) Subject: update config X-Git-Url: https://gitweb.ps.run/flake_thinkpad/commitdiff_plain/7d4be89983f22a94e36bf18bb21453b36aeee3ae update config q --- diff --git a/configuration.nix b/configuration.nix index e236758..cb526d1 100644 --- a/configuration.nix +++ b/configuration.nix @@ -193,34 +193,46 @@ in configDir = "/home/ps/.config/syncthing"; }; - services.tlp = { - enable = true; - settings = { - CPU_SCALING_GOVERNOR_ON_AC = "performance"; - CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; - - CPU_ENERGY_PERF_POLICY_ON_AC = "balance_performance"; - CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; - - PLATFORM_PROFILE_ON_AC = "balanced"; - PLATFORM_PROFILE_ON_BAT = "low-power"; - - CPU_BOOST_ON_AC = "1"; - CPU_BOOST_ON_BAT = "0"; - - AMDGPU_ABM_LEVEL_ON_AC = "0"; - AMDGPU_ABM_LEVEL_ON_BAT = "3"; - - CPU_MIN_PERF_ON_AC = 0; - CPU_MAX_PERF_ON_AC = 100; - CPU_MIN_PERF_ON_BAT = 0; - CPU_MAX_PERF_ON_BAT = 20; - - START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge - STOP_CHARGE_THRESH_BAT0 = 85; # 85 and above it stops charging + services.auto-cpufreq.enable = true; + services.auto-cpufreq.settings = { + battery = { + governor = "powersave"; + turbo = "never"; + }; + charger = { + governor = "performance"; + turbo = "auto"; }; }; + # services.tlp = { + # enable = true; + # settings = { + # CPU_SCALING_GOVERNOR_ON_AC = "performance"; + # CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + # + # CPU_ENERGY_PERF_POLICY_ON_AC = "balance_performance"; + # CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; + # + # PLATFORM_PROFILE_ON_AC = "balanced"; + # PLATFORM_PROFILE_ON_BAT = "low-power"; + # + # CPU_BOOST_ON_AC = "1"; + # CPU_BOOST_ON_BAT = "0"; + # + # AMDGPU_ABM_LEVEL_ON_AC = "0"; + # AMDGPU_ABM_LEVEL_ON_BAT = "3"; + # + # CPU_MIN_PERF_ON_AC = 0; + # CPU_MAX_PERF_ON_AC = 100; + # CPU_MIN_PERF_ON_BAT = 0; + # CPU_MAX_PERF_ON_BAT = 20; + # + # # START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge + # STOP_CHARGE_THRESH_BAT0 = 90; # 85 and above it stops charging + # }; + # }; + services.udev.extraRules = '' KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{serial}=="*vial:f64c2b3c*", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl" ''; @@ -230,6 +242,11 @@ in graphics = { enable = true; enable32Bit = true; + extraPackages = with pkgs; [ + rocmPackages.clr.icd + mesa.opencl + amf + ]; }; amdgpu.amdvlk = { @@ -296,13 +313,13 @@ in shell = pkgs.bash; extraGroups = [ "networkmanager" "wheel" "dialout" "jackaudio" "lp" "incus-admin" ]; }; - sshd = { - isSystemUser = true; - packages = [ - pkgs.python3 - ]; - group = "ssh"; - }; + # sshd = { + # isSystemUser = true; + # packages = [ + # pkgs.python3 + # ]; + # group = "ssh"; + # }; chirp = { isSystemUser = true; packages = [ @@ -323,10 +340,9 @@ in inherit inputs; inherit wallpaper; }; - # users = { - # "ps" = import ./home.nix; - # }; - users.ps.imports = [ ./home.nix ]; + users = { + "ps" = import ./home.nix; + }; }; # Enable automatic login for the user. @@ -341,19 +357,32 @@ in # Allow unfree packages nixpkgs.config.allowUnfree = true; + + environment.variables = { + RUSTICL_ENABLE = "radeonsi"; + }; # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ - args.inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.zig - args.inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.zls + args.inputs.zls.inputs.zig-overlay.packages.${pkgs.system}.master + args.inputs.zls.packages.${pkgs.system}.zls args.inputs.psch-flakes.packages.${pkgs.system}.resetmsmice + args.inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.zuban vim wget file git kitty i3 gdb mosh cmake + entr + asciinema asciinema-agg + shellify scrcpy xsel + xcwd + + pinta + mupdf + davinci-resolve pavucontrol syncthingtray @@ -388,28 +417,28 @@ in # Enable the OpenSSH daemon. services.openssh = { - enable = false; + enable = true; ports = [ 22 ]; - settings = { - PasswordAuthentication = false; - PermitRootLogin = "no"; - }; - authorizedKeysCommand = - let keys = pkgs.writers.writePython3Bin "keys" {} '' - import sys - - args = sys.argv - - print(args) - ''; - in - "${keys}/bin/keys"; - authorizedKeysCommandUser = "ps"; + # settings = { + # PasswordAuthentication = false; + # PermitRootLogin = "no"; + # }; + # authorizedKeysCommand = + # let keys = pkgs.writers.writePython3Bin "keys" {} '' + # import sys + # + # args = sys.argv + # + # print(args) + # ''; + # in + # "${keys}/bin/keys"; + # authorizedKeysCommandUser = "ps"; }; # Open ports in the firewall. - networking.firewall.allowedTCPPorts = [ 22 1234 5900 6011 6021 6022 8080 53317 ]; - networking.firewall.allowedUDPPorts = [ 5901 53317 ]; + networking.firewall.allowedTCPPorts = [ 22 1234 5900 6011 6021 6022 8080 53317 7236 7250 ]; + networking.firewall.allowedUDPPorts = [ 5901 53317 7236 5353 ]; # Or disable the firewall altogether. # networking.firewall.enable = false; diff --git a/flake.lock b/flake.lock index 9fe2cd5..7b6868e 100644 --- a/flake.lock +++ b/flake.lock @@ -29,11 +29,11 @@ }, "locked": { "dir": "pkgs/firefox-addons", - "lastModified": 1751515409, - "narHash": "sha256-yu+/TxHkuZ8GHKwpKTv1BpfbYD1wH1CyPsOmY72chTg=", + "lastModified": 1752033806, + "narHash": "sha256-XUHXDV8vwVjX6aYeJmPShMGJI9jx+JC0yWw0hsKbtMw=", "owner": "rycee", "repo": "nur-expressions", - "rev": "2e0dcafe8c48470e036908f34a2a1413f75bd804", + "rev": "08bd298d38f4110a3049cbe1876c1c77a8b4797f", "type": "gitlab" }, "original": { @@ -43,6 +43,22 @@ "type": "gitlab" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -97,6 +113,45 @@ "type": "github" } }, + "flake-utils_4": { + "inputs": { + "systems": "systems_4" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "zls", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -104,11 +159,11 @@ ] }, "locked": { - "lastModified": 1751468302, - "narHash": "sha256-tWosziZTT039x6PgEZUhzGlV8oLvdDmIgKTE8ESMaEA=", + "lastModified": 1751810233, + "narHash": "sha256-kllkNbIqQi3VplgTMeGzuh1t8Gk8TauvkTRt93Km+tQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "501cfec8277f931a9c9af9f23d3105c537faeafe", + "rev": "9b0873b46c9f9e4b7aa01eb634952c206af53068", "type": "github" }, "original": { @@ -142,11 +197,11 @@ "spectrum": "spectrum" }, "locked": { - "lastModified": 1750358184, - "narHash": "sha256-17EYMeY5v8KRk9HW6Z4dExY8Wg4y/zM2eM2wbbx+vMs=", + "lastModified": 1751732733, + "narHash": "sha256-MuaFFGHdShvGdHKrd3PUI2om+njixdG/1dGlglRdK8Q=", "owner": "astro", "repo": "microvm.nix", - "rev": "fd9f5dba1ffee5ad6f29394b2a9e4c66c1ce77dc", + "rev": "9d3d845ccb1a3f81747d027e95b110d4637468d0", "type": "github" }, "original": { @@ -157,11 +212,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1751211869, - "narHash": "sha256-1Cu92i1KSPbhPCKxoiVG5qnoRiKTgR5CcGSRyLpOd7Y=", + "lastModified": 1751943650, + "narHash": "sha256-7orTnNqkGGru8Je6Un6mq1T8YVVU/O5kyW4+f9C1mZQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b43c397f6c213918d6cfe6e3550abfe79b5d1c51", + "rev": "88983d4b665fb491861005137ce2b11a9f89f203", "type": "github" }, "original": { @@ -173,11 +228,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1751271578, - "narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=", + "lastModified": 1758427187, + "narHash": "sha256-pHpxZ/IyCwoTQPtFIAG2QaxuSm8jWzrzBGjwQZIttJc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df", + "rev": "554be6495561ff07b6c724047bdd7e0716aa7b46", "type": "github" }, "original": { @@ -217,17 +272,18 @@ "microvm": "microvm", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", - "psch-flakes": "psch-flakes" + "psch-flakes": "psch-flakes", + "zls": "zls" } }, "spectrum": { "flake": false, "locked": { - "lastModified": 1746869549, - "narHash": "sha256-BKZ/yZO/qeLKh9YqVkKB6wJiDQJAZNN5rk5NsMImsWs=", + "lastModified": 1751265943, + "narHash": "sha256-XoHSo6GEElzRUOYAEg/jlh5c8TDsyDESFIux3nU/NMc=", "ref": "refs/heads/main", - "rev": "d927e78530892ec8ed389e8fae5f38abee00ad87", - "revCount": 862, + "rev": "37c8663fab86fdb202fece339ef7ac7177ffc201", + "revCount": 904, "type": "git", "url": "https://spectrum-os.org/git/spectrum" }, @@ -280,6 +336,66 @@ "repo": "default", "type": "github" } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "zig-overlay": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils_4", + "nixpkgs": [ + "zls", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1755864794, + "narHash": "sha256-hgnov6RLA+DD4Uocs/vCbiH3/3sKvqiJOKHpdhGyVAI=", + "owner": "mitchellh", + "repo": "zig-overlay", + "rev": "5cd601f8760d2383210b7b8c8a45fc79388f3ddf", + "type": "github" + }, + "original": { + "owner": "mitchellh", + "repo": "zig-overlay", + "type": "github" + } + }, + "zls": { + "inputs": { + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ], + "zig-overlay": "zig-overlay" + }, + "locked": { + "lastModified": 1756050261, + "narHash": "sha256-RC7icNWQgTwyMYWjVx0lAikRwmRanmav/qs21/lKKvo=", + "owner": "zigtools", + "repo": "zls", + "rev": "35fa2d3ef62378db68b1e0805b9e529f6df9f5ce", + "type": "github" + }, + "original": { + "owner": "zigtools", + "repo": "zls", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 593a036..4996186 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,12 @@ url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs.nixpkgs.follows = "nixpkgs"; }; - + + zls = { + url = "github:zigtools/zls"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + microvm.url = "github:astro/microvm.nix"; microvm.inputs.nixpkgs.follows = "nixpkgs"; }; diff --git a/home.nix b/home.nix index fcf744d..e3394c6 100644 --- a/home.nix +++ b/home.nix @@ -107,9 +107,7 @@ in bars = []; modifier = "Mod4"; terminal = "${pkgs.kitty}/bin/kitty"; - gaps = { - inner = 5; - }; + gaps = { inner = 0; outer = 0; }; keybindings = let mod = config.xsession.windowManager.i3.config.modifier; @@ -386,17 +384,21 @@ in tnoremap map nnoremap :noh + nnoremap gr :Telescope lsp_references + nnoremap gd :Telescope lsp_definitions nnoremap u :UndotreeToggle :UndotreeFocus nnoremap f :Telescope find_files nnoremap b :Telescope buffers nnoremap e :Telescope diagnostics nnoremap g :Telescope live_grep nnoremap s :Telescope lsp_document_symbols - nnoremap r :Telescope lsp_references - nnoremap :Telescope lsp_references - nnoremap d :Telescope lsp_definitions - noremap y "+y" - noremap p "+p" + nnoremap r :lua vim.lsp.buf.rename() + nnoremap n :bnext + nnoremap m :bprevious + noremap y "+y + noremap p "+p + noremap "+ + noremap "+ " augroup FormatAutogroup " autocmd! @@ -407,11 +409,22 @@ in \ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit' \ | exe "normal! g`\"" \ | endif + + " Use persistent history. + if !isdirectory("/tmp/.vim-undo-dir") + call mkdir("/tmp/.vim-undo-dir", "", 0700) + endif + set undodir=/tmp/.vim-undo-dir + set undofile ''; extraLuaConfig = '' - require('lspconfig').zls.setup{} - require('lspconfig').clangd.setup{} + vim.lsp.enable('zls') + vim.lsp.enable('clangd') + vim.lsp.config('zuban', {}) + vim.lsp.enable('zuban') + require('guess-indent').setup {} local util = require('formatter.util') + local telescope = require('telescope') require('formatter').setup { logging = true, log_level = vim.log.levels.WARN, @@ -439,7 +452,12 @@ in }, completion = { list = { selection = { preselect = false, } }, + documentation = { + auto_show = true, + -- treesitter_highlighting = false, + }, }, + signature = { enabled = true }, } ''; }; @@ -734,6 +752,7 @@ in clang-tools bear linuxPackages_latest.perf texliveFull + asciidoctor-with-extensions emscripten caddy python3 @@ -758,7 +777,7 @@ in wireshark nil bc - ffmpeg + ffmpeg-full sc-im visidata localsend vis @@ -806,9 +825,8 @@ in (pkgs.writeShellScriptBin "fzfdir" '' find "$1" -name "$2" | ${pkgs.fzf}/bin/fzf --layout=reverse '') - (pkgs.writeShellScriptBin "md-app" '' - #popup bash -c 'file=$(fzfdir "md" "*.md") && run md $file' - firefox -p appmode --new-window localhost:8123/home/ps/sync/txt/hsrm + (pkgs.writeShellScriptBin "file-app" '' + app localhost:8123 '') (pkgs.writeShellScriptBin "run-popup" '' popup bash -c 'file=$(compgen -c | grep -v fzf | sort -u | fzf --layout=reverse --print-query | tail -n 1) && run $file'