Compare changes

Choose any two refs to compare.

+4 -7
README.md
···
2. Clone this repository and follow the [Home Manager manual](https://nix-community.github.io/home-manager/index.xhtml#sec-install-standalone).
3. Deploy the profile with `home-manager switch`.
-
Alternatively, use the home-manager command after installing it:
-
`home-manager --flake /path/to/repo#<username>@<hostname> switch`
-
### Nix-on-Droid
See [upstream](https://github.com/nix-community/nix-on-droid/).
···
- SBCs are small mammals ([Eulipotyphla](https://en.wikipedia.org/wiki/Eulipotyphla)), e.g. the [Home Assistant](https://www.home-assistant.io/) server and [Zigbee](https://en.wikipedia.org/wiki/Zigbee) bridge [`shrew`](./hosts/shrew).
- Desktops are carnivores ([Carnivora](https://en.wikipedia.org/wiki/Carnivora)), e.g. the tower PC [`vulpine`](./hosts/vulpine).
- Mobile (battery powered) hosts are reptiles, e.g. the laptop [`gecko`](./hosts/gecko).
-
- Virtual hosts are birds, e.g. the virtual private server [`owl`](./hosts/owl).
-
- Work-associated hosts are aquatic.
+
- Virtual hosts are birds, e.g. the virtual private server (VPS) [`owl`](./hosts/owl).
+
- Work-associated hosts are aquatic, e.g. the VPSs for [Eon](https://github.com/RyanGibb/eon) experiments [`duck`](./hosts/duck), and running the [EEG](https://www.cst.cam.ac.uk/research/eeg) infrastructure including using the federated [Shibboleth](https://www.shibboleth.net/) identity server to provision [Matrix](https://matrix.org/) accounts [`swan`](./hosts/swan).
- [`barnacle`](./hosts/barnacle/default.nix) builds an ISO image that can be written to media like a USB flash drive to create a read-only live USB that can be booted to provide the custom environment on all my other hosts and used to, for example, install an operating system, with the [`install.sh`](./hosts/barnacle/install.sh) script.
- Each host directory typically contains,
- `default.nix` - Main configuration entry point that imports other modules.
- `hardware-configuration.nix` - Hardware-specific configuration generated by `nixos-generate-config`.
-
- `minimal.nix` - A minimal configuration that can be useful when updating with insuffient disk space.
+
- `minimal.nix` - A minimal configuration that can be useful when updating with insufficient disk space.
The minimal configuration can be build, the `default.nix` system garbage collected, and then the updated configuration built.
Note this precludes trivial rollback.
-
- Other modules seperating functionality, such as `services.nix`.
+
- Other modules separating functionality, such as `services.nix`.
- [`modules/`](./modules/) - NixOS modules of common functionality extracted into modular components which can be enabled by host configurations.
- [`pkgs/`](./pkgs/) - Custom package definitions for packages not available in nixpkgs or requiring modifications.
- [`home/`](./home/) - Home-manager NixOS modules configurations.
+60 -38
flake.lock
···
"type": "github"
}
},
+
"disko": {
+
"inputs": {
+
"nixpkgs": [
+
"nixpkgs"
+
]
+
},
+
"locked": {
+
"lastModified": 1743598667,
+
"narHash": "sha256-ViE7NoFWytYO2uJONTAX35eGsvTYXNHjWALeHAg8OQY=",
+
"owner": "nix-community",
+
"repo": "disko",
+
"rev": "329d3d7e8bc63dd30c39e14e6076db590a6eabe6",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-community",
+
"repo": "disko",
+
"type": "github"
+
}
+
},
"eilean": {
"inputs": {
"eon": [
···
"opam-nix": "opam-nix"
},
"locked": {
-
"lastModified": 1738667109,
-
"narHash": "sha256-BDTEsrdmS/V4Kpjx7yBafqMEtw629xJCZel9jbT7dlg=",
+
"lastModified": 1743149102,
+
"narHash": "sha256-pW24ij8CqAdU8m5OFD1amwNmovf25YRygl1bv+s390o=",
"owner": "RyanGibb",
"repo": "eon",
-
"rev": "5a56fd3173a3f123d99cb674cb28c133e0cfc263",
+
"rev": "81bdd51d1e2651c46df2a1ce38b7df5661e7eef1",
"type": "github"
},
"original": {
···
]
},
"locked": {
-
"lastModified": 1739757849,
-
"narHash": "sha256-Gs076ot1YuAAsYVcyidLKUMIc4ooOaRGO0PqTY7sBzA=",
+
"lastModified": 1743387206,
+
"narHash": "sha256-24N3NAuZZbYqZ39NgToZgHUw6M7xHrtrAm18kv0+2Wo=",
"owner": "nix-community",
"repo": "home-manager",
-
"rev": "9d3d080aec2a35e05a15cedd281c2384767c2cfe",
+
"rev": "15c5f9d04fabd176f30286c8f52bbdb2c853a146",
"type": "github"
},
"original": {
···
"lucide-src": {
"flake": false,
"locked": {
-
"narHash": "sha256-5ipNSxTlQ7627lGgsyZxk7vS1sr9RkrlR8/QMj2Zg6s=",
-
"type": "file",
-
"url": "https://unpkg.com/lucide@0.482.0"
+
"lastModified": 1742302029,
+
"narHash": "sha256-OyPVtpnC4/AAmPq84Wt1r1Gcs48d9KG+UBCtZK87e9k=",
+
"type": "tarball",
+
"url": "https://github.com/lucide-icons/lucide/releases/download/0.483.0/lucide-icons-0.483.0.zip"
},
"original": {
-
"type": "file",
-
"url": "https://unpkg.com/lucide@0.482.0"
+
"type": "tarball",
+
"url": "https://github.com/lucide-icons/lucide/releases/download/0.483.0/lucide-icons-0.483.0.zip"
}
},
"mirage-opam-overlays": {
···
},
"nixos-hardware": {
"locked": {
-
"lastModified": 1740646007,
-
"narHash": "sha256-dMReDQobS3kqoiUCQIYI9c0imPXRZnBubX20yX/G5LE=",
+
"lastModified": 1743420942,
+
"narHash": "sha256-b/exDDQSLmENZZgbAEI3qi9yHkuXAXCPbormD8CSJXo=",
"owner": "nixos",
"repo": "nixos-hardware",
-
"rev": "009b764ac98a3602d41fc68072eeec5d24fc0e49",
+
"rev": "de6fc5551121c59c01e2a3d45b277a6d05077bc4",
"type": "github"
},
"original": {
···
},
"nixpkgs-unstable": {
"locked": {
-
"lastModified": 1741851582,
-
"narHash": "sha256-cPfs8qMccim2RBgtKGF+x9IBCduRvd/N5F4nYpU0TVE=",
+
"lastModified": 1743448293,
+
"narHash": "sha256-bmEPmSjJakAp/JojZRrUvNcDX2R5/nuX6bm+seVaGhs=",
"owner": "nixos",
"repo": "nixpkgs",
-
"rev": "6607cf789e541e7873d40d3a8f7815ea92204f32",
+
"rev": "77b584d61ff80b4cef9245829a6f1dfad5afdfa3",
"type": "github"
},
"original": {
···
},
"nixpkgs_2": {
"locked": {
-
"lastModified": 1741048562,
-
"narHash": "sha256-W4YZ3fvWZiFYYyd900kh8P8wU6DHSiwaH0j4+fai1Sk=",
+
"lastModified": 1743501102,
+
"narHash": "sha256-7PCBQ4aGVF8OrzMkzqtYSKyoQuU2jtpPi4lmABpe5X4=",
"owner": "nixos",
"repo": "nixpkgs",
-
"rev": "6af28b834daca767a7ef99f8a7defa957d0ade6f",
+
"rev": "02f2af8c8a8c3b2c05028936a1e84daefa1171d4",
"type": "github"
},
"original": {
···
"opam2json": "opam2json"
},
"locked": {
-
"lastModified": 1732617437,
-
"narHash": "sha256-jj25fziYrES8Ix6HkfSiLzrN6MZjiwlHUxFSIuLRjgE=",
+
"lastModified": 1741156005,
+
"narHash": "sha256-JBPvXe5g1V2xpmPVMlf5CP5+T1E+TCK73lqeqV89EJE=",
"owner": "tweag",
"repo": "opam-nix",
-
"rev": "ea8b9cb81fe94e1fc45c6376fcff15f17319c445",
+
"rev": "e71936b31658f0b039a7d26b0c9c7a461d949ba4",
"type": "github"
},
"original": {
···
"opam-repository": {
"flake": false,
"locked": {
-
"lastModified": 1732612513,
-
"narHash": "sha256-kju4NWEQo4xTxnKeBIsmqnyxIcCg6sNZYJ1FmG/gCDw=",
+
"lastModified": 1740730647,
+
"narHash": "sha256-6veU2WjUGcWDAzLDjoAI1L6GWZd0KIUq19sHcbJS+u8=",
"owner": "ocaml",
"repo": "opam-repository",
-
"rev": "3d52b66b04788999a23f22f0d59c2dfc831c4f32",
+
"rev": "f1f75fef5fbf1e8bd1cc9544e50b89ba59f625e2",
"type": "github"
},
"original": {
···
"agenix": "agenix",
"alec-website": "alec-website",
"deploy-rs": "deploy-rs",
+
"disko": "disko",
"eilean": "eilean",
"eon": "eon",
"fn06-website": "fn06-website",
···
},
"locked": {
-
"lastModified": 1742406297,
-
"narHash": "sha256-cgvmt451qgo44nLYdYkxs02btGyCROj9esDzZRRRU10=",
-
"owner": "RyanGibb",
-
"repo": "tangled",
-
"rev": "396ea88e0c5e7e50de3bc77a3fb72bcb19b64e85",
-
"type": "github"
+
"lastModified": 1743620557,
+
"narHash": "sha256-w7a9Qn/IUdCe+gk5cMvSUS+YKItK2iTiu2Qcq49a+zU=",
+
"ref": "refs/heads/master",
+
"rev": "19ee94f42ab259c218762e6f0ed87952f80b5162",
+
"revCount": 420,
+
"type": "git",
+
"url": "https://tangled.sh/@tangled.sh/core"
},
"original": {
-
"owner": "RyanGibb",
-
"repo": "tangled",
-
"type": "github"
+
"type": "git",
+
"url": "https://tangled.sh/@tangled.sh/core"
},
"timewall": {
···
"rust-overlay": "rust-overlay"
},
"locked": {
-
"lastModified": 1740819101,
-
"narHash": "sha256-E2YADfdQt3q4QWU5ieftfoJ+tQnFxIDvn/T8b4CNlFk=",
+
"lastModified": 1743524557,
+
"narHash": "sha256-0rNcLtKWbjI0VqlusrqPMcpPgdkkZGkOIt9s3CnsCao=",
"owner": "bcyran",
"repo": "timewall",
-
"rev": "9f2c12b3ee55b7fe7cc24e83ec283248906872b1",
+
"rev": "789befef40bf0d45e48285f17f512b41924cfeb7",
"type": "github"
},
"original": {
+4 -2
flake.nix
···
nix-rpi5.url = "gitlab:vriska/nix-rpi5?ref=main";
nur.url = "github:nix-community/NUR/e9e77b7985ef9bdeca12a38523c63d47555cc89b";
timewall.url = "github:bcyran/timewall/";
-
tangled.url = "github:RyanGibb/tangled/";
+
tangled.url = "git+https://tangled.sh/@tangled.sh/core";
+
disko.url = "github:nix-community/disko";
# deduplicate flake inputs
eilean.inputs.nixpkgs.follows = "nixpkgs";
···
nur.inputs.nixpkgs.follows = "nixpkgs";
timewall.inputs.nixpkgs.follows = "nixpkgs";
tangled.inputs.nixpkgs.follows = "nixpkgs";
+
disko.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
···
(
{ config, ... }:
{
-
networking.hostName = "${host}";
+
networking.hostName = host-nixpkgs.lib.mkDefault "${host}";
# pin nix command's nixpkgs flake to the system flake to avoid unnecessary downloads
nix.registry.nixpkgs.flake = host-nixpkgs;
system.stateVersion = "24.05";
+4 -45
home/calendar.nix
···
options.custom.calendar.enable = lib.mkEnableOption "calendar";
config = lib.mkIf cfg.enable {
+
home.packages = with pkgs; [
+
vdirsyncer
+
];
+
programs = {
password-store.enable = true;
gpg.enable = true;
-
vdirsyncer.enable = true;
-
khal = {
-
enable = true;
-
locale = {
-
timeformat = "%I:%M%p";
-
dateformat = "%y-%m-%d";
-
longdateformat = "%Y-%m-%d";
-
datetimeformat = "%y-%m-%d %I:%M%p";
-
longdatetimeformat = "%Y-%m-%d %I:%M%p";
-
};
-
settings = {
-
default.default_calendar = "ryan_freumh_org";
-
keybindings.external_edit = "ctrl e";
-
keybindings.save = "ctrl s";
-
};
-
};
};
services = {
gpg-agent.enable = true;
-
};
-
-
accounts.calendar = {
-
basePath = "calendar";
-
accounts = {
-
"ryan_freumh_org" = {
-
khal = {
-
enable = true;
-
color = "white";
-
};
-
vdirsyncer = {
-
enable = true;
-
};
-
remote = {
-
type = "caldav";
-
url = "https://cal.freumh.org/ryan/f497c073-d027-2aa5-1e58-cbec1bf5a8c7/";
-
passwordCommand = [
-
"${pkgs.pass}/bin/pass"
-
"show"
-
"calendar/ryan@freumh.org"
-
];
-
userName = "ryan";
-
};
-
local = {
-
type = "filesystem";
-
fileExt = ".ics";
-
};
-
};
-
};
};
};
}
+1 -7
home/default.nix
···
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
-
set-window-option -g mode-keys vi
set-option -g mouse on
set-option -g set-titles on
···
# https://stackoverflow.com/questions/62182401/neovim-screen-lagging-when-switching-mode-from-insert-to-normal
# locking
set -s escape-time 0
-
set -g lock-command ${pkgs.vlock}/bin/vlock
-
set -g lock-after-time 0 # Seconds; 0 = never
-
bind L lock-session
# for .zprofile display environment starting https://github.com/tmux/tmux/issues/3483
set-option -g update-environment XDG_VTNR
# Allow clipboard with OSC-52 work
···
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel
# find
-
bind-key -r f run-shell tmux-sessionizer
+
bind-key -r f run-shell "tmux neww tmux-sessionizer"
# reload
bind-key r source-file ~/.config/tmux/tmux.conf
-
# kill unattached
-
bind-key K run-shell 'tmux ls | grep -v attached | cut -d: -f1 | xargs -I {} tmux kill-window -t {}'
'';
};
-1
home/gui/sway.nix
···
export MOZ_ENABLE_WAYLAND=1
export MOZ_DBUS_REMOTE=1
export QT_STYLE_OVERRIDE="Fusion"
-
export WLR_NO_HARDWARE_CURSORS=1
export NIXOS_OZONE_WL=1
# for intellij
+4
home/zsh.cfg
···
+
+
# https://www.emacswiki.org/emacs/TrampMode#h5o-9
+
[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
setopt autocd nomatch notify interactive_comments inc_append_history
unsetopt beep extendedglob share_history
···
source /run/current-system/sw/share/bash-completion/completions/ledger.bash
fi
+
eval $(opam env)
+4 -1
hosts/gecko/default.nix
···
emacs.enable = true;
};
home.sessionVariables = {
-
LEDGER_FILE = "~/vault/finances.ledger";
+
LEDGER_FILE = "$HOME/vault/finances.ledger";
+
CALENDAR_DIR = "$HOME/calendar";
};
programs.git.extraConfig.commit.gpgSign = true;
programs.direnv = {
···
# other
ltex-ls
typst-lsp
+
+
overlay-unstable.claude-code
];
services.gnome.gnome-keyring.enable = true;
+31
hosts/hippo/default.nix
···
+
{
+
pkgs,
+
config,
+
lib,
+
disko,
+
...
+
}:
+
+
{
+
imports = [
+
./hardware-configuration.nix
+
disko.nixosModules.disko
+
./disk-config.nix
+
];
+
+
custom = {
+
enable = true;
+
autoUpgrade.enable = true;
+
homeManager.enable = true;
+
};
+
+
home-manager.users.${config.custom.username}.config.custom.machineColour = "blue";
+
+
networking.hostName = "iphito";
+
+
services.openssh.openFirewall = true;
+
+
users.users.root.openssh.authorizedKeys.keys = [
+
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA7UrJmBFWR3c7jVzpoyg4dJjON9c7t9bT9acfrj6G7i mtelvers"
+
];
+
}
+33
hosts/hippo/disk-config.nix
···
+
{ lib, ... }:
+
+
{
+
disko.devices = {
+
disk.disk1 = {
+
device = lib.mkDefault "/dev/sda";
+
type = "disk";
+
content = {
+
type = "gpt";
+
partitions = {
+
ESP = {
+
type = "EF00";
+
size = "500M";
+
content = {
+
type = "filesystem";
+
format = "vfat";
+
mountpoint = "/boot";
+
mountOptions = [ "umask=0077" ];
+
};
+
};
+
root = {
+
size = "100%";
+
content = {
+
type = "filesystem";
+
format = "ext4";
+
mountpoint = "/";
+
};
+
};
+
};
+
};
+
};
+
};
+
}
+40
hosts/hippo/hardware-configuration.nix
···
+
{
+
config,
+
lib,
+
pkgs,
+
modulesPath,
+
...
+
}:
+
+
{
+
imports = [
+
(modulesPath + "/installer/scan/not-detected.nix")
+
];
+
+
boot.initrd.availableKernelModules = [
+
"megaraid_sas"
+
"xhci_pci"
+
"nvme"
+
"ahci"
+
"sd_mod"
+
];
+
boot.initrd.kernelModules = [ "dm-snapshot" ];
+
boot.kernelModules = [ "kvm-amd" ];
+
boot.extraModulePackages = [ ];
+
+
networking.useDHCP = lib.mkDefault true;
+
+
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+
+
boot.loader.grub = {
+
enable = true;
+
device = "nodev";
+
efiSupport = true;
+
efiInstallAsRemovable = true;
+
};
+
+
boot.kernelParams = [
+
"console=ttyS1,115200n8"
+
];
+
}
+38 -2
hosts/owl/services.nix
···
"capybara.fn06.org"
"shrew.freumh.org"
"knot.freumh.org"
+
"enki.freumh.org"
];
# VPN
···
proxyWebsockets = true;
};
};
-
+
+
services.nginx.virtualHosts."enki.freumh.org" = {
+
forceSSL = true;
+
locations."/" = {
+
proxyPass = ''
+
http://localhost:8000
+
'';
+
proxyWebsockets = true;
+
extraConfig = ''
+
# SSE-specific settings
+
proxy_buffering off;
+
proxy_read_timeout 3600s;
+
proxy_send_timeout 3600s;
+
proxy_connect_timeout 60s;
+
+
# Forward headers
+
proxy_set_header Connection "";
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+
proxy_set_header X-Forwarded-Proto $scheme;
+
proxy_set_header Host $host;
+
'';
+
};
+
};
+
# minecraft server
services.minecraft-server = {
enable = true;
···
name = "knot";
type = "CNAME";
value = "vps";
+
}
+
+
{
+
name = "enki";
+
type = "CNAME";
+
value = "vps";
+
}
+
+
{
+
name = "hippo";
+
type = "A";
+
value = "128.232.124.251";
}
# generate with
···
];
};
};
-
}
+
}