summaryrefslogtreecommitdiff
path: root/hosts
diff options
context:
space:
mode:
Diffstat (limited to 'hosts')
-rw-r--r--hosts/ahmed/cloudflare-proxy/default.nix88
-rw-r--r--hosts/ahmed/configuration.nix17
-rw-r--r--hosts/ahmed/home/default.nix9
-rw-r--r--hosts/common.nix81
-rw-r--r--hosts/muhammed/configuration.nix21
-rw-r--r--hosts/muhammed/home/default.nix14
-rw-r--r--hosts/muhammed/home/dev-utils/default.nix49
-rw-r--r--hosts/muhammed/home/iterm2/auto_theme.py31
-rw-r--r--hosts/muhammed/home/iterm2/default.nix22
-rw-r--r--hosts/muhammed/home/misc-utils/default.nix12
-rw-r--r--hosts/muhammed/home/neovim/default.nix8
-rw-r--r--hosts/muhammed/home/neovim/filetype.nix14
-rw-r--r--hosts/muhammed/home/neovim/lsp.nix148
-rw-r--r--hosts/muhammed/home/noweb/default.nix12
-rw-r--r--hosts/muhammed/home/qbittorrent/default.nix5
15 files changed, 33 insertions, 498 deletions
diff --git a/hosts/ahmed/cloudflare-proxy/default.nix b/hosts/ahmed/cloudflare-proxy/default.nix
deleted file mode 100644
index 45ccaa6..0000000
--- a/hosts/ahmed/cloudflare-proxy/default.nix
+++ /dev/null
@@ -1,88 +0,0 @@
-# This module adds some extra configuration useful when running behid a Cloudflare Proxy.
-# Mainly, it blocks all incomming conncections on relevant ports that aren't
-# coming from an official CloudFlare domain.
-{
- config,
- lib,
- pkgs,
- metadata,
- ...
-}: let
- # TODO: What happens when these get out of date??? Huh??? You little pissbaby
- fileToList = x: lib.strings.splitString "\n" (builtins.readFile x);
- cfipv4 = fileToList (pkgs.fetchurl {
- url = "https://www.cloudflare.com/ips-v4";
- hash = "sha256-8Cxtg7wBqwroV3Fg4DbXAMdFU1m84FTfiE5dfZ5Onns=";
- });
- cfipv6 = fileToList (pkgs.fetchurl {
- url = "https://www.cloudflare.com/ips-v6";
- hash = "sha256-np054+g7rQDE3sr9U8Y/piAp89ldto3pN9K+KCNMoKk=";
- });
-
- IPv4Whitelist = [metadata.hosts.muhammed.ipAddress];
- IPv6Whitelist = [];
-in {
- config = {
- # Teach NGINX how to extract the proxied IP from proxied requests.
- #
- # See: https://nixos.wiki/wiki/Nginx#Using_realIP_when_behind_CloudFlare_or_other_CDN
- services.nginx.commonHttpConfig = let
- realIpsFromList = lib.strings.concatMapStringsSep "\n" (x: "set_real_ip_from ${x};");
- in ''
- ${realIpsFromList cfipv4}
- ${realIpsFromList cfipv6}
- real_ip_header CF-Connecting-IP;
- '';
-
- # Block non-Cloudflare IP addresses.
- networking.firewall = let
- chain = "cloudflare-whitelist";
- in {
- extraCommands = let
- allow-interface = lib.strings.concatMapStringsSep "\n" (i: ''ip46tables --append ${chain} --in-interface ${i} --jump RETURN'');
- allow-ip = cmd: lib.strings.concatMapStringsSep "\n" (r: ''${cmd} --append ${chain} --source ${r} --jump RETURN'');
- in ''
- # Flush the old firewall rules. This behavior mirrors the default firewall service.
- # See: https://github.com/NixOS/nixpkgs/blob/ac911bf685eecc17c2df5b21bdf32678b9f88c92/nixos/modules/services/networking/firewall-iptables.nix#L59-L66
- ip46tables --delete INPUT --protocol tcp --destination-port 80 --syn --jump ${chain} 2>/dev/null || true
- ip46tables --delete INPUT --protocol tcp --destination-port 443 --syn --jump ${chain} 2>/dev/null || true
- ip46tables --flush ${chain} || true
- ip46tables --delete-chain ${chain} || true
-
- # Create a chain that only allows whitelisted IPs through.
- ip46tables --new-chain ${chain}
-
- # Allow trusted interfaces through.
- ${allow-interface config.networking.firewall.trustedInterfaces}
-
- # Allow local whitelisted IPs through
- ${allow-ip "iptables" IPv4Whitelist}
- ${allow-ip "ip6tables" IPv6Whitelist}
-
- # Allow Cloudflare's IP ranges through.
- ${allow-ip "iptables" cfipv4}
- ${allow-ip "ip6tables" cfipv6}
-
- # Everything else is dropped.
- #
- # TODO: I would like to use `nixos-fw-log-refuse` here, but I keep
- # running into weird issues when reloading the firewall.
- # Something about the table not being deleted properly.
- ip46tables --append ${chain} --jump DROP
-
- # Inject our chain as the first check in INPUT (before nixos-fw).
- # We want to capture any new incomming TCP connections.
- ip46tables --insert INPUT 1 --protocol tcp --destination-port 80 --syn --jump ${chain}
- ip46tables --insert INPUT 1 --protocol tcp --destination-port 443 --syn --jump ${chain}
- '';
- extraStopCommands = ''
- # Clean up added rulesets (${chain}). This mirrors the behavior of the
- # default firewall at the time of writing.
- #
- # See: https://github.com/NixOS/nixpkgs/blob/ac911bf685eecc17c2df5b21bdf32678b9f88c92/nixos/modules/services/networking/firewall-iptables.nix#L218-L219
- ip46tables --delete INPUT --protocol tcp --destination-port 80 --syn --jump ${chain} 2>/dev/null || true
- ip46tables --delete INPUT --protocol tcp --destination-port 443 --syn --jump ${chain} 2>/dev/null || true
- '';
- };
- };
-}
diff --git a/hosts/ahmed/configuration.nix b/hosts/ahmed/configuration.nix
index 86e7e60..81fc77a 100644
--- a/hosts/ahmed/configuration.nix
+++ b/hosts/ahmed/configuration.nix
@@ -3,13 +3,16 @@
{
config,
pkgs,
- flakeInputs,
...
}: {
imports = [
./hardware-configuration.nix
- ./cloudflare-proxy
+ ../../shared/nixos/cloudflare-proxy
+ ../../shared/nixos/common-nix-settings
+ ../../shared/nixos/common-shell-settings
+ ../../shared/nixos/common-hm-settings
+
./duksebot
./git.linus.onl
./hellohtml.linus.onl
@@ -17,7 +20,6 @@
./nofitications.linus.onl
./ssh
./torrenting
- ./home
./remote-builder
];
@@ -29,6 +31,15 @@
};
users.mutableUsers = false;
+ home-manager.users.linus = {
+ imports = [
+ # Despite this being a "just a server" it is also the only x86_64-linux
+ # host I have access to, so in practice I end up using it for development
+ # sometimes.
+ ../../shared/home-manager/development-minimal
+ ];
+ };
+
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
diff --git a/hosts/ahmed/home/default.nix b/hosts/ahmed/home/default.nix
deleted file mode 100644
index a031e96..0000000
--- a/hosts/ahmed/home/default.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-# Here we extend the HM user defined in `home/default.nix`. All the global HM
-# stuff is defined in there. The only imports here are specific to this host.
-{...}: {
- home-manager.users.linus = {
- imports = [
- # empty for now
- ];
- };
-}
diff --git a/hosts/common.nix b/hosts/common.nix
deleted file mode 100644
index 551fa47..0000000
--- a/hosts/common.nix
+++ /dev/null
@@ -1,81 +0,0 @@
-# Shared configuraion regardless of hosts.
-{
- pkgs,
- options,
- flakeInputs,
- flakeOutputs,
- ...
-}: {
- # Enable de facto stable features.
- nix.settings.experimental-features = ["nix-command" "flakes"];
-
- nixpkgs.overlays = [
- # Use local overlays.
- flakeOutputs.overlays.additions
- flakeOutputs.overlays.modifications
-
- # Add unstable nixpkgs.
- (final: prev: {unstable = flakeInputs.nixpkgs-unstable.legacyPackages.${pkgs.system};})
- ];
-
- # I'm not *that* vegan.
- nixpkgs.config.allowUnfree = true;
-
- nix.nixPath = [
- # Use overlays from this repo for building system configuration as well as
- # system-wide.
- #
- # See: https://nixos.wiki/wiki/Overlays#Using_nixpkgs.overlays_from_configuration.nix_as_.3Cnixpkgs-overlays.3E_in_your_NIX_PATH
- "nixpkgs-overlays=${flakeInputs.self}/overlays/compat.nix"
-
- # For consistency, use the same version of nixpkgs everywhere. This DOES
- # however make the system closure depend on the nixpkgs sources which would
- # be undesirable if I didn't already use all my systems interactively for
- # Nix stuff.
- "nixpkgs=${flakeInputs.nixpkgs}"
- "nixpkgs-unstable=${flakeInputs.nixpkgs-unstable}"
- ];
-
- # Set ZSH as the shell.
- # https://nixos.wiki/wiki/Command_Shell#Changing_default_shelltrue
- programs.zsh.enable = true;
- environment.shells = [pkgs.zsh];
- users.users.linus.shell = pkgs.zsh;
-
- # Very basic system administration tools.
- environment.systemPackages = with pkgs; [
- tree
- gh
- vim
- flakeInputs.comma.packages.${system}.default
- nix-index
- curl
- moreutils
- flakeInputs.agenix.packages.${system}.default
- jq
- ];
-
- # Aliases that are burned into my muscle memory.
- environment.shellAliases = {
- "mv" = "mv -i";
- "rm" = "rm -i";
- "cp" = "cp -i";
- "ls" = "ls -F -G -A --color=auto";
- "grep" = "grep --color=auto";
- "file" = "file --no-dereference";
- "tree" = "tree --dirsfirst";
-
- # See: https://github.com/NixOS/nix/issues/5858
- "nix" = "nix --print-build-logs";
-
- ".." = "cd ../";
- "..." = "cd ../../";
- "...." = "cd ../../../";
- "....." = "cd ../../../../";
- "......" = "cd ../../../../../";
- "......." = "cd ../../../../../../";
- "........" = "cd ../../../../../../../";
- "........." = "cd ../../../../../../../../";
- ".........." = "cd ../../../../../../../../../";
- };
-}
diff --git a/hosts/muhammed/configuration.nix b/hosts/muhammed/configuration.nix
index cb2216e..81ebca0 100644
--- a/hosts/muhammed/configuration.nix
+++ b/hosts/muhammed/configuration.nix
@@ -6,7 +6,10 @@
...
}: {
imports = [
- ./home
+ ../../shared/nixos/common-shell-settings
+ ../../shared/nixos/common-nix-settings
+ ../../shared/nixos/common-hm-settings
+
./remote-builders
];
@@ -20,12 +23,26 @@
# Use the Nix daemon.
services.nix-daemon.enable = true;
- # Set up main account with ZSH.
+ # Set up main account.
users.users.linus = {
description = "Personal user account";
home = "/Users/linus";
};
+ home-manager.users.linus = {
+ imports = [
+ ../../shared/home-manager/development-full
+ ../../shared/home-manager/qbittorrent
+ ../../shared/home-manager/iterm2
+ ({pkgs, ...}: {
+ home.packages = with pkgs; [
+ imagemagick
+ ffmpeg_6-full
+ ];
+ })
+ ];
+ };
+
# Should match containing folder.
networking.hostName = "muhammed";
diff --git a/hosts/muhammed/home/default.nix b/hosts/muhammed/home/default.nix
deleted file mode 100644
index 9eb78bc..0000000
--- a/hosts/muhammed/home/default.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-# Here we extend the HM user defined in `home/default.nix`. All the global HM
-# stuff is defined in there.
-{...}: {
- home-manager.users.linus = {
- imports = [
- ./iterm2
- ./noweb
- ./neovim
- ./dev-utils
- ./misc-utils
- ./qbittorrent
- ];
- };
-}
diff --git a/hosts/muhammed/home/dev-utils/default.nix b/hosts/muhammed/home/dev-utils/default.nix
deleted file mode 100644
index 167b713..0000000
--- a/hosts/muhammed/home/dev-utils/default.nix
+++ /dev/null
@@ -1,49 +0,0 @@
-# This part (module) of my home manager configuration adds some random utilities.
-{
- pkgs,
- lib,
- ...
-}: {
- home.packages = with pkgs; [
- # smol utils
- nodePackages_latest.nodemon
- rlwrap
- devenv
-
- # heavy hitters
- imagemagick
- ffmpeg_6-full
-
- # interpreaters
- unstable.deno
- (python311Full.withPackages (ps:
- with ps; [
- virtualenv
- tkinter
- ]))
- tcl-8_6
- crystal
- nim
- guile
- vemf
- unstable.gleam
- cscript
- erlang_nox # Required by Gleam
- rebar3 # Required by Gleam
- unstable.nodejs_latest
-
- # Rust ecosystem
- rustc
- cargo
-
- # Clojure ecosystem
- clojure
- leiningen
- ];
-
- # Add system manual pages to the search path on Darwin.
- home.sessionVariables.MANPATH = lib.optionalString pkgs.stdenv.isDarwin "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man:$MANPATH";
-
- # Add local executables/scripts to path.
- home.sessionVariables.PATH = "$HOME/.local/bin:$PATH";
-}
diff --git a/hosts/muhammed/home/iterm2/auto_theme.py b/hosts/muhammed/home/iterm2/auto_theme.py
deleted file mode 100644
index 0970304..0000000
--- a/hosts/muhammed/home/iterm2/auto_theme.py
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env python3
-
-import asyncio
-import iterm2
-
-async def update(connection, theme):
- # Themes have space-delimited attributes, one of which will be light or dark.
- parts = theme.split(" ")
- if "dark" in parts:
- preset = await iterm2.ColorPreset.async_get(connection, "Dark Background")
- else:
- preset = await iterm2.ColorPreset.async_get(connection, "Light Background")
-
- # Update the list of all profiles and iterate over them.
- profiles=await iterm2.PartialProfile.async_query(connection)
- for partial in profiles:
- # Fetch the full profile and then set the color preset in it.
- profile = await partial.async_get_full_profile()
- await profile.async_set_color_preset(preset)
-
-async def main(connection):
- app = await iterm2.async_get_app(connection)
- await update(connection, await app.async_get_variable("effectiveTheme"))
- async with iterm2.VariableMonitor(connection, iterm2.VariableScopes.APP, "effectiveTheme", None) as mon:
- while True:
- # Block until theme changes
- theme = await mon.async_get()
- await update(connection, theme)
-
-
-iterm2.run_forever(main)
diff --git a/hosts/muhammed/home/iterm2/default.nix b/hosts/muhammed/home/iterm2/default.nix
deleted file mode 100644
index b6a9ecc..0000000
--- a/hosts/muhammed/home/iterm2/default.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-# This file configures iterm2. Note that the actual definition of iTerm2 for
-# home-manager is in `modules/home-manager/iterm2`. *That* file declares
-# `options.programs.iterm2.enable`.
-{pkgs, ...}: {
- config = {
- home.packages = with pkgs; [imgcat];
-
- # Install a script which automatically makes iTerm2 match the system-wide light/dark mode.
- home.file."/Library/Application Support/iTerm2/Scripts/AutoLaunch/auto_theme.py".text = builtins.readFile ./auto_theme.py;
-
- programs.iterm2 = {
- enable = true;
- # config = {
- # # Use the minimal tab style.
- # # See: https://github.com/gnachman/iTerm2/blob/bd40fba0611fa94684dadf2478625f2a93eb6e47/sources/iTermPreferences.h#L29
- # TabStyleWithAutomaticOption = 5;
- # };
-
- shellIntegration.enableZshIntegration = true;
- };
- };
-}
diff --git a/hosts/muhammed/home/misc-utils/default.nix b/hosts/muhammed/home/misc-utils/default.nix
deleted file mode 100644
index 5065a59..0000000
--- a/hosts/muhammed/home/misc-utils/default.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-# This part (module) of my home manager configuration adds some random utilities.
-{pkgs, ...}: let
- # Set some default options
- xkcdpass' = pkgs.writeShellScriptBin "xkcdpass" ''
- ${pkgs.xkcdpass}/bin/xkcdpass --delimiter \'\' --capitalize --numwords=4 "$@"
- '';
-in {
- home.packages = [
- # Generating passwords
- xkcdpass'
- ];
-}
diff --git a/hosts/muhammed/home/neovim/default.nix b/hosts/muhammed/home/neovim/default.nix
deleted file mode 100644
index 8efb97d..0000000
--- a/hosts/muhammed/home/neovim/default.nix
+++ /dev/null
@@ -1,8 +0,0 @@
-# Once again we extend the global configuration defined in `home/neovim/` with
-# some stuff specific to this host (mainly development stuff).
-{...}: {
- imports = [
- ./lsp.nix
- ./filetype.nix
- ];
-}
diff --git a/hosts/muhammed/home/neovim/filetype.nix b/hosts/muhammed/home/neovim/filetype.nix
deleted file mode 100644
index 73d5f5a..0000000
--- a/hosts/muhammed/home/neovim/filetype.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-# This module configures various syntax/filetype plugins for Neovim.
-{pkgs, ...}: {
- programs.neovim.plugins = with pkgs;
- with vimPlugins; [
- # Filetype plugins
- vim-nix
- vim-noweb
- vim-janet
- nim-vim
- vim-crystal
- vim-svelte
- gleam-vim
- ];
-}
diff --git a/hosts/muhammed/home/neovim/lsp.nix b/hosts/muhammed/home/neovim/lsp.nix
deleted file mode 100644
index c301bb0..0000000
--- a/hosts/muhammed/home/neovim/lsp.nix
+++ /dev/null
@@ -1,148 +0,0 @@
-# This module sets up LSP server configurations for Neovim.
-{pkgs, ...}: {
- programs.neovim.plugins = [
- {
- plugin = pkgs.vimPlugins.nvim-lspconfig;
- type = "lua";
- config = ''
- local lspconfig = require("lspconfig")
- local util = require("lspconfig.util")
-
- -- Mappings.
- -- See `:help vim.diagnostic.*` for documentation on any of the below functions
- local opts = { noremap=true, silent=true }
- vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, opts)
- vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
- vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
- vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, opts)
-
- -- Use an on_attach function to only map the following keys
- -- after the language server attaches to the current buffer
- local on_attach = function(client, bufnr)
- -- Enable completion triggered by <c-x><c-o>
- vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-
- -- Mappings.
- -- See `:help vim.lsp.*` for documentation on any of the below functions
- local bufopts = { noremap=true, silent=true, buffer=bufnr }
- vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
- vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
- vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
- vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
- vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
- vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts)
- vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
- vim.keymap.set('n', '<leader>wl', function()
- print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
- end, bufopts)
- vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
- vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, bufopts)
- vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, bufopts)
- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
- vim.keymap.set('n', '<leader>f', function() vim.lsp.buf.format { async = true } end, bufopts)
- vim.keymap.set('n', '<leader>s', function() vim.cmd[[ClangdSwitchSourceHeader]] end, bufopts)
- end
-
- -- Use a loop to conveniently call 'setup' on multiple servers and
- -- map buffer local keybindings when the language server attaches
- local servers = {
- pyright = {
- cmd = { "${pkgs.pyright}/bin/pyright-langserver", "--stdio" },
- },
- nixd = {
- cmd = { "${pkgs.nixd}/bin/nixd" },
- },
- denols = {
- init_options = {
- enable = true,
- unstable = true,
- lint = true,
- nodeModulesDir = true,
- },
- cmd = { "${pkgs.unstable.deno}/bin/deno", "lsp" },
- root_dir = function(startpath)
- if util.find_package_json_ancestor(startpath) then
- -- This is a Node project; let ts_ls handle this one.
- -- This exactly mirrors how typescript-langauge-server yields to this server for Deno projects.
- return nil
- else
- -- Otherwise, we try to find the root or
- -- default to the current directory.
- return util.root_pattern("deno.json", "deno.jsonc", ".git")(startpath)
- or util.path.dirname(startpath)
- end
- end,
- },
- ts_ls = {
- cmd = { "${pkgs.nodePackages_latest.typescript-language-server}/bin/typescript-language-server", "--stdio" },
- root_dir = function(startpath)
- local find_deno_root_dir = util.root_pattern("deno.json", "deno.jsonc")
- if find_deno_root_dir(startpath) then
- -- This is a Deno project; let deno-lsp handle this one.
- -- This exactly mirrors how deno-lsp yields to this server for Node projects.
- return nil
- else
- -- Otherwise fall back to the usual resolution method.
- -- See: https://github.com/neovim/nvim-lspconfig/blob/056f569f71e4b726323b799b9cfacc53653bceb3/lua/lspconfig/server_configurations/ts_ls.lua#L15
- return util.root_pattern("tsconfig.json", "jsconfig.json", "package.json", ".git")(startpath)
- end
- end,
- -- We also have to disallow starting in without a root directory, as otherwise returning
- -- nil from find_root will just cause the LSP to be spawned in single file mode instead of yielding to deno-lsp.
- --
- -- This has the side effect that Deno LSP will be preferred in a single file context which is what we want!
- --
- -- See: https://github.com/neovim/nvim-lspconfig/blob/056f569f71e4b726323b799b9cfacc53653bceb3/lua/lspconfig/manager.lua#L281-L286
- single_file_support = false,
- },
- clangd = {
- cmd = { "${pkgs.clang-tools}/bin/clangd" },
- },
- nimls = {
- cmd = { "${pkgs.nimlsp}/bin/nimlsp" },
- },
- rust_analyzer = {
- cmd = { "${pkgs.rust-analyzer}/bin/rust-analyzer" },
- },
- rust_analyzer = {
- cmd = { "${pkgs.rust-analyzer}/bin/rust-analyzer" },
- },
- gleam = {
- cmd = { "${pkgs.unstable.gleam}/bin/gleam", "lsp" },
- },
- svelte = {
- cmd = { "${pkgs.nodePackages_latest.svelte-language-server}/bin/svelteserver", "--stdio" },
- root_dir = util.root_pattern("package.json", ".git", "deno.json", "deno.jsonc"),
- },
- };
- for server, config in pairs(servers) do
- -- set common options
- config.on_attach = on_attach;
- config.debounce_text_changes = 150;
-
- lspconfig[server].setup(config)
- end
- '';
- }
- ];
-}
-# I spent like an hour writing this, only to find it was a pretty bad idea.
-#
-# nixToLua = s:
-# if builtins.isAttrs s then
-# let
-# renderAttr = name: value: "[ [==========[" + name + "]==========] ] = " + (nixToLua value);
-# attrsList = map (name: renderAttr name s.${name}) (lib.attrNames s);
-# attrsListStr = lib.concatStringsSep ", " attrsList;
-# in
-# "{ ${attrsListStr} }"
-# else if builtins.isList s then
-# "{ " + (lib.concatStringsSep ", " (map nixToLua s)) + " }"
-# else if builtins.isString s then
-# # Oh boy I sure hope `s` doesn't contain "]==========]".
-# "[==========[" + s + "]==========]"
-# else if builtins.isInt s || builtins.isFloat s then
-# toString s
-# else
-# throw "Cannot convert ${builtins.typeOf s} to Lua value!";
-
diff --git a/hosts/muhammed/home/noweb/default.nix b/hosts/muhammed/home/noweb/default.nix
deleted file mode 100644
index ef67862..0000000
--- a/hosts/muhammed/home/noweb/default.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{pkgs, ...}: {
- home.packages = with pkgs; [
- noweb
- texliveFull
- yalafi-shell
- ];
-
- # Prepend nowebs STY files to the search path. I chose to do it globally,
- # rather than using `makeWrapper` because I sometimes want to manually invoke
- # `pdflatex` and the like on the output of `noweave`.
- home.sessionVariables.TEXINPUTS = "${pkgs.noweb.tex}/tex/latex/noweb/:$TEXINPUTS";
-}
diff --git a/hosts/muhammed/home/qbittorrent/default.nix b/hosts/muhammed/home/qbittorrent/default.nix
deleted file mode 100644
index 0b7e2b1..0000000
--- a/hosts/muhammed/home/qbittorrent/default.nix
+++ /dev/null
@@ -1,5 +0,0 @@
-# Adds qbittorrent.
-# FIXME: Configuration is still stored mutably.
-{pkgs, ...}: {
- home.packages = [pkgs.qbittorrent];
-}