]> gitweb.ps.run Git - flake_thinkpad/commitdiff
update config
authorPatrick <patrick.schoenberger@posteo.de>
Mon, 6 Oct 2025 20:19:00 +0000 (22:19 +0200)
committerPatrick <patrick.schoenberger@posteo.de>
Mon, 6 Oct 2025 20:19:00 +0000 (22:19 +0200)
q

configuration.nix
flake.lock
flake.nix
home.nix

index e23675844ed5423f68f86e32ccba7a85d6033fd0..cb526d1b7c64682cac7f7a2ffab79a22679138c9 100644 (file)
@@ -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;
 
index 9fe2cd5f699f2765cf73f8e7a3c5394c519ec4ff..7b6868e1c0ba251fc0fb0944f8e38d43b94aee2e 100644 (file)
       },
       "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": {
         "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"
         "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": [
         ]
       },
       "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": {
         "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": {
     },
     "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": {
     },
     "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": {
         "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"
       },
         "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",
index 593a03645b7de7d29ed472b8b7ec2005c821e3da..4996186492ebbe7568504dd78345e92203713273 100644 (file)
--- a/flake.nix
+++ b/flake.nix
       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";
   };
index fcf744d0fcbee41d5bbaa258f5db356b94bb56cf..e3394c633fc99de324294302c48815662d464ed1 100644 (file)
--- 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 <Esc> <C-\><C-n>
       map <Space> <Leader>
       nnoremap <Esc> :noh<CR>
+      nnoremap gr :Telescope lsp_references<CR>
+      nnoremap gd :Telescope lsp_definitions<CR>
       nnoremap <leader>u :UndotreeToggle<CR> :UndotreeFocus<CR>
       nnoremap <leader>f :Telescope find_files<CR>
       nnoremap <leader>b :Telescope buffers<CR>
       nnoremap <leader>e :Telescope diagnostics<CR>
       nnoremap <leader>g :Telescope live_grep<CR>
       nnoremap <leader>s :Telescope lsp_document_symbols<CR>
-      nnoremap <leader>r :Telescope lsp_references<CR>
-      nnoremap <leader><S-r> :Telescope lsp_references<CR><C-q>
-      nnoremap <leader>d :Telescope lsp_definitions<CR>
-      noremap <leader>y "+y"<CR>
-      noremap <leader>p "+p"<CR>
+      nnoremap <leader>r :lua vim.lsp.buf.rename()<CR>
+      nnoremap <leader>n :bnext<CR>
+      nnoremap <leader>m :bprevious<CR>
+      noremap <leader>y "+y<CR>
+      noremap <leader>p "+p<CR>
+      noremap <leader><S-y> "+<S-y><CR>
+      noremap <leader><S-p> "+<S-p><CR>
 
       " 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'