diff --git a/flake.lock b/flake.lock index 77d10f9..45326d2 100644 --- a/flake.lock +++ b/flake.lock @@ -2,17 +2,17 @@ "nodes": { "ags": { "inputs": { + "astal": "astal", "nixpkgs": [ "nixpkgs" - ], - "systems": "systems" + ] }, "locked": { - "lastModified": 1721306136, - "narHash": "sha256-VKPsIGf3/a+RONBipx4lEE4LXG2sdMNkWQu22LNQItg=", + "lastModified": 1732307740, + "narHash": "sha256-ZDsYdZOtg5qkK/wfLLB83B3SI+fE32S+/6Ey0ggHODM=", "owner": "Aylur", "repo": "ags", - "rev": "344ea72cd3b8d4911f362fec34bce7d8fb37028c", + "rev": "81159966eb8b39b66c3efc133982fd76920c9605", "type": "github" }, "original": { @@ -41,11 +41,11 @@ ] }, "locked": { - "lastModified": 1721571743, - "narHash": "sha256-hat7wggtDISBJD8kTo5MTrT+IsY/Ha2MwgjmqqijoCA=", + "lastModified": 1731774881, + "narHash": "sha256-1Dxryiw8u2ejntxrrv3sMtIE8WHKxmlN4KeH+uMGbmc=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "601f6cf95cbe4fef02dc7faf34bba58566c914e9", + "rev": "b31a6a4da8199ae3489057db7d36069a70749a56", "type": "github" }, "original": { @@ -54,6 +54,81 @@ "type": "github" } }, + "astal": { + "inputs": { + "nixpkgs": [ + "ags", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1731952585, + "narHash": "sha256-Sh1E7sJd8JJM3PCU1ZOei/QWz97OLCENIi2rTRoaniw=", + "owner": "aylur", + "repo": "astal", + "rev": "664c7a4ddfcf48c6e8accd3c33bb94424b0e8609", + "type": "github" + }, + "original": { + "owner": "aylur", + "repo": "astal", + "type": "github" + } + }, + "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-compat_2": { + "flake": false, + "locked": { + "lastModified": 1717312683, + "narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=", + "owner": "nix-community", + "repo": "flake-compat", + "rev": "38fd3954cf65ce6faf3d0d45cd26059e059f07ea", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "flake-compat", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "hyprland", + "pre-commit-hooks", + "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": [ @@ -61,11 +136,11 @@ ] }, "locked": { - "lastModified": 1721534365, - "narHash": "sha256-XpZOkaSJKdOsz1wU6JfO59Rx2fqtcarQ0y6ndIOKNpI=", + "lastModified": 1732482255, + "narHash": "sha256-GUffLwzawz5WRVfWaWCg78n/HrBJrOG7QadFY6rtV8A=", "owner": "nix-community", "repo": "home-manager", - "rev": "635563f245309ef5320f80c7ebcb89b2398d2949", + "rev": "a9953635d7f34e7358d5189751110f87e3ac17da", "type": "github" }, "original": { @@ -91,11 +166,11 @@ ] }, "locked": { - "lastModified": 1721330371, - "narHash": "sha256-aYlHTWylczLt6ERJyg6E66Y/XSCbVL7leVcRuJmVbpI=", + "lastModified": 1728669738, + "narHash": "sha256-EDNAU9AYcx8OupUzbTbWE1d3HYdeG0wO6Msg3iL1muk=", "owner": "hyprwm", "repo": "hyprcursor", - "rev": "4493a972b48f9c3014befbbf381ed5fff91a65dc", + "rev": "0264e698149fcb857a66a53018157b41f8d97bb0", "type": "github" }, "original": { @@ -108,19 +183,21 @@ "inputs": { "aquamarine": "aquamarine", "hyprcursor": "hyprcursor", + "hyprland-protocols": "hyprland-protocols", "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", "nixpkgs": "nixpkgs", - "systems": "systems_2", + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems", "xdph": "xdph" }, "locked": { - "lastModified": 1721668777, - "narHash": "sha256-QNKSZDkZ5+0a+g0wZoZfcWuH1Fy3ZvIeKg0grNdwnHc=", + "lastModified": 1732717065, + "narHash": "sha256-VzYiTZXneHZneIdEfr55Mt5adJ2p4AGBIJt8eVcqGc4=", "owner": "hyprwm", "repo": "hyprland", - "rev": "4c3b03516209a49244a8f044143c1162752b8a7a", + "rev": "e9a7fb8f91d23f1ac2671e55f74234dcec2ee1c6", "type": "github" }, "original": { @@ -133,21 +210,19 @@ "inputs": { "nixpkgs": [ "hyprland", - "xdph", "nixpkgs" ], "systems": [ "hyprland", - "xdph", "systems" ] }, "locked": { - "lastModified": 1718746314, - "narHash": "sha256-HUklK5u86w2Yh9dOkk4FdsL8eehcOZ95jPhLixGDRQY=", + "lastModified": 1728345020, + "narHash": "sha256-xGbkc7U/Roe0/Cv3iKlzijIaFBNguasI31ynL2IlEoM=", "owner": "hyprwm", "repo": "hyprland-protocols", - "rev": "1b61f0093afff20ab44d88ad707aed8bf2215290", + "rev": "a7c183800e74f337753de186522b9017a07a8cee", "type": "github" }, "original": { @@ -172,11 +247,11 @@ ] }, "locked": { - "lastModified": 1721324361, - "narHash": "sha256-BiJKO0IIdnSwHQBSrEJlKlFr753urkLE48wtt0UhNG4=", + "lastModified": 1728168612, + "narHash": "sha256-AnB1KfiXINmuiW7BALYrKqcjCnsLZPifhb/7BsfPbns=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "adbefbf49664a6c2c8bf36b6487fd31e3eb68086", + "rev": "f054f2e44d6a0b74607a6bc0f52dba337a3db38e", "type": "github" }, "original": { @@ -197,11 +272,11 @@ ] }, "locked": { - "lastModified": 1721324102, - "narHash": "sha256-WAZ0X6yJW1hFG6otkHBfyJDKRpNP5stsRqdEuHrFRpk=", + "lastModified": 1731702627, + "narHash": "sha256-+JeO9gevnXannQxMfR5xzZtF4sYmSlWkX/BPmPx0mWk=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "962582a090bc233c4de9d9897f46794280288989", + "rev": "e911361a687753bbbdfe3b6a9eab755ecaf1d9e1", "type": "github" }, "original": { @@ -222,11 +297,11 @@ ] }, "locked": { - "lastModified": 1721324119, - "narHash": "sha256-SOOqIT27/X792+vsLSeFdrNTF+OSRp5qXv6Te+fb2Qg=", + "lastModified": 1726874836, + "narHash": "sha256-VKR0sf0PSNCB0wPHVKSAn41mCNVCnegWmgkrneKDhHM=", "owner": "hyprwm", "repo": "hyprwayland-scanner", - "rev": "a048a6cb015340bd82f97c1f40a4b595ca85cc30", + "rev": "500c81a9e1a76760371049a8d99e008ea77aa59e", "type": "github" }, "original": { @@ -235,13 +310,36 @@ "type": "github" } }, + "nixos-cosmic": { + "inputs": { + "flake-compat": "flake-compat_2", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable_2", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1732412226, + "narHash": "sha256-Eb7LqtaCVgZy5Kp3pMrRTAmcnFO7HGj6lpAM2TrQzTA=", + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "rev": "44c9057ebbf4eb41cff08b8fc9c952b3f977656a", + "type": "github" + }, + "original": { + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1721379653, - "narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=", + "lastModified": 1731676054, + "narHash": "sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1d9c2c9b3e71b9ee663d11c5d298727dace8d374", + "rev": "5e4fbfb6b3de1aa2872b76d49fafc942626e2add", "type": "github" }, "original": { @@ -251,13 +349,45 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1730741070, + "narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d063c1dd113c91ab27959ba540c0d9753409edf3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { + "locked": { + "lastModified": 1731797254, + "narHash": "sha256-df3dJApLPhd11AlueuoN0Q4fHo/hagP75LlM5K1sz9g=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { - "lastModified": 1721379653, - "narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=", + "lastModified": 1732521221, + "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1d9c2c9b3e71b9ee663d11c5d298727dace8d374", + "rev": "4633a7c72337ea8fd23a4f2ba3972865e3ec685d", "type": "github" }, "original": { @@ -270,11 +400,11 @@ "plugin-harpoon1": { "flake": false, "locked": { - "lastModified": 1703631439, - "narHash": "sha256-SIqssvuNnkw1YbEEElLYCHmh9OLnoHzggXNIZMb3jYI=", + "lastModified": 1724948422, + "narHash": "sha256-ksPNAYnaFbq7N5ifF+RFbLexLW2Lm1ey0agHLzhn9GA=", "owner": "ThePrimeagen", "repo": "harpoon", - "rev": "ccae1b9bec717ae284906b0bf83d720e59d12b91", + "rev": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3", "type": "github" }, "original": { @@ -286,11 +416,11 @@ "plugin-rainbow-delimiters-nvim": { "flake": false, "locked": { - "lastModified": 1720388982, - "narHash": "sha256-6+MSV9pkudhf/xVdofU6syYCzViHltvDWkYvbeuEfLs=", + "lastModified": 1732056071, + "narHash": "sha256-nAg4XbPlJ/z6ELHKqBrp/FLRwIkiam7BAKR9eqkoxCI=", "owner": "HiPhish", "repo": "rainbow-delimiters.nvim", - "rev": "b29da4a6061a88270e875b38367d82c04c856128", + "rev": "d803ba7668ba390aa4cfd3580183c982cac36fd8", "type": "gitlab" }, "original": { @@ -315,17 +445,63 @@ "type": "github" } }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1731363552, + "narHash": "sha256-vFta1uHnD29VUY4HJOO/D6p6rxyObnf+InnSMT4jlMU=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "ags": "ags", "home-manager": "home-manager", "hyprland": "hyprland", + "nixos-cosmic": "nixos-cosmic", "nixpkgs": "nixpkgs_2", "plugin-harpoon1": "plugin-harpoon1", "plugin-rainbow-delimiters-nvim": "plugin-rainbow-delimiters-nvim", "plugin-undotree-nvim": "plugin-undotree-nvim" } }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixos-cosmic", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1732328983, + "narHash": "sha256-RHt12f/slrzDpSL7SSkydh8wUE4Nr4r23HlpWywed9E=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "ed8aa5b64f7d36d9338eb1d0a3bb60cf52069a72", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1689347949, @@ -341,28 +517,24 @@ "type": "github" } }, - "systems_2": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - }, "xdph": { "inputs": { - "hyprland-protocols": "hyprland-protocols", + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], "hyprlang": [ "hyprland", "hyprlang" ], + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], "nixpkgs": [ "hyprland", "nixpkgs" @@ -373,11 +545,11 @@ ] }, "locked": { - "lastModified": 1721648131, - "narHash": "sha256-cyyxu/oj4QEFp3CVx2WeXa9T4OAUyynuBJHGkBZSxJI=", + "lastModified": 1731703417, + "narHash": "sha256-rheDc/7C+yI+QspYr9J2z9kQ5P9F4ATapI7qyFAe1XA=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "663be9cad424b170b28b9fa8a61042d721007f3b", + "rev": "8070f36deec723de71e7557441acb17e478204d3", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 37c3e5b..021f13b 100644 --- a/flake.nix +++ b/flake.nix @@ -24,6 +24,9 @@ plugin-harpoon1.flake = false; hyprland.url = "github:hyprwm/hyprland"; + + nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic"; + nixos-cosmic.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = diff --git a/home-manager/kalle-pc/kalle.nix b/home-manager/kalle-pc/kalle.nix index 021f239..2543e31 100644 --- a/home-manager/kalle-pc/kalle.nix +++ b/home-manager/kalle-pc/kalle.nix @@ -1,9 +1,10 @@ -{ inputs -, outputs -, lib -, config -, pkgs -, ... +{ + inputs, + outputs, + lib, + config, + pkgs, + ... }: { @@ -12,19 +13,19 @@ homeDirectory = "/home/kalle"; }; - imports = - [ - ../../nvim - ../../tmux - ../../eww - ../../hyprland - ../../hyprland/hyprpaper.nix - ../../ags - ]; + imports = [ + ../../nvim + ../../tmux + ../../eww + ../../hyprland + ../../hyprland/hyprpaper.nix + ../../ags + ]; hyprland = let - mod = "SUPER"; in + mod = "SUPER"; + in { mod = mod; @@ -63,11 +64,11 @@ "${pkgs.ags}/bin/ags" "${pkgs.firefox}/bin/firefox" "${pkgs.discord}/bin/discord" + "${pkgs.kitty}/bin/kitty" ]; environment = { XCURSOR_SIZE = "24"; - QT_QPA_PLATFORMTHEME = "qt5ct"; }; sensitivity = 0.1; @@ -75,8 +76,15 @@ layout = "dwindle"; layerRules = { - "gtk-layer-shell" = [ "blur" "ignorezero" ]; - "notifications2" = [ "noanim" "blur" "ignorezero"]; + "gtk-layer-shell" = [ + "blur" + "ignorezero" + ]; + "notifications2" = [ + "noanim" + "blur" + "ignorezero" + ]; }; windowRules = { @@ -85,11 +93,9 @@ discord = [ "workspace name:HDMI-A-2" ]; }; - windowRulesV2 = { # ULauncher "class:^(ulauncher)$" = [ - "forceinput" "dimaround" ]; }; @@ -105,9 +111,9 @@ # bind = ALT, M, exec, xdotool key 'ALT+m' # bind = ALT, B, exec, xdotool key 'ALT+b' binds = { - "${mod}, return" = "exec, kitty"; - "${mod}, E" = "exec, ulauncher-toggle #wofi --show drun"; - "${mod}, Print" = "exec, bash -c \"grim -g \\\"$(slurp)\\\" - | wl-copy\""; + "${mod}, return" = "exec, ${pkgs.kitty}/bin/kitty"; + "${mod}, E" = "exec, ${pkgs.ulauncher}/bin/ulauncher-toggle #wofi --show drun"; + "${mod}, Print" = "exec, ${pkgs.bash}/bin/bash -c \"grim -g \\\"$(slurp)\\\" - | wl-copy\""; # Clipboard history # bind = $mainMod, V, exec, cliphist list | wofi --dmenu | cliphist decode | wl-copy }; @@ -120,9 +126,7 @@ }; nixpkgs = { - overlays = with outputs.overlays; [ - nvim-plugins - ]; + overlays = with outputs.overlays; [ nvim-plugins ]; config = { allowUnfree = true; @@ -130,6 +134,7 @@ permittedInsecurePackages = [ "electron-25.9.0" + "electron-29.4.6" ]; }; }; @@ -138,6 +143,7 @@ # environment. home.packages = with pkgs; [ discord + discord-canary vesktop chromium httpie @@ -150,9 +156,7 @@ pavucontrol difftastic sops - (obsidian.override { - electron = electron_29-bin; - }) + (obsidian.override { electron = electron_29-bin; }) unzip vlc feishin @@ -166,7 +170,7 @@ enable = true; nativeMessagingHosts = [ pkgs.plasma-browser-integration ]; }; - + gtk = { enable = true; theme = { @@ -187,7 +191,7 @@ qt = { enable = true; - style.name = "breeze-dark"; + style.name = "breeze"; }; dconf = { @@ -220,7 +224,7 @@ programs.kitty = { enable = true; - theme = "Catppuccin-Mocha"; + themeFile = "Catppuccin-Mocha"; settings = { background_opacity = "0.8"; allow_remote_control = true; diff --git a/hyprland/default.nix b/hyprland/default.nix index c52a014..81fad16 100644 --- a/hyprland/default.nix +++ b/hyprland/default.nix @@ -1,8 +1,9 @@ -{ inputs -, lib -, config -, pkgs -, ... +{ + inputs, + lib, + config, + pkgs, + ... }: { @@ -27,43 +28,45 @@ }; monitors = mkOption { - type = types.listOf (types.submodule { - options = { - name = mkOption { - type = types.str; + type = types.listOf ( + types.submodule { + options = { + name = mkOption { + type = types.str; + }; + width = mkOption { + type = types.int; + }; + height = mkOption { + type = types.int; + }; + refreshRate = mkOption { + type = types.int; + default = 60; + }; + x = mkOption { + type = types.int; + default = 0; + }; + y = mkOption { + type = types.int; + default = 0; + }; + transform = mkOption { + type = types.int; + default = 0; + }; + vrr = mkOption { + type = types.int; + default = 0; + }; + enabled = mkOption { + type = types.bool; + default = true; + }; }; - width = mkOption { - type = types.int; - }; - height = mkOption { - type = types.int; - }; - refreshRate = mkOption { - type = types.int; - default = 60; - }; - x = mkOption { - type = types.int; - default = 0; - }; - y = mkOption { - type = types.int; - default = 0; - }; - transform = mkOption { - type = types.int; - default = 0; - }; - vrr = mkOption { - type = types.int; - default = 0; - }; - enabled = mkOption { - type = types.bool; - default = true; - }; - }; - }); + } + ); default = [ ]; }; @@ -137,8 +140,9 @@ wayland.windowManager.hyprland = { enable = true; settings = { - monitor = map - (m: + monitor = + map ( + m: let resolution = "${toString m.width}x${toString m.height}@${toString m.refreshRate}"; position = "${toString m.x}x${toString m.y}"; @@ -146,10 +150,9 @@ transform = if m.transform != 0 then ",transform,${toString m.transform}" else ""; in "${m.name},${if m.enabled then "${resolution},${position},1${vrr}${transform}" else "disable"}" - ) - (cfg.monitors) - # Automatically detect newly connected monitors - ++ [ ",preferred,auto,auto" ]; + ) (cfg.monitors) + # Automatically detect newly connected monitors + ++ [ ",preferred,auto,auto" ]; exec-once = [ "${pkgs.wl-clipboard}/bin/wl-paste --watch ${pkgs.cliphist}/bin/cliphist store" @@ -200,10 +203,10 @@ new_optimizations = "on"; }; - drop_shadow = "yes"; - shadow_range = 4; - shadow_render_power = 3; - "col.shadow" = "rgba(1a1a1aee)"; + # drop_shadow = "yes"; + # shadow_range = 4; + # shadow_render_power = 3; + # "col.shadow" = "rgba(1a1a1aee)"; }; gestures = { @@ -240,12 +243,9 @@ workspace = let # Create one work space for each non primary monitor - perMonitorWorkspaces = map - (m: "name:${m.name}, monitor:${m.name}") - (lib.filter - (m: m.name != cfg.primaryMonitor) - cfg.monitors - ); + perMonitorWorkspaces = map (m: "name:${m.name}, monitor:${m.name}") ( + lib.filter (m: m.name != cfg.primaryMonitor) cfg.monitors + ); # Create 10 work spaces on the primary monitor primaryMonitorWorkspaces = map (i: "${toString i}, monitor:${cfg.primaryMonitor}") (lib.range 1 10); @@ -256,20 +256,18 @@ bind = let # Create binds to switch workspaces and move windows between them - workspaceBinds = - lib.flatten - (map - (i: - let - k = if i == 10 then 0 else i; - in - [ - "${cfg.mod}, ${toString k}, workspace, ${toString i}" - "${cfg.mod} SHIFT, ${toString k}, movetoworkspace, ${toString i}" - ] - ) - (lib.range 1 10) - ); + workspaceBinds = lib.flatten ( + map ( + i: + let + k = if i == 10 then 0 else i; + in + [ + "${cfg.mod}, ${toString k}, workspace, ${toString i}" + "${cfg.mod} SHIFT, ${toString k}, movetoworkspace, ${toString i}" + ] + ) (lib.range 1 10) + ); # Create binds to manage wiwdows windowManagementBinds = [ @@ -285,9 +283,9 @@ bindm = let windowManagementBinds = [ - "${cfg.mod}, mouse:272, movewindow" - "${cfg.mod}, mouse:273, resizewindow" - ]; + "${cfg.mod}, mouse:272, movewindow" + "${cfg.mod}, mouse:273, resizewindow" + ]; configBinds = lib.mapAttrsToList (k: v: "${k}, ${v}") cfg.mouseBinds; diff --git a/nixos/kalle-pc/configuration.nix b/nixos/kalle-pc/configuration.nix index 4642b63..507c6f8 100644 --- a/nixos/kalle-pc/configuration.nix +++ b/nixos/kalle-pc/configuration.nix @@ -1,16 +1,17 @@ -{ inputs -, config -, pkgs -, ... +{ + inputs, + config, + pkgs, + ... }: { - imports = - [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - ./hardware-configuration.override.nix - ]; + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ./hardware-configuration.override.nix + # inputs.nixos-cosmic.nixosModules.default + ]; nix.settings = { # Enable flakes and new 'nix' command @@ -18,9 +19,18 @@ # Deduplicate and optimize nix store auto-optimise-store = true; # Allow me to use cachix - trusted-users = [ "root" "kalle" ]; - substituters = ["https://hyprland.cachix.org"]; - trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; + trusted-users = [ + "root" + "kalle" + ]; + substituters = [ + "https://hyprland.cachix.org" + "https://cosmic.cachix.org/" + ]; + trusted-public-keys = [ + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" + ]; }; services.btrfs.autoScrub.enable = true; @@ -52,12 +62,15 @@ xkb.layout = "us"; }; + # services.desktopManager.cosmic.enable = true; + # services.displayManager.cosmic-greeter.enable = true; + # Allow flashing ZSA keyboards hardware.keyboard.zsa.enable = true; programs.hyprland = { enable = true; - # package = inputs.hyprland.packages.x86_64-linux.hyprland; + package = inputs.hyprland.packages.x86_64-linux.hyprland; }; xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; @@ -78,7 +91,10 @@ users.users.kalle = { isNormalUser = true; group = "kalle"; - extraGroups = [ "wheel" "dialout" ]; # Enable ‘sudo’ for the user. + extraGroups = [ + "wheel" + "dialout" + ]; # Enable ‘sudo’ for the user. }; users.groups.kalle.gid = 1000; @@ -97,7 +113,7 @@ enableDefaultPackages = true; packages = with pkgs; [ noto-fonts - noto-fonts-cjk + noto-fonts-cjk-sans noto-fonts-color-emoji fira-code @@ -108,9 +124,18 @@ fontconfig = { defaultFonts = { - serif = [ "Noto Serif" "Symbols Nerd Font" ]; - sansSerif = [ "Noto Sans" "Symbols Nerd Font" ]; - monospace = [ "Fira Code" "Symbols Nerd Font Mono" ]; + serif = [ + "Noto Serif" + "Symbols Nerd Font" + ]; + sansSerif = [ + "Noto Sans" + "Symbols Nerd Font" + ]; + monospace = [ + "Fira Code" + "Symbols Nerd Font Mono" + ]; }; }; }; @@ -119,21 +144,23 @@ programs.steam = { enable = true; package = pkgs.steam.override { - extraPkgs = pkgs: with pkgs; [ - xorg.libXcursor - xorg.libXi - xorg.libXinerama - xorg.libXScrnSaver - libpng - libpulseaudio - libvorbis - stdenv.cc.cc.lib - libkrb5 - keyutils - ]; - extraLibraries = pkgs: with pkgs; [ - gperftools # Needed for tf2 to work - ]; + extraPkgs = + pkgs: with pkgs; [ + xorg.libXcursor + xorg.libXi + xorg.libXinerama + xorg.libXScrnSaver + libpng + libpulseaudio + libvorbis + stdenv.cc.cc.lib + libkrb5 + keyutils + ]; + extraLibraries = + pkgs: with pkgs; [ + gperftools # Needed for tf2 to work + ]; }; }; @@ -154,4 +181,3 @@ system.stateVersion = "23.05"; # Did you read the comment? } - diff --git a/nvim/default.nix b/nvim/default.nix index 5311dbc..faa279a 100644 --- a/nvim/default.nix +++ b/nvim/default.nix @@ -1,8 +1,9 @@ -{ inputs -, lib -, config -, pkgs -, ... +{ + inputs, + lib, + config, + pkgs, + ... }: { @@ -33,6 +34,7 @@ gopls vhdl-ls nixd + nixfmt-rfc-style ]; plugins = with pkgs.vimPlugins; [ diff --git a/nvim/plugin/lsp.lua b/nvim/plugin/lsp.lua index f1f6ed5..0f0b419 100644 --- a/nvim/plugin/lsp.lua +++ b/nvim/plugin/lsp.lua @@ -103,6 +103,13 @@ require('lspconfig').lua_ls.setup { require('lspconfig').nixd.setup { on_attach = on_attach, capabilities = capabilities, + settings = { + nixd = { + formatting = { + command = { "nixfmt" }, + }, + }, + }, } require('lspconfig').tsserver.setup { @@ -152,3 +159,14 @@ require('rust-tools').setup({ } }, }) + +-- Workaround for https://github.com/neovim/neovim/issues/30985 +for _, method in ipairs({ 'textDocument/diagnostic', 'workspace/diagnostic' }) do + local default_diagnostic_handler = vim.lsp.handlers[method] + vim.lsp.handlers[method] = function(err, result, context, config) + if err ~= nil and err.code == -32802 then + return + end + return default_diagnostic_handler(err, result, context, config) + end +end