From 869a24b55e80906f34f5d541db8c22ff4eb264a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 28 Apr 2024 23:36:01 +0200 Subject: [PATCH 1/5] Install home manager on server --- .config/home-manager/home.nix | 75 +++++++++++++++++++++++++ .config/nvim/lua/plugins/treesitter.lua | 2 +- .config/zsh/.zshrc | 3 + .profile | 1 + 4 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 .config/home-manager/home.nix diff --git a/.config/home-manager/home.nix b/.config/home-manager/home.nix new file mode 100644 index 0000000..342093c --- /dev/null +++ b/.config/home-manager/home.nix @@ -0,0 +1,75 @@ +{ config, pkgs, ... }: + +{ + home.username = "server"; + home.homeDirectory = "/home/server"; + home.stateVersion = "23.11"; # Please read the comment before changing. + + # The home.packages option allows you to install Nix packages into your + # environment. + home.packages = [ + pkgs.ctop + pkgs.nodejs + pkgs.luarocks + pkgs.jre + pkgs.stdenv.cc.cc.lib + + # # It is sometimes useful to fine-tune packages, for example, by applying + # # overrides. You can do that directly here, just don't forget the + # # parentheses. Maybe you want to install Nerd Fonts with a limited number of + # # fonts? + # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) + + # # You can also create simple shell scripts directly inside your + # # configuration. For example, this adds a command 'my-hello' to your + # # environment: + # (pkgs.writeShellScriptBin "my-hello" '' + # echo "Hello, ${config.home.username}!" + # '') + ]; + + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; + + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; + + # Home Manager can also manage your environment variables through + # 'home.sessionVariables'. These will be explicitly sourced when using a + # shell provided by Home Manager. If you don't want to manage your shell + # through Home Manager then you have to manually source 'hm-session-vars.sh' + # located at either + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/server/etc/profile.d/hm-session-vars.sh + # + home.sessionVariables = { + EDITOR = "nvim"; + LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib"; + }; + + programs.home-manager.enable = true; + + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; + defaultEditor = true; + }; +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua index 12684a7..1140532 100644 --- a/.config/nvim/lua/plugins/treesitter.lua +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -6,7 +6,7 @@ return { }, build = ":TSUpdate", opts = { - ensure_installed = { "cpp", "c", "lua", "vim", "dockerfile", "python", "java", "cmake", "diff", "gitcommit", "html", "css", "javascript", "json", "rust", "sql", "yaml", "markdown", "markdown_inline" }, + ensure_installed = { "cpp", "c", "lua", "vim", "dockerfile", "python", "java", "cmake", "diff", "gitcommit", "html", "css", "javascript", "json", "rust", "sql", "yaml", "markdown", "markdown_inline", "nix" }, auto_install = true, highlight = { enable = true, diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 862a5f0..b848ee1 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -7,6 +7,9 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]] source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi +# Home Manager +source $XDG_STATE_HOME/nix/profile/etc/profile.d/hm-session-vars.sh + # Use LS colors for ZSH completion export LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:' zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} diff --git a/.profile b/.profile index 44b0075..6107181 100644 --- a/.profile +++ b/.profile @@ -18,3 +18,4 @@ export XDG_CURRENT_DESKTOP=GNOME export OPENCV_LOG_LEVEL=ERROR export PATH="$HOME/.local/bin:$PATH" export COLORTERM=truecolor +export NIX_PATH=$XDG_STATE_HOME/nix/defexpr/channels From 033167324d07cf360197624569d464c2ed1f19b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Mon, 29 Apr 2024 10:51:21 +0200 Subject: [PATCH 2/5] Try to fix some zsh issues --- .config/zsh/.zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 862a5f0..1f8cc80 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -83,7 +83,7 @@ function find_global() { fi file="$(cat $FZY_CACHE | fzy -l 20)" echo $file | cat - $FZY_CACHE | awk '!x[$0]++' > /tmp/fzy_paths_$file_type && mv /tmp/fzy_paths_$file_type $FZY_CACHE - echo $file + echo "$file" } function open_path() { @@ -270,7 +270,7 @@ fi if [[ "$(hostname)" == "mallorea" ]]; then alias lf="/usr/bin/lf -last-dir-path /tmp/lf_dir && cd \"\$(cat /tmp/lf_dir 2> /dev/null || pwd)\"" else - alias lf="cd \"\$(/usr/bin/lf -print-selection -print-last-dir)\"" + alias lf="cd \"\$(/usr/bin/lf -print-last-dir)\"" fi function o () { From 3163f29d0a608cc560e3a4975f9dde9b3c3ad9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Mon, 29 Apr 2024 10:52:06 +0200 Subject: [PATCH 3/5] Update scripts --- .config/hypr/hyprland.conf | 1 + .config/nvim/lazy-lock.json | 55 +++++++++++++++-------------- .config/nvim/lua/plugins/oil.lua | 1 + .config/scripts/disk_check.sh | 10 +++--- .config/scripts/install.sh | 4 +-- .config/scripts/launch_alacritty.sh | 2 -- .config/scripts/performance.sh | 2 ++ .config/scripts/powersave.sh | 4 ++- .config/scripts/setup_display.sh | 12 ------- 9 files changed, 42 insertions(+), 49 deletions(-) delete mode 100755 .config/scripts/setup_display.sh diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 22e3c2a..9ea7c2e 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -13,6 +13,7 @@ exec-once=wl-paste --type image --watch cliphist store exec-once=/usr/lib/mate-polkit/polkit-mate-authentication-agent-1 exec-once=/usr/lib/kdeconnectd exec-once=waybar +exec-once=hyprpm reload -n # windowrulev2 = tile, class:.* windowrulev2 = float, title:^(rofi)(.*)$ diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 02a2431..9df811d 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,45 +1,46 @@ { "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "bufferline.nvim": { "branch": "main", "commit": "d6cb9b7cac52887bcac65f8698e67479553c0748" }, - "catppuccin": { "branch": "main", "commit": "c0de3b46811fe1ce3912e2245a9dfbea6b41c300" }, + "bufferline.nvim": { "branch": "main", "commit": "f4b4b980ce88d546aeb69d11463187c8f716a1a1" }, + "catppuccin": { "branch": "main", "commit": "a1439ad7c584efb3d0ce14ccb835967f030450fe" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-snippy": { "branch": "master", "commit": "6e39210aa3a74e2bf6462f492eaf0d436cd2b7d3" }, "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, - "formatter.nvim": { "branch": "master", "commit": "cb4778b8432f1ae86dae4634c0b611cb269a4c2f" }, - "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, - "lualine.nvim": { "branch": "master", "commit": "8b56462bfb746760465264de41b4907310f113ec" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" }, - "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, - "neogit": { "branch": "master", "commit": "9c5b1392f22203c1ea082ad42f2c97f3ca6b5de1" }, - "nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" }, - "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, - "nvim-lspconfig": { "branch": "master", "commit": "7f5cf1121f772850a30bdaf83fb448e88846aa58" }, + "formatter.nvim": { "branch": "master", "commit": "ad246d34ce7a32f752071ed81b09b94e6b127fad" }, + "gen.nvim": { "branch": "main", "commit": "87fbe811155b90eea58622614809705b966009ad" }, + "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, + "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" }, + "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, + "neogit": { "branch": "master", "commit": "0cae7abc30cb91d661f28257c331fcb5b5198e31" }, + "nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" }, + "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, + "nvim-lspconfig": { "branch": "master", "commit": "7133e85c3df14a387da8942c094c7edddcdef309" }, "nvim-neoclip.lua": { "branch": "main", "commit": "798cd0592a81c185465db3a091a0ff8a21af60fd" }, "nvim-snippy": { "branch": "master", "commit": "6295b6cb30725c343a8986096c9f04b0e7646c52" }, "nvim-tree.lua": { "branch": "master", "commit": "59e65d88db177ad1e6a8cffaafd4738420ad20b6" }, - "nvim-treesitter": { "branch": "master", "commit": "212b7a504cf56f85d1acc5be237261b42d7560c5" }, - "nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" }, - "obsidian.nvim": { "branch": "main", "commit": "b1f5eb198a6e8dffffc484e803f0b3de4e15f815" }, - "oil.nvim": { "branch": "master", "commit": "c437f3c5b0da0a9cc6a222d87212cce11b80ba75" }, - "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, - "sqlite.lua": { "branch": "master", "commit": "40701b6151f8883980c1548647116de39b763540" }, + "nvim-treesitter": { "branch": "master", "commit": "dbbaa3f66e736a8e446572e1079ffa2f6d40b266" }, + "nvim-web-devicons": { "branch": "master", "commit": "27eac98fd6675d29d0e19d4d0622fd7a3968483a" }, + "obsidian.nvim": { "branch": "main", "commit": "b1bfc2ad9172f0405bf6c21e1f63cfb73f79b480" }, + "oil.nvim": { "branch": "master", "commit": "f3a31eba24587bc038592103d8f7e64648292115" }, + "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, + "sqlite.lua": { "branch": "master", "commit": "d0ffd703b56d090d213b497ed4eb840495f14a11" }, "telescope-fzy-native.nvim": { "branch": "master", "commit": "282f069504515eec762ab6d6c89903377252bf5b" }, - "telescope-undo.nvim": { "branch": "main", "commit": "d3afc1c105535a90caec092ce27a113f77ba7b84" }, - "telescope.nvim": { "branch": "master", "commit": "dc1ea28cc2a02cd1cebb9d80e967807d668f78f8" }, - "todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" }, - "tree-sitter-hyprlang": { "branch": "master", "commit": "fc1d331586e4da2b5f5bcfa89d630ebafe66458b" }, + "telescope-undo.nvim": { "branch": "main", "commit": "d19e2edc8b18d03283bd91f67310ac300ad003ce" }, + "telescope.nvim": { "branch": "master", "commit": "35f94f0ef32d70e3664a703cefbe71bd1456d899" }, + "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, + "tree-sitter-hyprlang": { "branch": "master", "commit": "e5da7d0aa44403153e0394d87d9edea4e5bd6609" }, "tree-sitter-typst": { "branch": "master", "commit": "823309ed8b872dd33c7f350a3bab3d6e51436a5a" }, - "trim.nvim": { "branch": "master", "commit": "17a16c532a0ba1528fe9a4d79015b2843734502d" }, - "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, - "vim-bracketed-paste": { "branch": "master", "commit": "45411da73cc159e4fc2138d930553d247bbfbcdc" }, + "trim.nvim": { "branch": "master", "commit": "4fe47a46c02a58894ded8328ca81f6c214a892f5" }, + "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, + "vim-bracketed-paste": { "branch": "master", "commit": "ffa3bc10ab511a646f1b30bc9345f240c15394e9" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-hypr-nav": { "branch": "main", "commit": "6ab4865a7eb5aad35305298815a4563c9d48556a" }, - "vim-rooter": { "branch": "master", "commit": "1353fa47ee3a81083c284e28ff4f7d92655d7c9e" }, + "vim-rooter": { "branch": "master", "commit": "45e53f01e4e1c4a3ee20814de232162713aff578" }, "vim-snippets": { "branch": "master", "commit": "393d980157b8149b3ff65a48bc4aae24dca9c846" }, - "vimtex": { "branch": "master", "commit": "a77d14b2e4391c0d3e860708bb1fd56161ab68eb" } + "vimtex": { "branch": "master", "commit": "18caeded58202e63bb170b5c745e6ee0bf870ba2" } } \ No newline at end of file diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua index d89ea95..b4e1df6 100644 --- a/.config/nvim/lua/plugins/oil.lua +++ b/.config/nvim/lua/plugins/oil.lua @@ -13,6 +13,7 @@ return { 'stevearc/oil.nvim', dependencies = { "nvim-tree/nvim-web-devicons" }, lazy = true, opts = { + default_file_explorer = true, keymaps = { ["g?"] = "actions.show_help", [""] = function() require("oil").select({}, save_dir) end, diff --git a/.config/scripts/disk_check.sh b/.config/scripts/disk_check.sh index c2ca6d7..7185f6a 100755 --- a/.config/scripts/disk_check.sh +++ b/.config/scripts/disk_check.sh @@ -2,14 +2,14 @@ REPORT_EMAIL=email@thomasave.be -ZPOOL_STATUS=`zpool status -x` -if [ "$ZPOOL_STATUS" = "all pools are healthy" -o "$ZPOOL_STATUS" = "no pools available" ] +ZPOOL_STATUS=$(zpool status -x) +if [ "$ZPOOL_STATUS" = "all pools are healthy" ] || [ "$ZPOOL_STATUS" = "no pools available" ] then - echo -n 0 > /var/db/zpool.status + printf 0 > /var/db/zpool.status else - if [ `cat /var/db/zpool.status` -eq 0 ] + if [ "$(cat /var/db/zpool.status)" -eq 0 ] then zpool status | mail -s "ZPOOL NOT HEALTHY" $REPORT_EMAIL - echo -n 1 > /var/db/zpool.status + printf 1 > /var/db/zpool.status fi fi diff --git a/.config/scripts/install.sh b/.config/scripts/install.sh index ecd0eba..c5c3a2f 100755 --- a/.config/scripts/install.sh +++ b/.config/scripts/install.sh @@ -45,8 +45,8 @@ if $NVIM; then $SUDO apt install -y software-properties-common $SUDO add-apt-repository ppa:neovim-ppa/unstable -y $SUDO curl -sL https://deb.nodesource.com/setup_21.x | $SUDO bash - - declare repo_version=$(if command -v lsb_release &> /dev/null; then lsb_release -r -s; else grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"'; fi) - wget https://packages.microsoft.com/config/ubuntu/$repo_version/packages-microsoft-prod.deb -O packages-microsoft-prod.deb + repo_version=$(if command -v lsb_release &> /dev/null; then lsb_release -r -s; else grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"'; fi) + wget https://packages.microsoft.com/config/ubuntu/"$repo_version"/packages-microsoft-prod.deb -O packages-microsoft-prod.deb $SUDO dpkg -i packages-microsoft-prod.deb rm packages-microsoft-prod.deb $SUDO apt update diff --git a/.config/scripts/launch_alacritty.sh b/.config/scripts/launch_alacritty.sh index 3f1f431..12764c9 100755 --- a/.config/scripts/launch_alacritty.sh +++ b/.config/scripts/launch_alacritty.sh @@ -1,6 +1,5 @@ #!/bin/bash -RUNNING_SSH=false RUNNING_WAYPIPE=false SSH_CLIENT="" CHILD_PID=$(pgrep -P "$1") @@ -9,7 +8,6 @@ GRAND_CHILD_PID=$(pgrep -P "$CHILD_PID") if [ "$GRAND_CHILD_PID" != 0 ]; then GRAND_CHILD_NAME=$(ps -p "$GRAND_CHILD_PID" -o comm=) if [ "$GRAND_CHILD_NAME" == "ssh" ]; then - RUNNING_SSH=true CHILD_PID=$GRAND_CHILD_PID SSH_CLIENT=$(ps -p "$CHILD_PID" -o args --no-headers | awk '{ print $2 }') fi diff --git a/.config/scripts/performance.sh b/.config/scripts/performance.sh index a4a819a..ec8bcc6 100755 --- a/.config/scripts/performance.sh +++ b/.config/scripts/performance.sh @@ -1,3 +1,5 @@ +#!/bin/sh + cpupower frequency-set --governor performance echo 1 > /sys/devices/system/cpu/cpu1/online diff --git a/.config/scripts/powersave.sh b/.config/scripts/powersave.sh index 89cc8b4..19d089d 100755 --- a/.config/scripts/powersave.sh +++ b/.config/scripts/powersave.sh @@ -1,4 +1,6 @@ -cpupower frequency-set --governor powersave +#!/bin/sh + +cpupower frequency-set --governor powersave echo 0 > /sys/devices/system/cpu/cpu1/online echo 0 > /sys/devices/system/cpu/cpu2/online diff --git a/.config/scripts/setup_display.sh b/.config/scripts/setup_display.sh deleted file mode 100755 index 89633b1..0000000 --- a/.config/scripts/setup_display.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/zsh - -declare -i count=3 -declare -i seconds=0.5 - -while ((count)); do - xrandr >/dev/null - sleep $seconds - ((count--)) -done - -xrandr --fb 7680x2160 --output DP-2 --mode 1920x1080 --pos 0x0 --output DP-0 --primary --mode 3840x2160 --pos 1920x0 --output HDMI-0 --mode 1920x1080 --pos 5760x0 From 0c8b1f5bf9cc76c0526cc4a9219e490405a8a90e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Mon, 29 Apr 2024 10:53:00 +0200 Subject: [PATCH 4/5] update home-manager config --- .config/home-manager/home.nix | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/.config/home-manager/home.nix b/.config/home-manager/home.nix index 342093c..4f8e424 100644 --- a/.config/home-manager/home.nix +++ b/.config/home-manager/home.nix @@ -4,6 +4,8 @@ home.username = "server"; home.homeDirectory = "/home/server"; home.stateVersion = "23.11"; # Please read the comment before changing. + targets.genericLinux.enable = true; + nixpkgs.config.allowUnfree = true; # The home.packages option allows you to install Nix packages into your # environment. @@ -43,22 +45,6 @@ # ''; }; - # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. These will be explicitly sourced when using a - # shell provided by Home Manager. If you don't want to manage your shell - # through Home Manager then you have to manually source 'hm-session-vars.sh' - # located at either - # - # ~/.nix-profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # /etc/profiles/per-user/server/etc/profile.d/hm-session-vars.sh - # home.sessionVariables = { EDITOR = "nvim"; LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib"; From 1d95babb607b733fa7e020b947dea5ee86006cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Mon, 29 Apr 2024 10:54:43 +0200 Subject: [PATCH 5/5] Only source home manager if installed --- .config/zsh/.zshrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 9dfdcb0..d6294af 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -8,7 +8,9 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]] fi # Home Manager -source $XDG_STATE_HOME/nix/profile/etc/profile.d/hm-session-vars.sh +if [ -f "$XDG_STATE_HOME/nix/profile/etc/profile.d/hm-session-vars.sh" ]; then + source $XDG_STATE_HOME/nix/profile/etc/profile.d/hm-session-vars.sh +fi # Use LS colors for ZSH completion export LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:'