Disable wheatley, update flake lock, set up preservation in preparation for using it (setup encryption on queen first)

This commit is contained in:
Lillian Violet 2026-01-05 16:39:32 +01:00
parent 31ace37709
commit f95d8cdbcf
12 changed files with 953 additions and 63 deletions

100
flake.lock generated
View file

@ -104,11 +104,11 @@
},
"crane": {
"locked": {
"lastModified": 1766194365,
"narHash": "sha256-4AFsUZ0kl6MXSm4BaQgItD0VGlEKR3iq7gIaL7TjBvc=",
"lastModified": 1766774972,
"narHash": "sha256-8qxEFpj4dVmIuPn9j9z6NTbU+hrcGjBOvaxTzre5HmM=",
"owner": "ipetkov",
"repo": "crane",
"rev": "7d8ec2c71771937ab99790b45e6d9b93d15d9379",
"rev": "01bc1d404a51a0a07e9d8759cd50a7903e218c82",
"type": "github"
},
"original": {
@ -389,11 +389,11 @@
]
},
"locked": {
"lastModified": 1766682973,
"narHash": "sha256-GKO35onS711ThCxwWcfuvbIBKXwriahGqs+WZuJ3v9E=",
"lastModified": 1767437240,
"narHash": "sha256-OA0dBHhccdupFXp+/eaFfb8K1dQxk61in4aF5ITGVX8=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "91cdb0e2d574c64fae80d221f4bf09d5592e9ec2",
"rev": "1cfa305fba94468f665de1bd1b62dddf2e0cb012",
"type": "github"
},
"original": {
@ -409,11 +409,11 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1766561058,
"narHash": "sha256-VFqsBWqFFBTBqKFw0fGw2a2mJjPP9HPW8nXEW2A5zJM=",
"lastModified": 1767082077,
"narHash": "sha256-2tL1mRb9uFJThUNfuDm/ehrnPvImL/QDtCxfn71IEz4=",
"owner": "Jovian-Experiments",
"repo": "Jovian-NixOS",
"rev": "9d0abe57d633a6e08d72865a761891a8c81e740f",
"rev": "efd4b22e6fdc6d7fb4e186ae333a4b74e03da440",
"type": "github"
},
"original": {
@ -430,11 +430,11 @@
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1766582277,
"narHash": "sha256-mUZRMKId7Uycwnt31RytPwhmY/8UTbk92ckZWHoS0Eg=",
"lastModified": 1767013031,
"narHash": "sha256-p8ANXBakAtfX/aEhLbU6w0tuQe3nrBvLdHbKirJP7ug=",
"owner": "nix-community",
"repo": "lanzaboote",
"rev": "4c78502846c1ef668eedbd4f55d818ebac5388ac",
"rev": "c2a82339373daee8cbbcad5f51f22ae6b71069e0",
"type": "github"
},
"original": {
@ -523,11 +523,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1766568855,
"narHash": "sha256-UXVtN77D7pzKmzOotFTStgZBqpOcf8cO95FcupWp4Zo=",
"lastModified": 1767185284,
"narHash": "sha256-ljDBUDpD1Cg5n3mJI81Hz5qeZAwCGxon4kQW3Ho3+6Q=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "c5db9569ac9cc70929c268ac461f4003e3e5ca80",
"rev": "40b1a28dce561bea34858287fbb23052c3ee63fe",
"type": "github"
},
"original": {
@ -555,11 +555,11 @@
},
"nixpkgs-edge": {
"locked": {
"lastModified": 1766842912,
"narHash": "sha256-SzsTB2TwGJdUhftnhzbOSl7E9zCA+arDf2UekBosEwo=",
"lastModified": 1767455410,
"narHash": "sha256-TSvmXw7o4JxF9ezZbexZRamzq2XL0JQurOncalFJeP4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e84c4549c32ee83f156e0f402b1bb9a7fbeff42e",
"rev": "b32ae206cdbeb3d9fd5e15d7810fd97ff82e3a56",
"type": "github"
},
"original": {
@ -570,11 +570,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1766651565,
"narHash": "sha256-QEhk0eXgyIqTpJ/ehZKg9IKS7EtlWxF3N7DXy42zPfU=",
"lastModified": 1767116409,
"narHash": "sha256-5vKw92l1GyTnjoLzEagJy5V5mDFck72LiQWZSOnSicw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3e2499d5539c16d0d173ba53552a4ff8547f4539",
"rev": "cad22e7d996aea55ecab064e84834289143e44a0",
"type": "github"
},
"original": {
@ -602,11 +602,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1766070988,
"narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=",
"lastModified": 1766902085,
"narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c6245e83d836d0433170a16eb185cefe0572f8b8",
"rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4",
"type": "github"
},
"original": {
@ -618,11 +618,11 @@
},
"nixpkgs_4": {
"locked": {
"lastModified": 1766651565,
"narHash": "sha256-QEhk0eXgyIqTpJ/ehZKg9IKS7EtlWxF3N7DXy42zPfU=",
"lastModified": 1767116409,
"narHash": "sha256-5vKw92l1GyTnjoLzEagJy5V5mDFck72LiQWZSOnSicw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3e2499d5539c16d0d173ba53552a4ff8547f4539",
"rev": "cad22e7d996aea55ecab064e84834289143e44a0",
"type": "github"
},
"original": {
@ -650,11 +650,11 @@
},
"nixpkgs_6": {
"locked": {
"lastModified": 1766125104,
"narHash": "sha256-l/YGrEpLromL4viUo5GmFH3K5M1j0Mb9O+LiaeCPWEM=",
"lastModified": 1766840161,
"narHash": "sha256-Ss/LHpJJsng8vz1Pe33RSGIWUOcqM1fjrehjUkdrWio=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7d853e518814cca2a657b72eeba67ae20ebf7059",
"rev": "3edc4a30ed3903fdf6f90c837f961fa6b49582d1",
"type": "github"
},
"original": {
@ -666,11 +666,11 @@
},
"nixpkgs_7": {
"locked": {
"lastModified": 1764517877,
"narHash": "sha256-pp3uT4hHijIC8JUK5MEqeAWmParJrgBVzHLNfJDZxg4=",
"lastModified": 1766651565,
"narHash": "sha256-QEhk0eXgyIqTpJ/ehZKg9IKS7EtlWxF3N7DXy42zPfU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2d293cbfa5a793b4c50d17c05ef9e385b90edf6c",
"rev": "3e2499d5539c16d0d173ba53552a4ff8547f4539",
"type": "github"
},
"original": {
@ -767,6 +767,21 @@
"type": "github"
}
},
"preservation": {
"locked": {
"lastModified": 1757436102,
"narHash": "sha256-mMI9IanU+Xw+pVogD2oT0I2kTmvz2Un/Apc5+CwUpEY=",
"owner": "nix-community",
"repo": "preservation",
"rev": "93416f4614ad2dfed5b0dcf12f27e57d27a5ab11",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "preservation",
"type": "github"
}
},
"root": {
"inputs": {
"catppuccin": "catppuccin",
@ -783,6 +798,7 @@
"nixpkgs-edge": "nixpkgs-edge",
"nixpkgs-unstable": "nixpkgs-unstable",
"plasma-manager": "plasma-manager",
"preservation": "preservation",
"simple-nixos-mailserver": "simple-nixos-mailserver",
"sops-nix": "sops-nix",
"stylix": "stylix",
@ -797,11 +813,11 @@
]
},
"locked": {
"lastModified": 1766285238,
"narHash": "sha256-DqVXFZ4ToiFHgnxebMWVL70W+U+JOxpmfD37eWD/Qc8=",
"lastModified": 1766976750,
"narHash": "sha256-w+o3AIBI56tzfMJRqRXg9tSXnpQRN5hAT15o2t9rxYw=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "c4249d0c370d573d95e33b472014eae4f2507c2f",
"rev": "9fe44e7f05b734a64a01f92fc51ad064fb0a884f",
"type": "github"
},
"original": {
@ -858,11 +874,11 @@
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1766289575,
"narHash": "sha256-BOKCwOQQIP4p9z8DasT5r+qjri3x7sPCOq+FTjY8Z+o=",
"lastModified": 1766894905,
"narHash": "sha256-pn8AxxfajqyR/Dmr1wnZYdUXHgM3u6z9x0Z1Ijmz2UQ=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "9836912e37aef546029e48c8749834735a6b9dad",
"rev": "61b39c7b657081c2adc91b75dd3ad8a91d6f07a7",
"type": "github"
},
"original": {
@ -890,11 +906,11 @@
"tinted-zed": "tinted-zed"
},
"locked": {
"lastModified": 1766603026,
"narHash": "sha256-J2DDdRqSU4w9NNgkMfmMeaLIof5PXtS9RG7y6ckDvQE=",
"lastModified": 1767397606,
"narHash": "sha256-QA1d/6XzxK3lsMiJ+xiJf340cpNeJs/xIM6D0/yLqs4=",
"owner": "nix-community",
"repo": "stylix",
"rev": "551df12ee3ebac52c5712058bd97fd9faa4c3430",
"rev": "6850ad2e9f3f7ff6116e9e6fb73a9cca2d9b1a35",
"type": "github"
},
"original": {

View file

@ -70,6 +70,9 @@
zjstatus.url = "github:dj95/zjstatus";
# preservation
preservation.url = "github:nix-community/preservation";
# Fix for steam cursor not being visible under wayland
# Add any other flake you might need
@ -95,6 +98,7 @@
jovian,
nixos-hardware,
nix-index-database,
preservation,
stylix,
...
} @ inputs: let
@ -130,6 +134,7 @@
catppuccin.nixosModules.catppuccin
stylix.nixosModules.stylix
nix-index-database.nixosModules.nix-index
preservation.nixosModules.preservation
{programs.nix-index-database.comma.enable = true;}
{
home-manager.sharedModules = [
@ -254,16 +259,16 @@
];
};
wheatley = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = {inherit inputs outputs;};
modules =
sharedModules
++ [
{_module.args = {inherit pkgs-edge;};}
./nixos/hosts/wheatley/configuration.nix
];
};
# wheatley = nixpkgs.lib.nixosSystem {
# system = "aarch64-linux";
# specialArgs = {inherit inputs outputs;};
# modules =
# sharedModules
# ++ [
# {_module.args = {inherit pkgs-edge;};}
# ./nixos/hosts/wheatley/configuration.nix
# ];
# };
};
};
}

