feat: add stylix as custom module

This commit is contained in:
Swarsel 2024-07-24 19:43:16 +02:00
parent ec82754ae1
commit 821d5cb78e
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
8 changed files with 157 additions and 67 deletions

View file

@ -2275,7 +2275,6 @@ This is basically just adjusted to the core count, path to the =hwmon= (this was
# waybar config - TEMPLATE - update for cores and temp # waybar config - TEMPLATE - update for cores and temp
programs.waybar.settings.mainBar = { programs.waybar.settings.mainBar = {
cpu.format = "{icon0} {icon1} {icon2} {icon3} {icon4} {icon5} {icon6} {icon7}";
# temperature.hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon4/temp1_input"; # temperature.hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon4/temp1_input";
temperature.hwmon-path.abs = "/sys/devices/platform/thinkpad_hwmon/hwmon/"; temperature.hwmon-path.abs = "/sys/devices/platform/thinkpad_hwmon/hwmon/";
temperature.input-filename = "temp1_input"; temperature.input-filename = "temp1_input";
@ -4467,6 +4466,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
#+BEGIN_src nix :tangle modules/home/default.nix #+BEGIN_src nix :tangle modules/home/default.nix
{ {
laptop = import ./laptop.nix; laptop = import ./laptop.nix;
hardware = import ./hardware.nix;
monitors = import ./monitors.nix; monitors = import ./monitors.nix;
input = import ./input.nix; input = import ./input.nix;
nixos = import ./nixos.nix; nixos = import ./nixos.nix;
@ -4490,6 +4490,28 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
} }
#+end_src #+end_src
***** Hardware
#+begin_src nix :tangle modules/home/hardware.nix
{ lib, config, ... }:
let
generateIcons = n: lib.concatStringsSep " " (builtins.map (x: "{icon" + toString x + "}") (lib.range 0 (n - 1)));
in
{
options.swarselsystems.cpuCount = lib.mkOption {
type = lib.types.int;
default = 8;
};
options.swarselsystems.cpuString = lib.mkOption {
type = lib.types.str;
default = generateIcons config.swarselsystems.cpuCount;
description = "The generated icons string for use by Waybar.";
internal = true;
};
}
#+end_src
***** Monitors ***** Monitors
#+begin_src nix :tangle modules/home/monitors.nix #+begin_src nix :tangle modules/home/monitors.nix
@ -5083,12 +5105,18 @@ By default, [[https://github.com/danth/stylix][stylix]] wants to style GRUB as w
=theme= is defined in [[#h:5bc1b0c9-dc59-4c81-b5b5-e60699deda78][Theme (stylix)]]. =theme= is defined in [[#h:5bc1b0c9-dc59-4c81-b5b5-e60699deda78][Theme (stylix)]].
#+begin_src nix :noweb yes :tangle profiles/common/nixos/stylix.nix #+begin_src nix :noweb yes :tangle profiles/common/nixos/stylix.nix
{ pkgs, ... }: { pkgs, home-manager, ... }:
{ {
stylix = { stylix = {
<<theme>> <<theme>>
targets.grub.enable = false; # the styling makes grub more ugly targets.grub.enable = false; # the styling makes grub more ugly
}; };
home-manager.users.swarsel = {
stylix.targets = {
emacs.enable = false;
waybar.enable = false;
};
};
} }
#+end_src #+end_src
@ -6024,8 +6052,10 @@ This section has been notably empty ever since switching to stylix. Only Emacs i
{ {
stylix = lib.mkIf (!config.swarselsystems.isNixos) { stylix = lib.mkIf (!config.swarselsystems.isNixos) {
<<theme>> <<theme>>
targets.emacs.enable = false; targets = {
targets.waybar.enable = false; emacs.enable = false;
waybar.enable = false;
};
}; };
} }
#+end_src #+end_src
@ -6771,7 +6801,7 @@ The rest of this configuration is found here:
#+begin_src nix :tangle profiles/common/home/waybar.nix #+begin_src nix :tangle profiles/common/home/waybar.nix
{ ... }: { config, ... }:
{ {
programs.waybar = { programs.waybar = {
@ -6910,6 +6940,7 @@ The rest of this configuration is found here:
tooltip-format = "Memory: {used:0.1f}G/{total:0.1f}G\nSwap: {swapUsed}G/{swapTotal}G"; tooltip-format = "Memory: {used:0.1f}G/{total:0.1f}G\nSwap: {swapUsed}G/{swapTotal}G";
}; };
cpu = { cpu = {
format = config.swarselsystems.cpuString;
min-length = 6; min-length = 6;
interval = 5; interval = 5;
format-icons = [ "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ]; format-icons = [ "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ];

View file

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2024-07-24 Mi 18:31 --> <!-- 2024-07-24 Mi 19:15 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>SwarselSystems: NixOS + Emacs Configuration</title> <title>SwarselSystems: NixOS + Emacs Configuration</title>
@ -223,7 +223,7 @@
<ul> <ul>
<li><a href="#h:8a411ee2-a58e-4b5b-99bd-4ba772f8f0a2">2.3.1. Inputs</a></li> <li><a href="#h:8a411ee2-a58e-4b5b-99bd-4ba772f8f0a2">2.3.1. Inputs</a></li>
<li><a href="#h:df0072bc-853f-438f-bd85-bfc869501015">2.3.2. let</a></li> <li><a href="#h:df0072bc-853f-438f-bd85-bfc869501015">2.3.2. let</a></li>
<li><a href="#orgfc20bba">2.3.3. General (outputs)</a></li> <li><a href="#org671bdfd">2.3.3. General (outputs)</a></li>
<li><a href="#h:9c9b9e3b-8771-44fa-ba9e-5056ae809655">2.3.4. nixosConfigurations</a></li> <li><a href="#h:9c9b9e3b-8771-44fa-ba9e-5056ae809655">2.3.4. nixosConfigurations</a></li>
<li><a href="#h:f881aa05-a670-48dd-a57b-2916abdcb692">2.3.5. homeConfigurations</a></li> <li><a href="#h:f881aa05-a670-48dd-a57b-2916abdcb692">2.3.5. homeConfigurations</a></li>
<li><a href="#h:5f6ef553-59f9-4239-b6f3-63d33b57f335">2.3.6. nixOnDroidConfigurations</a></li> <li><a href="#h:5f6ef553-59f9-4239-b6f3-63d33b57f335">2.3.6. nixOnDroidConfigurations</a></li>
@ -241,11 +241,11 @@
<li><a href="#h:4dc59747-9598-4029-aa7d-92bf186d6c06">3.1.3. Virtual hosts</a></li> <li><a href="#h:4dc59747-9598-4029-aa7d-92bf186d6c06">3.1.3. Virtual hosts</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orga96c07c">3.2. Overlays, packages, and modules</a> <li><a href="#org6862793">3.2. Overlays, packages, and modules</a>
<ul> <ul>
<li><a href="#org07cc93a">3.2.1. Packages</a></li> <li><a href="#org3d6f012">3.2.1. Packages</a></li>
<li><a href="#orga89e3b1">3.2.2. Overlays</a></li> <li><a href="#org2c302bf">3.2.2. Overlays</a></li>
<li><a href="#org70c326b">3.2.3. Modules</a></li> <li><a href="#org8ade63b">3.2.3. Modules</a></li>
</ul> </ul>
</li> </li>
<li><a href="#h:1c1250cd-e9b4-4715-8d9f-eb09e64bfc7f">3.3. Common NixOS</a> <li><a href="#h:1c1250cd-e9b4-4715-8d9f-eb09e64bfc7f">3.3. Common NixOS</a>
@ -253,7 +253,7 @@
<li><a href="#h:45e4315b-0929-4c47-b65a-c8f0a685f4df">3.3.1. Imports, enable home-manager module</a></li> <li><a href="#h:45e4315b-0929-4c47-b65a-c8f0a685f4df">3.3.1. Imports, enable home-manager module</a></li>
<li><a href="#h:5a114da6-ef8d-404d-b31b-b51472908e77">3.3.2. General</a></li> <li><a href="#h:5a114da6-ef8d-404d-b31b-b51472908e77">3.3.2. General</a></li>
<li><a href="#h:d87d80fd-2ac7-4f29-b338-0518d06b4deb">3.3.3. sops</a></li> <li><a href="#h:d87d80fd-2ac7-4f29-b338-0518d06b4deb">3.3.3. sops</a></li>
<li><a href="#org8d56c12">3.3.4. Theme (stylix)</a></li> <li><a href="#org7aeef95">3.3.4. Theme (stylix)</a></li>
<li><a href="#h:0e7e8bea-ec58-499c-9731-09dddfc39532">3.3.5. System Packages</a></li> <li><a href="#h:0e7e8bea-ec58-499c-9731-09dddfc39532">3.3.5. System Packages</a></li>
<li><a href="#h:2bbf5f31-246d-4738-925f-eca40681f7b6">3.3.6. Programs (including zsh setup)</a></li> <li><a href="#h:2bbf5f31-246d-4738-925f-eca40681f7b6">3.3.6. Programs (including zsh setup)</a></li>
<li><a href="#h:79f3258f-ed9d-434d-b50a-e58d57ade2a7">3.3.7. Services</a></li> <li><a href="#h:79f3258f-ed9d-434d-b50a-e58d57ade2a7">3.3.7. Services</a></li>
@ -263,7 +263,7 @@
</li> </li>
<li><a href="#h:f0a6b5e0-2157-4522-b5e1-3f0abd91c05e">3.4. Common Home-Manager</a> <li><a href="#h:f0a6b5e0-2157-4522-b5e1-3f0abd91c05e">3.4. Common Home-Manager</a>
<ul> <ul>
<li><a href="#orgc08c163">3.4.1. Imports</a></li> <li><a href="#org5915500">3.4.1. Imports</a></li>
<li><a href="#h:893a7f33-7715-415b-a895-2687ded31c18">3.4.2. Installed packages</a></li> <li><a href="#h:893a7f33-7715-415b-a895-2687ded31c18">3.4.2. Installed packages</a></li>
<li><a href="#h:d87d80fd-2ac7-4f29-b338-0518d06b4deb">3.4.3. sops</a></li> <li><a href="#h:d87d80fd-2ac7-4f29-b338-0518d06b4deb">3.4.3. sops</a></li>
<li><a href="#h:edd6720e-1f90-40bf-b6f9-30a19d4cae08">3.4.4. SSH Machines</a></li> <li><a href="#h:edd6720e-1f90-40bf-b6f9-30a19d4cae08">3.4.4. SSH Machines</a></li>
@ -272,7 +272,7 @@
<li><a href="#h:5ef03803-e150-41bc-b603-e80d60d96efc">3.4.7. Linking dotfiles</a></li> <li><a href="#h:5ef03803-e150-41bc-b603-e80d60d96efc">3.4.7. Linking dotfiles</a></li>
<li><a href="#h:4486b02f-4fb8-432b-bfa2-2e786206341d">3.4.8. Sourcing environment variables</a></li> <li><a href="#h:4486b02f-4fb8-432b-bfa2-2e786206341d">3.4.8. Sourcing environment variables</a></li>
<li><a href="#h:070a75ce-e209-4cda-aa25-e979bbf75d47">3.4.9. Programs</a></li> <li><a href="#h:070a75ce-e209-4cda-aa25-e979bbf75d47">3.4.9. Programs</a></li>
<li><a href="#orgdd27bcf">3.4.10. nix-index</a></li> <li><a href="#org8cb86f5">3.4.10. nix-index</a></li>
<li><a href="#h:ac0e5e62-0dbf-4782-9a96-9e558eae86ae">3.4.11. password-store</a></li> <li><a href="#h:ac0e5e62-0dbf-4782-9a96-9e558eae86ae">3.4.11. password-store</a></li>
<li><a href="#h:1ab84307-b3fb-4c32-9def-4b89a53a8547">3.4.12. direnv</a></li> <li><a href="#h:1ab84307-b3fb-4c32-9def-4b89a53a8547">3.4.12. direnv</a></li>
<li><a href="#h:1bd6b0c7-f201-43e2-9624-6c50de00a1f6">3.4.13. eza</a></li> <li><a href="#h:1bd6b0c7-f201-43e2-9624-6c50de00a1f6">3.4.13. eza</a></li>
@ -339,7 +339,7 @@
<ul> <ul>
<li><a href="#h:99544398-72af-4382-b8e1-01b2221baff4">4.4.1. Org Mode</a></li> <li><a href="#h:99544398-72af-4382-b8e1-01b2221baff4">4.4.1. Org Mode</a></li>
<li><a href="#h:406c2ecc-0e3e-4d9f-9ae3-3eb1f8b87d1b">4.4.2. Nix Mode</a></li> <li><a href="#h:406c2ecc-0e3e-4d9f-9ae3-3eb1f8b87d1b">4.4.2. Nix Mode</a></li>
<li><a href="#org84946c9">4.4.3. nixpkgs-fmt</a></li> <li><a href="#org74678c2">4.4.3. nixpkgs-fmt</a></li>
<li><a href="#h:50327461-a11b-4e81-830a-90febc720cfa">4.4.4. Markdown Mode</a></li> <li><a href="#h:50327461-a11b-4e81-830a-90febc720cfa">4.4.4. Markdown Mode</a></li>
<li><a href="#h:65e69741-9860-4ed0-bbed-7b7be9a2a9d6">4.4.5. Olivetti</a></li> <li><a href="#h:65e69741-9860-4ed0-bbed-7b7be9a2a9d6">4.4.5. Olivetti</a></li>
<li><a href="#h:94d4a0dc-b0d7-4702-b760-beeaa6da2b8f">4.4.6. darkroom</a></li> <li><a href="#h:94d4a0dc-b0d7-4702-b760-beeaa6da2b8f">4.4.6. darkroom</a></li>
@ -399,7 +399,7 @@
</div> </div>
</div> </div>
<p> <p>
<b>This file has 42234 words spanning 11394 lines and was last revised on 2024-07-24 18:31:42 +0200.</b> <b>This file has 42312 words spanning 11425 lines and was last revised on 2024-07-24 19:14:57 +0200.</b>
</p> </p>
<p> <p>
@ -449,7 +449,7 @@ This section defines my Emacs configuration. For a while, I considered to use ry
</p> </p>
<p> <p>
My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-07-24 18:31:42 +0200) My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-07-24 19:14:57 +0200)
</p></li> </p></li>
</ul> </ul>
@ -1071,8 +1071,8 @@ mixedModules = [
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-orgfc20bba" class="outline-4"> <div id="outline-container-org671bdfd" class="outline-4">
<h4 id="orgfc20bba"><span class="section-number-4">2.3.3.</span> General (outputs)</h4> <h4 id="org671bdfd"><span class="section-number-4">2.3.3.</span> General (outputs)</h4>
<div class="outline-text-4" id="text-2-3-3"> <div class="outline-text-4" id="text-2-3-3">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-nix"> <pre class="src src-nix">
@ -2463,7 +2463,7 @@ in
</li> </li>
</ol> </ol>
</li> </li>
<li><a id="org831ef94"></a>Home-manager only<br /> <li><a id="org19fd753"></a>Home-manager only<br />
<ol class="org-ol"> <ol class="org-ol">
<li><a id="h:483a26b5-5a40-4417-9ffb-67cc2cf07161"></a>Home manager<br /> <li><a id="h:483a26b5-5a40-4417-9ffb-67cc2cf07161"></a>Home manager<br />
<div class="outline-text-6" id="text-h:483a26b5-5a40-4417-9ffb-67cc2cf07161"> <div class="outline-text-6" id="text-h:483a26b5-5a40-4417-9ffb-67cc2cf07161">
@ -3082,7 +3082,6 @@ This is basically just adjusted to the core count, path to the <code>hwmon</code
# waybar config - TEMPLATE - update for cores and temp # waybar config - TEMPLATE - update for cores and temp
programs.waybar.settings.mainBar = { programs.waybar.settings.mainBar = {
cpu.format = "{icon0} {icon1} {icon2} {icon3} {icon4} {icon5} {icon6} {icon7}";
# temperature.hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon4/temp1_input"; # temperature.hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon4/temp1_input";
temperature.hwmon-path.abs = "/sys/devices/platform/thinkpad_hwmon/hwmon/"; temperature.hwmon-path.abs = "/sys/devices/platform/thinkpad_hwmon/hwmon/";
temperature.input-filename = "temp1_input"; temperature.input-filename = "temp1_input";
@ -5547,8 +5546,8 @@ in
</ol> </ol>
</div> </div>
</div> </div>
<div id="outline-container-orga96c07c" class="outline-3"> <div id="outline-container-org6862793" class="outline-3">
<h3 id="orga96c07c"><span class="section-number-3">3.2.</span> Overlays, packages, and modules</h3> <h3 id="org6862793"><span class="section-number-3">3.2.</span> Overlays, packages, and modules</h3>
<div class="outline-text-3" id="text-3-2"> <div class="outline-text-3" id="text-3-2">
<p> <p>
In this section I define packages that I manually want to nixpkgs. This can be useful for packages that are currently awaiting a PR or public packages that I do not want to maintain. In this section I define packages that I manually want to nixpkgs. This can be useful for packages that are currently awaiting a PR or public packages that I do not want to maintain.
@ -5567,8 +5566,8 @@ These are for packages that are on nixpkgs, but do not fit my usecase, meaning I
This is simply a mirror of the most recent stable branch of nixpkgs. Useful for packages that are broken on nixpkgs, but do not need to be on bleeding edge anyways.</li> This is simply a mirror of the most recent stable branch of nixpkgs. Useful for packages that are broken on nixpkgs, but do not need to be on bleeding edge anyways.</li>
</ol> </ol>
</div> </div>
<div id="outline-container-org07cc93a" class="outline-4"> <div id="outline-container-org3d6f012" class="outline-4">
<h4 id="org07cc93a"><span class="section-number-4">3.2.1.</span> Packages</h4> <h4 id="org3d6f012"><span class="section-number-4">3.2.1.</span> Packages</h4>
<div class="outline-text-4" id="text-3-2-1"> <div class="outline-text-4" id="text-3-2-1">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-nix"> <pre class="src src-nix">
@ -5578,8 +5577,8 @@ _ : rec { }
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-orga89e3b1" class="outline-4"> <div id="outline-container-org2c302bf" class="outline-4">
<h4 id="orga89e3b1"><span class="section-number-4">3.2.2.</span> Overlays</h4> <h4 id="org2c302bf"><span class="section-number-4">3.2.2.</span> Overlays</h4>
<div class="outline-text-4" id="text-3-2-2"> <div class="outline-text-4" id="text-3-2-2">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-nix"> <pre class="src src-nix">
@ -5612,15 +5611,15 @@ _ : rec { }
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-org70c326b" class="outline-4"> <div id="outline-container-org8ade63b" class="outline-4">
<h4 id="org70c326b"><span class="section-number-4">3.2.3.</span> Modules</h4> <h4 id="org8ade63b"><span class="section-number-4">3.2.3.</span> Modules</h4>
<div class="outline-text-4" id="text-3-2-3"> <div class="outline-text-4" id="text-3-2-3">
<p> <p>
In this section I define custom modules under the <code>swarsel</code> attribute. These are mostly used to define settings specific to a host. I keep these settings confined to either home-manager or nixos to maintain compatibility with non-NixOS machines. In this section I define custom modules under the <code>swarsel</code> attribute. These are mostly used to define settings specific to a host. I keep these settings confined to either home-manager or nixos to maintain compatibility with non-NixOS machines.
</p> </p>
</div> </div>
<ol class="org-ol"> <ol class="org-ol">
<li><a id="orge617667"></a>NixOS<br /> <li><a id="org252b5a2"></a>NixOS<br />
<div class="outline-text-5" id="text-3-2-3-1"> <div class="outline-text-5" id="text-3-2-3-1">
<p> <p>
Modules that need to be loaded on the NixOS level. Note that these will not be available on systems that are not running NixOS Modules that need to be loaded on the NixOS level. Note that these will not be available on systems that are not running NixOS
@ -5634,11 +5633,12 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
</div> </div>
</div> </div>
</li> </li>
<li><a id="org9ea6237"></a>home-manager<br /> <li><a id="org6081f77"></a>home-manager<br />
<div class="outline-text-5" id="text-3-2-3-2"> <div class="outline-text-5" id="text-3-2-3-2">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-nix">{ <pre class="src src-nix">{
laptop = import ./laptop.nix; laptop = import ./laptop.nix;
hardware = import ./hardware.nix;
monitors = import ./monitors.nix; monitors = import ./monitors.nix;
input = import ./input.nix; input = import ./input.nix;
nixos = import ./nixos.nix; nixos = import ./nixos.nix;
@ -5647,7 +5647,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
</div> </div>
</div> </div>
<ol class="org-ol"> <ol class="org-ol">
<li><a id="orgccb127a"></a>Laptop<br /> <li><a id="org71712f5"></a>Laptop<br />
<div class="outline-text-6" id="text-3-2-3-2-1"> <div class="outline-text-6" id="text-3-2-3-2-1">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-nix">{ lib, config, ... }: <pre class="src src-nix">{ lib, config, ... }:
@ -5666,9 +5666,33 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
</div> </div>
</div> </div>
</li> </li>
<li><a id="org8ae6f49"></a>Monitors<br /> <li><a id="orgeebb3b2"></a>Hardware<br />
<div class="outline-text-6" id="text-3-2-3-2-2"> <div class="outline-text-6" id="text-3-2-3-2-2">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-nix"> { lib, config, ... }:
let
generateIcons = n: lib.concatStringsSep " " (builtins.map (x: "{icon" + toString x + "}") (lib.range 0 (n - 1)));
in
{
options.swarselsystems.cpuCount = lib.mkOption {
type = lib.types.int;
default = 8;
};
options.swarselsystems.cpuString = lib.mkOption {
type = lib.types.str;
default = generateIcons config.swarselsystems.cpuCount;
description = "The generated icons string for use by Waybar.";
internal = true;
};
}
</pre>
</div>
</div>
</li>
<li><a id="org6997a55"></a>Monitors<br />
<div class="outline-text-6" id="text-3-2-3-2-3">
<div class="org-src-container">
<pre class="src src-nix">{ lib, config, ... }: <pre class="src src-nix">{ lib, config, ... }:
let let
inherit (lib) mkOption types; inherit (lib) mkOption types;
@ -5683,8 +5707,8 @@ in
</div> </div>
</div> </div>
</li> </li>
<li><a id="orga003992"></a>Input<br /> <li><a id="orgf550ca7"></a>Input<br />
<div class="outline-text-6" id="text-3-2-3-2-3"> <div class="outline-text-6" id="text-3-2-3-2-4">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-nix">{ lib, config, ... }: <pre class="src src-nix">{ lib, config, ... }:
let let
@ -5719,8 +5743,8 @@ in
</div> </div>
</div> </div>
</li> </li>
<li><a id="orgd4e4ccc"></a>Nixos<br /> <li><a id="orgac5746c"></a>Nixos<br />
<div class="outline-text-6" id="text-3-2-3-2-4"> <div class="outline-text-6" id="text-3-2-3-2-5">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-nix"> <pre class="src src-nix">
{ lib, config, ... }: { lib, config, ... }:
@ -6281,8 +6305,8 @@ I use sops-nix to handle secrets that I want to have available on my machines at
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-org8d56c12" class="outline-4"> <div id="outline-container-org7aeef95" class="outline-4">
<h4 id="org8d56c12"><span class="section-number-4">3.3.4.</span> Theme (stylix)</h4> <h4 id="org7aeef95"><span class="section-number-4">3.3.4.</span> Theme (stylix)</h4>
<div class="outline-text-4" id="text-3-3-4"> <div class="outline-text-4" id="text-3-3-4">
<p> <p>
By default, <a href="https://github.com/danth/stylix">stylix</a> wants to style GRUB as well. However, I think that looks horrible. By default, <a href="https://github.com/danth/stylix">stylix</a> wants to style GRUB as well. However, I think that looks horrible.
@ -6290,7 +6314,7 @@ By default, <a href="https://github.com/danth/stylix">stylix</a> wants to style
</p> </p>
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-nix">{ pkgs, ... }: <pre class="src src-nix">{ pkgs, home-manager, ... }:
{ {
stylix = { stylix = {
@ -6340,6 +6364,12 @@ By default, <a href="https://github.com/danth/stylix">stylix</a> wants to style
targets.grub.enable = false; # the styling makes grub more ugly targets.grub.enable = false; # the styling makes grub more ugly
}; };
home-manager.users.swarsel = {
stylix.targets = {
emacs.enable = false;
waybar.enable = false;
};
};
} }
</pre> </pre>
</div> </div>
@ -6458,7 +6488,7 @@ Some programs profit from being installed through dedicated NixOS settings on sy
</div> </div>
</div> </div>
<ol class="org-ol"> <ol class="org-ol">
<li><a id="orge769e5e"></a>zsh<br /> <li><a id="org5d3d021"></a>zsh<br />
<div class="outline-text-5" id="text-3-3-6-1"> <div class="outline-text-5" id="text-3-3-6-1">
<p> <p>
Do not touch this. Do not touch this.
@ -6476,7 +6506,7 @@ Do not touch this.
</div> </div>
</div> </div>
</li> </li>
<li><a id="orgd036c0e"></a>syncthing<br /> <li><a id="org04b5ee8"></a>syncthing<br />
<div class="outline-text-5" id="text-3-3-6-2"> <div class="outline-text-5" id="text-3-3-6-2">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-nix"> <pre class="src src-nix">
@ -6554,7 +6584,7 @@ Enables the blueman service including the nice system tray icon.
</div> </div>
</div> </div>
</li> </li>
<li><a id="org3935093"></a>Network devices<br /> <li><a id="org7dd1773"></a>Network devices<br />
<div class="outline-text-5" id="text-3-3-7-2"> <div class="outline-text-5" id="text-3-3-7-2">
<p> <p>
In this section we enable compatibility with several network devices I have at home, mainly printers and scanners. In this section we enable compatibility with several network devices I have at home, mainly printers and scanners.
@ -6606,7 +6636,7 @@ services.printing = {
</div> </div>
</div> </div>
</li> </li>
<li><a id="org34a4def"></a>Avahi (device discovery)<br /> <li><a id="org446ff03"></a>Avahi (device discovery)<br />
<div class="outline-text-6" id="text-3-3-7-2-3"> <div class="outline-text-6" id="text-3-3-7-2-3">
<p> <p>
Avahi is the service used for the network discovery. Avahi is the service used for the network discovery.
@ -6760,8 +6790,8 @@ This section houses the greetd related settings. I do not really want to use a d
<h3 id="h:f0a6b5e0-2157-4522-b5e1-3f0abd91c05e"><span class="section-number-3">3.4.</span> Common Home-Manager</h3> <h3 id="h:f0a6b5e0-2157-4522-b5e1-3f0abd91c05e"><span class="section-number-3">3.4.</span> Common Home-Manager</h3>
<div class="outline-text-3" id="text-h:f0a6b5e0-2157-4522-b5e1-3f0abd91c05e"> <div class="outline-text-3" id="text-h:f0a6b5e0-2157-4522-b5e1-3f0abd91c05e">
</div> </div>
<div id="outline-container-orgc08c163" class="outline-4"> <div id="outline-container-org5915500" class="outline-4">
<h4 id="orgc08c163"><span class="section-number-4">3.4.1.</span> Imports</h4> <h4 id="org5915500"><span class="section-number-4">3.4.1.</span> Imports</h4>
<div class="outline-text-4" id="text-3-4-1"> <div class="outline-text-4" id="text-3-4-1">
<p> <p>
This section sets up all the imports that are used in the home-manager section. This section sets up all the imports that are used in the home-manager section.
@ -7388,8 +7418,10 @@ This section has been notably empty ever since switching to stylix. Only Emacs i
}; };
}; };
targets.emacs.enable = false; targets = {
targets.waybar.enable = false; emacs.enable = false;
waybar.enable = false;
};
}; };
} }
</pre> </pre>
@ -7567,8 +7599,8 @@ This section is for programs that require no further configuration. zsh Integrat
</li> </li>
</ol> </ol>
</div> </div>
<div id="outline-container-orgdd27bcf" class="outline-4"> <div id="outline-container-org8cb86f5" class="outline-4">
<h4 id="orgdd27bcf"><span class="section-number-4">3.4.10.</span> nix-index</h4> <h4 id="org8cb86f5"><span class="section-number-4">3.4.10.</span> nix-index</h4>
<div class="outline-text-4" id="text-3-4-10"> <div class="outline-text-4" id="text-3-4-10">
<p> <p>
nix-index provides a way to find out which packages are provided by which derivations. By default it also comes with a replacement for <code>command-not-found.sh</code>, however, the implementation is based on a channel based setup. I like consistency, so I replace the command with one that provides a flakes-based output. nix-index provides a way to find out which packages are provided by which derivations. By default it also comes with a replacement for <code>command-not-found.sh</code>, however, the implementation is based on a channel based setup. I like consistency, so I replace the command with one that provides a flakes-based output.
@ -8187,7 +8219,7 @@ The rest of this configuration is found here:
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-nix"> <pre class="src src-nix">
{ ... }: { config, ... }:
{ {
programs.waybar = { programs.waybar = {
@ -8326,6 +8358,7 @@ programs.waybar = {
tooltip-format = "Memory: {used:0.1f}G/{total:0.1f}G\nSwap: {swapUsed}G/{swapTotal}G"; tooltip-format = "Memory: {used:0.1f}G/{total:0.1f}G\nSwap: {swapUsed}G/{swapTotal}G";
}; };
cpu = { cpu = {
format = config.swarselsystems.cpuString;
min-length = 6; min-length = 6;
interval = 5; interval = 5;
format-icons = [ "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ]; format-icons = [ "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ];
@ -9911,7 +9944,7 @@ The standard Emacs behaviour for the Python process shell is a bit annoying. Thi
</div> </div>
</div> </div>
</li> </li>
<li><a id="org12bc16b"></a>Nix common prefix bracketer<br /> <li><a id="org9f13c14"></a>Nix common prefix bracketer<br />
<div class="outline-text-5" id="text-4-2-1-15"> <div class="outline-text-5" id="text-4-2-1-15">
<p> <p>
This function searches for common delimiters in region and removes them, summarizing all captured lines by it. This function searches for common delimiters in region and removes them, summarizing all captured lines by it.
@ -9944,7 +9977,7 @@ This function searches for common delimiters in region and removes them, summari
</div> </div>
</div> </div>
</li> </li>
<li><a id="orgb808b74"></a>Nix formatters<br /> <li><a id="orga41f382"></a>Nix formatters<br />
<div class="outline-text-5" id="text-4-2-1-16"> <div class="outline-text-5" id="text-4-2-1-16">
<p> <p>
This formats the org code block at <code>point</code> in accordance to the <code>nixpkgs-fmt</code> formatter This formats the org code block at <code>point</code> in accordance to the <code>nixpkgs-fmt</code> formatter
@ -11517,8 +11550,8 @@ This adds a rudimentary nix-mode to Emacs. I have not really tried this out, as
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-org84946c9" class="outline-4"> <div id="outline-container-org74678c2" class="outline-4">
<h4 id="org84946c9"><span class="section-number-4">4.4.3.</span> nixpkgs-fmt</h4> <h4 id="org74678c2"><span class="section-number-4">4.4.3.</span> nixpkgs-fmt</h4>
<div class="outline-text-4" id="text-4-4-3"> <div class="outline-text-4" id="text-4-4-3">
<p> <p>
Adds functions for formatting nix code. Adds functions for formatting nix code.
@ -13533,7 +13566,7 @@ My laptop, sadly soon to be replaced by a new one, since most basic functions ar
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: Leon Schwarzäugl</p> <p class="author">Author: Leon Schwarzäugl</p>
<p class="date">Created: 2024-07-24 Mi 18:31</p> <p class="date">Created: 2024-07-24 Mi 19:15</p>
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View file

@ -1,5 +1,6 @@
{ {
laptop = import ./laptop.nix; laptop = import ./laptop.nix;
hardware = import ./hardware.nix;
monitors = import ./monitors.nix; monitors = import ./monitors.nix;
input = import ./input.nix; input = import ./input.nix;
nixos = import ./nixos.nix; nixos = import ./nixos.nix;

17
modules/home/hardware.nix Normal file
View file

@ -0,0 +1,17 @@
{ lib, config, ... }:
let
generateIcons = n: lib.concatStringsSep " " (builtins.map (x: "{icon" + toString x + "}") (lib.range 0 (n - 1)));
in
{
options.swarselsystems.cpuCount = lib.mkOption {
type = lib.types.int;
default = 8;
};
options.swarselsystems.cpuString = lib.mkOption {
type = lib.types.str;
default = generateIcons config.swarselsystems.cpuCount;
description = "The generated icons string for use by Waybar.";
internal = true;
};
}

View file

@ -46,7 +46,9 @@
}; };
}; };
targets.emacs.enable = false; targets = {
targets.waybar.enable = false; emacs.enable = false;
waybar.enable = false;
};
}; };
} }

View file

@ -1,4 +1,4 @@
{ ... }: { config, ... }:
{ {
programs.waybar = { programs.waybar = {
@ -137,6 +137,7 @@
tooltip-format = "Memory: {used:0.1f}G/{total:0.1f}G\nSwap: {swapUsed}G/{swapTotal}G"; tooltip-format = "Memory: {used:0.1f}G/{total:0.1f}G\nSwap: {swapUsed}G/{swapTotal}G";
}; };
cpu = { cpu = {
format = config.swarselsystems.cpuString;
min-length = 6; min-length = 6;
interval = 5; interval = 5;
format-icons = [ "" "" "" "" "" "" "" "" ]; format-icons = [ "" "" "" "" "" "" "" "" ];

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, home-manager, ... }:
{ {
stylix = { stylix = {
@ -48,4 +48,10 @@
targets.grub.enable = false; # the styling makes grub more ugly targets.grub.enable = false; # the styling makes grub more ugly
}; };
home-manager.users.swarsel = {
stylix.targets = {
emacs.enable = false;
waybar.enable = false;
};
};
} }

View file

@ -19,7 +19,6 @@
# waybar config - TEMPLATE - update for cores and temp # waybar config - TEMPLATE - update for cores and temp
programs.waybar.settings.mainBar = { programs.waybar.settings.mainBar = {
cpu.format = "{icon0} {icon1} {icon2} {icon3} {icon4} {icon5} {icon6} {icon7}";
# temperature.hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon4/temp1_input"; # temperature.hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon4/temp1_input";
temperature.hwmon-path.abs = "/sys/devices/platform/thinkpad_hwmon/hwmon/"; temperature.hwmon-path.abs = "/sys/devices/platform/thinkpad_hwmon/hwmon/";
temperature.input-filename = "temp1_input"; temperature.input-filename = "temp1_input";