feat: overhaul overlays

This commit is contained in:
Leon Schwarzäugl 2026-03-05 23:01:13 +01:00
parent 91f4393800
commit 130444f5d7
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
23 changed files with 406 additions and 246 deletions

View file

@ -2027,7 +2027,11 @@ Concerning the =flake = _:= part:
pkgsFor = lib.genAttrs (import systems) (system: pkgsFor = lib.genAttrs (import systems) (system:
import inputs.nixpkgs { import inputs.nixpkgs {
inherit system; inherit system;
overlays = [ self.overlays.default ]; overlays = [
self.overlays.default
self.overlays.stables
self.overlays.modifications
];
config.allowUnfree = true; config.allowUnfree = true;
} }
); );
@ -2134,6 +2138,8 @@ More information on the actual packages build can be found in [[#h:64a5cc16-6b16
}; };
overlays = [ overlays = [
self.overlays.default self.overlays.default
self.overlays.stables
self.overlays.modifications
]; ];
}; };
inherit pkgs; inherit pkgs;
@ -3137,27 +3143,37 @@ This defines some apps; they differ from normal packages in that they can be cal
}; };
} }
#+end_src #+end_src
** Overlays ** Overlays/Overrides
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: h:7a059bd9-13f8-4005-b270-b41eeb6a4af2 :CUSTOM_ID: h:7a059bd9-13f8-4005-b270-b41eeb6a4af2
:END: :END:
In this section I define packages that I manually add to nixpkgs, or that I want to use in a modified way. This can be useful for packages that are currently awaiting a PR or public packages that I do not want to maintain. In this section I define packages that I manually add to nixpkgs, or that I want to use in a modified way. This can be useful for packages that are currently awaiting a PR or public packages that I do not want to maintain. This is done in a three step process.
As such, I also define three additional local overlays: The first overlay stage is responsible for extending the base nixpkgs:
1) =additions= 1) =additions=
These are for the aforementioned added packages. These are for the aforementioned added packages.
NOTE: The packages themselves are built in [[#h:6ed1a641-dba8-4e85-a62e-be93264df57a][Packages (pkgs)]]; here, we just add them to the overlay that we then use in the configuration. NOTE: The packages themselves are built in [[#h:6ed1a641-dba8-4e85-a62e-be93264df57a][Packages (pkgs)]]; here, we just add them to the overlay that we then use in the configuration.
2) =modification= 2) =nixpkgs-stable-versions=
These are for packages that are on nixpkgs, but do not fit my usecase, meaning I need to perform modifications on them. These are simply mirrors of other branches of nixpkgs (mostly past stable branches). Useful for packages that are broken on nixpkgs, but do not need to be on bleeding edge anyways. Automatically fetches all inputs names =nixpkgs-<suffix>= and adds them under the name in =<suffix>=. They will be available under =pkgs.<suffix>=.
3) =nixpkgs-stable-versions=
These are simply mirrors of other branches of nixpkgs (mostly past stable branches). Useful for packages that are broken on nixpkgs, but do not need to be on bleeding edge anyways. Automatically fetches all inputs names =nixpkgs-<suffix>= and adds them under the name in =<suffix>=. The second stage of overlays is responsible to replace packages in nixpkgs with stable versions. The benefit here is that I have a central place (this part of the config) where I can declare what needs to be stable - broken packages tend to be enduser packages, as packages with huge dependency chains will normally be caught earlier upstream if there is a failure (see [[#h:b562adaf-536c-4267-88a5-026d8a0cda61][Current issues]]). In effect, that means I can override package =xyz= right here, and then use =pkgs.xyz= in the rest of the config, whereas I would need to use =pkgs.<suffix>.xyz= if I were to only use =nixpkgs-stable-versions= from the first stage.
Note that packages with bigger dependencies should NOT be added here. Such as:
- chromium
- bluez
- pipewire
As doing so will trigger enormous rebuilds of e.g. =electron=.
The third stage takes care of further modifications that should be performed to the packages after they have been overridden in stages 1 and 2: These modifications are for packages that do not fit my usecase, meaning I need to perform modifications on them.
As part of the modifications, I add some of my own library functions to be used alongside the functions provided by =nixpkgs= and =home-manager=. As part of the modifications, I add some of my own library functions to be used alongside the functions provided by =nixpkgs= and =home-manager=.
On the structure of overlays: as you notice, all of the attributes within overlays are functions which take =final= and =prev= as arguments. This is a convention (sometimes you also see =super= instead of =final=) that aims to tell you that =final= represents the =pkgs= set after it has gone over all modifications, while =prev= is the =pkgs= set before the current modification. On the structure of overlays: as you notice, all of the attributes within overlays are functions which take =final= and =prev= as arguments. This is a convention (sometimes you also see =super= instead of =final=) that aims to tell you that =final= represents the =pkgs= set after it has gone over all modifications, while =prev= is the =pkgs= set before the current modification.
- So, in =additions=, the =final= set is the same as in =modifications=, but their =prev= sets might differ (in this case, I believe they will be the same since all modifications are done at the same step). - So, in =additions=, the =final= set is the same as in =modifications=, but their =prev= sets differ.
- This starts to make a difference when you use multiple overlays and have one overlay depend on the modifications in another overlay. - This starts to make a difference when you use multiple overlays and have one overlay depend on the modifications in another overlay.
- The =_= argument is used like in a number of other programing languages and signals that the argument is never actually used in the function. - The =_= argument is used like in a number of other programing languages and signals that the argument is never actually used in the function.
@ -3168,99 +3184,164 @@ On the structure of overlays: as you notice, all of the attributes within overla
inherit (self) outputs; inherit (self) outputs;
inherit (outputs) lib; inherit (outputs) lib;
in in
{ {
flake = _: flake = _:
{ {
overlays = { overlays = let
default = final: prev: nixpkgs-stable-versions = final: _:
let let
additions = final: _: import "${self}/pkgs/flake" { pkgs = final; inherit self lib; } nixpkgsInputs =
lib.filterAttrs
(name: _v: builtins.match "^nixpkgs-.*" name != null)
inputs;
rename = name: builtins.replaceStrings [ "nixpkgs-" ] [ "" ] name;
mkPkgs = src:
import src {
inherit (final.stdenv.hostPlatform) system;
config.allowUnfree = true;
};
in
builtins.listToAttrs (map
(name: {
name = rename name;
value = mkPkgs nixpkgsInputs.${name};
})
(builtins.attrNames nixpkgsInputs));
in rec {
default = additions;
additions = final: prev:
let
additions = final: _: import "${self}/pkgs/flake" { pkgs = final; inherit self lib; }
// { // {
swarsel-nix = import inputs.swarsel-nix { swarsel-nix = import inputs.swarsel-nix {
pkgs = prev; pkgs = prev;
};
zjstatus = inputs.zjstatus.packages.${prev.stdenv.hostPlatform.system}.default;
}; };
zjstatus = inputs.zjstatus.packages.${prev.system}.default;
in
(additions final prev)
// (nixpkgs-stable-versions final prev)
// (inputs.niri-flake.overlays.niri final prev)
// (inputs.noctalia.overlays.default final prev)
// (inputs.vbc-nix.overlays.default final prev)
// (inputs.nur.overlays.default final prev)
// (inputs.emacs-overlay.overlay final prev)
// (inputs.nix-topology.overlays.default final prev)
// (inputs.nix-index-database.overlays.nix-index final prev)
// (inputs.nixgl.overlay final prev)
// (inputs.nix-minecraft.overlay final prev)
// (inputs.nixos-extra-modules.overlays.default final prev);
stables = final: prev:
let
mkUsePkgsFrom = pkgsFrom: names:
builtins.listToAttrs (map
(name: {
inherit name;
value = pkgsFrom.${name};
})
names);
from = let
stablePackages = nixpkgs-stable-versions final prev;
in key:
stablePackages.${key} or (throw "Missing nixpkgs input nixpkgs-${key}");
in
(mkUsePkgsFrom (from "dev") [
# "swayosd"
"firezone-relay"
"firezone-server-web"
"firezone-server-api"
"firezone-server-domain"
])
// (mkUsePkgsFrom (from "stable24_05") [
"awscli2"
])
// (mkUsePkgsFrom (from "stable24_11") [
"python39"
"spotify"
"vieb"
])
// (mkUsePkgsFrom (from "stable25_05") [
"steam-fhsenv-without-steam"
"transmission_3"
])
// (mkUsePkgsFrom (from "stable") [
# "anki"
"azure-cli"
# "bat-extras.batgrep"
# "bluez"
"calibre"
# "chromium"
"dwarfs"
"gotenberg"
"khal"
"libreoffice"
"libreoffice-qt"
"nerd-fonts-symbols-only"
"noto-fonts"
"noto-fonts-cjk-sans"
"noto-fonts-color-emoji"
# "pipewire"
"podman"
"teams-for-linux"
# "vesktop"
"virtualbox"
]);
modifications = final: prev:
let
modifications = final: prev: {
# vesktop = prev.vesktop.override {
# withSystemVencord = true;
# };
lib = prev.lib // {
swarselsystems = self.outputs.swarselsystemsLib;
hm = self.outputs.homeLib;
}; };
modifications = final: prev: { firefox = prev.firefox.override {
# vesktop = prev.vesktop.override { nativeMessagingHosts = [
# withSystemVencord = true; prev.tridactyl-native
# }; prev.browserpass
# prev.plasma5Packages.plasma-browser-integration
lib = prev.lib // { ];
swarselsystems = self.outputs.swarselsystemsLib;
hm = self.outputs.homeLib;
};
firefox = prev.firefox.override {
nativeMessagingHosts = [
prev.tridactyl-native
prev.browserpass
# prev.plasma5Packages.plasma-browser-integration
];
};
isync = prev.isync.override {
withCyrusSaslXoauth2 = true;
};
mgba = final.swarsel-mgba;
retroarch = prev.retroarch.withCores (cores: with cores; [
snes9x # snes
nestopia # nes
dosbox # dos
scummvm # scumm
vba-m # gb/a
mgba # gb/a
melonds # ds
dolphin # gc/wii
]);
}; };
nixpkgs-stable-versions = final: _: isync = prev.isync.override {
let withCyrusSaslXoauth2 = true;
nixpkgsInputs = };
lib.filterAttrs
(name: _v: builtins.match "^nixpkgs-.*" name != null)
inputs;
rename = name: builtins.replaceStrings [ "nixpkgs-" ] [ "" ] name; mgba = final.swarsel-mgba;
mkPkgs = src: noctalia-shell = prev.noctalia-shell.override {
import src { calendarSupport = true;
inherit (final) system; };
config.allowUnfree = true;
};
in
builtins.listToAttrs (map
(name: {
name = rename name;
value = mkPkgs nixpkgsInputs.${name};
})
(builtins.attrNames nixpkgsInputs));
in retroarch = prev.retroarch.withCores (cores: with cores; [
lib.recursiveUpdate snes9x # snes
( nestopia # nes
(additions final prev) dosbox # dos
// (nixpkgs-stable-versions final prev) scummvm # scumm
// (inputs.niri-flake.overlays.niri final prev) vba-m # gb/a
// (inputs.noctalia.overlays.default final prev) mgba # gb/a
// (inputs.vbc-nix.overlays.default final prev) melonds # ds
// (inputs.nur.overlays.default final prev) dolphin # gc/wii
// (inputs.emacs-overlay.overlay final prev) ]);
// (inputs.nix-topology.overlays.default final prev)
// (inputs.nix-index-database.overlays.nix-index final prev) };
// (inputs.nixgl.overlay final prev) in
// (inputs.nix-minecraft.overlay final prev) modifications final prev;
// (inputs.nixos-extra-modules.overlays.default final prev)
)
(modifications final prev);
}; };
}; };
} }
#+end_src #+end_src
** Installer images (iso, kexec) ** Installer images (iso, kexec)
:PROPERTIES: :PROPERTIES:
@ -8938,6 +9019,8 @@ A breakdown of the flags being set:
nixpkgs = { nixpkgs = {
overlays = [ overlays = [
outputs.overlays.default outputs.overlays.default
outputs.overlays.stables
outputs.overlays.modifications
] ++ lib.optionals withHomeManager [ ] ++ lib.optionals withHomeManager [
(final: prev: (final: prev:
let let
@ -9669,7 +9752,7 @@ Enable OpenGL, Sound, Bluetooth and various drivers.
bluetooth = lib.mkIf config.swarselsystems.hasBluetooth { bluetooth = lib.mkIf config.swarselsystems.hasBluetooth {
enable = true; enable = true;
package = pkgs.stable.bluez; package = pkgs.bluez;
powerOnBoot = true; powerOnBoot = true;
settings = { settings = {
General = { General = {
@ -9721,7 +9804,7 @@ Pipewire handles communication on Wayland. This enables several sound tools as w
services.pipewire = { services.pipewire = {
enable = true; enable = true;
package = pkgs.stable.pipewire; package = pkgs.pipewire;
pulse.enable = true; pulse.enable = true;
jack.enable = true; jack.enable = true;
audio.enable = true; audio.enable = true;
@ -10515,13 +10598,17 @@ Most of the time I am using =power-saver=, however, it is good to be able to cho
:CUSTOM_ID: h:5db15758-17d8-4bde-811d-d11ccdd3f3d3 :CUSTOM_ID: h:5db15758-17d8-4bde-811d-d11ccdd3f3d3
:END: :END:
[[#h:388e71be-f00a-4d45-ade1-218ce942057d][SwayOSD]] provides a neat visual overlay when changing the system volume or brightness. However, the libinput backend needs some fixing, which is done here.
Nowadays, this is not used in favor of [[#h:96e05275-38df-401b-8809-d45d8f59e43c][Noctalia-shell]].
#+begin_src nix-ts :tangle modules/nixos/client/swayosd.nix #+begin_src nix-ts :tangle modules/nixos/client/swayosd.nix
{ lib, pkgs, config, ... }: { lib, pkgs, config, ... }:
{ {
options.swarselmodules.swayosd = lib.mkEnableOption "swayosd settings"; options.swarselmodules.swayosd = lib.mkEnableOption "swayosd settings";
config = lib.mkIf config.swarselmodules.swayosd { config = lib.mkIf config.swarselmodules.swayosd {
environment.systemPackages = [ pkgs.dev.swayosd ]; environment.systemPackages = [ pkgs.swayosd ];
services.udev.packages = [ pkgs.dev.swayosd ]; services.udev.packages = [ pkgs.swayosd ];
systemd.services.swayosd-libinput-backend = { systemd.services.swayosd-libinput-backend = {
description = "SwayOSD LibInput backend for listening to certain keys like CapsLock, ScrollLock, VolumeUp, etc."; description = "SwayOSD LibInput backend for listening to certain keys like CapsLock, ScrollLock, VolumeUp, etc.";
documentation = [ "https://github.com/ErikReider/SwayOSD" ]; documentation = [ "https://github.com/ErikReider/SwayOSD" ];
@ -10532,7 +10619,7 @@ Most of the time I am using =power-saver=, however, it is good to be able to cho
serviceConfig = { serviceConfig = {
Type = "dbus"; Type = "dbus";
BusName = "org.erikreider.swayosd"; BusName = "org.erikreider.swayosd";
ExecStart = "${pkgs.dev.swayosd}/bin/swayosd-libinput-backend"; ExecStart = "${pkgs.swayosd}/bin/swayosd-libinput-backend";
Restart = "on-failure"; Restart = "on-failure";
}; };
}; };
@ -10930,7 +11017,7 @@ I am using distrobox to quickly circumvent isses that I cannot immediately solve
virtualisation.podman = { virtualisation.podman = {
enable = true; enable = true;
dockerCompat = true; dockerCompat = true;
package = pkgs.stable.podman; package = pkgs.podman;
}; };
}; };
} }
@ -15991,7 +16078,7 @@ kanidm person credential create-reset-token <user>
services = { services = {
${serviceName} = { ${serviceName} = {
enable = true; enable = true;
package = pkgs.dev.oauth2-proxy; package = pkgs.update.oauth2-proxy;
cookie = { cookie = {
domain = ".${mainDomain}"; domain = ".${mainDomain}";
secure = true; secure = true;
@ -18845,19 +18932,19 @@ This has some state:
domain = { domain = {
settings.ERLANG_DISTRIBUTION_PORT = domainPort; settings.ERLANG_DISTRIBUTION_PORT = domainPort;
package = pkgs.dev.firezone-server-domain; package = pkgs.firezone-server-domain;
}; };
api = { api = {
externalUrl = "https://${serviceDomain}/api/"; externalUrl = "https://${serviceDomain}/api/";
address = "0.0.0.0"; address = "0.0.0.0";
port = apiPort; port = apiPort;
package = pkgs.dev.firezone-server-api; package = pkgs.firezone-server-api;
}; };
web = { web = {
externalUrl = "https://${serviceDomain}/"; externalUrl = "https://${serviceDomain}/";
address = "0.0.0.0"; address = "0.0.0.0";
port = webPort; port = webPort;
package = pkgs.dev.firezone-server-web; package = pkgs.firezone-server-web;
}; };
}; };
@ -18870,7 +18957,7 @@ This has some state:
publicIpv4 = proxyAddress4; publicIpv4 = proxyAddress4;
publicIpv6 = proxyAddress6; publicIpv6 = proxyAddress6;
openFirewall = lib.mkIf (!isProxied) true; openFirewall = lib.mkIf (!isProxied) true;
package = pkgs.dev.firezone-relay; package = pkgs.firezone-relay;
}; };
}; };
# systemd.services.firezone-initialize = # systemd.services.firezone-initialize =
@ -19227,7 +19314,11 @@ This section sets up all the imports that are used in the home-manager section.
nix.settings.experimental-features = "nix-command flakes"; nix.settings.experimental-features = "nix-command flakes";
nixpkgs = { nixpkgs = {
hostPlatform = "x86_64-darwin"; hostPlatform = "x86_64-darwin";
overlays = [ outputs.overlays.default ]; overlays = [
outputs.overlays.default
outputs.overlays.stables
outputs.overlays.modifications
];
config = { config = {
allowUnfree = true; allowUnfree = true;
}; };
@ -19408,7 +19499,7 @@ This sets the VirtualBox configuration. Guest should not be enabled if not direl
enable = true; enable = true;
enableKvm = true; enableKvm = true;
addNetworkInterface = lib.mkIf config.virtualisation.virtualbox.host.enableKvm false; addNetworkInterface = lib.mkIf config.virtualisation.virtualbox.host.enableKvm false;
package = pkgs.stable.virtualbox; package = pkgs.virtualbox;
enableExtensionPack = true; enableExtensionPack = true;
}; };
# leaving this here for future notice. setting guest.enable = true will make 'restarting sysinit-reactivation.target' take till timeout on nixos-rebuild switch # leaving this here for future notice. setting guest.enable = true will make 'restarting sysinit-reactivation.target' take till timeout on nixos-rebuild switch
@ -19776,7 +19867,7 @@ When setting up a new machine:
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
remmina remmina
# gp-onsaml-gui # gp-onsaml-gui
stable24_11.python39 python39
qemu qemu
packer packer
gnumake gnumake
@ -20459,6 +20550,8 @@ Again, we adapt =nix= to our needs, enable the home-manager command for non-NixO
nixpkgs = lib.mkIf (!isNixos) { nixpkgs = lib.mkIf (!isNixos) {
overlays = [ overlays = [
outputs.overlays.default outputs.overlays.default
outputs.overlays.stables
outputs.overlays.modifications
(final: prev: (final: prev:
let let
additions = final: _: import "${self}/pkgs/config" { additions = final: _: import "${self}/pkgs/config" {
@ -20611,7 +20704,7 @@ This holds packages that I can use as provided, or with small modifications (as
(aspellWithDicts (dicts: with dicts; [ de en en-computers en-science ])) (aspellWithDicts (dicts: with dicts; [ de en en-computers en-science ]))
# browser # browser
stable24_11.vieb vieb
mgba mgba
# utilities # utilities
@ -20668,7 +20761,7 @@ This holds packages that I can use as provided, or with small modifications (as
# element-desktop # element-desktop
nicotine-plus nicotine-plus
stable25_05.transmission_3 transmission_3
mktorrent mktorrent
hugo hugo
@ -20729,13 +20822,7 @@ This holds packages that I can use as provided, or with small modifications (as
slurp slurp
# the following packages are used (in some way) by waybar # the following packages are used (in some way) by waybar
# playerctl
pavucontrol pavucontrol
# stable.pamixer
# gnome.gnome-clocks
# wlogout
# jdiskreport
# monitor
#keychain #keychain
qalculate-gtk qalculate-gtk
@ -21192,8 +21279,7 @@ This section is for programs that require no further configuration. zsh Integrat
pkgs.bat-extras.batdiff pkgs.bat-extras.batdiff
pkgs.bat-extras.batman pkgs.bat-extras.batman
pkgs.bat-extras.batwatch pkgs.bat-extras.batwatch
] ++ [ pkgs.bat-extras.batgrep
pkgs.stable.bat-extras.batgrep
]; ];
# extraPackages = with pkgs.bat-extras; [ batdiff batman batgrep batwatch ]; # extraPackages = with pkgs.bat-extras; [ batdiff batman batgrep batwatch ];
}; };
@ -24217,7 +24303,7 @@ The `extraConfig` section here CANNOT be reindented. This has something to do wi
systemd.user.services.swayosd = confLib.overrideTarget "sway-session.target"; systemd.user.services.swayosd = confLib.overrideTarget "sway-session.target";
services.swayosd = { services.swayosd = {
enable = true; enable = true;
package = pkgs.dev.swayosd; package = pkgs.swayosd;
topMargin = 0.5; topMargin = 0.5;
}; };
}; };
@ -25604,7 +25690,7 @@ This service changes the screen hue at night. I am not sure if that really does
programs.anki = { programs.anki = {
enable = true; enable = true;
# # package = pkgs.anki; package = pkgs.anki;
hideBottomBar = true; hideBottomBar = true;
hideBottomBarMode = "always"; hideBottomBarMode = "always";
hideTopBar = true; hideTopBar = true;
@ -25782,7 +25868,7 @@ This service changes the screen hue at night. I am not sure if that really does
config = lib.mkIf config.swarselmodules.${moduleName} { config = lib.mkIf config.swarselmodules.${moduleName} {
programs.${moduleName} = { programs.${moduleName} = {
enable = true; enable = true;
package = pkgs.stable.vesktop; package = pkgs.vesktop;
settings = { settings = {
appBadge = false; appBadge = false;
arRPC = false; arRPC = false;
@ -26394,7 +26480,7 @@ Apart from configuring Noctalia, I here also add some systemd chains to make sur
fastfetch.enable = true; fastfetch.enable = true;
noctalia-shell = { noctalia-shell = {
enable = true; enable = true;
package = pkgs.noctalia-shell.override { calendarSupport = true; }; package = pkgs.noctalia-shell;
systemd.enable = true; systemd.enable = true;
settings = { settings = {
bar = { bar = {
@ -27072,7 +27158,7 @@ When setting up a new machine:
config = { config = {
home = { home = {
packages = with pkgs; [ packages = with pkgs; [
stable.teams-for-linux teams-for-linux
shellcheck shellcheck
dig dig
docker docker
@ -27082,9 +27168,9 @@ When setting up a new machine:
prometheus.cli prometheus.cli
tigervnc tigervnc
# openstackclient # openstackclient
vscode-fhs
antigravity
vscode
dev.antigravity
rustdesk-vbc rustdesk-vbc
]; ];
@ -27215,7 +27301,7 @@ When setting up a new machine:
}; };
awscli = { awscli = {
enable = true; enable = true;
package = pkgs.stable24_05.awscli2; package = pkgs.awscli2;
# settings = { # settings = {
# "default" = { }; # "default" = { };
# "profile s3-imagebuilder-prod" = { }; # "profile s3-imagebuilder-prod" = { };
@ -27613,7 +27699,7 @@ When setting up a new machine:
}; };
Service = { Service = {
ExecStart = "${pkgs.stable.teams-for-linux}/bin/teams-for-linux --disableGpu=true --minimized=true --trayIconEnabled=true"; ExecStart = "${pkgs.teams-for-linux}/bin/teams-for-linux --disableGpu=true --minimized=true --trayIconEnabled=true";
}; };
}; };

View file

@ -10,7 +10,7 @@ in
programs.anki = { programs.anki = {
enable = true; enable = true;
# # package = pkgs.anki; package = pkgs.anki;
hideBottomBar = true; hideBottomBar = true;
hideBottomBarMode = "always"; hideBottomBarMode = "always";
hideTopBar = true; hideTopBar = true;

View file

@ -14,7 +14,6 @@
picard-tools picard-tools
audacity audacity
sox sox
# stable.feishin # does not work with oauth2-proxy
calibre calibre
# printing # printing
@ -32,7 +31,7 @@
(aspellWithDicts (dicts: with dicts; [ de en en-computers en-science ])) (aspellWithDicts (dicts: with dicts; [ de en en-computers en-science ]))
# browser # browser
stable24_11.vieb vieb
mgba mgba
# utilities # utilities
@ -89,7 +88,7 @@
# element-desktop # element-desktop
nicotine-plus nicotine-plus
stable25_05.transmission_3 transmission_3
mktorrent mktorrent
hugo hugo
@ -150,13 +149,7 @@
slurp slurp
# the following packages are used (in some way) by waybar # the following packages are used (in some way) by waybar
# playerctl
pavucontrol pavucontrol
# stable.pamixer
# gnome.gnome-clocks
# wlogout
# jdiskreport
# monitor
#keychain #keychain
qalculate-gtk qalculate-gtk

View file

@ -9,8 +9,7 @@
pkgs.bat-extras.batdiff pkgs.bat-extras.batdiff
pkgs.bat-extras.batman pkgs.bat-extras.batman
pkgs.bat-extras.batwatch pkgs.bat-extras.batwatch
] ++ [ pkgs.bat-extras.batgrep
pkgs.stable.bat-extras.batgrep
]; ];
# extraPackages = with pkgs.bat-extras; [ batdiff batman batgrep batwatch ]; # extraPackages = with pkgs.bat-extras; [ batdiff batman batgrep batwatch ];
}; };

View file

@ -61,6 +61,8 @@ in
nixpkgs = lib.mkIf (!isNixos) { nixpkgs = lib.mkIf (!isNixos) {
overlays = [ overlays = [
outputs.overlays.default outputs.overlays.default
outputs.overlays.stables
outputs.overlays.modifications
(final: prev: (final: prev:
let let
additions = final: _: import "${self}/pkgs/config" { additions = final: _: import "${self}/pkgs/config" {

View file

@ -5,7 +5,7 @@
systemd.user.services.swayosd = confLib.overrideTarget "sway-session.target"; systemd.user.services.swayosd = confLib.overrideTarget "sway-session.target";
services.swayosd = { services.swayosd = {
enable = true; enable = true;
package = pkgs.dev.swayosd; package = pkgs.swayosd;
topMargin = 0.5; topMargin = 0.5;
}; };
}; };

View file

@ -7,7 +7,7 @@ in
config = lib.mkIf config.swarselmodules.${moduleName} { config = lib.mkIf config.swarselmodules.${moduleName} {
programs.${moduleName} = { programs.${moduleName} = {
enable = true; enable = true;
package = pkgs.stable.vesktop; package = pkgs.vesktop;
settings = { settings = {
appBadge = false; appBadge = false;
arRPC = false; arRPC = false;

View file

@ -11,7 +11,7 @@ in
config = { config = {
home = { home = {
packages = with pkgs; [ packages = with pkgs; [
stable.teams-for-linux teams-for-linux
shellcheck shellcheck
dig dig
docker docker
@ -21,9 +21,9 @@ in
prometheus.cli prometheus.cli
tigervnc tigervnc
# openstackclient # openstackclient
vscode-fhs
antigravity
vscode
dev.antigravity
rustdesk-vbc rustdesk-vbc
]; ];
@ -154,7 +154,7 @@ in
}; };
awscli = { awscli = {
enable = true; enable = true;
package = pkgs.stable24_05.awscli2; package = pkgs.awscli2;
# settings = { # settings = {
# "default" = { }; # "default" = { };
# "profile s3-imagebuilder-prod" = { }; # "profile s3-imagebuilder-prod" = { };
@ -552,7 +552,7 @@ in
}; };
Service = { Service = {
ExecStart = "${pkgs.stable.teams-for-linux}/bin/teams-for-linux --disableGpu=true --minimized=true --trayIconEnabled=true"; ExecStart = "${pkgs.teams-for-linux}/bin/teams-for-linux --disableGpu=true --minimized=true --trayIconEnabled=true";
}; };
}; };

View file

@ -10,7 +10,7 @@
virtualisation.podman = { virtualisation.podman = {
enable = true; enable = true;
dockerCompat = true; dockerCompat = true;
package = pkgs.stable.podman; package = pkgs.podman;
}; };
}; };
} }

View file

@ -33,7 +33,7 @@
bluetooth = lib.mkIf config.swarselsystems.hasBluetooth { bluetooth = lib.mkIf config.swarselsystems.hasBluetooth {
enable = true; enable = true;
package = pkgs.stable.bluez; package = pkgs.bluez;
powerOnBoot = true; powerOnBoot = true;
settings = { settings = {
General = { General = {

View file

@ -82,8 +82,7 @@
pipewire pipewire
pixman pixman
speex speex
# stable.cc.cc steam-fhsenv-without-steam
stable25_05.steam-fhsenv-without-steam
systemd systemd
tbb tbb
vulkan-loader vulkan-loader

View file

@ -6,7 +6,7 @@
services.pipewire = { services.pipewire = {
enable = true; enable = true;
package = pkgs.stable.pipewire; package = pkgs.pipewire;
pulse.enable = true; pulse.enable = true;
jack.enable = true; jack.enable = true;
audio.enable = true; audio.enable = true;

View file

@ -2,8 +2,8 @@
{ {
options.swarselmodules.swayosd = lib.mkEnableOption "swayosd settings"; options.swarselmodules.swayosd = lib.mkEnableOption "swayosd settings";
config = lib.mkIf config.swarselmodules.swayosd { config = lib.mkIf config.swarselmodules.swayosd {
environment.systemPackages = [ pkgs.dev.swayosd ]; environment.systemPackages = [ pkgs.swayosd ];
services.udev.packages = [ pkgs.dev.swayosd ]; services.udev.packages = [ pkgs.swayosd ];
systemd.services.swayosd-libinput-backend = { systemd.services.swayosd-libinput-backend = {
description = "SwayOSD LibInput backend for listening to certain keys like CapsLock, ScrollLock, VolumeUp, etc."; description = "SwayOSD LibInput backend for listening to certain keys like CapsLock, ScrollLock, VolumeUp, etc.";
documentation = [ "https://github.com/ErikReider/SwayOSD" ]; documentation = [ "https://github.com/ErikReider/SwayOSD" ];
@ -14,7 +14,7 @@
serviceConfig = { serviceConfig = {
Type = "dbus"; Type = "dbus";
BusName = "org.erikreider.swayosd"; BusName = "org.erikreider.swayosd";
ExecStart = "${pkgs.dev.swayosd}/bin/swayosd-libinput-backend"; ExecStart = "${pkgs.swayosd}/bin/swayosd-libinput-backend";
Restart = "on-failure"; Restart = "on-failure";
}; };
}; };

View file

@ -122,6 +122,8 @@ in
nixpkgs = { nixpkgs = {
overlays = [ overlays = [
outputs.overlays.default outputs.overlays.default
outputs.overlays.stables
outputs.overlays.modifications
] ++ lib.optionals withHomeManager [ ] ++ lib.optionals withHomeManager [
(final: prev: (final: prev:
let let

View file

@ -12,7 +12,11 @@ in
nix.settings.experimental-features = "nix-command flakes"; nix.settings.experimental-features = "nix-command flakes";
nixpkgs = { nixpkgs = {
hostPlatform = "x86_64-darwin"; hostPlatform = "x86_64-darwin";
overlays = [ outputs.overlays.default ]; overlays = [
outputs.overlays.default
outputs.overlays.stables
outputs.overlays.modifications
];
config = { config = {
allowUnfree = true; allowUnfree = true;
}; };

View file

@ -8,7 +8,7 @@
enable = true; enable = true;
enableKvm = true; enableKvm = true;
addNetworkInterface = lib.mkIf config.virtualisation.virtualbox.host.enableKvm false; addNetworkInterface = lib.mkIf config.virtualisation.virtualbox.host.enableKvm false;
package = pkgs.stable.virtualbox; package = pkgs.virtualbox;
enableExtensionPack = true; enableExtensionPack = true;
}; };
# leaving this here for future notice. setting guest.enable = true will make 'restarting sysinit-reactivation.target' take till timeout on nixos-rebuild switch # leaving this here for future notice. setting guest.enable = true will make 'restarting sysinit-reactivation.target' take till timeout on nixos-rebuild switch

View file

@ -160,7 +160,7 @@ in
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
remmina remmina
# gp-onsaml-gui # gp-onsaml-gui
stable24_11.python39 python39
qemu qemu
packer packer
gnumake gnumake

View file

@ -174,19 +174,19 @@ in
domain = { domain = {
settings.ERLANG_DISTRIBUTION_PORT = domainPort; settings.ERLANG_DISTRIBUTION_PORT = domainPort;
package = pkgs.dev.firezone-server-domain; package = pkgs.firezone-server-domain;
}; };
api = { api = {
externalUrl = "https://${serviceDomain}/api/"; externalUrl = "https://${serviceDomain}/api/";
address = "0.0.0.0"; address = "0.0.0.0";
port = apiPort; port = apiPort;
package = pkgs.dev.firezone-server-api; package = pkgs.firezone-server-api;
}; };
web = { web = {
externalUrl = "https://${serviceDomain}/"; externalUrl = "https://${serviceDomain}/";
address = "0.0.0.0"; address = "0.0.0.0";
port = webPort; port = webPort;
package = pkgs.dev.firezone-server-web; package = pkgs.firezone-server-web;
}; };
}; };
@ -199,7 +199,7 @@ in
publicIpv4 = proxyAddress4; publicIpv4 = proxyAddress4;
publicIpv6 = proxyAddress6; publicIpv6 = proxyAddress6;
openFirewall = lib.mkIf (!isProxied) true; openFirewall = lib.mkIf (!isProxied) true;
package = pkgs.dev.firezone-relay; package = pkgs.firezone-relay;
}; };
}; };
# systemd.services.firezone-initialize = # systemd.services.firezone-initialize =

View file

@ -165,14 +165,14 @@ in
services = { services = {
${serviceName} = { ${serviceName} = {
enable = true; enable = true;
package = pkgs.dev.oauth2-proxy; package = pkgs.update.oauth2-proxy;
cookie = { cookie = {
domain = ".${mainDomain}"; domain = ".${mainDomain}";
secure = true; secure = true;
expire = "900m"; expire = "900m";
secret = null; # set by service EnvironmentFile secretFile = null;
}; };
clientSecret = null; # set by service EnvironmentFile clientSecretFile = null;
reverseProxy = true; reverseProxy = true;
httpAddress = "0.0.0.0:${builtins.toString servicePort}"; httpAddress = "0.0.0.0:${builtins.toString servicePort}";
redirectURL = "https://${serviceDomain}/oauth2/callback"; redirectURL = "https://${serviceDomain}/oauth2/callback";

View file

@ -103,11 +103,11 @@ in
gotenberg = { gotenberg = {
enable = true; enable = true;
package = pkgs.stable.gotenberg; package = pkgs.gotenberg;
port = gotenbergPort; port = gotenbergPort;
bindIP = "127.0.0.1"; bindIP = "127.0.0.1";
timeout = "600s"; timeout = "600s";
chromium.package = pkgs.stable.chromium; chromium.package = pkgs.chromium;
}; };
}; };

View file

@ -49,7 +49,11 @@ let
pkgsFor = lib.genAttrs (import systems) (system: pkgsFor = lib.genAttrs (import systems) (system:
import inputs.nixpkgs { import inputs.nixpkgs {
inherit system; inherit system;
overlays = [ self.overlays.default ]; overlays = [
self.overlays.default
self.overlays.stables
self.overlays.modifications
];
config.allowUnfree = true; config.allowUnfree = true;
} }
); );

View file

@ -6,93 +6,162 @@ in
{ {
flake = _: flake = _:
{ {
overlays = { overlays =
default = final: prev: let
let nixpkgs-stable-versions = final: _:
additions = final: _: import "${self}/pkgs/flake" { pkgs = final; inherit self lib; } let
// { nixpkgsInputs =
swarsel-nix = import inputs.swarsel-nix { lib.filterAttrs
pkgs = prev; (name: _v: builtins.match "^nixpkgs-.*" name != null)
}; inputs;
zjstatus = inputs.zjstatus.packages.${prev.system}.default;
};
modifications = final: prev: { rename = name: builtins.replaceStrings [ "nixpkgs-" ] [ "" ] name;
# vesktop = prev.vesktop.override {
# withSystemVencord = true;
# };
lib = prev.lib // { mkPkgs = src:
swarselsystems = self.outputs.swarselsystemsLib; import src {
hm = self.outputs.homeLib; inherit (final.stdenv.hostPlatform) system;
config.allowUnfree = true;
};
in
builtins.listToAttrs (map
(name: {
name = rename name;
value = mkPkgs nixpkgsInputs.${name};
})
(builtins.attrNames nixpkgsInputs));
in
rec {
default = additions;
additions = final: prev:
let
additions = final: _: import "${self}/pkgs/flake" { pkgs = final; inherit self lib; }
// {
swarsel-nix = import inputs.swarsel-nix {
pkgs = prev;
};
zjstatus = inputs.zjstatus.packages.${prev.stdenv.hostPlatform.system}.default;
}; };
firefox = prev.firefox.override { in
nativeMessagingHosts = [ (additions final prev)
prev.tridactyl-native // (nixpkgs-stable-versions final prev)
prev.browserpass // (inputs.niri-flake.overlays.niri final prev)
# prev.plasma5Packages.plasma-browser-integration // (inputs.noctalia.overlays.default final prev)
]; // (inputs.vbc-nix.overlays.default final prev)
// (inputs.nur.overlays.default final prev)
// (inputs.emacs-overlay.overlay final prev)
// (inputs.nix-topology.overlays.default final prev)
// (inputs.nix-index-database.overlays.nix-index final prev)
// (inputs.nixgl.overlay final prev)
// (inputs.nix-minecraft.overlay final prev)
// (inputs.nixos-extra-modules.overlays.default final prev);
stables = final: prev:
let
mkUsePkgsFrom = pkgsFrom: names:
builtins.listToAttrs (map
(name: {
inherit name;
value = pkgsFrom.${name};
})
names);
from =
let
stablePackages = nixpkgs-stable-versions final prev;
in
key:
stablePackages.${key} or (throw "Missing nixpkgs input nixpkgs-${key}");
in
(mkUsePkgsFrom (from "dev") [
# "swayosd"
"firezone-relay"
"firezone-server-web"
"firezone-server-api"
"firezone-server-domain"
])
// (mkUsePkgsFrom (from "stable24_05") [
"awscli2"
])
// (mkUsePkgsFrom (from "stable24_11") [
"python39"
"spotify"
"vieb"
])
// (mkUsePkgsFrom (from "stable25_05") [
"steam-fhsenv-without-steam"
"transmission_3"
])
// (mkUsePkgsFrom (from "stable") [
# "anki"
"azure-cli"
# "bat-extras.batgrep"
# "bluez"
"calibre"
# "chromium"
"dwarfs"
"gotenberg"
"khal"
"libreoffice"
"libreoffice-qt"
"nerd-fonts-symbols-only"
"noto-fonts"
"noto-fonts-cjk-sans"
"noto-fonts-color-emoji"
# "pipewire"
"podman"
"teams-for-linux"
# "vesktop"
"virtualbox"
]);
modifications = final: prev:
let
modifications = final: prev: {
# vesktop = prev.vesktop.override {
# withSystemVencord = true;
# };
lib = prev.lib // {
swarselsystems = self.outputs.swarselsystemsLib;
hm = self.outputs.homeLib;
};
firefox = prev.firefox.override {
nativeMessagingHosts = [
prev.tridactyl-native
prev.browserpass
# prev.plasma5Packages.plasma-browser-integration
];
};
isync = prev.isync.override {
withCyrusSaslXoauth2 = true;
};
mgba = final.swarsel-mgba;
noctalia-shell = prev.noctalia-shell.override {
calendarSupport = true;
};
retroarch = prev.retroarch.withCores (cores: with cores; [
snes9x # snes
nestopia # nes
dosbox # dos
scummvm # scumm
vba-m # gb/a
mgba # gb/a
melonds # ds
dolphin # gc/wii
]);
}; };
in
isync = prev.isync.override { modifications final prev;
withCyrusSaslXoauth2 = true; };
};
mgba = final.swarsel-mgba;
retroarch = prev.retroarch.withCores (cores: with cores; [
snes9x # snes
nestopia # nes
dosbox # dos
scummvm # scumm
vba-m # gb/a
mgba # gb/a
melonds # ds
dolphin # gc/wii
]);
};
nixpkgs-stable-versions = final: _:
let
nixpkgsInputs =
lib.filterAttrs
(name: _v: builtins.match "^nixpkgs-.*" name != null)
inputs;
rename = name: builtins.replaceStrings [ "nixpkgs-" ] [ "" ] name;
mkPkgs = src:
import src {
inherit (final) system;
config.allowUnfree = true;
};
in
builtins.listToAttrs (map
(name: {
name = rename name;
value = mkPkgs nixpkgsInputs.${name};
})
(builtins.attrNames nixpkgsInputs));
in
lib.recursiveUpdate
(
(additions final prev)
// (nixpkgs-stable-versions final prev)
// (inputs.niri-flake.overlays.niri final prev)
// (inputs.noctalia.overlays.default final prev)
// (inputs.vbc-nix.overlays.default final prev)
// (inputs.nur.overlays.default final prev)
// (inputs.emacs-overlay.overlay final prev)
// (inputs.nix-topology.overlays.default final prev)
// (inputs.nix-index-database.overlays.nix-index final prev)
// (inputs.nixgl.overlay final prev)
// (inputs.nix-minecraft.overlay final prev)
// (inputs.nixos-extra-modules.overlays.default final prev)
)
(modifications final prev);
};
}; };
} }

View file

@ -42,6 +42,8 @@
}; };
overlays = [ overlays = [
self.overlays.default self.overlays.default
self.overlays.stables
self.overlays.modifications
]; ];
}; };
inherit pkgs; inherit pkgs;