feat: add swarsel-modules
Some checks are pending
Flake check / Check flake (push) Waiting to run

This commit is contained in:
Leon Schwarzäugl 2025-08-10 11:35:29 +02:00
parent 2a250deccf
commit 5229a4c480
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
6 changed files with 640 additions and 380 deletions

View file

@ -29,6 +29,9 @@ This configuration is part of a NixOS system that is (nearly) fully declarative
This literate configuration lets me explain my choices to my future self as well as you, the reader. I go to great lengths to explain the choices for all configuration steps that I take in order for me to pay due diligence in crafting my setup, and not simply copying big chunks of other peoples code. Also, the literate configuration approach is very convenient to me as I only need to keep of (ideally) a single file to manage all of my configuration. I hope that this documentation will make it easier for beginners to get into Emacs and NixOS as I know it can be a struggle in the beginning.
** How to use this document
:PROPERTIES:
:CUSTOM_ID: h:6f4b190c-fe69-47a3-9df2-ee429bd9b48b
:END:
When I started out with nix, it was a painful time. For a beginner, the available resources tend to be too detailed or assume too much prior knowledge. Also, it is a (sad) fact that using nix requires the user to understand it pretty well before most things start to make sense.
@ -840,6 +843,7 @@ The rest of the outputs either define or help define the actual configurations:
inputs.home-manager.nixosModules.home-manager
inputs.stylix.nixosModules.stylix
inputs.nswitch-rcm-nix.nixosModules.nswitch-rcm
inputs.swarsel-modules.nixosModules.default
"${self}/hosts/nixos/${configName}"
"${self}/profiles/nixos"
"${self}/modules/nixos"
@ -3897,6 +3901,9 @@ in
#+end_src
**** Expose home-manager sops secrets in NixOS (automatically active)
:PROPERTIES:
:CUSTOM_ID: h:a8bbe15f-a7dd-4e6d-ba49-26206c38e9c8
:END:
#+begin_src nix-ts :tangle modules/nixos/common/home-manager-secrets.nix
{ lib, config, globals, ... }:
@ -4114,8 +4121,8 @@ We enable the use of =home-manager= as a NixoS module. A nice trick here is the
users.${config.swarselsystems.mainUser}.imports = [
inputs.nix-index-database.homeModules.nix-index
inputs.sops-nix.homeManagerModules.sops
# inputs.stylix.homeModules.stylix
inputs.spicetify-nix.homeManagerModules.default
inputs.swarsel-modules.homeModules.default
{
imports = [
"${self}/profiles/home"
@ -4352,6 +4359,9 @@ This dynamically uses systemd boot or Lanzaboote depending on the minimal system
#+end_src
**** Boot
:PROPERTIES:
:CUSTOM_ID: h:a1311b07-2a8d-4c1f-addc-8572fc184e0d
:END:
#+begin_src nix-ts :tangle modules/nixos/common/boot.nix
{ lib, pkgs, config, globals, ... }:
@ -9750,6 +9760,9 @@ To get other URLs (token, etc.), use https://<kanidmDomain>/oauth2/openid/<clien
#+end_src
**** slink
:PROPERTIES:
:CUSTOM_ID: h:e46c37ac-5610-4603-8afc-2f5f008fc14d
:END:
Deployment notes:
- enable user: =podman exec -it slink slink user:activate --email=<mail>=
@ -10592,33 +10605,33 @@ It can be set to either:
- a PCI id in the form =vendor_id:device_id=
#+begin_src nix-ts :tangle modules/home/common/nixgl.nix
{ lib, config, nixgl, ... }:
{
options.swarselmodules.nixgl = lib.mkEnableOption "nixgl settings";
options.swarselsystems = {
isSecondaryGpu = lib.mkEnableOption "device has a secondary GPU";
SecondaryGpuCard = lib.mkOption {
type = lib.types.str;
default = "";
};
};
config = lib.mkIf config.swarselmodules.nixgl {
nixGL = lib.mkIf (!config.swarselsystems.isNixos) {
inherit (nixgl) packages;
defaultWrapper = lib.mkDefault "mesa";
vulkan.enable = lib.mkDefault false;
prime = lib.mkIf config.swarselsystem.isSecondaryGpu {
card = config.swarselsystem.secondaryGpuCard;
installScript = "mesa";
{ lib, config, nixgl, ... }:
{
options.swarselmodules.nixgl = lib.mkEnableOption "nixgl settings";
options.swarselsystems = {
isSecondaryGpu = lib.mkEnableOption "device has a secondary GPU";
SecondaryGpuCard = lib.mkOption {
type = lib.types.str;
default = "";
};
offloadWrapper = lib.mkIf config.swarselsystem.isSecondaryGpu "mesaPrime";
installScripts = [
"mesa"
"mesaPrime"
];
};
};
}
config = lib.mkIf config.swarselmodules.nixgl {
nixGL = lib.mkIf (!config.swarselsystems.isNixos) {
inherit (nixgl) packages;
defaultWrapper = lib.mkDefault "mesa";
vulkan.enable = lib.mkDefault false;
prime = lib.mkIf config.swarselsystem.isSecondaryGpu {
card = config.swarselsystem.secondaryGpuCard;
installScript = "mesa";
};
offloadWrapper = lib.mkIf config.swarselsystem.isSecondaryGpu "mesaPrime";
installScripts = [
"mesa"
"mesaPrime"
];
};
};
}
#+end_src
**** Installed packages
@ -14286,6 +14299,9 @@ This holds configuration that is specific to framework laptops.
}
#+end_src
** Shared
:PROPERTIES:
:CUSTOM_ID: h:3552f06f-07e0-4bb1-a50f-fd1efb2d7778
:END:
This section is for modules that are to be used on =NixOS= and =home-manager= scopes alike. This is for example needed in order to allow me to define and set my own custom functions only once in the =NixOS= config and then mirror them into the corresponding =home-manager= option.
@ -14369,6 +14385,9 @@ TODO: check which of these can be replaced but builtin functions.
#+end_src
*** Variables (vars; holds firefox & stylix config parts)
:PROPERTIES:
:CUSTOM_ID: h:ea362c55-97b4-45fd-bf41-ab461c444212
:END:
At work I am using several services that are using SSO login - however, as I am using four different accounts at work, this becomes a chore here. Hence, I have defined multiple profiles in [[#h:f0b2ea93-94c8-48d8-8d47-6fe58f58e0e6][Work]] that are all practically using the same configuration. To save screen space, I template that profile here.
Set in firefox =about:config > toolkit.legacyUserProfileCustomizations.stylesheets= to true. This should in principle be set automatically using the below config, but it seems not to be working reliably.
@ -14382,225 +14401,226 @@ This is where the theme for the whole OS is defined. Originally, this noweb-ref
In short, the options defined here are passed to the modules systems using =_modules.args= - they can then be used by passing =vars= as an attribute in the input attribute set of a modules system file (=basically all files in this configuration)
#+begin_src nix-ts :noweb yes :tangle modules/shared/vars.nix
{ self, lib, pkgs, ... }:
{
_module.args = {
vars = {
stylix = {
polarity = "dark";
opacity.popups = 0.5;
cursor = {
package = pkgs.banana-cursor;
# package = pkgs.capitaine-cursors;
name = "Banana";
# name = "capitaine-cursors";
size = 16;
};
fonts = {
sizes = {
terminal = 10;
applications = 11;
{ self, lib, pkgs, ... }:
{
_module.args = {
vars = {
stylix = {
polarity = "dark";
opacity.popups = 0.5;
cursor = {
package = pkgs.banana-cursor;
# package = pkgs.capitaine-cursors;
name = "Banana";
# name = "capitaine-cursors";
size = 16;
};
serif = {
# package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
package = pkgs.cantarell-fonts;
# package = pkgs.montserrat;
name = "Cantarell";
# name = "FiraCode Nerd Font Propo";
# name = "Montserrat";
};
sansSerif = {
# package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
package = pkgs.cantarell-fonts;
# package = pkgs.montserrat;
name = "Cantarell";
# name = "FiraCode Nerd Font Propo";
# name = "Montserrat";
};
monospace = {
package = pkgs.nerd-fonts.fira-mono; # has overrides
name = "FiraCode Nerd Font Mono";
};
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
fonts = {
sizes = {
terminal = 10;
applications = 11;
};
serif = {
# package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
package = pkgs.cantarell-fonts;
# package = pkgs.montserrat;
name = "Cantarell";
# name = "FiraCode Nerd Font Propo";
# name = "Montserrat";
};
sansSerif = {
# package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
package = pkgs.cantarell-fonts;
# package = pkgs.montserrat;
name = "Cantarell";
# name = "FiraCode Nerd Font Propo";
# name = "Montserrat";
};
monospace = {
package = pkgs.nerd-fonts.fira-mono; # has overrides
name = "FiraCode Nerd Font Mono";
};
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
};
};
};
stylixHomeTargets = {
emacs.enable = false;
waybar.enable = false;
sway.useWallpaper = false;
firefox.profileNames = [ "default" ];
};
stylixHomeTargets = {
emacs.enable = false;
waybar.enable = false;
sway.useWallpaper = false;
spicetify.enable = true;
firefox.profileNames = [ "default" ];
};
firefox = {
userChrome = builtins.readFile "${self}/files/firefox/chrome/userChrome.css";
extensions = {
packages = with pkgs.nur.repos.rycee.firefox-addons; [
tridactyl
tampermonkey
sidebery
browserpass
clearurls
darkreader
enhancer-for-youtube
istilldontcareaboutcookies
translate-web-pages
ublock-origin
reddit-enhancement-suite
sponsorblock
web-archives
onepassword-password-manager
single-file
widegithub
enhanced-github
unpaywall
don-t-fuck-with-paste
plasma-integration
noscript
firefox = {
userChrome = builtins.readFile "${self}/files/firefox/chrome/userChrome.css";
extensions = {
packages = with pkgs.nur.repos.rycee.firefox-addons; [
tridactyl
tampermonkey
sidebery
browserpass
clearurls
darkreader
enhancer-for-youtube
istilldontcareaboutcookies
translate-web-pages
ublock-origin
reddit-enhancement-suite
sponsorblock
web-archives
onepassword-password-manager
single-file
widegithub
enhanced-github
unpaywall
don-t-fuck-with-paste
plasma-integration
noscript
# configure a shortcut 'ctrl+shift+c' with behaviour 'do nothing' in order to disable the dev console shortcut
(buildFirefoxXpiAddon {
pname = "shortkeys";
version = "4.0.2";
addonId = "Shortkeys@Shortkeys.com";
url = "https://addons.mozilla.org/firefox/downloads/file/3673761/shortkeys-4.0.2.xpi";
sha256 = "c6fe12efdd7a871787ac4526eea79ecc1acda8a99724aa2a2a55c88a9acf467c";
meta = with lib;
{
description = "Easily customizable custom keyboard shortcuts for Firefox. To configure this addon go to Addons (ctrl+shift+a) ->Shortkeys ->Options. Report issues here (please specify that the issue is found in Firefox): https://github.com/mikecrittenden/shortkeys";
mozPermissions = [
"tabs"
"downloads"
"clipboardWrite"
"browsingData"
"storage"
"bookmarks"
"sessions"
"<all_urls>"
# configure a shortcut 'ctrl+shift+c' with behaviour 'do nothing' in order to disable the dev console shortcut
(buildFirefoxXpiAddon {
pname = "shortkeys";
version = "4.0.2";
addonId = "Shortkeys@Shortkeys.com";
url = "https://addons.mozilla.org/firefox/downloads/file/3673761/shortkeys-4.0.2.xpi";
sha256 = "c6fe12efdd7a871787ac4526eea79ecc1acda8a99724aa2a2a55c88a9acf467c";
meta = with lib;
{
description = "Easily customizable custom keyboard shortcuts for Firefox. To configure this addon go to Addons (ctrl+shift+a) ->Shortkeys ->Options. Report issues here (please specify that the issue is found in Firefox): https://github.com/mikecrittenden/shortkeys";
mozPermissions = [
"tabs"
"downloads"
"clipboardWrite"
"browsingData"
"storage"
"bookmarks"
"sessions"
"<all_urls>"
];
platforms = platforms.all;
};
})
];
};
settings =
{
"extensions.autoDisableScopes" = 0;
"browser.bookmarks.showMobileBookmarks" = true;
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"browser.search.suggest.enabled" = false;
"browser.search.suggest.enabled.private" = false;
"browser.urlbar.suggest.searches" = false;
"browser.urlbar.showSearchSuggestionsFirst" = false;
"browser.topsites.contile.enabled" = false;
"browser.newtabpage.activity-stream.feeds.section.topstories" = false;
"browser.newtabpage.activity-stream.feeds.snippets" = false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false;
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = false;
"browser.newtabpage.activity-stream.section.highlights.includeDownloads" = false;
"browser.newtabpage.activity-stream.section.highlights.includeVisited" = false;
"browser.newtabpage.activity-stream.showSponsored" = false;
"browser.newtabpage.activity-stream.system.showSponsored" = false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
};
search = {
# default = "Kagi";
default = "google";
# privateDefault = "Kagi";
privateDefault = "google";
engines = {
"Kagi" = {
urls = [{
template = "https://kagi.com/search";
params = [
{ name = "q"; value = "{searchTerms}"; }
];
platforms = platforms.all;
};
})
];
};
}];
icon = "https://kagi.com/favicon.ico";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@k" ];
};
settings =
{
"extensions.autoDisableScopes" = 0;
"browser.bookmarks.showMobileBookmarks" = true;
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"browser.search.suggest.enabled" = false;
"browser.search.suggest.enabled.private" = false;
"browser.urlbar.suggest.searches" = false;
"browser.urlbar.showSearchSuggestionsFirst" = false;
"browser.topsites.contile.enabled" = false;
"browser.newtabpage.activity-stream.feeds.section.topstories" = false;
"browser.newtabpage.activity-stream.feeds.snippets" = false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false;
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = false;
"browser.newtabpage.activity-stream.section.highlights.includeDownloads" = false;
"browser.newtabpage.activity-stream.section.highlights.includeVisited" = false;
"browser.newtabpage.activity-stream.showSponsored" = false;
"browser.newtabpage.activity-stream.system.showSponsored" = false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
"Nix Packages" = {
urls = [{
template = "https://search.nixos.org/packages";
params = [
{ name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"NixOS Wiki" = {
urls = [{
template = "https://nixos.wiki/index.php?search={searchTerms}";
}];
icon = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
};
"NixOS Options" = {
urls = [{
template = "https://search.nixos.org/options";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"Home Manager Options" = {
urls = [{
template = "https://home-manager-options.extranix.com/";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@hm" "@ho" "@hmo" ];
};
"Confluence search" = {
urls = [{
template = "https://vbc.atlassian.net/wiki/search";
params = [
{ name = "text"; value = "{searchTerms}"; }
];
}];
definedAliases = [ "@c" "@cf" "@confluence" ];
};
"Jira search" = {
urls = [{
template = "https://vbc.atlassian.net/issues/";
params = [
{ name = "jql"; value = "textfields ~ \"{searchTerms}*\"&wildcardFlag=true"; }
];
}];
definedAliases = [ "@j" "@jire" ];
};
"google".metaData.alias = "@g";
};
force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart
};
search = {
# default = "Kagi";
default = "google";
# privateDefault = "Kagi";
privateDefault = "google";
engines = {
"Kagi" = {
urls = [{
template = "https://kagi.com/search";
params = [
{ name = "q"; value = "{searchTerms}"; }
];
}];
icon = "https://kagi.com/favicon.ico";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@k" ];
};
"Nix Packages" = {
urls = [{
template = "https://search.nixos.org/packages";
params = [
{ name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"NixOS Wiki" = {
urls = [{
template = "https://nixos.wiki/index.php?search={searchTerms}";
}];
icon = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
};
"NixOS Options" = {
urls = [{
template = "https://search.nixos.org/options";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"Home Manager Options" = {
urls = [{
template = "https://home-manager-options.extranix.com/";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@hm" "@ho" "@hmo" ];
};
"Confluence search" = {
urls = [{
template = "https://vbc.atlassian.net/wiki/search";
params = [
{ name = "text"; value = "{searchTerms}"; }
];
}];
definedAliases = [ "@c" "@cf" "@confluence" ];
};
"Jira search" = {
urls = [{
template = "https://vbc.atlassian.net/issues/";
params = [
{ name = "jql"; value = "textfields ~ \"{searchTerms}*\"&wildcardFlag=true"; }
];
}];
definedAliases = [ "@j" "@jire" ];
};
"google".metaData.alias = "@g";
};
force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart
};
};
};
};
}
}
#+end_src
** Packages
@ -20613,6 +20633,9 @@ This sets up the =dashboard=, which is really quite useless. But, it looks cool
#+end_src
*** Popup frames
:PROPERTIES:
:CUSTOM_ID: h:5322b631-a108-49a0-b95a-b61a70070dd9
:END:
#+begin_src emacs-lisp
(defun prot-window-delete-popup-frame (&rest _)

233
flake.lock generated
View file

@ -933,6 +933,24 @@
"type": "github"
}
},
"flake-parts_16": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_7"
},
"locked": {
"lastModified": 1754487366,
"narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
@ -1130,7 +1148,7 @@
},
"flake-utils_3": {
"inputs": {
"systems": "systems_4"
"systems": "systems_5"
},
"locked": {
"lastModified": 1726560853,
@ -1148,7 +1166,7 @@
},
"flake-utils_4": {
"inputs": {
"systems": "systems_5"
"systems": "systems_6"
},
"locked": {
"lastModified": 1731533236,
@ -1166,7 +1184,7 @@
},
"flake-utils_5": {
"inputs": {
"systems": "systems_7"
"systems": "systems_8"
},
"locked": {
"lastModified": 1726560853,
@ -1184,7 +1202,7 @@
},
"flake-utils_6": {
"inputs": {
"systems": "systems_8"
"systems": "systems_9"
},
"locked": {
"lastModified": 1731533236,
@ -1202,7 +1220,7 @@
},
"flake-utils_7": {
"inputs": {
"systems": "systems_12"
"systems": "systems_13"
},
"locked": {
"lastModified": 1731533236,
@ -1220,7 +1238,7 @@
},
"flake-utils_8": {
"inputs": {
"systems": "systems_15"
"systems": "systems_16"
},
"locked": {
"lastModified": 1731533236,
@ -1238,7 +1256,7 @@
},
"flake-utils_9": {
"inputs": {
"systems": "systems_18"
"systems": "systems_20"
},
"locked": {
"lastModified": 1731533236,
@ -1633,11 +1651,11 @@
]
},
"locked": {
"lastModified": 1754613544,
"narHash": "sha256-ueR1mGX4I4DWfDRRxxMphbKDNisDeMPMusN72VV1+cc=",
"lastModified": 1754756528,
"narHash": "sha256-W1jYKMetZSOHP5m2Z5Wokdj/ct17swPHs+MiY2WT1HQ=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "cc2fa2331aebf9661d22bb507d362b39852ac73f",
"rev": "3ec1cd9a0703fbd55d865b7fd2b07d08374f0355",
"type": "github"
},
"original": {
@ -2719,6 +2737,21 @@
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
}
},
"nixpkgs-lib_7": {
"locked": {
"lastModified": 1753579242,
"narHash": "sha256-zvaMGVn14/Zz8hnp4VWT9xVnhc8vuL3TStRqwk22biA=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "0f36c44e01a6129be94e3ade315a5883f0228a6e",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1751274312,
@ -3198,6 +3231,22 @@
}
},
"nixpkgs_27": {
"locked": {
"lastModified": 1754498491,
"narHash": "sha256-erbiH2agUTD0Z30xcVSFcDHzkRvkRXOQ3lb887bcVrs=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c2ae88e026f9525daf89587f3cbee584b92b6134",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_28": {
"locked": {
"lastModified": 1750865895,
"narHash": "sha256-p2dWAQcLVzquy9LxYCZPwyUdugw78Qv3ChvnX755qHA=",
@ -3953,9 +4002,11 @@
"nur": "nur",
"pre-commit-hooks": "pre-commit-hooks_2",
"sops-nix": "sops-nix",
"spicetify-nix": "spicetify-nix",
"stylix": "stylix",
"swarsel": "swarsel",
"systems": "systems_16",
"swarsel-modules": "swarsel-modules",
"systems": "systems_18",
"vbc-nix": "vbc-nix_3",
"zjstatus": "zjstatus_3"
}
@ -4194,6 +4245,27 @@
"type": "github"
}
},
"spicetify-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_3"
},
"locked": {
"lastModified": 1754196919,
"narHash": "sha256-0zATw65mNql9H8e7HWVBPpijMSbDVeK7JNivRBcUScM=",
"owner": "Gerg-l",
"repo": "spicetify-nix",
"rev": "24fcb94f7792ab755b933e1c9516996530ac1fbd",
"type": "github"
},
"original": {
"owner": "Gerg-l",
"repo": "spicetify-nix",
"type": "github"
}
},
"stylix": {
"inputs": {
"base16": "base16",
@ -4205,7 +4277,7 @@
"gnome-shell": "gnome-shell",
"nixpkgs": "nixpkgs_8",
"nur": "nur_2",
"systems": "systems_3",
"systems": "systems_4",
"tinted-foot": "tinted-foot",
"tinted-kitty": "tinted-kitty",
"tinted-schemes": "tinted-schemes",
@ -4237,7 +4309,7 @@
"gnome-shell": "gnome-shell_2",
"nixpkgs": "nixpkgs_16",
"nur": "nur_4",
"systems": "systems_6",
"systems": "systems_7",
"tinted-foot": "tinted-foot_2",
"tinted-kitty": "tinted-kitty_2",
"tinted-schemes": "tinted-schemes_2",
@ -4269,7 +4341,7 @@
"gnome-shell": "gnome-shell_3",
"nixpkgs": "nixpkgs_24",
"nur": "nur_6",
"systems": "systems_9",
"systems": "systems_10",
"tinted-foot": "tinted-foot_3",
"tinted-kitty": "tinted-kitty_3",
"tinted-schemes": "tinted-schemes_3",
@ -4319,7 +4391,7 @@
"sops-nix": "sops-nix_2",
"stylix": "stylix_2",
"swarsel": "swarsel_2",
"systems": "systems_13",
"systems": "systems_14",
"vbc-nix": "vbc-nix_2",
"zjstatus": "zjstatus_2"
},
@ -4337,6 +4409,27 @@
"type": "github"
}
},
"swarsel-modules": {
"inputs": {
"flake-parts": "flake-parts_16",
"nixpkgs": "nixpkgs_27",
"systems": "systems_17"
},
"locked": {
"lastModified": 1754778610,
"narHash": "sha256-XFv8P39Lps5bbjFdA3GWkY8ibpgdekFd10LsAFUVQhA=",
"owner": "Swarsel",
"repo": "swarsel-modules",
"rev": "7ecf2230e28e64097ca1208aa4bf4f242ec2bc3b",
"type": "github"
},
"original": {
"owner": "Swarsel",
"ref": "main",
"repo": "swarsel-modules",
"type": "github"
}
},
"swarsel_2": {
"inputs": {
"devshell": "devshell_5",
@ -4365,7 +4458,7 @@
"pre-commit-hooks": "pre-commit-hooks_6",
"sops-nix": "sops-nix_3",
"stylix": "stylix_3",
"systems": "systems_10",
"systems": "systems_11",
"vbc-nix": "vbc-nix",
"zjstatus": "zjstatus"
},
@ -4414,21 +4507,6 @@
}
},
"systems_11": {
"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"
}
},
"systems_12": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -4443,6 +4521,21 @@
"type": "github"
}
},
"systems_12": {
"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"
}
},
"systems_13": {
"locked": {
"lastModified": 1681028828,
@ -4459,21 +4552,6 @@
}
},
"systems_14": {
"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"
}
},
"systems_15": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -4488,6 +4566,21 @@
"type": "github"
}
},
"systems_15": {
"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"
}
},
"systems_16": {
"locked": {
"lastModified": 1681028828,
@ -4505,16 +4598,16 @@
},
"systems_17": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"repo": "default",
"type": "github"
}
},
@ -4533,6 +4626,21 @@
"type": "github"
}
},
"systems_19": {
"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"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
@ -4548,6 +4656,21 @@
"type": "github"
}
},
"systems_20": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
@ -4950,7 +5073,7 @@
"swarsel",
"nixpkgs"
],
"systems": "systems_11"
"systems": "systems_12"
},
"locked": {
"lastModified": 1742477270,
@ -4973,7 +5096,7 @@
"swarsel",
"nixpkgs"
],
"systems": "systems_14"
"systems": "systems_15"
},
"locked": {
"lastModified": 1742477270,
@ -4995,7 +5118,7 @@
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_17"
"systems": "systems_19"
},
"locked": {
"lastModified": 1742477270,
@ -5058,7 +5181,7 @@
"inputs": {
"crane": "crane_6",
"flake-utils": "flake-utils_9",
"nixpkgs": "nixpkgs_27",
"nixpkgs": "nixpkgs_28",
"rust-overlay": "rust-overlay_6"
},
"locked": {

View file

@ -19,8 +19,10 @@
nixpkgs-stable24_05.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-stable24_11.url = "github:NixOS/nixpkgs/nixos-24.11";
systems.url = "github:nix-systems/default";
swarsel-modules.url = "github:Swarsel/swarsel-modules/main";
home-manager = {
url = "github:nix-community/home-manager";
# url = "github:Swarsel/home-manager/module/pizauth";
inputs.nixpkgs.follows = "nixpkgs";
};
swarsel.url = "github:Swarsel/.dotfiles";

View file

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2025-08-09 Sa 14:31 -->
<!-- 2025-08-10 So 11:35 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>SwarselSystems: NixOS + Emacs Configuration</title>
@ -203,7 +203,7 @@
<ul>
<li><a href="#h:a86fe971-f169-4052-aacf-15e0f267c6cd">1. Introduction (no code)</a>
<ul>
<li><a href="#org95f3948">1.1. How to use this document</a></li>
<li><a href="#h:6f4b190c-fe69-47a3-9df2-ee429bd9b48b">1.1. How to use this document</a></li>
<li><a href="#h:bcc3ebbe-df8a-46bd-b42d-73aad6fc66e5">1.2. Structure of this file</a></li>
<li><a href="#h:2c5529ed-e6d9-44b6-b0d3-5bf96a6bed64">1.3. <span class="todo TODO">TODO</span> Structure of this flake</a></li>
<li><a href="#h:48e0cb2c-e412-4ae3-a244-80a8c09dbb02">1.4. Hosts</a></li>
@ -319,7 +319,7 @@
<li><a href="#h:5c3027b4-ba66-445e-9c5f-c27e332c90e5">3.2.1.2. Share configuration between nodes (automatically active)</a></li>
<li><a href="#h:85c9b83f-40c3-4558-bb28-a37b6f8597b9">3.2.1.3. Global options (automatically active)</a></li>
<li><a href="#h:30b81bf9-1e69-4ce8-88af-5592896bcee4">3.2.1.4. Meta options (options only)</a></li>
<li><a href="#org102ae59">3.2.1.5. Expose home-manager sops secrets in NixOS (automatically active)</a></li>
<li><a href="#h:a8bbe15f-a7dd-4e6d-ba49-26206c38e9c8">3.2.1.5. Expose home-manager sops secrets in NixOS (automatically active)</a></li>
<li><a href="#h:e2e7444b-cb85-4719-b154-e5f37274d02d">3.2.1.6. Topology (automatically active)</a></li>
<li><a href="#h:24c9146f-2147-4fd5-bafc-d5853e15cf12">3.2.1.7. General NixOS settings (nix, stateVersion)</a></li>
<li><a href="#h:7f6d6908-4d02-4907-9c70-f802f4358520">3.2.1.8. Setup home-manager base</a></li>
@ -328,7 +328,7 @@
<li><a href="#h:852d59ab-63c3-4831-993d-b5e23b877796">3.2.1.11. Time, locale settings</a></li>
<li><a href="#h:82b8ede2-02d8-4c43-8952-7200ebd4dc23">3.2.1.12. PII management</a></li>
<li><a href="#h:d9a89071-b3ba-44d1-b5e0-e9ca6270d377">3.2.1.13. Lanzaboote (secure boot)</a></li>
<li><a href="#org895e59b">3.2.1.14. Boot</a></li>
<li><a href="#h:a1311b07-2a8d-4c1f-addc-8572fc184e0d">3.2.1.14. Boot</a></li>
<li><a href="#h:e7668594-fa8b-4d36-a695-a58222478988">3.2.1.15. Impermanence</a></li>
</ul>
</li>
@ -418,7 +418,7 @@
<li><a href="#h:f922e8d6-f6e8-4779-a7ad-4037229c9bf0">3.2.3.33. croc</a></li>
<li><a href="#h:13071cc3-5cba-44b5-8b5b-2a27be22e021">3.2.3.34. microbin</a></li>
<li><a href="#h:4ccdcd5c-a4dd-49e4-94e7-d81db970059c">3.2.3.35. shlink</a></li>
<li><a href="#orgb7ca62f">3.2.3.36. slink</a></li>
<li><a href="#h:e46c37ac-5610-4603-8afc-2f5f008fc14d">3.2.3.36. slink</a></li>
</ul>
</li>
<li><a href="#h:ac0cd8b3-06cf-4dca-ba73-6100c8fedb47">3.2.4. Darwin</a>
@ -493,6 +493,7 @@
<li><a href="#h:eb94df98-2bcd-4555-9f88-e252f93b924f">3.3.1.32. Kanshi</a></li>
<li><a href="#h:7d384e3b-1be7-4644-b304-ada4af0b692b">3.3.1.33. gpg-agent</a></li>
<li><a href="#h:74e236be-a977-4d38-b8c5-0b9feef8af91">3.3.1.34. gammastep</a></li>
<li><a href="#h:d1fb3075-ad52-4c1b-ba45-5ddbd0d3b708">3.3.1.35. Spicetify</a></li>
</ul>
</li>
<li><a href="#h:b1a00339-6e9b-4ae4-b5dc-6fd5669a2ddb">3.3.2. Server</a>
@ -510,15 +511,16 @@
<ul>
<li><a href="#h:84fd7029-ecb6-4131-9333-289982f24ffa">3.3.4.1. Gaming</a></li>
<li><a href="#h:f0b2ea93-94c8-48d8-8d47-6fe58f58e0e6">3.3.4.2. Work</a></li>
<li><a href="#h:8a7b1c26-3448-42d3-932a-5d05d54b5490">3.3.4.3. Framework</a></li>
<li><a href="#h:52b41e73-46f3-4c2c-af64-eafb51e3b6b6">3.3.4.3. Uni</a></li>
<li><a href="#h:8a7b1c26-3448-42d3-932a-5d05d54b5490">3.3.4.4. Framework</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#org7f776e3">3.4. Shared</a>
<li><a href="#h:3552f06f-07e0-4bb1-a50f-fd1efb2d7778">3.4. Shared</a>
<ul>
<li><a href="#h:79f7150f-b162-4f57-abdf-07f40dffd932">3.4.1. <span class="todo TODO">TODO</span> Configuration options</a></li>
<li><a href="#org6e2eee2">3.4.2. Variables (vars; holds firefox &amp; stylix config parts)</a></li>
<li><a href="#h:ea362c55-97b4-45fd-bf41-ab461c444212">3.4.2. Variables (vars; holds firefox &amp; stylix config parts)</a></li>
</ul>
</li>
<li><a href="#h:64a5cc16-6b16-4802-b421-c67ccef853e1">3.5. Packages</a>
@ -568,14 +570,15 @@
<li><a href="#h:b79fbb59-9cf2-48eb-b469-2589223dda95">3.6.1.4. Chaostheatre</a></li>
<li><a href="#h:125443fb-deb6-44c9-83ee-bbd10daf78dd">3.6.1.5. toto</a></li>
<li><a href="#h:cb3631a8-9c1b-42f2-ab01-502c7b4c273d">3.6.1.6. Work</a></li>
<li><a href="#h:eb272c99-842a-4095-bc65-283562749300">3.6.1.7. Framework</a></li>
<li><a href="#h:b7beb4a5-8808-438d-8799-7f08f38fd1ba">3.6.1.8. AMD CPU</a></li>
<li><a href="#h:79c71b6d-a1ad-447d-8940-bb5bfd71dced">3.6.1.9. AMD GPU</a></li>
<li><a href="#h:641d0a2a-0592-448a-a6e3-d0a9c330293e">3.6.1.10. Hibernation</a></li>
<li><a href="#h:0bb401e3-b195-4ff2-bc74-23c5a54d83d2">3.6.1.11. BTRFS</a></li>
<li><a href="#h:dfc076fd-ee74-4663-b164-653370c52b75">3.6.1.12. Local Server</a></li>
<li><a href="#h:9b7b50d1-57ad-41ca-94ab-74393aae01bf">3.6.1.13. OCI Sync Server</a></li>
<li><a href="#h:cc780ef2-7e5e-4835-b659-c731b306a320">3.6.1.14. Moonside</a></li>
<li><a href="#h:87a83b10-3c2f-407c-89aa-922ad77748a4">3.6.1.7. Uni</a></li>
<li><a href="#h:eb272c99-842a-4095-bc65-283562749300">3.6.1.8. Framework</a></li>
<li><a href="#h:b7beb4a5-8808-438d-8799-7f08f38fd1ba">3.6.1.9. AMD CPU</a></li>
<li><a href="#h:79c71b6d-a1ad-447d-8940-bb5bfd71dced">3.6.1.10. AMD GPU</a></li>
<li><a href="#h:641d0a2a-0592-448a-a6e3-d0a9c330293e">3.6.1.11. Hibernation</a></li>
<li><a href="#h:0bb401e3-b195-4ff2-bc74-23c5a54d83d2">3.6.1.12. BTRFS</a></li>
<li><a href="#h:dfc076fd-ee74-4663-b164-653370c52b75">3.6.1.13. Local Server</a></li>
<li><a href="#h:9b7b50d1-57ad-41ca-94ab-74393aae01bf">3.6.1.14. OCI Sync Server</a></li>
<li><a href="#h:cc780ef2-7e5e-4835-b659-c731b306a320">3.6.1.15. Moonside</a></li>
</ul>
</li>
<li><a href="#h:ced5841f-c088-4d88-b3a1-7d62aad8837b">3.6.2. home-manager</a>
@ -586,8 +589,9 @@
<li><a href="#h:36a0209f-2c17-4808-a1d0-a9e1920c307a">3.6.2.4. Chaostheatre</a></li>
<li><a href="#h:e1d4f141-af11-448a-9796-fc822a8f77ec">3.6.2.5. toto</a></li>
<li><a href="#h:7b091523-a5b0-48b6-8b03-4dc2405e2d81">3.6.2.6. Work</a></li>
<li><a href="#h:712b9d7f-16c0-42b3-b02b-6d79ee15cfcc">3.6.2.7. Framework</a></li>
<li><a href="#h:8027b858-369e-4f12-bbaf-f15eeee3d904">3.6.2.8. Local Server</a></li>
<li><a href="#h:56f509b9-3271-4212-b5ea-482dbe288bda">3.6.2.7. Uni</a></li>
<li><a href="#h:712b9d7f-16c0-42b3-b02b-6d79ee15cfcc">3.6.2.8. Framework</a></li>
<li><a href="#h:8027b858-369e-4f12-bbaf-f15eeee3d904">3.6.2.9. Local Server</a></li>
</ul>
</li>
</ul>
@ -757,7 +761,7 @@
<li><a href="#h:a81fb9de-6b6b-4a4a-b758-5107c6e7f0cb">4.4.42. vterm</a></li>
<li><a href="#h:1f4d32a0-c1ed-4409-aec4-7b5c96aa21dd">4.4.43. multiple cursors</a></li>
<li><a href="#h:438d928f-77a8-477a-ac8b-ca54ec673f91">4.4.44. Less logging</a></li>
<li><a href="#org9515b19">4.4.45. Popup frames</a></li>
<li><a href="#h:5322b631-a108-49a0-b95a-b61a70070dd9">4.4.45. Popup frames</a></li>
</ul>
</li>
</ul>
@ -812,7 +816,7 @@
</div>
</div>
<p>
<b>This file has 91224 words spanning 23377 lines and was last revised on 2025-08-09 14:31:36 +0200.</b>
<b>This file has 91577 words spanning 23506 lines and was last revised on 2025-08-10 11:35:15 +0200.</b>
</p>
<p>
@ -842,9 +846,9 @@ This configuration is part of a NixOS system that is (nearly) fully declarative
This literate configuration lets me explain my choices to my future self as well as you, the reader. I go to great lengths to explain the choices for all configuration steps that I take in order for me to pay due diligence in crafting my setup, and not simply copying big chunks of other peoples code. Also, the literate configuration approach is very convenient to me as I only need to keep of (ideally) a single file to manage all of my configuration. I hope that this documentation will make it easier for beginners to get into Emacs and NixOS as I know it can be a struggle in the beginning.
</p>
</div>
<div id="outline-container-org95f3948" class="outline-3">
<h3 id="org95f3948"><span class="section-number-3">1.1.</span> How to use this document</h3>
<div class="outline-text-3" id="text-1-1">
<div id="outline-container-h:6f4b190c-fe69-47a3-9df2-ee429bd9b48b" class="outline-3">
<h3 id="h:6f4b190c-fe69-47a3-9df2-ee429bd9b48b"><span class="section-number-3">1.1.</span> How to use this document</h3>
<div class="outline-text-3" id="text-h:6f4b190c-fe69-47a3-9df2-ee429bd9b48b">
<p>
When I started out with nix, it was a painful time. For a beginner, the available resources tend to be too detailed or assume too much prior knowledge. Also, it is a (sad) fact that using nix requires the user to understand it pretty well before most things start to make sense.
</p>
@ -881,7 +885,7 @@ This section defines my Emacs configuration. For a while, I considered to use ry
</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: 2025-08-09 14:31:36 +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: 2025-08-10 11:35:15 +0200)
</p></li>
</ul>
@ -1327,8 +1331,10 @@ This provides devshell support for flake-parts</li>
nixpkgs-stable24_05.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-stable24_11.url = "github:NixOS/nixpkgs/nixos-24.11";
systems.url = "github:nix-systems/default";
swarsel-modules.url = "github:Swarsel/swarsel-modules/main";
home-manager = {
url = "github:nix-community/home-manager";
# url = "github:Swarsel/home-manager/module/pizauth";
inputs.nixpkgs.follows = "nixpkgs";
};
swarsel.url = "github:Swarsel/.dotfiles";
@ -1389,6 +1395,10 @@ This provides devshell support for flake-parts</li>
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
};
spicetify-nix = {
url = "github:Gerg-l/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs:
@ -1817,6 +1827,7 @@ The rest of the outputs either define or help define the actual configurations:
inputs.home-manager.nixosModules.home-manager
inputs.stylix.nixosModules.stylix
inputs.nswitch-rcm-nix.nixosModules.nswitch-rcm
inputs.swarsel-modules.nixosModules.default
"${self}/hosts/nixos/${configName}"
"${self}/profiles/nixos"
"${self}/modules/nixos"
@ -2920,6 +2931,7 @@ in
swarselprofiles = {
personal = lib.mkIf (!minimal) true;
work = lib.mkIf (!minimal) true;
uni = lib.mkIf (!minimal) true;
framework = lib.mkIf (!minimal) true;
amdcpu = true;
amdgpu = true;
@ -5003,9 +5015,9 @@ in
</div>
</div>
</div>
<div id="outline-container-org102ae59" class="outline-5">
<h5 id="org102ae59"><span class="section-number-5">3.2.1.5.</span> Expose home-manager sops secrets in NixOS (automatically active)</h5>
<div class="outline-text-5" id="text-3-2-1-5">
<div id="outline-container-h:a8bbe15f-a7dd-4e6d-ba49-26206c38e9c8" class="outline-5">
<h5 id="h:a8bbe15f-a7dd-4e6d-ba49-26206c38e9c8"><span class="section-number-5">3.2.1.5.</span> Expose home-manager sops secrets in NixOS (automatically active)</h5>
<div class="outline-text-5" id="text-h:a8bbe15f-a7dd-4e6d-ba49-26206c38e9c8">
<div class="org-src-container">
<pre class="src src-nix-ts">{ lib, config, globals, ... }:
let
@ -5236,7 +5248,8 @@ We enable the use of <code>home-manager</code> as a NixoS module. A nice trick h
users.${config.swarselsystems.mainUser}.imports = [
inputs.nix-index-database.homeModules.nix-index
inputs.sops-nix.homeManagerModules.sops
# inputs.stylix.homeModules.stylix
inputs.spicetify-nix.homeManagerModules.default
inputs.swarsel-modules.homeModules.default
{
imports = [
"${self}/profiles/home"
@ -5486,9 +5499,9 @@ This dynamically uses systemd boot or Lanzaboote depending on the minimal system
</div>
</div>
</div>
<div id="outline-container-org895e59b" class="outline-5">
<h5 id="org895e59b"><span class="section-number-5">3.2.1.14.</span> Boot</h5>
<div class="outline-text-5" id="text-3-2-1-14">
<div id="outline-container-h:a1311b07-2a8d-4c1f-addc-8572fc184e0d" class="outline-5">
<h5 id="h:a1311b07-2a8d-4c1f-addc-8572fc184e0d"><span class="section-number-5">3.2.1.14.</span> Boot</h5>
<div class="outline-text-5" id="text-h:a1311b07-2a8d-4c1f-addc-8572fc184e0d">
<div class="org-src-container">
<pre class="src src-nix-ts">{ lib, pkgs, config, globals, ... }:
{
@ -11025,9 +11038,9 @@ in
</div>
</div>
</div>
<div id="outline-container-orgb7ca62f" class="outline-5">
<h5 id="orgb7ca62f"><span class="section-number-5">3.2.3.36.</span> slink</h5>
<div class="outline-text-5" id="text-3-2-3-36">
<div id="outline-container-h:e46c37ac-5610-4603-8afc-2f5f008fc14d" class="outline-5">
<h5 id="h:e46c37ac-5610-4603-8afc-2f5f008fc14d"><span class="section-number-5">3.2.3.36.</span> slink</h5>
<div class="outline-text-5" id="text-h:e46c37ac-5610-4603-8afc-2f5f008fc14d">
<p>
Deployment notes:
</p>
@ -12036,7 +12049,7 @@ This holds packages that I can use as provided, or with small modifications (as
libreoffice-qt
xournalpp
obsidian
spotify
# spotify
vesktop # discord client
# nextcloud-client # enables a systemd service that I do not want
spotify-player
@ -14943,6 +14956,36 @@ in
</div>
</div>
</div>
<div id="outline-container-h:d1fb3075-ad52-4c1b-ba45-5ddbd0d3b708" class="outline-5">
<h5 id="h:d1fb3075-ad52-4c1b-ba45-5ddbd0d3b708"><span class="section-number-5">3.3.1.35.</span> Spicetify</h5>
<div class="outline-text-5" id="text-h:d1fb3075-ad52-4c1b-ba45-5ddbd0d3b708">
<div class="org-src-container">
<pre class="src src-nix-ts">{ inputs, lib, config, pkgs, ... }:
let
moduleName = "spicetify";
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.system};
in
{
options.swarselmodules.${moduleName} = lib.mkEnableOption "${moduleName} settings";
config = lib.mkIf config.swarselmodules.${moduleName} {
programs.spicetify = {
enable = true;
spotifyPackage = pkgs.stable24_11.spotify;
enabledExtensions = with spicePkgs.extensions; [
fullAppDisplay
shuffle
hidePodcasts
fullAlbumDate
skipStats
history
];
};
};
}
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-h:b1a00339-6e9b-4ae4-b5dc-6fd5669a2ddb" class="outline-4">
<h4 id="h:b1a00339-6e9b-4ae4-b5dc-6fd5669a2ddb"><span class="section-number-4">3.3.2.</span> Server</h4>
@ -15129,26 +15172,8 @@ in
stable.prometheus.cli
tigervnc
openstackclient
pizauth
];
systemd.user.services.pizauth = {
Unit = {
Description = "Pizauth OAuth2 token manager";
};
Service = {
Type = "simple";
ExecStart = "${pkgs.pizauth}/bin/pizauth server -vvvv -d";
ExecReload = "${pkgs.pizauth}/bin/pizauth reload";
ExecStop = "${pkgs.pizauth}/bin/pizauth shutdown";
};
Install = {
WantedBy = [ "default.target" ];
};
};
home.sessionVariables = {
DOCUMENT_DIR_PRIV = lib.mkForce "${homeDir}/Documents/Private";
DOCUMENT_DIR_WORK = lib.mkForce "${homeDir}/Documents/Work";
@ -15482,28 +15507,30 @@ in
};
};
swarselservices.pizauth = {
enable = true;
accounts = {
work = {
authUri = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize";
tokenUri = "https://login.microsoftonline.com/common/oauth2/v2.0/token";
clientId = "08162f7c-0fd2-4200-a84a-f25a4db0b584";
clientSecret = "TxRBilcHdC6WGBee]fs?QR:SJ8nI[g82";
scopes = [
"https://outlook.office365.com/IMAP.AccessAsUser.All"
"https://outlook.office365.com/SMTP.Send"
"offline_access"
];
loginHint = "${nixosConfig.repo.secrets.local.work.mailAddress}";
};
};
};
xdg =
let
inherit (nixosConfig.repo.secrets.local.work) user1 user2 user3;
in
{
configFile."pizauth.conf".text = ''
account "work" {
auth_uri = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize";
token_uri = "https://login.microsoftonline.com/common/oauth2/v2.0/token";
client_id = "08162f7c-0fd2-4200-a84a-f25a4db0b584";
client_secret = "TxRBilcHdC6WGBee]fs?QR:SJ8nI[g82";
scopes = [
"https://outlook.office365.com/IMAP.AccessAsUser.All",
"https://outlook.office365.com/SMTP.Send",
"offline_access"
];
// You don't have to specify login_hint, but it does make
// authentication a little easier.
login_hint = "${nixosConfig.repo.secrets.local.work.mailAddress}";
}
'';
mimeApps = {
defaultApplications = {
"x-scheme-handler/msteams" = [ "teams-for-linux.desktop" ];
@ -15655,12 +15682,45 @@ in
}
</pre>
</div>
</div>
</div>
<div id="outline-container-h:52b41e73-46f3-4c2c-af64-eafb51e3b6b6" class="outline-5">
<h5 id="h:52b41e73-46f3-4c2c-af64-eafb51e3b6b6"><span class="section-number-5">3.3.4.3.</span> Uni</h5>
<div class="outline-text-5" id="text-h:52b41e73-46f3-4c2c-af64-eafb51e3b6b6">
<div class="org-src-container">
<pre class="src src-nix-ts">{ config, lib, nixosConfig ? config, ... }:
{
options.swarselmodules.optional.uni = lib.mkEnableOption "optional uni settings";
config = lib.mkIf config.swarselmodules.optional.uni
{
swarselservices.pizauth = {
enable = true;
accounts = {
uni = {
authUri = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize";
tokenUri = "https://login.microsoftonline.com/common/oauth2/v2.0/token";
clientId = "08162f7c-0fd2-4200-a84a-f25a4db0b584";
clientSecret = "TxRBilcHdC6WGBee]fs?QR:SJ8nI[g82";
scopes = [
"https://outlook.office365.com/IMAP.AccessAsUser.All"
"https://outlook.office365.com/SMTP.Send"
"offline_access"
];
loginHint = "${nixosConfig.repo.secrets.local.uni.mailAddress}";
};
};
};
};
}
</pre>
</div>
</div>
</div>
<div id="outline-container-h:8a7b1c26-3448-42d3-932a-5d05d54b5490" class="outline-5">
<h5 id="h:8a7b1c26-3448-42d3-932a-5d05d54b5490"><span class="section-number-5">3.3.4.3.</span> Framework</h5>
<h5 id="h:8a7b1c26-3448-42d3-932a-5d05d54b5490"><span class="section-number-5">3.3.4.4.</span> Framework</h5>
<div class="outline-text-5" id="text-h:8a7b1c26-3448-42d3-932a-5d05d54b5490">
<p>
This holds configuration that is specific to framework laptops.
@ -15687,9 +15747,9 @@ This holds configuration that is specific to framework laptops.
</div>
</div>
</div>
<div id="outline-container-org7f776e3" class="outline-3">
<h3 id="org7f776e3"><span class="section-number-3">3.4.</span> Shared</h3>
<div class="outline-text-3" id="text-3-4">
<div id="outline-container-h:3552f06f-07e0-4bb1-a50f-fd1efb2d7778" class="outline-3">
<h3 id="h:3552f06f-07e0-4bb1-a50f-fd1efb2d7778"><span class="section-number-3">3.4.</span> Shared</h3>
<div class="outline-text-3" id="text-h:3552f06f-07e0-4bb1-a50f-fd1efb2d7778">
<p>
This section is for modules that are to be used on <code>NixOS</code> and <code>home-manager</code> scopes alike. This is for example needed in order to allow me to define and set my own custom functions only once in the <code>NixOS</code> config and then mirror them into the corresponding <code>home-manager</code> option.
</p>
@ -15777,9 +15837,9 @@ TODO: check which of these can be replaced but builtin functions.
</div>
</div>
</div>
<div id="outline-container-org6e2eee2" class="outline-4">
<h4 id="org6e2eee2"><span class="section-number-4">3.4.2.</span> Variables (vars; holds firefox &amp; stylix config parts)</h4>
<div class="outline-text-4" id="text-3-4-2">
<div id="outline-container-h:ea362c55-97b4-45fd-bf41-ab461c444212" class="outline-4">
<h4 id="h:ea362c55-97b4-45fd-bf41-ab461c444212"><span class="section-number-4">3.4.2.</span> Variables (vars; holds firefox &amp; stylix config parts)</h4>
<div class="outline-text-4" id="text-h:ea362c55-97b4-45fd-bf41-ab461c444212">
<p>
At work I am using several services that are using SSO login - however, as I am using four different accounts at work, this becomes a chore here. Hence, I have defined multiple profiles in <a href="#h:f0b2ea93-94c8-48d8-8d47-6fe58f58e0e6">Work</a> that are all practically using the same configuration. To save screen space, I template that profile here.
Set in firefox <code>about:config &gt; toolkit.legacyUserProfileCustomizations.stylesheets</code> to true. This should in principle be set automatically using the below config, but it seems not to be working reliably.
@ -15852,6 +15912,7 @@ In short, the options defined here are passed to the modules systems using <code
emacs.enable = false;
waybar.enable = false;
sway.useWallpaper = false;
spicetify.enable = true;
firefox.profileNames = [ "default" ];
};
@ -18282,12 +18343,39 @@ in
}
</pre>
</div>
</div>
</div>
<div id="outline-container-h:87a83b10-3c2f-407c-89aa-922ad77748a4" class="outline-5">
<h5 id="h:87a83b10-3c2f-407c-89aa-922ad77748a4"><span class="section-number-5">3.6.1.7.</span> Uni</h5>
<div class="outline-text-5" id="text-h:87a83b10-3c2f-407c-89aa-922ad77748a4">
<div class="org-src-container">
<pre class="src src-nix-ts">{ lib, config, ... }:
{
options.swarselprofiles.uni = lib.mkEnableOption "is this a uni host";
config = lib.mkIf config.swarselprofiles.uni {
# swarselmodules = {
# optional = {
# uni = lib.mkDefault true;
# };
# };
home-manager.users."${config.swarselsystems.mainUser}" = {
swarselprofiles = {
uni = lib.mkDefault true;
};
};
};
}
</pre>
</div>
</div>
</div>
<div id="outline-container-h:eb272c99-842a-4095-bc65-283562749300" class="outline-5">
<h5 id="h:eb272c99-842a-4095-bc65-283562749300"><span class="section-number-5">3.6.1.7.</span> Framework</h5>
<h5 id="h:eb272c99-842a-4095-bc65-283562749300"><span class="section-number-5">3.6.1.8.</span> Framework</h5>
<div class="outline-text-5" id="text-h:eb272c99-842a-4095-bc65-283562749300">
<div class="org-src-container">
<pre class="src src-nix-ts">{ lib, config, ... }:
@ -18314,7 +18402,7 @@ in
</div>
</div>
<div id="outline-container-h:b7beb4a5-8808-438d-8799-7f08f38fd1ba" class="outline-5">
<h5 id="h:b7beb4a5-8808-438d-8799-7f08f38fd1ba"><span class="section-number-5">3.6.1.8.</span> AMD CPU</h5>
<h5 id="h:b7beb4a5-8808-438d-8799-7f08f38fd1ba"><span class="section-number-5">3.6.1.9.</span> AMD CPU</h5>
<div class="outline-text-5" id="text-h:b7beb4a5-8808-438d-8799-7f08f38fd1ba">
<div class="org-src-container">
<pre class="src src-nix-ts">{ lib, config, ... }:
@ -18336,7 +18424,7 @@ in
</div>
</div>
<div id="outline-container-h:79c71b6d-a1ad-447d-8940-bb5bfd71dced" class="outline-5">
<h5 id="h:79c71b6d-a1ad-447d-8940-bb5bfd71dced"><span class="section-number-5">3.6.1.9.</span> AMD GPU</h5>
<h5 id="h:79c71b6d-a1ad-447d-8940-bb5bfd71dced"><span class="section-number-5">3.6.1.10.</span> AMD GPU</h5>
<div class="outline-text-5" id="text-h:79c71b6d-a1ad-447d-8940-bb5bfd71dced">
<div class="org-src-container">
<pre class="src src-nix-ts">{ lib, config, ... }:
@ -18358,7 +18446,7 @@ in
</div>
</div>
<div id="outline-container-h:641d0a2a-0592-448a-a6e3-d0a9c330293e" class="outline-5">
<h5 id="h:641d0a2a-0592-448a-a6e3-d0a9c330293e"><span class="section-number-5">3.6.1.10.</span> Hibernation</h5>
<h5 id="h:641d0a2a-0592-448a-a6e3-d0a9c330293e"><span class="section-number-5">3.6.1.11.</span> Hibernation</h5>
<div class="outline-text-5" id="text-h:641d0a2a-0592-448a-a6e3-d0a9c330293e">
<div class="org-src-container">
<pre class="src src-nix-ts">{ lib, config, ... }:
@ -18380,7 +18468,7 @@ in
</div>
</div>
<div id="outline-container-h:0bb401e3-b195-4ff2-bc74-23c5a54d83d2" class="outline-5">
<h5 id="h:0bb401e3-b195-4ff2-bc74-23c5a54d83d2"><span class="section-number-5">3.6.1.11.</span> BTRFS</h5>
<h5 id="h:0bb401e3-b195-4ff2-bc74-23c5a54d83d2"><span class="section-number-5">3.6.1.12.</span> BTRFS</h5>
<div class="outline-text-5" id="text-h:0bb401e3-b195-4ff2-bc74-23c5a54d83d2">
<div class="org-src-container">
<pre class="src src-nix-ts">{ lib, config, ... }:
@ -18402,7 +18490,7 @@ in
</div>
</div>
<div id="outline-container-h:dfc076fd-ee74-4663-b164-653370c52b75" class="outline-5">
<h5 id="h:dfc076fd-ee74-4663-b164-653370c52b75"><span class="section-number-5">3.6.1.12.</span> Local Server</h5>
<h5 id="h:dfc076fd-ee74-4663-b164-653370c52b75"><span class="section-number-5">3.6.1.13.</span> Local Server</h5>
<div class="outline-text-5" id="text-h:dfc076fd-ee74-4663-b164-653370c52b75">
<div class="org-src-container">
<pre class="src src-nix-ts">{ lib, config, ... }:
@ -18459,7 +18547,7 @@ in
</div>
</div>
<div id="outline-container-h:9b7b50d1-57ad-41ca-94ab-74393aae01bf" class="outline-5">
<h5 id="h:9b7b50d1-57ad-41ca-94ab-74393aae01bf"><span class="section-number-5">3.6.1.13.</span> OCI Sync Server</h5>
<h5 id="h:9b7b50d1-57ad-41ca-94ab-74393aae01bf"><span class="section-number-5">3.6.1.14.</span> OCI Sync Server</h5>
<div class="outline-text-5" id="text-h:9b7b50d1-57ad-41ca-94ab-74393aae01bf">
<div class="org-src-container">
<pre class="src src-nix-ts">{ lib, config, ... }:
@ -18494,7 +18582,7 @@ in
</div>
</div>
<div id="outline-container-h:cc780ef2-7e5e-4835-b659-c731b306a320" class="outline-5">
<h5 id="h:cc780ef2-7e5e-4835-b659-c731b306a320"><span class="section-number-5">3.6.1.14.</span> Moonside</h5>
<h5 id="h:cc780ef2-7e5e-4835-b659-c731b306a320"><span class="section-number-5">3.6.1.15.</span> Moonside</h5>
<div class="outline-text-5" id="text-h:cc780ef2-7e5e-4835-b659-c731b306a320">
<div class="org-src-container">
<pre class="src src-nix-ts">{ lib, config, ... }:
@ -18597,9 +18685,11 @@ in
kanshi = lib.mkDefault true;
gpgagent = lib.mkDefault true;
gammastep = lib.mkDefault true;
spicetify = lib.mkDefault true;
optional = {
gaming = lib.mkDefault true;
uni = lib.mkDefault true;
};
};
};
@ -18782,12 +18872,33 @@ in
}
</pre>
</div>
</div>
</div>
<div id="outline-container-h:56f509b9-3271-4212-b5ea-482dbe288bda" class="outline-5">
<h5 id="h:56f509b9-3271-4212-b5ea-482dbe288bda"><span class="section-number-5">3.6.2.7.</span> Uni</h5>
<div class="outline-text-5" id="text-h:56f509b9-3271-4212-b5ea-482dbe288bda">
<div class="org-src-container">
<pre class="src src-nix-ts">{ lib, config, ... }:
{
options.swarselprofiles.uni = lib.mkEnableOption "is this a uni host";
config = lib.mkIf config.swarselprofiles.uni {
swarselmodules = {
optional = {
uni = lib.mkDefault true;
};
};
};
}
</pre>
</div>
</div>
</div>
<div id="outline-container-h:712b9d7f-16c0-42b3-b02b-6d79ee15cfcc" class="outline-5">
<h5 id="h:712b9d7f-16c0-42b3-b02b-6d79ee15cfcc"><span class="section-number-5">3.6.2.7.</span> Framework</h5>
<h5 id="h:712b9d7f-16c0-42b3-b02b-6d79ee15cfcc"><span class="section-number-5">3.6.2.8.</span> Framework</h5>
<div class="outline-text-5" id="text-h:712b9d7f-16c0-42b3-b02b-6d79ee15cfcc">
<div class="org-src-container">
<pre class="src src-nix-ts">{ lib, config, ... }:
@ -18809,7 +18920,7 @@ in
</div>
</div>
<div id="outline-container-h:8027b858-369e-4f12-bbaf-f15eeee3d904" class="outline-5">
<h5 id="h:8027b858-369e-4f12-bbaf-f15eeee3d904"><span class="section-number-5">3.6.2.8.</span> Local Server</h5>
<h5 id="h:8027b858-369e-4f12-bbaf-f15eeee3d904"><span class="section-number-5">3.6.2.9.</span> Local Server</h5>
<div class="outline-text-5" id="text-h:8027b858-369e-4f12-bbaf-f15eeee3d904">
<div class="org-src-container">
<pre class="src src-nix-ts">{ lib, config, ... }:
@ -22428,9 +22539,9 @@ This sets up the <code>dashboard</code>, which is really quite useless. But, it
</div>
</div>
</div>
<div id="outline-container-org9515b19" class="outline-4">
<h4 id="org9515b19"><span class="section-number-4">4.4.45.</span> Popup frames</h4>
<div class="outline-text-4" id="text-4-4-45">
<div id="outline-container-h:5322b631-a108-49a0-b95a-b61a70070dd9" class="outline-4">
<h4 id="h:5322b631-a108-49a0-b95a-b61a70070dd9"><span class="section-number-4">4.4.45.</span> Popup frames</h4>
<div class="outline-text-4" id="text-h:5322b631-a108-49a0-b95a-b61a70070dd9">
<div class="org-src-container">
<pre class="src src-emacs-lisp">(defun prot-window-delete-popup-frame (&amp;rest _)
"Kill selected selected frame if it has parameter `prot-window-popup-frame'.
@ -25461,7 +25572,7 @@ similarly, there exists an version that starts from the right.
</div>
<div id="postamble" class="status">
<p class="author">Author: Leon Schwarzäugl</p>
<p class="date">Created: 2025-08-09 Sa 14:31</p>
<p class="date">Created: 2025-08-10 So 11:35</p>
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View file

@ -9,8 +9,8 @@
users.${config.swarselsystems.mainUser}.imports = [
inputs.nix-index-database.homeModules.nix-index
inputs.sops-nix.homeManagerModules.sops
# inputs.stylix.homeModules.stylix
inputs.spicetify-nix.homeManagerModules.default
inputs.swarsel-modules.homeModules.default
{
imports = [
"${self}/profiles/home"

View file

@ -18,6 +18,7 @@
inputs.home-manager.nixosModules.home-manager
inputs.stylix.nixosModules.stylix
inputs.nswitch-rcm-nix.nixosModules.nswitch-rcm
inputs.swarsel-modules.nixosModules.default
"${self}/hosts/nixos/${configName}"
"${self}/profiles/nixos"
"${self}/modules/nixos"