View file

@ -60,7 +60,6 @@
# })
];
config = {
permittedInsecurePackages = ["cinny-4.2.3" "cinny-unwrapped-4.2.3" "cinny-4.2.2" "cinny-unwrapped-4.2.2"];
# Configure your nixpkgs instance
# Disable if you don't want unfree packages

View file

@ -117,6 +117,16 @@
owner = config.users.users.lillian.name;
path = "/home/lillian/.netrc";
};
secrets."prod.keys" = {
mode = "0600";
owner = config.users.users.lillian.name;
path = "/home/lillian/.config/Ryujinx/system/prod.keys";
};
secrets."title.keys" = {
mode = "0600";
owner = config.users.users.lillian.name;
path = "/home/lillian/.config/Ryujinx/system/title.keys";
};
};
programs = {

View file

@ -78,6 +78,7 @@
boot = {
loader.systemd-boot.enable = false;
initrd.systemd.enable = true;
binfmt.emulatedSystems = ["aarch64-linux"];

File diff suppressed because one or more lines are too long

View file

@ -30,6 +30,8 @@
# ../../../disko/queen
];
preservation.enable = lib.mkForce false;
services.anubis.instances.default.settings.TARGET = "http://localhost:8123";
# required due to unix socket permissions

View file

@ -5,12 +5,12 @@
config,
pkgs,
pkgs-edge,
stdenv,
...
}: {
imports = [
./locale
./packages
./preservation.nix
inputs.home-manager.nixosModules.home-manager
#../hosts/${config.networking.hostName}/hardware-configuration.nix
];

View file

@ -28,7 +28,7 @@
age
alejandra
e2fsprogs
uutils-findutils
# uutils-findutils
git
git-filter-repo
pre-commit

View file

@ -0,0 +1,195 @@
{...}: {
preservation = {
# the module doesn't do anything unless it is enabled
enable = true;
preserveAt."/persistent" = {
# preserve system directories
directories = [
#Shared
"/var/lib/sbctl"
"/var/lib/bluetooth"
"/var/lib/fprint"
"/var/lib/fwupd"
"/var/lib/libvirt"
"/var/lib/tpm2-tss"
"/var/lib/tpm2-udev-trigger"
"/var/lib/power-profiles-daemon"
"/var/lib/systemd/coredump"
"/var/lib/systemd/rfkill"
"/var/lib/systemd/timers"
"/var/log"
#Desktop
"/var/lib/decky-loader"
"/var/lib/flatpak"
#Server
"/var/lib/continuwuity"
"/var/lib/dhcpcd"
"/var/lib/docker"
"/var/lib/dovecot"
"/var/lib/forgejo"
"/var/lib/gotosocial"
"/var/lib/grafana"
"/var/lib/jellyfin"
"/var/lib/media"
"/var/lib/mollysocket"
"/var/lib/private"
"/var/lib/mysql"
"/var/lib/nextcloud"
"/var/lib/onlyoffice"
"/var/lib/postfix"
"/var/lib/postgresql"
"/var/lib/prometheus2"
"/var/lib/rabbitmq"
"/var/lib/redis-nextcloud"
"/var/lib/redis-rspamd"
"/var/lib/secrets"
"/var/lib/writefreely"
"/var/db"
"/var/dkim"
"/var/secrets"
"/var/sieve"
"/var/vmail"
"/var/mysql"
{
directory = "/var/lib/nixos";
inInitrd = true;
}
];
# preserve system files
files = [
{
file = "/etc/machine-id";
inInitrd = true;
}
{
file = "/etc/ssh/ssh_host_rsa_key";
how = "symlink";
configureParent = true;
}
{
file = "/etc/ssh/ssh_host_ed25519_key";
how = "symlink";
configureParent = true;
}
"/var/lib/usbguard/rules.conf"
# creates a symlink on the volatile root
# creates an empty directory on the persistent volume, i.e. /persistent/var/lib/systemd
# does not create an empty file at the symlink's target (would require `createLinkTarget = true`)
{
file = "/var/lib/systemd/random-seed";
how = "symlink";
inInitrd = true;
configureParent = true;
}
"/var/lib/systemd/tpm2-srk-public-key.pem"
"/var/lib/systemd/tpm2-srk-public-key.tpm2b_public"
];
# preserve user-specific files, implies ownership
users = {
lillian = {
commonMountOptions = [
"x-gvfs-hide"
];
directories = [
{
directory = ".ssh";
mode = "0700";
}
#Desktop
"gnupg"
".local/state/wireplumber"
".local/share/direnv"
".local/state/nix"
".local/state/comma"
".local/state/home-manager"
".local/share/PrismLauncher"
".local/share/qBittorrent"
".local/share/kwalletd"
".local/share/kwin" #TODO: add the window script via nix instead of saving it imperatively and keeping it
".local/share/lutris"
".local/share/Nextcloud"
".local/share/Steam"
".local/share/zoxide"
".local/share/flatpak"
".local/share/applications"
".local/share/firefoxpwa/"
".local/share/com.nonpolynomial.intiface_central"
".mozilla"
".steam"
".zsh"
".pki"
".tldrc"
".thunderbird"
"Code"
"Writing"
".config/kdeconnect"
".config/Nextcloud"
".config/noisetorch"
".config/qBittorrent"
".config/r2modman"
".config/r2modmanPlus-local"
".config/Ryujinx"
".config/Signal"
".config/sops"
".config/vesktop"
];
#Shared
files = [
".z"
".zsh_history"
];
};
root = {
# specify user home when it is not `/home/${user}`
home = "/root";
directories = [
{
directory = ".ssh";
mode = "0700";
}
];
};
};
};
};
# Create some directories with custom permissions.
#
# In this configuration the path `/home/butz/.local` is not an immediate parent
# of any persisted file, so it would be created with the systemd-tmpfiles default
# ownership `root:root` and mode `0755`. This would mean that the user `butz`
# could not create other files or directories inside `/home/butz/.local`.
#
# Therefore systemd-tmpfiles is used to prepare such directories with
# appropriate permissions.
#
# Note that immediate parent directories of persisted files can also be
# configured with ownership and permissions from the `parent` settings if
# `configureParent = true` is set for the file.
systemd.tmpfiles.settings.preservation = {
"/home/lillian/.config".d = {
user = "lillian";
group = "users";
mode = "0755";
};
"/home/lillian/.local".d = {
user = "lillian";
group = "users";
mode = "0755";
};
"/home/lillian/.local/share".d = {
user = "lillian";
group = "users";
mode = "0755";
};
"/home/lillian/.local/state".d = {
user = "lillian";
group = "users";
mode = "0755";
};
};
}

110
overlays/flake.nix Normal file
View file

@ -0,0 +1,110 @@
{
description = "An overlay to remove fascist artifacts";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
outputs = { self, nixpkgs }: {
overlays.antifa = final: prev:
let
patchSystemd = d: d.overrideAttrs (old: {
# https://github.com/systemd/systemd/pull/39285
patches = old.patches ++ [ ./systemd-detect-fash.patch ];
});
disableAuthor = author: throw ''
This package was disabled by nixpkgs-antifa because: it is authored by ${author}
'';
disableCorp = corp: throw ''
This package was disabled by nixpkgs-antifa because: it exclusively integrates with offerings from ${corp}
'';
# NB: not listing out culture names in code -- yet
disablePropaganda = throw ''
This package was disabled by nixpkgs-antifa because: it is ethnonationalist propaganda
'';
in rec {
# https://lix.systems/add-to-config/#flake-based-configurations
inherit (prev.lixPackageSets.stable) lix nixpkgs-review nix-eval-jobs nix-fast-build colmena;
nix = lix;
certmgr = disableAuthor "Cloudflare";
cf-terraforming = disableAuthor "Cloudflare";
cf-vault = disableCorp "Cloudflare";
cfdyndns = disableCorp "Cloudflare";
cfssl = disableAuthor "Cloudflare";
cloudflare-cli = disableCorp "Cloudflare";
cloudflare-dynamic-dns = disableCorp "Cloudflare";
cloudflare-dyndns = disableCorp "Cloudflare";
cloudflare-utils = disableCorp "Cloudflare";
cloudflare-warp = disableAuthor "Cloudflare";
cloudflared = disableAuthor "Cloudflare";
flarectl = disableAuthor "Cloudflare";
gortr = disableAuthor "Cloudflare";
prometheus-cloudflare-exporter = disableCorp "Cloudflare";
proski = disableCorp "Cloudflare";
wgcf = disableCorp "Cloudflare";
worker-build = disableAuthor "Cloudflare";
wrangler = disableAuthor "Cloudflare";
wrangler_1 = disableAuthor "Cloudflare";
gnomeExtensions.warp-toggle = disableCorp "Cloudflare";
octodns-providers.cloudflare = disableCorp "Cloudflare";
pythonPackages.certbot-dns-cloudflare = disableCorp "Cloudflare";
pythonPackages.cloudflare = disableAuthor "Cloudflare";
pythonPackages.pycfdns = disableCorp "Cloudflare";
terraform-providers.cloudflare = disableCorp "Cloudflare";
brave = disableAuthor "Brendan Eich";
ladybird = disableAuthor "Andreas Kling";
palemoon = disableAuthor "Moonchild Straver";
_9base = disableAuthor "suckless";
dmenu = disableAuthor "suckless";
dwm = disableAuthor "suckless";
farbfeld = disableAuthor "suckless";
ii = disableAuthor "suckless";
libgrapheme = disableAuthor "suckless";
quark = disableAuthor "suckless";
sent = disableAuthor "suckless";
sic = disableAuthor "suckless";
sinit = disableAuthor "suckless";
slock = disableAuthor "suckless";
slstatus = disableAuthor "suckless";
sselp = disableAuthor "suckless";
st = disableAuthor "suckless";
surf = disableAuthor "suckless";
svkbd = disableAuthor "suckless";
tabbed = disableAuthor "suckless";
wmname = disableAuthor "suckless";
xssstate = disableAuthor "suckless";
blink = disableAuthor "Justine Tunney";
cosmopolitan = disableAuthor "Justine Tunney";
jart-jsoncpp = disableAuthor "Justine Tunney";
pythonPackages.fabulous = disableAuthor "Justine Tunney";
hyprland = disableAuthor "Vaxry";
tailwindcss = disableAuthor "Adam Wathan";
urbit = disableAuthor "Curtis Yarvin";
bibletime = disablePropaganda;
biblesync = disablePropaganda;
grb = disablePropaganda;
kjv = disablePropaganda;
lukesmithxyz-bible-kjv = disablePropaganda;
sword = disablePropaganda;
vul = disablePropaganda;
xiphos = disablePropaganda;
gnomeExtensions.quran-player = disablePropaganda;
emacsPackages.holy-books = disablePropaganda;
systemd = patchSystemd prev.systemd;
};
nixosModules.antifa = { lib, pkgs, ... }: {
nix.package = lib.mkForce pkgs.lix;
};
};
}

View file

@ -0,0 +1,554 @@
From f09346dd2ceb30d0c7ea03bbd0099967e7e54be0 Mon Sep 17 00:00:00 2001
From: soscho2143 <mnovikov@mil.ru>
Date: Sun, 12 Oct 2025 13:52:36 -0400
Subject: [PATCH 1/2] detect-fash: implement systemd-detect-fash
---
man/systemd-detect-fash.xml | 131 +++++++++
shell-completion/bash/systemd-detect-fash | 40 +++
src/detect-fash/detect-fash.c | 312 ++++++++++++++++++++++
src/detect-fash/meson.build | 9 +
4 files changed, 492 insertions(+)
create mode 100644 man/systemd-detect-fash.xml
create mode 100644 shell-completion/bash/systemd-detect-fash
create mode 100644 src/detect-fash/detect-fash.c
create mode 100644 src/detect-fash/meson.build
diff --git a/man/systemd-detect-fash.xml b/man/systemd-detect-fash.xml
new file mode 100644
index 0000000000000..aaebf4e48650b
--- /dev/null
+++ b/man/systemd-detect-fash.xml
@@ -0,0 +1,131 @@
+<?xml version='1.0'?> <!--*-nxml-*-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
+
+<refentry id="systemd-detect-fash"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+
+ <refentryinfo>
+ <title>systemd-detect-fash</title>
+ <productname>systemd</productname>
+ </refentryinfo>
+
+ <refmeta>
+ <refentrytitle>systemd-detect-fash</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </refmeta>
+
+ <refnamediv>
+ <refname>systemd-detect-fash</refname>
+ <refpurpose>Detect execution in a fascist environment</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>systemd-detect-fash</command>
+ <arg choice="opt" rep="repeat">OPTIONS</arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para><command>systemd-detect-fash</command> detects execution in
+ a fascist environment. It identifies the fascist
+ technology and can distinguish full machine fascism from
+ installed fashware. <filename>systemd-detect-fash</filename>
+ exits with a return value of 0 (success) if a fascism
+ technology is detected, and non-zero (error) otherwise.
+
+ <para>When executed without <option>--quiet</option> will print a
+ short identifier for the detected fascist technology. The
+ following technologies are currently identified:</para>
+
+ <table>
+ <title>Known fascist technologies</title>
+ <tgroup cols='3' align='left' colsep='1' rowsep='1'>
+ <colspec colname="type" />
+ <colspec colname="id" />
+ <colspec colname="product" />
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>ID</entry>
+ <entry>Product</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><varname>omarchy</varname></entry>
+ <entry>Omarchy linux distro. Detected by checking os-release.</entry>
+ </row>
+
+ <row>
+ <entry><varname>ladybird</varname></entry>
+ <entry>Ladybird browser. Detected by checking for "ladybird" binary in path.</entry>
+ </row>
+
+ <row>
+ <entry><varname>hyprland</varname></entry>
+ <entry>Hyperland window manager. Detected by checking the existence of hyprland config files on disk.</entry>
+ </row>
+
+ <row>
+ <entry><varname>dhh</varname></entry>
+ <entry>Checks for DHH's public key on disk.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+
+ <para>The following options are understood:</para>
+
+ <variablelist>
+ <varlistentry>
+ <term><option>-o</option></term>
+ <term><option>--omarchy</option></term>
+
+ <listitem><para>Only detects if os-release is Omarchy.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-y</option></term>
+ <term><option>--hyprland</option></term>
+
+ <listitem><para>Only detects Hyprland.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-l</option></term>
+ <term><option>--ladybird</option></term>
+
+ <listitem><para>Only detects Ladybird.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-d</option></term>
+ <term><option>--dhh</option></term>
+
+ <listitem><para>Only detects DHH.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-q</option></term>
+ <term><option>--quiet</option></term>
+
+ <listitem><para>Suppress output of the fascist technology identifier.</para></listitem>
+ </varlistentry>
+ </refsect1>
+
+ <refsect1>
+ <title>Exit status</title>
+
+ <para>If a fascist technology is detected, 0 is returned, a
+ non-zero code otherwise.</para>
+ </refsect1>
+</refentry>
diff --git a/shell-completion/bash/systemd-detect-fash b/shell-completion/bash/systemd-detect-fash
new file mode 100644
index 0000000000000..dc2a7f5f4774a
--- /dev/null
+++ b/shell-completion/bash/systemd-detect-fash
@@ -0,0 +1,40 @@
+# shellcheck shell=bash
+# systemd-detect-fash(1) completion -*- shell-script -*-
+# SPDX-License-Identifier: LGPL-2.1-or-later
+#
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# systemd is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with systemd; If not, see <https://www.gnu.org/licenses/>.
+
+__contains_word() {
+ local w word=$1; shift
+ for w in "$@"; do
+ [[ $w = "$word" ]] && return
+ done
+}
+
+_systemd_detect_fash() {
+ local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} words cword
+ local i verb comps
+
+ local -A OPTS=(
+ [STANDALONE]='-h --help --version -q --quiet -o --omarchy -l --ladybird -y --hyprland -d --dhh'
+ )
+
+ _init_completion || return
+
+ COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
+}
+
+complete -F _systemd_detect_fash systemd-detect-fash
diff --git a/src/detect-fash/detect-fash.c b/src/detect-fash/detect-fash.c
new file mode 100644
index 0000000000000..311547ec6a619
--- /dev/null
+++ b/src/detect-fash/detect-fash.c
@@ -0,0 +1,312 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+
+#include <stdlib.h>
+#include <getopt.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "alloc-util.h"
+#include "build.h"
+#include "log.h"
+#include "main-func.h"
+#include "pretty-print.h"
+#include "string-table.h"
+
+static bool arg_quiet = false;
+static enum {
+ ANY_FASCISM,
+ ONLY_LADYBIRD,
+ ONLY_OMARCHY,
+ ONLY_HYPRLAND,
+ ONLY_DHH
+} arg_mode = ANY_FASCISM;
+
+/* detects if os-release is omarchy */
+static int detect_omarchy(void) {
+ const char *term = "omarchy";
+ const int len = 256;
+
+ /* if we cannot access os-release we cannot check */
+ if (access("/etc/os-release", F_OK) != 0)
+ return -1;
+
+ FILE *osfile = fopen("/etc/os-release", "r");
+ char os[len];
+ fgets(os, len, osfile);
+ if (strcasestr(os, term) != NULL)
+ return 1;
+
+ return 0;
+}
+
+/*
+ detects if the LadyBird browser
+ has been built on this machine
+ or if the binary exists in $PATH
+*/
+static unsigned detect_ladybird(void) {
+
+ /* name of the ladybird binary */
+ const char* ladybird_bin = "/ladybird";
+
+ /* check if build variable is available */
+ char* LADYBIRD_SOURCE_DIR = getenv("LADYBIRD_SOURCE_DIR");
+ if (LADYBIRD_SOURCE_DIR != NULL)
+ return 1;
+
+ char* PATH = getenv("PATH");
+ if (PATH == NULL)
+ return 0;
+
+ /* this value will get mutated so we need to duplicate it */
+ char* path = strdup(PATH);
+ /* loop through PATH until we find a file named "ladybird" */
+ char* path_iter = strtok(path, ":");
+ char* abs_path = malloc(256);
+ while (path_iter != NULL) {
+ strncat(abs_path, path_iter, 128);
+ strncat(abs_path, ladybird_bin, 128);
+ /* if we do NOT find the binary at current path, keep going */
+ if (access(abs_path, F_OK) != 0){
+ path_iter = strtok(NULL, ":");
+ abs_path[0] = 0;
+ continue;
+ }
+ free(abs_path);
+ free(path);
+ return 1;
+ }
+ free(abs_path);
+ free(path);
+ return 0;
+}
+
+/* detects if hyprland is installed */
+static unsigned detect_hyprland(void) {
+ const char* hyprland_config = "/hypr/hyprland.conf";
+ const char* XDG_CONFIG_HOME = getenv("XDG_CONFIG_HOME");
+ const char* HOME = getenv("HOME");
+ int maxlen = 128;
+
+ char *hyprland_abs_path = malloc(maxlen);
+
+ if (XDG_CONFIG_HOME != NULL) {
+ strncat(hyprland_abs_path, XDG_CONFIG_HOME, maxlen - strlen(hyprland_config));
+ } else if (HOME != NULL) {
+ strncat(hyprland_abs_path, HOME, maxlen - strlen(hyprland_config));
+ strcat(hyprland_abs_path, "/.config");
+ } else {
+ return 0;
+ }
+ strcat(hyprland_abs_path, hyprland_config);
+ if (access(hyprland_abs_path, F_OK) == 0){
+ free(hyprland_abs_path);
+ return 1;
+ }
+ free(hyprland_abs_path);
+ return 0;
+}
+
+/* detects if this is dhh's computer using his ssh pubkey */
+static int detect_dhh(void) {
+ /* fingerprint of dhh's ssh public key */
+ const char *dhh_fingerprint = "SHA256:YCKX7xo5Hkihy/NVH5ang8Oty9q8Vvqu4sxI7EbDxPg";
+ /* path to ssh pubkey */
+ const char *ssh_pubkey = "/.ssh/id_ed25519.pub";
+ /* command to generate fingerprint */
+ const char *ssh_fingerpint_cmd = "ssh-keygen -E sha256 -lf ";
+
+ /* get the home directory */
+ char *HOME = getenv("HOME");
+
+ if (HOME == NULL)
+ return -1;
+ /* check if we have read access to the public key on disk */
+ char *ssh_pubkey_abs_path = (char *)malloc(strlen(HOME) + strlen(ssh_pubkey) + 1);
+ ssh_pubkey_abs_path[0] = 0;
+ strcat(ssh_pubkey_abs_path, HOME);
+ strcat(ssh_pubkey_abs_path, ssh_pubkey);
+ if (access(ssh_pubkey_abs_path, F_OK) != 0)
+ return 0;
+
+ /* generate a fingerprint of it */
+ char *get_fingerprint_cmd = (char *)malloc(strlen(ssh_fingerpint_cmd) + strlen(ssh_pubkey_abs_path) + 1);
+ get_fingerprint_cmd[0] = 0;
+ strcat(get_fingerprint_cmd, ssh_fingerpint_cmd);
+ strcat(get_fingerprint_cmd, ssh_pubkey_abs_path);
+
+ char fingerprint[70];
+ FILE *fingerprint_cmd_output = popen(get_fingerprint_cmd, "r");
+
+ if (fingerprint_cmd_output == NULL)
+ return -1;
+ fgets(fingerprint, 70, fingerprint_cmd_output);
+
+ /* free memory */
+ pclose(fingerprint_cmd_output);
+ free(ssh_pubkey_abs_path);
+ free(get_fingerprint_cmd);
+
+ /* comare it to DHH's fingerprint */
+ if (strstr(fingerprint, dhh_fingerprint) != NULL)
+ return 1;
+ return 0;
+}
+
+static int help(void) {
+ _cleanup_free_ char *link = NULL;
+ int r;
+
+ r = terminal_urlify_man("systemd-detect-fash", "1", &link);
+ if (r < 0)
+ return log_oom();
+
+ printf("%s [OPTIONS...]\n\n"
+ "Detect execution in a fascist environment.\n\n"
+ " -h --help Show this help\n"
+ " --version Show package version\n"
+ " -q --quiet Quiet mode\n"
+ " -o --omarchy Only detect omarchy\n"
+ " -l --ladybird Only detect ladybird\n"
+ " -y --hyprland Only detect hyprland\n"
+ " -d --dhh Only detect dhh\n"
+ "\nSee the %s for details.\n",
+ program_invocation_short_name,
+ link);
+
+ return 0;
+}
+
+static int parse_argv(int argc, char *argv[]) {
+
+ enum {
+ ARG_VERSION = 0x100,
+ ARG_OMARCHY,
+ ARG_LADYBIRD,
+ ARG_HYPRLAND,
+ ARG_DHH
+ };
+
+ static const struct option options[] = {
+ { "help", no_argument, NULL, 'h' },
+ { "version", no_argument, NULL, ARG_VERSION },
+ { "omarchy", no_argument, NULL, 'o' },
+ { "ladybird", no_argument, NULL, 'l' },
+ { "hyprland", no_argument, NULL, 'y' },
+ { "dhh", no_argument, NULL, 'd' },
+ {}
+ };
+
+ int c;
+
+ assert(argc >= 0);
+ assert(argv);
+
+ while ((c = getopt_long(argc, argv, "hqolyd", options, NULL)) >= 0)
+
+ switch (c) {
+
+ case 'h':
+ return help();
+
+ case ARG_VERSION:
+ return version();
+
+ case 'q':
+ arg_quiet = true;
+ break;
+
+ case 'l':
+ arg_mode = ONLY_LADYBIRD;
+ break;
+
+ case 'o':
+ arg_mode = ONLY_OMARCHY;
+ break;
+
+ case 'y':
+ arg_mode = ONLY_HYPRLAND;
+ break;
+
+ case 'd':
+ arg_mode = ONLY_DHH;
+ break;
+
+ case '?':
+ return -EINVAL;
+
+ default:
+ assert_not_reached();
+ }
+ return 1;
+}
+
+static int run(int argc, char *argv[]) {
+ int dhh = 0;
+ int hyprland = 0;
+ int ladybird = 0;
+ int omarchy = 0;
+ int fascism = 0;
+ int r;
+
+ /* This is mostly intended to be used for scripts which want
+ * to detect whether we are being run in a fascist
+ * environment or not */
+
+ log_setup();
+
+ r = parse_argv(argc, argv);
+ if (r <= 0)
+ return r;
+
+ switch (arg_mode) {
+ case ONLY_OMARCHY:
+ omarchy = detect_omarchy();
+ fascism = omarchy;
+ if (omarchy < 0)
+ return log_error_errno(fascism, "Failed to check for omarchy: %m");
+ break;
+
+ case ONLY_LADYBIRD:
+ ladybird = detect_ladybird();
+ fascism = ladybird;
+ if (ladybird < 0)
+ return log_error_errno(fascism, "Failed to check for ladybird: %m");
+ break;
+
+ case ONLY_HYPRLAND:
+ hyprland = detect_hyprland();
+ fascism = hyprland;
+ if (hyprland < 0)
+ return log_error_errno(fascism, "Failed to check for hyprland: %m");
+ break;
+
+ case ONLY_DHH:
+ dhh = detect_dhh();
+ fascism = dhh;
+ if (dhh < 0)
+ return log_error_errno(fascism, "Failed to check for dhh: %m");
+ break;
+
+ case ANY_FASCISM:
+ default:
+ ladybird = detect_ladybird();
+ omarchy = detect_omarchy();
+ hyprland = detect_hyprland();
+ dhh = detect_dhh();
+ fascism = (ladybird | omarchy | hyprland | dhh);
+ if (fascism < 0)
+ return log_error_errno(fascism, "Failed to check for fascism: %m");
+ }
+
+ if (!arg_quiet) {
+ if (ladybird) puts("ladybird");
+ if (omarchy) puts("omarchy");
+ if (dhh) puts("dhh");
+ if (hyprland) puts("hyprland");
+ }
+ return fascism;
+}
+
+DEFINE_MAIN_FUNCTION_WITH_POSITIVE_FAILURE(run);
diff --git a/src/detect-fash/meson.build b/src/detect-fash/meson.build
new file mode 100644
index 0000000000000..f4cca34117e7b
--- /dev/null
+++ b/src/detect-fash/meson.build
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+executables += [
+ executable_template + {
+ 'name' : 'systemd-detect-fash',
+ 'public' : true,
+ 'sources' : files('detect-fash.c'),
+ },
+]
From 825072a331cb6d7464eb4479c4998ab0d020e32f Mon Sep 17 00:00:00 2001
From: soscho2143 <mnovikov@mil.ru>
Date: Sun, 12 Oct 2025 14:18:49 -0400
Subject: [PATCH 2/2] detect-fash: added to meson.build
---
meson.build | 1 +
1 file changed, 1 insertion(+)
diff --git a/meson.build b/meson.build
index c67e7b6c30de4..76c625d22080d 100644
--- a/meson.build
+++ b/meson.build
@@ -2353,6 +2353,7 @@ subdir('src/cryptenroll')
subdir('src/cryptsetup')
subdir('src/debug-generator')
subdir('src/delta')
+subdir('src/detect-fash')
subdir('src/detect-virt')
subdir('src/dissect')
subdir('src/environment-d-generator')