From 200e9eb7da0005a161617e90891109b47cd92174 Mon Sep 17 00:00:00 2001 From: tristan Date: Fri, 13 Jun 2025 11:53:32 +0100 Subject: [PATCH 1/5] framework: nix-index, nh, qt, comma --- flake.nix | 44 ------------------------------------------- nixos/default.nix | 7 +++++-- nixos/workstation.nix | 1 + 3 files changed, 6 insertions(+), 46 deletions(-) diff --git a/flake.nix b/flake.nix index 26369b5..442ed27 100644 --- a/flake.nix +++ b/flake.nix @@ -52,22 +52,6 @@ ]; }; - FCS-Tristan-Nixbook = mkConf { - nixos-modules = [ - ./hardware/fcs-tristan-nixbook.nix - ./nixos/workstation.nix - ./nixos/modules/work.nix - ./nixos/programs/cosmic.nix - ./nixos/programs/libvertd.nix - ./nixos/programs/hyprland.nix - ]; - home-modules = [ - ./home/programs/work.nix - ./home/programs/graphical.nix - ./home/desktop/cosmic/laptop.nix - ]; - }; - framework-13 = mkConf { nixos-modules = [ ./hardware/framework-13.nix @@ -102,26 +86,6 @@ ]; }; - vm-sway = - builtins.trace '' - use super+enter to start a terminal. - use super+d to launch applications - - start the vm with '-vga qxl' or '-vga virtio' - '' - mkConf - { - nixos-modules = [ - ./hardware/vm.nix - (auto-login "sway") - ./nixos/workstation.nix - ]; - home-modules = [ - ./home/desktop/sway/. - ./home/workstation.nix - ]; - }; - vm-cosmic = mkConf { @@ -136,14 +100,6 @@ }; vm-hyprland = - builtins.trace '' - use super+enter to start a terminal. - use super+d to launch applications - - Hyprland is VERY SLOW in the VM. - - start with '-vga virtio' - '' mkConf { nixos-modules = [ diff --git a/nixos/default.nix b/nixos/default.nix index 04cca58..be17b83 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -96,8 +96,7 @@ in { sops lsof nix-tree - nix-index - nh + comma jq ]; @@ -109,4 +108,8 @@ in { enable = true; enabledCollectors = ["systemd"]; }; + + programs.nix-index.enable = true; + programs.nh.enable = true; + } diff --git a/nixos/workstation.nix b/nixos/workstation.nix index 1d24a21..334e4de 100644 --- a/nixos/workstation.nix +++ b/nixos/workstation.nix @@ -53,6 +53,7 @@ }; }; }; + qt.enable = true; nixpkgs.overlays = [ (final: prev: { From 83cacc4a057bd307f9e6d28ac5650b236b2320b4 Mon Sep 17 00:00:00 2001 From: Tristan Date: Mon, 16 Jun 2025 21:20:02 +0100 Subject: [PATCH 2/5] alpine: add gpu drivers --- hardware/alpine.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hardware/alpine.nix b/hardware/alpine.nix index 17e78eb..611eb01 100644 --- a/hardware/alpine.nix +++ b/hardware/alpine.nix @@ -86,6 +86,7 @@ in { nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.graphics.enable = true; system.stateVersion = "24.05"; # don't change. home-manager.users.${user}.imports = [ From eb3094369e1a2bb437ffb6fe19949ee945286382 Mon Sep 17 00:00:00 2001 From: Tristan Date: Sun, 22 Jun 2025 16:36:33 +0100 Subject: [PATCH 3/5] alpine: fix node exporter dashboard --- nixos/services/grafana.nix | 6 ++++-- nixos/services/prometheus.nix | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/nixos/services/grafana.nix b/nixos/services/grafana.nix index 353bbc8..9bfb549 100644 --- a/nixos/services/grafana.nix +++ b/nixos/services/grafana.nix @@ -5,9 +5,9 @@ name = "dashboards"; paths = map mkDashboard dashboards; }; - mkDashboard = {name, url, sha256}: pkgs.writeTextFile { + mkDashboard = {name, url, sha256, patch ? lib.id}: pkgs.writeTextFile { inherit name; - text = builtins.readFile ( builtins.fetchurl {inherit url sha256;} ); + text = patch (builtins.readFile ( builtins.fetchurl {inherit url sha256;} )); destination = "/dash/${name}.json"; }; in { @@ -42,6 +42,8 @@ in { name = "node-exporter"; url = "https://grafana.com/api/dashboards/1860/revisions/37/download"; sha256 = "sha256:0qza4j8lywrj08bqbww52dgh2p2b9rkhq5p313g72i57lrlkacfl"; + # https://github.com/rfmoz/grafana-dashboards/issues/169 + patch = builtins.replaceStrings ["$__rate_interval"] ["$__range"]; } { name = "synapse"; diff --git a/nixos/services/prometheus.nix b/nixos/services/prometheus.nix index 9e18f22..8581e70 100644 --- a/nixos/services/prometheus.nix +++ b/nixos/services/prometheus.nix @@ -2,8 +2,8 @@ inherit (config.services) prometheus; nodes = [ "alpine" - "100.106.49.128" - "zenix" + "100.106.49.128" # laptop + "100.65.29.110" # gaming pc ]; addPort = ip: "${ip}:${toString prometheus.exporters.node.port}"; in { From 2b74b7218ba1a96e5558385a93f908bd0566c5f7 Mon Sep 17 00:00:00 2001 From: tristan Date: Tue, 24 Jun 2025 14:27:07 +0100 Subject: [PATCH 4/5] framework: nixvim lsp-format, btrfs scrub --- flake.lock | 36 ++++++++++++++++++------------------ hardware/framework-13.nix | 1 + lib/nixvim.nix | 8 +------- nixos/default.nix | 1 + 4 files changed, 21 insertions(+), 25 deletions(-) diff --git a/flake.lock b/flake.lock index 7285e99..9598f6f 100644 --- a/flake.lock +++ b/flake.lock @@ -106,11 +106,11 @@ ] }, "locked": { - "lastModified": 1743550720, - "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "lastModified": 1748821116, + "narHash": "sha256-F82+gS044J1APL0n4hH50GYdPRv/5JWm34oCJYmVKdE=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "rev": "49f0870db23e8c1ca0b5259734a02cd9e1e371a1", "type": "github" }, "original": { @@ -246,11 +246,11 @@ ] }, "locked": { - "lastModified": 1748665073, - "narHash": "sha256-RMhjnPKWtCoIIHiuR9QKD7xfsKb3agxzMfJY8V9MOew=", + "lastModified": 1749154018, + "narHash": "sha256-gjN3j7joRvT3a8Zgcylnd4NFsnXeDBumqiu4HmY1RIg=", "owner": "nix-community", "repo": "home-manager", - "rev": "282e1e029cb6ab4811114fc85110613d72771dea", + "rev": "7aae0ee71a17b19708b93b3ed448a1a0952bf111", "type": "github" }, "original": { @@ -346,11 +346,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1749024892, - "narHash": "sha256-OGcDEz60TXQC+gVz5sdtgGJdKVYr6rwdzQKuZAJQpCA=", + "lastModified": 1749727998, + "narHash": "sha256-mHv/yeUbmL91/TvV95p+mBVahm9mdQMJoqaTVTALaFw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8f1b52b04f2cb6e5ead50bd28d76528a2f0380ef", + "rev": "fd487183437963a59ba763c0cc4f27e3447dd6dd", "type": "github" }, "original": { @@ -385,11 +385,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1748975233, - "narHash": "sha256-eLz/5C3qQN8w7dyLnY8zKdwLuHuS03s8csuLjTis2No=", + "lastModified": 1749702372, + "narHash": "sha256-X+PDQ9kgt3/nOUQWSyz/8WHFOp+SyDND+bKpVufxpdE=", "owner": "nix-community", "repo": "nixvim", - "rev": "8917e2e8ecc957037c712145ddcfce08d00c1cad", + "rev": "88f452558ea37ab8ab2052cf45b5a5653a1e556b", "type": "github" }, "original": { @@ -466,11 +466,11 @@ ] }, "locked": { - "lastModified": 1747603214, - "narHash": "sha256-lAblXm0VwifYCJ/ILPXJwlz0qNY07DDYdLD+9H+Wc8o=", + "lastModified": 1749592509, + "narHash": "sha256-VunQzfZFA+Y6x3wYi2UE4DEQ8qKoAZZCnZPUlSoqC+A=", "owner": "Mic92", "repo": "sops-nix", - "rev": "8d215e1c981be3aa37e47aeabd4e61bb069548fd", + "rev": "50754dfaa0e24e313c626900d44ef431f3210138", "type": "github" }, "original": { @@ -503,11 +503,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1749058304, - "narHash": "sha256-8fUXBczmQ7/Y8nrc988oaN4M7YZz/RbzZa0n1d8i3GM=", + "lastModified": 1749768934, + "narHash": "sha256-xtWRTlYBs+wYE8NaV+mwdlVYWX0k2BkCuFdjexjEebY=", "owner": "danth", "repo": "stylix", - "rev": "689d4db89d3be6fd82b7dcb41a1cea5c4743b1ef", + "rev": "e1cfc2b69432ac2abe95db133dcbdfc96cd3bedb", "type": "github" }, "original": { diff --git a/hardware/framework-13.nix b/hardware/framework-13.nix index b8ef1a9..120e188 100644 --- a/hardware/framework-13.nix +++ b/hardware/framework-13.nix @@ -14,6 +14,7 @@ boot.kernelModules = ["kvm-intel"]; boot.extraModulePackages = []; + services.btrfs.autoScrub.enable = true; fileSystems."/" = { device = "/dev/mapper/crypted"; fsType = "btrfs"; diff --git a/lib/nixvim.nix b/lib/nixvim.nix index e5cc8a4..1b26adb 100644 --- a/lib/nixvim.nix +++ b/lib/nixvim.nix @@ -247,13 +247,6 @@ in { vim.lsp.buf.format({async = false}) ''; } - { - event = "BufWritePre"; - pattern = "*.ts"; - callback = luaFunc '' - vim.lsp.buf.format() - ''; - } ]; plugins = { @@ -284,6 +277,7 @@ in { }; }; + lsp-format.enable = true; lsp = { enable = true; inlayHints = true; diff --git a/nixos/default.nix b/nixos/default.nix index be17b83..5241347 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -109,6 +109,7 @@ in { enabledCollectors = ["systemd"]; }; + programs.command-not-found.enable = false; programs.nix-index.enable = true; programs.nh.enable = true; From 960165b7696877fc442ca1913bde6adbd1a7716e Mon Sep 17 00:00:00 2001 From: tristan Date: Tue, 24 Jun 2025 15:13:16 +0100 Subject: [PATCH 5/5] framework: fix cosmic conf --- flake.nix | 1 + home/desktop/cosmic/default.nix | 11 +---------- nixos/programs/cosmic.nix | 10 +++++----- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/flake.nix b/flake.nix index 6746eb3..f07fd87 100644 --- a/flake.nix +++ b/flake.nix @@ -69,6 +69,7 @@ home-modules = [ ./home/programs/work.nix ./home/programs/graphical.nix + ./home/desktop/cosmic/. ]; }; diff --git a/home/desktop/cosmic/default.nix b/home/desktop/cosmic/default.nix index 7d4bd00..7232003 100644 --- a/home/desktop/cosmic/default.nix +++ b/home/desktop/cosmic/default.nix @@ -47,16 +47,7 @@ in { output = "all"; rotation_frequency = 600; sampling_method = mkRON "enum" "Alphanumeric"; - scaling_mode = mkRON "enum" { - value = [ - (mkRON "tuple" [ - 0.5 - 1.0 - (mkRON "raw" "0.345354352") - ]) - ]; - variant = "Fit"; - }; + scaling_mode = mkRON "enum" "Zoom"; source = mkRON "enum" { value = [ (toString config.stylix.image) ]; variant = "Path"; diff --git a/nixos/programs/cosmic.nix b/nixos/programs/cosmic.nix index 21f0e54..369930d 100644 --- a/nixos/programs/cosmic.nix +++ b/nixos/programs/cosmic.nix @@ -1,8 +1,8 @@ -{ - inputs, - config, - ... -}: { +{...}: { services.desktopManager.cosmic.enable = true; services.displayManager.cosmic-greeter.enable = true; + # fix for shutdown, not yet in 25.05 + # https://github.com/NixOS/nixpkgs/pull/412260/commits/27c3430d620adfed574674e36a89a52be80f01d9 + services.geoclue2.enable = true; + services.geoclue2.enableDemoAgent = false; }