diff --git a/SwarselSystems.org b/SwarselSystems.org index d950608..1fdfeeb 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -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. @@ -387,115 +390,121 @@ A short overview over each input and what it does: This provides devshell support for flake-parts #+begin_src nix :noweb yes :tangle flake.nix - { - description = "SwarseFlake - Nix Flake for all SwarselSystems"; + { + description = "SwarseFlake - Nix Flake for all SwarselSystems"; - nixConfig = { - extra-substituters = [ - "https://nix-community.cachix.org" - "https://cache.ngi0.nixos.org/" + nixConfig = { + extra-substituters = [ + "https://nix-community.cachix.org" + "https://cache.ngi0.nixos.org/" + ]; + extra-trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA=" + ]; + }; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs-dev.url = "github:Swarsel/nixpkgs/main"; + nixpkgs-kernel.url = "github:NixOS/nixpkgs/063f43f2dbdef86376cc29ad646c45c46e93234c?narHash=sha256-6m1Y3/4pVw1RWTsrkAK2VMYSzG4MMIj7sqUy7o8th1o%3D"; #specifically pinned for kernel version + nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.05"; + 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"; + emacs-overlay = { + url = "github:nix-community/emacs-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nur.url = "github:nix-community/NUR"; + nixgl.url = "github:guibou/nixGL"; + stylix.url = "github:danth/stylix"; + sops-nix.url = "github:Mic92/sops-nix"; + lanzaboote.url = "github:nix-community/lanzaboote"; + nix-on-droid = { + url = "github:nix-community/nix-on-droid/release-24.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nixos-generators = { + url = "github:nix-community/nixos-generators"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nixos-hardware = { + url = "github:NixOS/nixos-hardware/master"; + }; + nswitch-rcm-nix = { + url = "github:Swarsel/nswitch-rcm-nix"; + }; + nix-index-database = { + url = "github:nix-community/nix-index-database"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + impermanence.url = "github:nix-community/impermanence"; + zjstatus = { + url = "github:dj95/zjstatus"; + }; + fw-fanctrl = { + url = "github:TamtamHero/fw-fanctrl/packaging/nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nix-darwin = { + url = "github:lnl7/nix-darwin"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + pre-commit-hooks = { + url = "github:cachix/git-hooks.nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + vbc-nix = { + url = "git+ssh://git@github.com/vbc-it/vbc-nix.git?ref=main"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nix-topology.url = "github:oddlama/nix-topology"; + flake-parts.url = "github:hercules-ci/flake-parts"; + devshell = { + url = "github:numtide/devshell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + spicetify-nix = { + url = "github:Gerg-l/spicetify-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + outputs = + inputs: + inputs.flake-parts.lib.mkFlake { inherit inputs; } { + imports = [ + ./nix/globals.nix + ./nix/hosts.nix + ./nix/topology.nix + ./nix/devshell.nix + ./nix/apps.nix + ./nix/packages.nix + ./nix/overlays.nix + ./nix/lib.nix + ./nix/templates.nix + ./nix/formatter.nix + ./nix/modules.nix + ./nix/iso.nix ]; - extra-trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA=" + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" ]; }; - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - nixpkgs-dev.url = "github:Swarsel/nixpkgs/main"; - nixpkgs-kernel.url = "github:NixOS/nixpkgs/063f43f2dbdef86376cc29ad646c45c46e93234c?narHash=sha256-6m1Y3/4pVw1RWTsrkAK2VMYSzG4MMIj7sqUy7o8th1o%3D"; #specifically pinned for kernel version - nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.05"; - 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"; - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - swarsel.url = "github:Swarsel/.dotfiles"; - emacs-overlay = { - url = "github:nix-community/emacs-overlay"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - nur.url = "github:nix-community/NUR"; - nixgl.url = "github:guibou/nixGL"; - stylix.url = "github:danth/stylix"; - sops-nix.url = "github:Mic92/sops-nix"; - lanzaboote.url = "github:nix-community/lanzaboote"; - nix-on-droid = { - url = "github:nix-community/nix-on-droid/release-24.05"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - nixos-generators = { - url = "github:nix-community/nixos-generators"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - nixos-hardware = { - url = "github:NixOS/nixos-hardware/master"; - }; - nswitch-rcm-nix = { - url = "github:Swarsel/nswitch-rcm-nix"; - }; - nix-index-database = { - url = "github:nix-community/nix-index-database"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - disko = { - url = "github:nix-community/disko"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - impermanence.url = "github:nix-community/impermanence"; - zjstatus = { - url = "github:dj95/zjstatus"; - }; - fw-fanctrl = { - url = "github:TamtamHero/fw-fanctrl/packaging/nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - nix-darwin = { - url = "github:lnl7/nix-darwin"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - pre-commit-hooks = { - url = "github:cachix/git-hooks.nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - vbc-nix = { - url = "git+ssh://git@github.com/vbc-it/vbc-nix.git?ref=main"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - nix-topology.url = "github:oddlama/nix-topology"; - flake-parts.url = "github:hercules-ci/flake-parts"; - devshell = { - url = "github:numtide/devshell"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - outputs = - inputs: - inputs.flake-parts.lib.mkFlake { inherit inputs; } { - imports = [ - ./nix/globals.nix - ./nix/hosts.nix - ./nix/topology.nix - ./nix/devshell.nix - ./nix/apps.nix - ./nix/packages.nix - ./nix/overlays.nix - ./nix/lib.nix - ./nix/templates.nix - ./nix/formatter.nix - ./nix/modules.nix - ./nix/iso.nix - ]; - systems = [ - "x86_64-linux" - "aarch64-linux" - "x86_64-darwin" - "aarch64-darwin" - ]; - }; - } + } #+end_src ** Auxiliary files :PROPERTIES: @@ -834,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" @@ -1855,6 +1865,7 @@ My work machine. Built for more security, this is the gold standard of my config 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; @@ -3890,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, ... }: @@ -4107,7 +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" @@ -4344,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, ... }: @@ -9742,6 +9760,9 @@ To get other URLs (token, etc.), use https:///oauth2/openid/= @@ -10584,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 @@ -10711,7 +10732,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 @@ -13506,6 +13527,37 @@ This service changes the screen hue at night. I am not sure if that really does } #+end_src +**** Spicetify +:PROPERTIES: +:CUSTOM_ID: h:d1fb3075-ad52-4c1b-ba45-5ddbd0d3b708 +:END: + + +#+begin_src nix-ts :tangle modules/home/common/spicetify.nix + { 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 + ]; + }; + }; + } +#+end_src + *** Server :PROPERTIES: :CUSTOM_ID: h:b1a00339-6e9b-4ae4-b5dc-6fd5669a2ddb @@ -13678,26 +13730,8 @@ The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]] 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"; @@ -14031,28 +14065,30 @@ The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]] }; }; + 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" ]; @@ -14206,6 +14242,39 @@ The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]] #+end_src +**** Uni +:PROPERTIES: +:CUSTOM_ID: h:52b41e73-46f3-4c2c-af64-eafb51e3b6b6 +:END: + +#+begin_src nix-ts :tangle modules/home/optional/uni.nix :noweb yes + { 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}"; + }; + }; + }; + }; + } + +#+end_src + **** Framework :PROPERTIES: :CUSTOM_ID: h:8a7b1c26-3448-42d3-932a-5d05d54b5490 @@ -14230,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. @@ -14313,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. @@ -14326,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" - "" + # 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" + "" + ]; + 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 @@ -16750,6 +16826,33 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a #+end_src +**** Uni +:PROPERTIES: +:CUSTOM_ID: h:87a83b10-3c2f-407c-89aa-922ad77748a4 +:END: + +#+begin_src nix-ts :tangle profiles/nixos/uni/default.nix :mkdirp yes + { 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; + }; + }; + + }; + + } + +#+end_src + **** Framework :PROPERTIES: :CUSTOM_ID: h:eb272c99-842a-4095-bc65-283562749300 @@ -17058,9 +17161,11 @@ This holds modules that are to be used on most hosts. These are also the most im 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; }; }; }; @@ -17245,6 +17350,27 @@ This holds modules that are to be used on most hosts. These are also the most im #+end_src +**** Uni +:PROPERTIES: +:CUSTOM_ID: h:56f509b9-3271-4212-b5ea-482dbe288bda +:END: + +#+begin_src nix-ts :tangle profiles/home/uni/default.nix :mkdirp yes + { lib, config, ... }: + { + options.swarselprofiles.uni = lib.mkEnableOption "is this a uni host"; + config = lib.mkIf config.swarselprofiles.uni { + swarselmodules = { + optional = { + uni = lib.mkDefault true; + }; + }; + }; + + } + +#+end_src + **** Framework :PROPERTIES: :CUSTOM_ID: h:712b9d7f-16c0-42b3-b02b-6d79ee15cfcc @@ -20507,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 _) diff --git a/flake.lock b/flake.lock index d3f48f0..5d2a290 100644 --- a/flake.lock +++ b/flake.lock @@ -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": { diff --git a/flake.nix b/flake.nix index 2f589b8..af2d912 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; @@ -81,6 +83,10 @@ url = "github:numtide/devshell"; inputs.nixpkgs.follows = "nixpkgs"; }; + spicetify-nix = { + url = "github:Gerg-l/spicetify-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = inputs: diff --git a/hosts/nixos/pyramid/default.nix b/hosts/nixos/pyramid/default.nix index 79541c3..b89f44d 100644 --- a/hosts/nixos/pyramid/default.nix +++ b/hosts/nixos/pyramid/default.nix @@ -16,6 +16,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; diff --git a/hosts/nixos/pyramid/secrets/pii.nix.enc b/hosts/nixos/pyramid/secrets/pii.nix.enc index d902cda..f5a735a 100644 --- a/hosts/nixos/pyramid/secrets/pii.nix.enc +++ b/hosts/nixos/pyramid/secrets/pii.nix.enc @@ -1,5 +1,5 @@ { - "data": "ENC[AES256_GCM,data:kkwEMOzab5JK9G+rSfYygcAI6Y+b1tXkUFPdxN8e2Rnz2Uv4bDfITu8bmKqJ1q5kmHxQjQukioZkdQkabqBR8cx/CG3dRJfPAjEwMz4v8UYGSNSf8blJvdb4YKSizeOEALCuawBIm5hmvwuskXlol6UfkK66h9UnP94wwdh0KKemWinANxbIUX+cl6kK4X1eZrWRGr5Ts2HmjcowIbA+SmA8yVAwqoP6L1DuavilLGPfWhBI4Kj7ZTI3LRlvu4DZZ+DCAea3FgrrjbTWiWZfFW0YX2fDgNQkIxpp3N203zDu23HebZcmCrVBkfvFS7awBr5iVnwfsqOJR0LH92lIlUb8YoFShlJU/Day80i9uyYDCTHc4l2NBvjIH8NlpiYaA2A+rCW3VkVX3WzCGxBfi/kIqoNE3RdLJAYrIimsYaHSmk4o6jslR3xIRyQzDcNtWa92kINdCwBuJXc0UYe/HnR8tFlmOrlixMlVINTy45PRNYJoy7cuoJPd+aNIPQ2V31TB/CjUSZhEptVJSnQnKDui1xuV7vqcyPv06xftJGZRk/LL2cl3+HDLflkZYE7NVlLaOWMBOkX99W/WokF3NGBWuVeUp9bLCwpuEmzFafpCjKhGrQSDGkw17jmYWCULN9v3q6OvyylwqVuDDQZNSxGZFsSPr7qOxeENwTDQvRwpydthPRMMHh/wf3t5pyV/jW79SBuxIWvn4JbO8TBsd9TmVgXMgpd97+Zg3CnTqZApVVRzM8NzF25fMYHJv12YvkEmyOm0otFU84COhgNkpBRTJhyJdjKWVOTJFJyQviwy6BTBF6jqHyS+YP7BEZO2UID/9ODKVrSACCatSQlNtLQRrXOiE9h3g43uAJc/TyJ+A0IceUJ3BM+6PEJiqDWUfO5ucP3pLDdb4IDOAi/YeV9HQdyCdEVRf6a0CHmPcnkb+X+fxxcmZQCvuzQjOZQZw8UUwfhdJms6jTWqaN9leb3z4u8RPxOM1T+Qsu5dL5ouady7xVSO4c1Fw+EiiL9yOh42DTa4OyBlcTJiz5iigqmkaiQOwdwn+FlOYNraOd24h8+x7dDVQBbHjnV7xF7I1rmpOfA/lUbfovLU5SrIxLPT64J25ucudJWBTCDiYADUwhv+QmfJJsdt11+NWPkS3ymFbbWPtpZvhCaawrNKb3s/ohOEi8JIAyY9dtfRGuRoTsCcsJ4xjeSLehX4TgR0cl31Jmm+0kO2uuP7veDrqyUg1Swqsq4+BKfimprh/QzwSoB9lOdEPu0bdQza9sk+D5+H2ooXsVXA2YJscBZ/Kv+YYW57LlfwEvfpJDx5XiQtAYYlUeN8SPx72i9QzYugm339gj+eB8gtbX3W8Sl+D9Vs0P+GZ4G7K03JvzEExtA=,iv:Go3U5S9ZxtPawFoVjknH8j8WDg2TJLIU6mp5DQDj9BE=,tag:0QPJYyQsuZ4hz8xZZ2V4xw==,type:str]", + "data": "ENC[AES256_GCM,data:p68IT8Bx7PKlHX5ZI5L0pU64WGA+q3byfbT9yOceKKq4BxD2ZX4zwxXrTsb1q6WOcxOfr7aqqJ8uzkSURKbSbjd1sImBrrzTh2BU80PnM7d8n2GuqJdj2TsiJ25MD5BNG2v0Ib3jDErI5cA6DWkQgzZV3gyfc486XpsFP8TZLjdHBqVO+FcDde/yqLMbAzaGfsOL/yvqsKgoCLQIsY9XyKVuVYuzreBRKo/kXUROCIB9wNFKvXvsMquCPGGDeumjVmcOvKqds3Gz4Ij3YjMiuLEcy4fJCl+Oqt9uKTAzETtxh+0G6UxqPc0IpS3ZzBGKVN+waOqbee0EgZys187qDVkg57L2QZ8I5An7EsMpo7T4KQDhxE8ZU4aLvwS/fobHaFW/9pSjqnH1v1O7gVpPS1T+GDTBHUDvlFVA3EtmTaXT2P3JHpFZCGex9AuyqQPOggwC2CVedmeWEc5osbGJhJjWjHvqkfcfLjIJB8bvp5y3FBXodJAEX9lW+Kbhe3121JU5pAlDp9QWG7a9wHdTSLbhC3qJXAtovOrOqrPTUD/LkSVMYDI+MaN+kw1kgCXH/ZXZmE8WCu7e8g7Vh4XEuRwhwAloGN6KyU+0LUP1SaMRTktur6sUtTIGdWdkaIVXn5sHMiLFYmwXy07uSZ3bGQ8nb3D0yInLkxCH/C/czS+bW3GFACo+bx9GcmDCPYXT1ay4HNFicCwcFNseDnbJMhs9SmI/EXQs1f7AaojMTnBmRpZLvAa++s5cW+GGYjoqZXn7CpGS9bPyv16MLv+81Is2zg1yXYTAwZyGjDrqYYBgsC0I1VgY1sDf1MRZtucL46GMaveIgrx8nlNB2vWkN9pky3GeZL9YvQgw6WEd32pnDxH2d7In83wqPjzk2Ce1fUG24nCBS/GLMEeE+DGud0jMaRbOkR4JmYGw9ej3En+52HHn+Nwy7nQy9gpvf0jOpzPyImCDbtIa+SgFm81nj3Di2SEcxhzqzY3oJbWdNmhbJzacxik73qi+PvY+s5eEr5/Xav8yUltWJHof7vCxw6qejBYa6gb01GOuWfyVVwMpmycrt7bbnWJQ1cULXnChwX3RaktMn1gYAO1kXpgOAEzGE0c/nIqnNWYdzQnfPmFUrBUSLj0SyymsGzBsTc8AmCk0ue8K8Z2lGYgSwHVRgvspWX4W3fvyL0AYwCureXh2MyqohNOEilKqolxQjNIM2B1hDNBWqN3dO6NnJKSE4XicfXHfd/6VVmpNVquWMq3SpcWMhiG3ZWMEWsJ8tTARlCg45uWCKq1iONd8baXLV3C+lutzQ86By5jmEGVYerSLvTsDN1t/VENaNqGCeJPNY5uLuhhoC55C/6zRYNQvzppWru7L+dMh/+t4i9cAgEgsVej5nJKnBPFlUFd2ZaaSoMf1Od1JjJSp3XdaQiXmAS2SUPPU3pLjM2xkpSSK0l1W7EKeQN2CA+dX3Whz3zBmRl8=,iv:DftbkwcfZYce8u+4APA0Od/J6gijDN1c35rBobS7kB4=,tag:IpqjdivPHQrjK/7oRx6spw==,type:str]", "sops": { "age": [ { @@ -11,8 +11,8 @@ "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA0Z2tONmQxTUhZUW12Z2Jm\nUnoxSnpYcnZDNGNzSko1ckl2RDh3NG1VS2dFCmIwUXhmSk1OUk02S0JPVDR5UWJ4\na0gwWlg0V005ZWxYa29PZ0laS2VqM0kKLS0tIHN5SU9pQ090eHljeXJGWm5hRFQ4\nZ001Nzkyb29RYkNUMDNDNlo4YnVQeTQK34bNIBgxId2+DHKQNVV3Iro3KGkE03Sp\niB1+dADT6nRvGvoyPqnLq/NYfw7eQ6XqYt55zkdCta8v6L1UNUkw8g==\n-----END AGE ENCRYPTED FILE-----\n" } ], - "lastmodified": "2025-08-07T12:21:20Z", - "mac": "ENC[AES256_GCM,data:JxNvTsW6D7IbaczGsdgfTJcACm5VLrOw6Ep+RU9PoXn2LJZeJ9U8KIlnNdODtxMpiIpZ+ZPeJgQk+EXlUVd5n2dJQEr6vqfs4o85givDWE29Pki12Zb7jMhiW8/z9GYQ/TcskkWUfA0Brz9fKVKXLARvQdL1/9Rlw+F1VwWWBOo=,iv:V31hoIpUgq6X47D0B+MtBMsdD0oDpPkh2kvQWRJtS3w=,tag:dsW9SUIdGipX5rKyLAvCvQ==,type:str]", + "lastmodified": "2025-08-09T20:09:09Z", + "mac": "ENC[AES256_GCM,data:s+LaqADPYV1UjsYZlxh6LGqaTwGzDYWyfcxPXakVUEmCe0YHfphSyRmhWwlr7WWM3w6BsZESq+PKYKtL7UunoolPh0KVEcobsvp7K/ZEPzDOH14ddOGiXDEpYRNqVYZtprR9pvrydOCPJbXO+klpLl0o3mm6j9VX2tIQdx3HNiA=,iv:rI2MG8OJUM6RNkJ3GsSYedOnRBTa+tbpporHC337unE=,tag:SY4yi5T7sFTIV02I8BbISg==,type:str]", "pgp": [ { "created_at": "2025-06-14T22:31:01Z", diff --git a/index.html b/index.html index c73f8b4..5801476 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + SwarselSystems: NixOS + Emacs Configuration @@ -203,7 +203,7 @@
  • 3.2.4. Darwin @@ -493,6 +493,7 @@
  • 3.3.1.32. Kanshi
  • 3.3.1.33. gpg-agent
  • 3.3.1.34. gammastep
  • +
  • 3.3.1.35. Spicetify
  • 3.3.2. Server @@ -510,15 +511,16 @@
  • -
  • 3.4. Shared +
  • 3.4. Shared
  • 3.5. Packages @@ -568,14 +570,15 @@
  • 3.6.1.4. Chaostheatre
  • 3.6.1.5. toto
  • 3.6.1.6. Work
  • -
  • 3.6.1.7. Framework
  • -
  • 3.6.1.8. AMD CPU
  • -
  • 3.6.1.9. AMD GPU
  • -
  • 3.6.1.10. Hibernation
  • -
  • 3.6.1.11. BTRFS
  • -
  • 3.6.1.12. Local Server
  • -
  • 3.6.1.13. OCI Sync Server
  • -
  • 3.6.1.14. Moonside
  • +
  • 3.6.1.7. Uni
  • +
  • 3.6.1.8. Framework
  • +
  • 3.6.1.9. AMD CPU
  • +
  • 3.6.1.10. AMD GPU
  • +
  • 3.6.1.11. Hibernation
  • +
  • 3.6.1.12. BTRFS
  • +
  • 3.6.1.13. Local Server
  • +
  • 3.6.1.14. OCI Sync Server
  • +
  • 3.6.1.15. Moonside
  • 3.6.2. home-manager @@ -586,8 +589,9 @@
  • 3.6.2.4. Chaostheatre
  • 3.6.2.5. toto
  • 3.6.2.6. Work
  • -
  • 3.6.2.7. Framework
  • -
  • 3.6.2.8. Local Server
  • +
  • 3.6.2.7. Uni
  • +
  • 3.6.2.8. Framework
  • +
  • 3.6.2.9. Local Server
  • @@ -757,7 +761,7 @@
  • 4.4.42. vterm
  • 4.4.43. multiple cursors
  • 4.4.44. Less logging
  • -
  • 4.4.45. Popup frames
  • +
  • 4.4.45. Popup frames
  • @@ -812,7 +816,7 @@

    -This file has 91224 words spanning 23377 lines and was last revised on 2025-08-09 14:31:36 +0200. +This file has 91577 words spanning 23506 lines and was last revised on 2025-08-10 11:35:15 +0200.

    @@ -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.

    -
    -

    1.1. How to use this document

    -
    +
    +

    1.1. How to use this document

    +

    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.

    @@ -881,7 +885,7 @@ This section defines my Emacs configuration. For a while, I considered to use ry

    -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)

    @@ -1327,8 +1331,10 @@ This provides devshell support for flake-parts 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 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
    -
    -
    3.2.1.5. Expose home-manager sops secrets in NixOS (automatically active)
    -
    +
    +
    3.2.1.5. Expose home-manager sops secrets in NixOS (automatically active)
    +
    { lib, config, globals, ... }:
     let
    @@ -5236,7 +5248,8 @@ We enable the use of home-manager 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
     
    -
    -
    3.2.1.14. Boot
    -
    +
    +
    3.2.1.14. Boot
    +
    { lib, pkgs, config, globals, ... }:
     {
    @@ -11025,9 +11038,9 @@ in
     
    -
    -
    3.2.3.36. slink
    -
    +
    +
    3.2.3.36. slink
    +

    Deployment notes:

    @@ -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
    +
    +
    3.3.1.35. Spicetify
    +
    +
    +
    { 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
    +      ];
    +    };
    +  };
    +}
    +
    +
    +
    +

    3.3.2. Server

    @@ -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 } + +
    +
    +
    +
    +
    3.3.4.3. Uni
    +
    +
    +
    { 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}";
    +          };
    +        };
    +      };
    +    };
    +}
    +
     
    -
    3.3.4.3. Framework
    +
    3.3.4.4. Framework

    This holds configuration that is specific to framework laptops. @@ -15687,9 +15747,9 @@ This holds configuration that is specific to framework laptops.

    -
    -

    3.4. Shared

    -
    +
    +

    3.4. Shared

    +

    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.

    @@ -15777,9 +15837,9 @@ TODO: check which of these can be replaced but builtin functions.
    -
    -

    3.4.2. Variables (vars; holds firefox & stylix config parts)

    -
    +
    +

    3.4.2. Variables (vars; holds firefox & stylix config parts)

    +

    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 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. @@ -15852,6 +15912,7 @@ In short, the options defined here are passed to the modules systems using +

    +
    +
    +
    +
    3.6.1.7. Uni
    +
    +
    +
    { 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;
    +      };
    +    };
    +
    +  };
    +
    +}
    +
     
    -
    3.6.1.7. Framework
    +
    3.6.1.8. Framework
    { lib, config, ... }:
    @@ -18314,7 +18402,7 @@ in
     
    -
    3.6.1.8. AMD CPU
    +
    3.6.1.9. AMD CPU
    { lib, config, ... }:
    @@ -18336,7 +18424,7 @@ in
     
    -
    3.6.1.9. AMD GPU
    +
    3.6.1.10. AMD GPU
    { lib, config, ... }:
    @@ -18358,7 +18446,7 @@ in
     
    -
    3.6.1.10. Hibernation
    +
    3.6.1.11. Hibernation
    { lib, config, ... }:
    @@ -18380,7 +18468,7 @@ in
     
    -
    3.6.1.11. BTRFS
    +
    3.6.1.12. BTRFS
    { lib, config, ... }:
    @@ -18402,7 +18490,7 @@ in
     
    -
    3.6.1.12. Local Server
    +
    3.6.1.13. Local Server
    { lib, config, ... }:
    @@ -18459,7 +18547,7 @@ in
     
    -
    3.6.1.13. OCI Sync Server
    +
    3.6.1.14. OCI Sync Server
    { lib, config, ... }:
    @@ -18494,7 +18582,7 @@ in
     
    -
    3.6.1.14. Moonside
    +
    3.6.1.15. Moonside
    { 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
     
     }
     
    +
    +
    +
    +
    +
    +
    3.6.2.7. Uni
    +
    +
    +
    { lib, config, ... }:
    +{
    +  options.swarselprofiles.uni = lib.mkEnableOption "is this a uni host";
    +  config = lib.mkIf config.swarselprofiles.uni {
    +    swarselmodules = {
    +      optional = {
    +        uni = lib.mkDefault true;
    +      };
    +    };
    +  };
    +
    +}
    +
     
    -
    3.6.2.7. Framework
    +
    3.6.2.8. Framework
    { lib, config, ... }:
    @@ -18809,7 +18920,7 @@ in
     
    -
    3.6.2.8. Local Server
    +
    3.6.2.9. Local Server
    { lib, config, ... }:
    @@ -22428,9 +22539,9 @@ This sets up the dashboard, which is really quite useless. But, it
     
    -
    -

    4.4.45. Popup frames

    -
    +
    +

    4.4.45. Popup frames

    +
    (defun prot-window-delete-popup-frame (&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.
     

    Author: Leon Schwarzäugl

    -

    Created: 2025-08-09 Sa 14:31

    +

    Created: 2025-08-10 So 11:35

    Validate

    diff --git a/modules/home/common/packages.nix b/modules/home/common/packages.nix index c9c3ba1..0e066d8 100644 --- a/modules/home/common/packages.nix +++ b/modules/home/common/packages.nix @@ -77,7 +77,7 @@ libreoffice-qt xournalpp obsidian - spotify + # spotify vesktop # discord client # nextcloud-client # enables a systemd service that I do not want spotify-player diff --git a/modules/home/common/spicetify.nix b/modules/home/common/spicetify.nix new file mode 100644 index 0000000..d8a9864 --- /dev/null +++ b/modules/home/common/spicetify.nix @@ -0,0 +1,22 @@ +{ 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 + ]; + }; + }; +} diff --git a/modules/home/optional/uni.nix b/modules/home/optional/uni.nix new file mode 100644 index 0000000..6fb253f --- /dev/null +++ b/modules/home/optional/uni.nix @@ -0,0 +1,24 @@ +{ 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}"; + }; + }; + }; + }; +} diff --git a/modules/home/optional/work.nix b/modules/home/optional/work.nix index 6941c79..bb35779 100644 --- a/modules/home/optional/work.nix +++ b/modules/home/optional/work.nix @@ -18,26 +18,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"; @@ -371,28 +353,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" ]; diff --git a/modules/nixos/common/home-manager.nix b/modules/nixos/common/home-manager.nix index 59fcd94..7092ca2 100644 --- a/modules/nixos/common/home-manager.nix +++ b/modules/nixos/common/home-manager.nix @@ -9,7 +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" diff --git a/modules/shared/vars.nix b/modules/shared/vars.nix index 79b753a..e8ebecd 100644 --- a/modules/shared/vars.nix +++ b/modules/shared/vars.nix @@ -48,6 +48,7 @@ emacs.enable = false; waybar.enable = false; sway.useWallpaper = false; + spicetify.enable = true; firefox.profileNames = [ "default" ]; }; diff --git a/nix/hosts.nix b/nix/hosts.nix index 85aeaf1..243219a 100644 --- a/nix/hosts.nix +++ b/nix/hosts.nix @@ -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" diff --git a/profiles/home/personal/default.nix b/profiles/home/personal/default.nix index 6cb0b04..87dbc5c 100644 --- a/profiles/home/personal/default.nix +++ b/profiles/home/personal/default.nix @@ -40,9 +40,11 @@ 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; }; }; }; diff --git a/profiles/home/uni/default.nix b/profiles/home/uni/default.nix new file mode 100644 index 0000000..e816f45 --- /dev/null +++ b/profiles/home/uni/default.nix @@ -0,0 +1,12 @@ +{ lib, config, ... }: +{ + options.swarselprofiles.uni = lib.mkEnableOption "is this a uni host"; + config = lib.mkIf config.swarselprofiles.uni { + swarselmodules = { + optional = { + uni = lib.mkDefault true; + }; + }; + }; + +} diff --git a/profiles/nixos/uni/default.nix b/profiles/nixos/uni/default.nix new file mode 100644 index 0000000..24fa649 --- /dev/null +++ b/profiles/nixos/uni/default.nix @@ -0,0 +1,18 @@ +{ 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; + }; + }; + + }; + +}