diff --git a/flake.lock b/flake.lock index 16a50c3..d0f353d 100644 --- a/flake.lock +++ b/flake.lock @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1747274630, - "narHash": "sha256-87RJwXbfOHyzTB9LYagAQ6vOZhszCvd8Gvudu+gf3qo=", + "lastModified": 1747742835, + "narHash": "sha256-kYL4GCwwznsypvsnA20oyvW8zB/Dvn6K5G/tgMjVMT4=", "owner": "nix-community", "repo": "disko", - "rev": "ec7c109a4f794fce09aad87239eab7f66540b888", + "rev": "df522e787fdffc4f32ed3e1fca9ed0968a384d62", "type": "github" }, "original": { @@ -371,11 +371,11 @@ }, "master": { "locked": { - "lastModified": 1747542820, - "narHash": "sha256-GaOZntlJ6gPPbbkTLjbd8BMWaDYafhuuYRNrxCGnPJw=", + "lastModified": 1747961295, + "narHash": "sha256-4zIgtNabrwQL0MjaYrvBfrunVwoESjkwVXKuL943uQU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "292fa7d4f6519c074f0a50394dbbe69859bb6043", + "rev": "9f90d00a4fdd6daad5b906dd3fac4991023e4c59", "type": "github" }, "original": { @@ -387,11 +387,11 @@ }, "mnw": { "locked": { - "lastModified": 1747507276, - "narHash": "sha256-mGxeIGNqgY2r2Ji2hZ8cpy5lLFwnkUq4XVHQeDMiMsE=", + "lastModified": 1747586468, + "narHash": "sha256-hqE5MB6fmuIAJnvDgA7UTKkaQHJr3PCWzHEL1i4z3PU=", "owner": "gerg-l", "repo": "mnw", - "rev": "74bb7dcc52df51337fde52c695216b64b2270a06", + "rev": "9dd8fc25ba906915540f762503974406e2d62ba1", "type": "github" }, "original": { @@ -411,11 +411,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1747475604, - "narHash": "sha256-QQI3EaXwqTiWAz6JCV1rD9g7uJzkhOK8gQpawVznYEs=", + "lastModified": 1747554936, + "narHash": "sha256-LBFEVTt3JISA/HDHznJanvlNvKllNfILr1nfI8KZmVM=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "a389c17ddc7b05050c35f9c1cd6b58a5d2ef720c", + "rev": "5a732bf3edb47767a25c3b05436e4c21f91edf91", "type": "github" }, "original": { @@ -427,11 +427,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1747473845, - "narHash": "sha256-jmjtmuIjIKuGWyNenamx6gaWPSVkD84TxngP6hX8Auc=", + "lastModified": 1747523215, + "narHash": "sha256-55RIMak4EwDaLdNTkM+4d3LjC90wlkNRaaG8DupK3AM=", "owner": "neovim", "repo": "neovim", - "rev": "8e8f4523c687cac4e966cb78856f73706dcec37d", + "rev": "5661f74ab2a6ef0c497ef2ea49bc58ea89b6ab6b", "type": "github" }, "original": { @@ -452,16 +452,16 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1745587317, - "narHash": "sha256-h9v4lIpLYhMY5z9QzAS2rSDz8ntHpqY51Ksk59lGdTA=", + "lastModified": 1747465671, + "narHash": "sha256-d1M0YTNodjKSzqVxMWL9Ey9CZGuhZwdbvNmTt3ytwJM=", "owner": "NixOS", "repo": "nix", - "rev": "3f811c237312a91cfe9314a215ebb4b159bccb23", + "rev": "39f9f5d1b6f6120b2fba929b9a5faa0ec24e7746", "type": "github" }, "original": { "owner": "NixOS", - "ref": "3f811c237312a91cfe9314a215ebb4b159bccb23", + "ref": "39f9f5d1b6f6120b2fba929b9a5faa0ec24e7746", "repo": "nix", "type": "github" } @@ -531,11 +531,11 @@ ] }, "locked": { - "lastModified": 1742568034, - "narHash": "sha256-QaMEhcnscfF2MqB7flZr+sLJMMYZPnvqO4NYf9B4G38=", + "lastModified": 1747663185, + "narHash": "sha256-Obh50J+O9jhUM/FgXtI3he/QRNiV9+J53+l+RlKSaAk=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "42ee229088490e3777ed7d1162cb9e9d8c3dbb11", + "rev": "ee07ba0d36c38e9915c55d2ac5a8fb0f05f2afcc", "type": "github" }, "original": { @@ -631,11 +631,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1747542968, - "narHash": "sha256-VgGfVMEC7BQJBoC4okHua+n05Davm4SdUeg0l7PSymQ=", + "lastModified": 1747589429, + "narHash": "sha256-kP7iy92VBgkw/rrq4DSSU4vGNZ1ApIx2+FKePugIemg=", "owner": "Gerg-L", "repo": "nvim-flake", - "rev": "929d875993a4d385387c097f69754041fcefd9a6", + "rev": "c9fd60cc6bb5913af839c42108416d26b8b2fd50", "type": "github" }, "original": { @@ -753,11 +753,11 @@ ] }, "locked": { - "lastModified": 1746485181, - "narHash": "sha256-PxrrSFLaC7YuItShxmYbMgSuFFuwxBB+qsl9BZUnRvg=", + "lastModified": 1747603214, + "narHash": "sha256-lAblXm0VwifYCJ/ILPXJwlz0qNY07DDYdLD+9H+Wc8o=", "owner": "mic92", "repo": "sops-nix", - "rev": "e93ee1d900ad264d65e9701a5c6f895683433386", + "rev": "8d215e1c981be3aa37e47aeabd4e61bb069548fd", "type": "github" }, "original": { @@ -774,11 +774,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1747355848, - "narHash": "sha256-WpOTfGuObhpaI38+uHgaOwnMAjHMrdLrfs6D35fKwjk=", + "lastModified": 1747607404, + "narHash": "sha256-xj2Ji+rE+oYjf0BsTDT7K/StnYuZQK9MTbX8U1DUcC0=", "owner": "Gerg-L", "repo": "spicetify-nix", - "rev": "a2bc0d49449fc61ca2eb364d6189179059394483", + "rev": "8c1be0e5e9a7f35ccd6f7b10bcfa08f2734dad91", "type": "github" }, "original": { @@ -789,16 +789,16 @@ }, "stable": { "locked": { - "lastModified": 1747335874, - "narHash": "sha256-IKKIXTSYJMmUtE+Kav5Rob8SgLPnfnq4Qu8LyT4gdqQ=", + "lastModified": 1747825515, + "narHash": "sha256-BWpMQymVI73QoKZdcVCxUCCK3GNvr/xa2Dc4DM1o2BE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ba8b70ee098bc5654c459d6a95dfc498b91ff858", + "rev": "cd2812de55cf87df88a9e09bf3be1ce63d50c1a6", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-24.11", + "ref": "nixos-25.05", "repo": "nixpkgs", "type": "github" } @@ -810,11 +810,11 @@ ] }, "locked": { - "lastModified": 1737334952, - "narHash": "sha256-R/TDnBhkOFRiUqJaQel93in+w9SuVMBKnukt05rbVJY=", + "lastModified": 1747956973, + "narHash": "sha256-L2El+D70h0vZhHmaERqAw8fZaNvwPZZIIKxamDQfMU4=", "owner": "Gerg-L", "repo": "suckless", - "rev": "a1cc74ee4ab1def59cc9cd131a86b5769e144c9e", + "rev": "f144825dd53f99203b05d3af31475e7431e55b1c", "type": "github" }, "original": { @@ -892,11 +892,11 @@ }, "unstable": { "locked": { - "lastModified": 1747327360, - "narHash": "sha256-LSmTbiq/nqZR9B2t4MRnWG7cb0KVNU70dB7RT4+wYK4=", + "lastModified": 1747744144, + "narHash": "sha256-W7lqHp0qZiENCDwUZ5EX/lNhxjMdNapFnbErcbnP11Q=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e06158e58f3adee28b139e9c2bcfcc41f8625b46", + "rev": "2795c506fe8fb7b03c36ccb51f75b6df0ab2553f", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 55afc27..5afd50c 100644 --- a/flake.nix +++ b/flake.nix @@ -17,14 +17,14 @@ type = "github"; owner = "NixOS"; repo = "nixpkgs"; - ref = "nixos-24.11"; + ref = "nixos-25.05"; }; #nix itself nix = { type = "github"; owner = "NixOS"; repo = "nix"; - ref = "3f811c237312a91cfe9314a215ebb4b159bccb23"; + ref = "39f9f5d1b6f6120b2fba929b9a5faa0ec24e7746"; inputs.nixpkgs.follows = "stable"; }; #other diff --git a/nixosConfigurations/gerg-desktop/kernel.nix b/nixosConfigurations/gerg-desktop/kernel.nix index bc8f562..2923bc2 100644 --- a/nixosConfigurations/gerg-desktop/kernel.nix +++ b/nixosConfigurations/gerg-desktop/kernel.nix @@ -5,40 +5,35 @@ }: { - boot = { - # For linuxManualConfig to work: https://github.com/NixOS/nixpkgs/issues/368249 - initrd.systemd.strip = false; - - kernelPackages = pkgs.linuxPackagesFor ( - let - version = "6.14.5"; - src = pkgs.fetchurl { - url = "mirror://kernel/linux/kernel/v${builtins.head (lib.splitVersion version)}.x/linux-${version}.tar.xz"; - hash = "sha256-KCB+xSu+qjUHAQrv+UT0QvfZ8isoa3nK9F7G3xsk9Ak="; + boot.kernelPackages = pkgs.linuxPackagesFor ( + let + version = "6.14.5"; + src = pkgs.fetchurl { + url = "mirror://kernel/linux/kernel/v${builtins.head (lib.splitVersion version)}.x/linux-${version}.tar.xz"; + hash = "sha256-KCB+xSu+qjUHAQrv+UT0QvfZ8isoa3nK9F7G3xsk9Ak="; + }; + in + (pkgs.linuxManualConfig { + inherit src; + inherit (config.boot) kernelPatches; + version = "${version}-gerg"; + config = { + CONFIG_RUST = "y"; + CONFIG_MODULES = "y"; + }; + configfile = ./kernelConfig; + }).overrideAttrs + (old: { + passthru = old.passthru or { } // { + features = lib.foldr (x: y: x.features or { } // y) { + efiBootStub = true; + netfilterRPFilter = true; + ia32Emulation = true; + } config.boot.kernelPatches; }; - in - (pkgs.linuxManualConfig { - inherit src; - inherit (config.boot) kernelPatches; - version = "${version}-gerg"; - config = { - CONFIG_RUST = "y"; - CONFIG_MODULES = "y"; + meta = old.meta or { } // { + broken = false; }; - configfile = ./kernelConfig; - }).overrideAttrs - (old: { - passthru = old.passthru or { } // { - features = lib.foldr (x: y: x.features or { } // y) { - efiBootStub = true; - netfilterRPFilter = true; - ia32Emulation = true; - } config.boot.kernelPatches; - }; - meta = old.meta or { } // { - broken = false; - }; - }) - ); - }; + }) + ); } diff --git a/nixosConfigurations/gerg-desktop/kernelConfig b/nixosConfigurations/gerg-desktop/kernelConfig index 993b971..7f2352e 100644 --- a/nixosConfigurations/gerg-desktop/kernelConfig +++ b/nixosConfigurations/gerg-desktop/kernelConfig @@ -5292,16 +5292,16 @@ CONFIG_BUFFER_HEAD=y CONFIG_LEGACY_DIRECT_IO=y # CONFIG_EXT2_FS is not set # CONFIG_EXT3_FS is not set -# CONFIG_EXT4_FS is not set +CONFIG_EXT4_FS=y # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set -# CONFIG_XFS_FS is not set +CONFIG_XFS_FS=y # CONFIG_GFS2_FS is not set # CONFIG_OCFS2_FS is not set -# CONFIG_BTRFS_FS is not set +CONFIG_BTRFS_FS is not set # CONFIG_NILFS2_FS is not set # CONFIG_F2FS_FS is not set -# CONFIG_BCACHEFS_FS is not set +CONFIG_BCACHEFS_FS=y # CONFIG_ZONEFS_FS is not set # CONFIG_FS_DAX is not set CONFIG_FS_POSIX_ACL=y diff --git a/nixosConfigurations/gerg-desktop/main.nix b/nixosConfigurations/gerg-desktop/main.nix index 7e622b8..960d59b 100644 --- a/nixosConfigurations/gerg-desktop/main.nix +++ b/nixosConfigurations/gerg-desktop/main.nix @@ -43,6 +43,7 @@ nixfmt-rfc-style zellij tidal-hifi + hyperfine #prusa-slicer # 3D printer slicer # QMK configuration @@ -60,7 +61,10 @@ boot = { binfmt.emulatedSystems = [ "aarch64-linux" ]; - supportedFilesystems.ntfs = true; + supportedFilesystems = { + ext4 = true; + ntfs = true; + }; initrd = { availableKernelModules = [ "nvme" @@ -127,6 +131,29 @@ silent = true; }; + zoxide.enable = true; + + zsh = { + shellAliases.cd = "z"; + interactiveShellInit = + let + monitorScript = pkgs.replaceVarsWith { + src = ./monitor.ps; + replacements = builtins.mapAttrs (_: lib.getExe) { + inherit (pkgs) perl xdotool; + }; + isExecutable = true; + }; + in + '' + if [[ -z "$ZELLIJ" ]]; then + MONITOR="$(${monitorScript} || true)" + zellij attach -c "''${MONITOR:+"$MONITOR@"}$USER" + exit + fi + ''; + }; + nix-index = { enable = true; package = nix-index-database.packages.nix-index-with-db; diff --git a/nixosConfigurations/gerg-desktop/monitor.ps b/nixosConfigurations/gerg-desktop/monitor.ps new file mode 100644 index 0000000..04e52c3 --- /dev/null +++ b/nixosConfigurations/gerg-desktop/monitor.ps @@ -0,0 +1,45 @@ +#!@perl@ + +use strict; + +my %M; # hash to hold keys from 'xdotool getmouselocation --shell' +my $pipe; # file handle for the pipes we're going to open + +# get the current cursor location into $M{X} and $M{Y} +open($pipe, "-|", qw(@xdotool@ getmouselocation --shell)) || + die "couldn't open pipe from xdotool: $!\n"; + +while(<$pipe>) { + chomp; + my($key, $val) = split /=/; + $M{$key} = $val; +}; +close($pipe); + +# compare mouse location to monitor co-ordinates +open($pipe, "-|", "xrandr") || + die "couldn't open pipe from xrandr: $!\n"; + +while(<$pipe>) { + my ($display, $width, $height, $x_offset, $y_offset); + + next unless m/ connected /; + my @F = split; + $display = $F[0]; + + # co-ordinates are on fourth field (F[3]) on the primary display + # or on third field (F[2]) on non-primary displays. Perl arrays + # start from zero, not one (same as in bash). + if ($F[2] eq "primary") { + ($width, $height, $x_offset, $y_offset) = split /[x+]/, $F[3]; + } else { + ($width, $height, $x_offset, $y_offset) = split /[x+]/, $F[2]; + }; + + if ($M{X} >= $x_offset && $M{X} <= $width + $x_offset && + $M{Y} >= $y_offset && $M{Y} <= $height + $y_offset) { + print "$display\n"; + last; + }; +}; +close($pipe); diff --git a/nixosModules/zsh.nix b/nixosModules/zsh.nix index dc1239a..70eac30 100644 --- a/nixosModules/zsh.nix +++ b/nixosModules/zsh.nix @@ -16,6 +16,8 @@ bindkey '^[[B' history-substring-search-down ### fzf-tab ### source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh + ### vi-mode ### + source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh ### transient shell prompt ### zle-line-init() { emulate -L zsh