diff options
| author | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-01-18 08:10:20 -0600 |
|---|---|---|
| committer | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-01-18 08:10:20 -0600 |
| commit | d6c4bd6d87d31a2c688fb2fcfdb0cb15d8f9163d (patch) | |
| tree | 07f85b8fac540f7625f90b10ee500a1bc8116ac3 | |
| parent | ed2550a41c8429a1d2fe897deb878717c2ebc3d1 (diff) | |
| parent | 43af7f28b28021932b318964a953463d8dd79372 (diff) | |
Merge branch 'main' into wg
48 files changed, 977 insertions, 963 deletions
@@ -1,37 +1,43 @@ -```sh -nixos-rebuild build-vm --flake .#collinux -``` +# `bluedragon1221/nixos` +Cool things: +1. Using [hjem](https://github.com/feel-co/hjem) over [home-manager](https://github.com/nix-community/home-manager) +2. Features an [awesome tmux configuration](https://github.com/bluedragon1221/tmux-tsunami) +3. Deployments over ssh using [deploy-rs](https://github.com/serokell/deploy-rs) +4. Automatic secret decryption with ssh keys using [agenix](https://github.com/ryantm/agenix) +5. Fully declarative self-hosted services, including: + - [Headscale](./modules/services/nixos/selfhost/headscale.nix) + - [AdGuard Home](./modules/services/nixos/selfhost/adguard.nix) + - [Forgejo](./modules/services/nixos/selfhost/forgejo.nix) + - [Navidrome](./modules/services/nixos/selfhost/navidrome.nix) + - ... all with configurable [caddy-tailscale](https://github.com/tailscale/caddy-tailscale) integration +6. [Homogenous modules](./docs/homogenous_modules.md) +# Hosts +## [Mercury](./hosts/mercury) +- Device: Lenovo Thinkpad X1 Carbon Gen 6 +- OS: NixOS +- DE/Compositor: Sway (or Niri, I can't decide) +Goes everywhere with me. Used for programming, school, and browsing the web -A host config has many parts -- user environment config (home-manager) -- system config -- hardware config (facter) - - disks config (disko or manual) +## [Jupiter](./hosts/jupiter) +- Device: HP ENVY Desktop +- OS: NixOS (dual booted with Windows 11 LTSC IoT Enterprise) +- DE/Compositor: GNOME +Used for heavier tasks, like gaming and music production -## Dream hosts/config.nix -```nix -collinux = { - user = { - fullName = ""; - name = ""; - email = ""; - password = ""; - }; +## [Ganymede](./hosts/ganymede) +- Device: Lenovo Yoga 730 (broken screen) +- OS: NixOS +- DE/Compositor: none +Hosts my family's webserver, personal Headscale instance, and a few other self-hosted services over my tailnet - theme = ""; +## Terra +- Device: Samsung S20 Ultra +- OS: Android +My phone. Used for communication, reading Hacker News, and whatever else. - desktop = { - programs = {}; - }; - - terminal = { - programs = {}; - }; - - boot = {}; - - extraNixosModules = []; - extraHomeModules = []; -}; -``` +## Io +- Device: Raspberry PI Zero 2 W +- OS: Alpine Linux +- DE/Compositor: none +Low-power device used as a Forgejo actions builder diff --git a/docs/homogenous_modules.md b/docs/homogenous_modules.md new file mode 100644 index 0000000..aa2cbda --- /dev/null +++ b/docs/homogenous_modules.md @@ -0,0 +1,87 @@ +# Homogenous Nix Modules: Why and How +In the creation of my nixos configuration, I came to a (possibly unique) issue: +many services that I wanted to configure required a "system" piece, and a "home" piece. + +For example, in configuring a shell, it makes sense to configure that shell as the default shell for the user in the same place. +However, in standard nixos configuration, you configure the actual shell with home-manager, and the default-ness with nixos. + +My solution to this was to create a new way of managing my nixos modules, which I coined "Homogenous Modules." + +The idea is as follows: each module contains three parts: +1. a shared `options.nix` file, +2. a nixos part, and +3. a home-manager part (or [Hjem](github.com/feel-co/hjem), in my case). + +The `options.nix` file contains _only_ the `options` section of a module. +The nixos part contains the `config` section of the module, as if it was a nixos module. +The home-manager part contains the `config` section of the module, as if it was a home-manager module. + +Now, `{imports = [./options.nix ./nixos.nix];}` is a valid nixos module, and +`{imports = [./options.nix ./home.nix];}` is a valid home-manager module. + +## Example +Let's implement that shell example from the start, from scratch. +We'll start with with the `options.nix`: +```nix +{lib, ...}: let + inherit (lib) mkOption mkEnableOption; +in { + options = { + collinux.shells = { + zsh = { + enable = mkEnableOption "the zsh shell and customizations to it"; + default = mkEnableOption "make zsh the default shell"; + }; + bash = { + enable = mkEnableOption "the bash shell and customizations to it"; + default = mkEnableOption "make bash the default shell"; + }; + }; + }; + config.assertions = [ + { + assertion = with collinux.shells; !(zsh.default && bash.default); + message = "You can only have one default shell!"; + } + ]; +} +``` + +Here, we define a simple configuration. + +In the nixos part, we'll set the default shell: +```nix +{pkgs, config, lib, ...}: let + cfg = config.collinux.shells; +in { + users.users."collin".shell = + if config.zsh.enable + then pkgs.zsh + else if config.bash.enable + then pkgs.bash + else null; +} +``` + +And in the home-manager part, we'll set some customization options: +```nix +{pkgs, config, lib, ...}: let + cfg = config.collinux.shells; + + shellAliases = { + ll = "ls -l"; + update = "home-manager switch"; + }; +in { + programs.zsh = { + enable = cfg.zsh.enable; + syntaxHighlighting.enable = true; + inherit shellAliases; + }; + + programs.bash = { + enable = cfg.bash.enable; + inherit shellAliases; + }; +} +``` @@ -23,13 +23,29 @@ "type": "github" } }, + "betterfox": { + "flake": false, + "locked": { + "lastModified": 1765663165, + "narHash": "sha256-zGpfQk2gY6ifxIk1fvCk5g5SIFo+o8RItmw3Yt3AeCg=", + "owner": "yokoffing", + "repo": "Betterfox", + "rev": "eee6e58b2b0ee10a59efb6586a5db07ae181d8c7", + "type": "github" + }, + "original": { + "owner": "yokoffing", + "repo": "Betterfox", + "type": "github" + } + }, "crane": { "locked": { - "lastModified": 1765739568, - "narHash": "sha256-gQYx35Of4UDKUjAYvmxjUEh/DdszYeTtT6MDin4loGE=", + "lastModified": 1767461147, + "narHash": "sha256-TH/xTeq/RI+DOzo+c+4F431eVuBpYVwQwBxzURe7kcI=", "owner": "ipetkov", "repo": "crane", - "rev": "67d2baff0f9f677af35db61b32b5df6863bcc075", + "rev": "7d59256814085fd9666a2ae3e774dc5ee216b630", "type": "github" }, "original": { @@ -105,11 +121,11 @@ "firefox-csshacks": { "flake": false, "locked": { - "lastModified": 1762974384, - "narHash": "sha256-aAwiI6+QWPQuEGdz0Ey57RFMakM7XuBYiUJuANxECgM=", + "lastModified": 1767805548, + "narHash": "sha256-XRDYJlnvaPFTRQSAfG5xgb7PpsGuLPcZS1pS263MyEs=", "owner": "MrOtherGuy", "repo": "firefox-csshacks", - "rev": "2f30a2283ba09c5934f474110a8be462482eb272", + "rev": "021da269f0a0b3da3fac9f14d04a2d51c2afd7dc", "type": "github" }, "original": { @@ -137,15 +153,15 @@ "flake-compat_2": { "flake": false, "locked": { - "lastModified": 1761588595, - "narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=", - "owner": "edolstra", + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "NixOS", "repo": "flake-compat", - "rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", "type": "github" }, "original": { - "owner": "edolstra", + "owner": "NixOS", "repo": "flake-compat", "type": "github" } @@ -174,17 +190,18 @@ }, "hjem": { "inputs": { + "nix-darwin": "nix-darwin", "nixpkgs": [ "nixpkgs" ], "smfh": "smfh" }, "locked": { - "lastModified": 1765522723, - "narHash": "sha256-/RSFdpON1oyd6Ha6ckOKcO8NiwZMO6tH3UCOq1r+zEE=", + "lastModified": 1767318528, + "narHash": "sha256-I2zxtEafZbFbqXe71rjqwVeTDv8SIVLaSzQd39SwfwM=", "owner": "feel-co", "repo": "hjem", - "rev": "85bdffaf424c027ac7f098d67854c10d384a63df", + "rev": "8539013044624a257e8da370069107aea148e985", "type": "github" }, "original": { @@ -201,11 +218,11 @@ ] }, "locked": { - "lastModified": 1766387499, - "narHash": "sha256-AjK3/UKDzeXFeYNLVBaJ3+HLE9he1g5UrlNd4/BM3eA=", + "lastModified": 1745494811, + "narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=", "owner": "nix-community", "repo": "home-manager", - "rev": "527ad07e6625302b648ed3b28c34b62a79bd103e", + "rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be", "type": "github" }, "original": { @@ -224,11 +241,11 @@ "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1766225539, - "narHash": "sha256-0Y6o3oUmQCxrzLIvZTcUAQCPEXAc+tU+N3ZjmzdrC28=", + "lastModified": 1767697030, + "narHash": "sha256-0iVZ99H3kR5h6Lhw8kDDuUc5C/k6iismeWgCS1qWTQ4=", "owner": "nix-community", "repo": "lanzaboote", - "rev": "14455220bef50f8df94f05e5763cdf51bc704acd", + "rev": "657469e8f036334db768daaf7732b1174676054b", "type": "github" }, "original": { @@ -237,6 +254,27 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "hjem", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1765065051, + "narHash": "sha256-b7W9WsvyMOkUScNxbzS45KEJp0iiqRPyJ1I3JBE+oEE=", + "owner": "nix-darwin", + "repo": "nix-darwin", + "rev": "7e22bf538aa3e0937effcb1cee73d5f1bcc26f79", + "type": "github" + }, + "original": { + "owner": "nix-darwin", + "repo": "nix-darwin", + "type": "github" + } + }, "nix-std": { "locked": { "lastModified": 1710870712, @@ -254,11 +292,11 @@ }, "nixos-facter-modules": { "locked": { - "lastModified": 1765442039, - "narHash": "sha256-k3lYQ+A1F7aTz8HnlU++bd9t/x/NP2A4v9+x6opcVg0=", + "lastModified": 1766558141, + "narHash": "sha256-Ud9v49ZPsoDBFuyJSQ2Mpw1ZgAH/aMwUwwzrVoetNus=", "owner": "numtide", "repo": "nixos-facter-modules", - "rev": "9dd775ee92de63f14edd021d59416e18ac2c00f1", + "rev": "e796d536e3d83de74267069e179dc620a608ed7d", "type": "github" }, "original": { @@ -269,11 +307,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1766070988, - "narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=", + "lastModified": 1767892417, + "narHash": "sha256-dhhvQY67aboBk8b0/u0XB6vwHdgbROZT3fJAjyNh5Ww=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c6245e83d836d0433170a16eb185cefe0572f8b8", + "rev": "3497aa5c9457a9d88d71fa93a4a8368816fbeeba", "type": "github" }, "original": { @@ -283,6 +321,21 @@ "type": "github" } }, + "nmd": { + "locked": { + "lastModified": 1759339018, + "narHash": "sha256-13x2gvgnnr3cJ5qp7zz7ZnUSrg0DF/sU9KiwZkML6J0=", + "owner": "gvolpe", + "repo": "nmd", + "rev": "5ecbe493e22de649e79c8e51dc5e92659940e081", + "type": "github" + }, + "original": { + "owner": "gvolpe", + "repo": "nmd", + "type": "github" + } + }, "pre-commit": { "inputs": { "flake-compat": "flake-compat_2", @@ -293,11 +346,11 @@ ] }, "locked": { - "lastModified": 1765464257, - "narHash": "sha256-dixPWKiHzh80PtD0aLuxYNQ0xP+843dfXG/yM3OzaYQ=", + "lastModified": 1767281941, + "narHash": "sha256-6MkqajPICgugsuZ92OMoQcgSHnD6sJHwk8AxvMcIgTE=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "09e45f2598e1a8499c3594fe11ec2943f34fe509", + "rev": "f0927703b7b1c8d97511c4116eb9b4ec6645a0fa", "type": "github" }, "original": { @@ -309,6 +362,7 @@ "root": { "inputs": { "agenix": "agenix", + "betterfox": "betterfox", "deploy-rs": "deploy-rs", "disko": "disko", "firefox-csshacks": "firefox-csshacks", @@ -316,6 +370,7 @@ "lanzaboote": "lanzaboote", "nixos-facter-modules": "nixos-facter-modules", "nixpkgs": "nixpkgs", + "nmd": "nmd", "tmux-tsunami": "tmux-tsunami" } }, @@ -328,11 +383,11 @@ ] }, "locked": { - "lastModified": 1759113356, - "narHash": "sha256-xm4kEUcV2jk6u15aHazFP4YsMwhq+PczA+Ul/4FDKWI=", + "lastModified": 1763347184, + "narHash": "sha256-6QH8hpCYJxifvyHEYg+Da0BotUn03BwLIvYo3JAxuqQ=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "be3b8843a2be2411500f6c052876119485e957a2", + "rev": "08895cce80433978d5bfd668efa41c5e24578cbd", "type": "github" }, "original": { @@ -349,11 +404,11 @@ ] }, "locked": { - "lastModified": 1765680428, - "narHash": "sha256-fyPmRof9SZeI14ChPk5rVPOm7ISiiGkwGCunkhM+eUg=", + "lastModified": 1767495280, + "narHash": "sha256-hEEgtE/RSRigw8xscchGymf/t1nluZwTfru4QF6O1CQ=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "eb3898d8ef143d4bf0f7f2229105fc51c7731b2f", + "rev": "cb24c5cc207ba8e9a4ce245eedd2d37c3a988bc1", "type": "github" }, "original": { @@ -372,11 +427,11 @@ "systems": "systems_3" }, "locked": { - "lastModified": 1760525934, - "narHash": "sha256-1HtxuA45R/jExzE9iuimuECHWbV2c+CBdJmr/RtluaI=", + "lastModified": 1763430012, + "narHash": "sha256-06G7pXUdpMnUqR0JWWvV7sA8oNGOZU1cSLqQS1GMf7Y=", "owner": "feel-co", "repo": "smfh", - "rev": "7123a00cc3c3e90ba703a37ca8d997be95c62d99", + "rev": "eddda76e3dd4c6deaea5f819f174fc16dbe70f90", "type": "github" }, "original": { @@ -438,11 +493,11 @@ ] }, "locked": { - "lastModified": 1764704796, - "narHash": "sha256-ul2+03ZvvSap1pPjWkHtan0juHzre6Qm6efCuGqENro=", + "lastModified": 1768326969, + "narHash": "sha256-Mwo6C1u4UcVEAZOJa/CUSDx3he4CAfAx1Ns8l+blj3I=", "owner": "bluedragon1221", "repo": "tmux-tsunami", - "rev": "89703f8732291e2373d485932952448b0e5ee475", + "rev": "f379f00fec4912b539d3659f7c74da7669785adb", "type": "github" }, "original": { @@ -37,10 +37,18 @@ url = "github:MrOtherGuy/firefox-csshacks"; flake = false; }; + betterfox = { + url = "github:yokoffing/Betterfox"; + flake = false; + }; + + nmd.url = "github:gvolpe/nmd"; }; outputs = inputs: let - inherit (import ./lib/nix-furnace/mkSystem.nix) mkNixosSystem; + inherit (import ./lib/nix-furnace/mkSystem.nix) mkNixosSystem genDocs; + + buildPkgs = import inputs.nixpkgs {system = "x86_64-linux";}; in rec { nixosConfigurations."mercury" = mkNixosSystem { inherit inputs; @@ -58,6 +66,12 @@ username = "collin"; }; + packages."x86_64-linux".docs = buildPkgs.callPackage genDocs { + inherit inputs; + pkgs = buildPkgs; + hostname = "mercury"; + }; + deploy.nodes."ganymede" = { hostname = "ganymede"; sshUser = "root"; diff --git a/hosts/ganymede/caddy-env.age b/hosts/ganymede/caddy-env.age index 79d7b91..ecfc05a 100644 --- a/hosts/ganymede/caddy-env.age +++ b/hosts/ganymede/caddy-env.age @@ -1,6 +1,7 @@ age-encryption.org/v1 --> ssh-ed25519 Jg4yWQ cVxgS8Sy6bB9lQVeDBQVhmCaD437YxPAZduSzFA6WHE -KV9ZrAEH3z8cT0IeaIfkqMYhU/4LS2St0ySK030Ie1c ---- pUeKTMwZf3FARqVLl9TARgItjcr1O82hUKaZ9YtjFRM -a_v1BRgʫ*+r֘0}ܨd`˟ϞJ<3hi1|Gjl3!7r 3Xp=d`71ݻѲh<Hdy;V˜NiGN^@`OnTyq>FW5/2̞?[HZ - Sd:FCGq%-#W~Wz_XF)ZS~MhCF!C)N*ٟ -R
\ No newline at end of file +-> ssh-ed25519 Jg4yWQ t4jtOOcuC4v735Yi4FzdDnvjQFNYVgzMluuH7H3oxx4 +qLKbZ3wA3kk7UXqwUJN2HH+6Wr3qgzINNwLx+dbgsIg +--- im4dvpbhdvB7fwa8QJ7clFZ+5aVIaXld/gPlhUalc14 +>u4BECQD:3kkKļc}}}mK)HM3v}ܣI9Ikxr1s?"8Д>J{uafϚ}.3Oa9m2-@C0b
X|]:9`WX1ba|W2=l]CwU&~"0! +6 +MFίp D˅+q
`-R6/L 4
\ No newline at end of file diff --git a/hosts/ganymede/caddy.nix b/hosts/ganymede/caddy.nix index b073f9a..6ad32cf 100644 --- a/hosts/ganymede/caddy.nix +++ b/hosts/ganymede/caddy.nix @@ -12,24 +12,16 @@ hash = "sha256-BQdm8p9eDGhRu6mKyX2FAUaKoU6Lv2A746Sey39T13I="; }); - extraConfig = '' - { - acme_dns porkbun { - api_key {env.PORKBUN_API_KEY} - api_secret_key {env.PORKBUN_API_SECRET_KEY} - } + globalConfig = '' + acme_dns porkbun { + api_key {env.PORKBUN_API_KEY} + api_secret_key {env.PORKBUN_API_SECRET_KEY} } ''; - virtualHosts."https://web.tail7cca06.ts.net".extraConfig = '' - bind tailscale/web - root * /var/www/williams_web + virtualHosts."https://williamsfam.us.com".extraConfig = '' + root * /var/www file_server - - handle_path /papa_stories/* { - root * /var/www/papa_stories - file_server - } ''; }; } diff --git a/hosts/ganymede/config.nix b/hosts/ganymede/config.nix index 297d7c6..f6b3b74 100644 --- a/hosts/ganymede/config.nix +++ b/hosts/ganymede/config.nix @@ -1,10 +1,17 @@ -{config, ...}: { +{config, ...}: let + tailscaleIP = "100.100.218.182"; +in { collinux = { user.name = "collin"; secrets = { - "williams-psk".file = ./williams-psk.age; + "williams-psk" = { + file = ./williams-psk.age; + owner = "wpa_supplicant"; + }; + "caddy-env".file = ./caddy-env.age; + "tsnsrv-authkey".file = ./tsnsrv-authkey.age; "wg-key".file = ./ganymede-wg-key.age; }; @@ -52,17 +59,33 @@ gateway = "192.168.50.1"; }; }; - tailscale.enable = true; - sshd.enable = true; + tailscale = { + enable = true; + tailnet = "collinux.tailnet"; + }; + sshd = { + enable = true; + bind_host = "0.0.0.0"; + }; }; selfhost = { - adguard.enable = true; - forgejo.enable = true; caddy = { enable = true; envFile = config.collinux.secrets."caddy-env".path; }; + + forgejo = { + enable = true; + bind_host = tailscaleIP; + root_url = "ganymede.collinux.tailnet:8010"; + }; + + headscale = { + enable = true; + root_url = "headscale.williamsfam.us.com"; + caddy.enable = true; + }; }; }; }; diff --git a/hosts/ganymede/minecraft.nix b/hosts/ganymede/minecraft.nix index cff5de2..c244868 100644 --- a/hosts/ganymede/minecraft.nix +++ b/hosts/ganymede/minecraft.nix @@ -1,6 +1,6 @@ {config, ...}: { networking.firewall.allowedUDPPorts = [19132]; - virtualisation.oci-containers.backend = "podman"; + virtualisation.oci-containers.backend = "docker"; virtualisation.oci-containers.containers."Minecraft" = { environment = { @@ -9,16 +9,14 @@ SERVER_NAME = "YServer"; TZ = config.time.timeZone; - VERSION = "1.21.81.2"; - CONTENT_LOG_FILE_ENABLED = "true"; + VERSION = "1.21.131.1"; + CONTENT_LOG_FILE_ENABLED = "false"; ALLOW_CHEATS = "false"; DIFFICULTY = "1"; }; image = "itzg/minecraft-bedrock-server"; ports = ["0.0.0.0:19132:19132/udp"]; - volumes = ["/srv/minecraft/:/data"]; - - podman.sdnotify = "conmon"; # avoid nasty errors about healthcheck (idk, the service runs fine) + volumes = ["/var/lib/minecraft/:/data"]; }; } diff --git a/hosts/ganymede/nixos.nix b/hosts/ganymede/nixos.nix index 863032f..9dc6dec 100644 --- a/hosts/ganymede/nixos.nix +++ b/hosts/ganymede/nixos.nix @@ -1,8 +1,15 @@ -{inputs, ...}: { +{ + config, + inputs, + ... +}: { imports = [ inputs.disko.nixosModules.disko + inputs.tsnsrv.nixosModules.default ./disks.nix + ./minecraft.nix + ./iwlwifi.nix ./caddy.nix ]; @@ -15,6 +22,6 @@ networkConfig.DHCP = "yes"; }; - nixpkgs.hostPlatform = "x86_64-linux"; - system.stateVersion = "25.05"; + # i broke something and this fixes it + environment.etc."systemd/resolved.conf.d/10-dns.conf".text = config.environment.etc."systemd/resolved.conf".text; } diff --git a/hosts/ganymede/tsnsrv-authkey.age b/hosts/ganymede/tsnsrv-authkey.age new file mode 100644 index 0000000..d0e6eb1 --- /dev/null +++ b/hosts/ganymede/tsnsrv-authkey.age @@ -0,0 +1,7 @@ +age-encryption.org/v1 +-> ssh-ed25519 Jg4yWQ NYO6CUksU6appmdib7CER3YYbcKoyn0wmB4YGTCeTE0 +tizx14UdvQftYrkDa3iXQYDp6JPWHfjDmFwjr11FBxQ +-> ssh-ed25519 azBilg 3PYXHVdB2y2Y42ijOiv8LJ9c4WmeB5ivEPcehfS3Wns +tP/xCHzd31DydF5aCn1tJGudanXLl+DIPod7KFtglXQ +--- nbch7DRt1CYKBqzE9CeUIJgTMKIUCEA/CXVQZjkywfI +~}H <42)U{QK3%G^FW3GJy
1
\ No newline at end of file diff --git a/hosts/jupiter/config.nix b/hosts/jupiter/config.nix index cd4df81..806785e 100644 --- a/hosts/jupiter/config.nix +++ b/hosts/jupiter/config.nix @@ -76,10 +76,7 @@ sshd.enable = true; }; - audio = { - enable = true; - pulse.enable = true; - }; + audio.enable = true; bluetooth.enable = true; }; diff --git a/hosts/jupiter/nixos.nix b/hosts/jupiter/nixos.nix index e39328a..80ab0f4 100644 --- a/hosts/jupiter/nixos.nix +++ b/hosts/jupiter/nixos.nix @@ -1,21 +1,8 @@ -{ - inputs, - pkgs, - ... -}: { +{inputs, ...}: { imports = [ ./disks.nix inputs.nixos-facter-modules.nixosModules.facter ]; - boot.blacklistedKernelModules = ["snd_seq_dummy"]; - - systemd.network.wait-online.enable = false; # fix for weird wifi issue - - fonts.packages = [pkgs.nerd-fonts.iosevka]; - facter.reportPath = ./facter.json; - time.timeZone = "America/Chicago"; - nixpkgs.hostPlatform = "x86_64-linux"; - system.stateVersion = "25.05"; } diff --git a/hosts/mercury/config.nix b/hosts/mercury/config.nix index 590698a..f996be9 100644 --- a/hosts/mercury/config.nix +++ b/hosts/mercury/config.nix @@ -23,14 +23,20 @@ }; desktop = { - wallpaper = ./wallpaper.jpg; - - greetd.enable = true; + wallpaper = ./wallpapers/abstract-swirls.jpg; + gtk.enable = true; + greetd = { + enable = true; + autologin.enable = true; + }; wm = { sway.enable = true; - components.fuzzel.enable = true; - components.dunst.enable = true; + + components = { + fuzzel.enable = true; + dunst.enable = true; + }; }; programs = { @@ -59,26 +65,25 @@ shells.bash.enable = true; # for nix-shells programs = { - lazygit.enable = true; starship.enable = true; - fzf.enable = true; bat.enable = true; eza.enable = true; + helix = { + enable = true; + hardMode = true; + }; + tmux.enable = true; + + lazygit.enable = true; + nh.enable = true; git = { enable = true; userName = "Collin Williams"; userEmail = "96917990+bluedragon1221@users.noreply.github.com"; installKey = true; }; - - nh.enable = true; - - helix = { - enable = true; - hardMode = true; - }; }; }; diff --git a/hosts/mercury/facter.json b/hosts/mercury/facter.json index 17aa2a1..cd802f7 100644 --- a/hosts/mercury/facter.json +++ b/hosts/mercury/facter.json @@ -23,8 +23,8 @@ }, "bluetooth": [ { - "index": 42, - "attached_to": 44, + "index": 41, + "attached_to": 43, "class_list": [ "usb", "bluetooth" @@ -107,8 +107,8 @@ "module_alias": "usb:v8087p0A2Bd0010dcE0dsc01dp01icE0isc01ip01in00" }, { - "index": 47, - "attached_to": 44, + "index": 45, + "attached_to": 43, "class_list": [ "usb", "bluetooth" @@ -247,26 +247,21 @@ "model": "Intel PCI bridge", "sysfs_id": "/devices/pci0000:00/0000:00:1c.0", "sysfs_bus_id": "0000:00:1c.0", - "resources": [ - { - "type": "irq", - "base": 120, - "triggered": 0, - "enabled": true - } - ], "detail": { "function": 0, "command": 1031, "header_type": 1, "secondary_bus": 2, - "irq": 120, "prog_if": 0 }, "driver": "pcieport", + "driver_module": "pcieportdrv", "drivers": [ "pcieport" ], + "driver_modules": [ + "pcieportdrv" + ], "module_alias": "pci:v00008086d00009D10sv000017AAsd0000225Cbc06sc04i00" }, { @@ -324,7 +319,6 @@ "command": 7, "header_type": 0, "secondary_bus": 0, - "irq": 0, "prog_if": 0 }, "module_alias": "pci:v00008086d00009D4Esv000017AAsd0000225Cbc06sc01i00" @@ -384,26 +378,21 @@ "model": "Intel PCI bridge", "sysfs_id": "/devices/pci0000:00/0000:00:1d.0/0000:05:00.0/0000:06:01.0", "sysfs_bus_id": "0000:06:01.0", - "resources": [ - { - "type": "irq", - "base": 124, - "triggered": 0, - "enabled": true - } - ], "detail": { "function": 0, "command": 1031, "header_type": 1, "secondary_bus": 8, - "irq": 124, "prog_if": 0 }, "driver": "pcieport", + "driver_module": "pcieportdrv", "drivers": [ "pcieport" ], + "driver_modules": [ + "pcieportdrv" + ], "module_alias": "pci:v00008086d000015D3sv00002222sd00001111bc06sc04i00" }, { @@ -461,26 +450,21 @@ "model": "Intel PCI bridge", "sysfs_id": "/devices/pci0000:00/0000:00:1d.0/0000:05:00.0/0000:06:04.0", "sysfs_bus_id": "0000:06:04.0", - "resources": [ - { - "type": "irq", - "base": 126, - "triggered": 0, - "enabled": true - } - ], "detail": { "function": 0, "command": 1031, "header_type": 1, "secondary_bus": 60, - "irq": 126, "prog_if": 0 }, "driver": "pcieport", + "driver_module": "pcieportdrv", "drivers": [ "pcieport" ], + "driver_modules": [ + "pcieportdrv" + ], "module_alias": "pci:v00008086d000015D3sv00002222sd00001111bc06sc04i00" }, { @@ -538,7 +522,6 @@ "command": 6, "header_type": 0, "secondary_bus": 0, - "irq": 0, "prog_if": 0 }, "driver": "skl_uncore", @@ -606,26 +589,21 @@ "model": "Intel PCI bridge", "sysfs_id": "/devices/pci0000:00/0000:00:1d.0/0000:05:00.0/0000:06:00.0", "sysfs_bus_id": "0000:06:00.0", - "resources": [ - { - "type": "irq", - "base": 123, - "triggered": 0, - "enabled": true - } - ], "detail": { "function": 0, "command": 1030, "header_type": 1, "secondary_bus": 7, - "irq": 123, "prog_if": 0 }, "driver": "pcieport", + "driver_module": "pcieportdrv", "drivers": [ "pcieport" ], + "driver_modules": [ + "pcieportdrv" + ], "module_alias": "pci:v00008086d000015D3sv00002222sd00001111bc06sc04i00" }, { @@ -683,26 +661,21 @@ "model": "Intel PCI bridge", "sysfs_id": "/devices/pci0000:00/0000:00:1d.0/0000:05:00.0", "sysfs_bus_id": "0000:05:00.0", - "resources": [ - { - "type": "irq", - "base": 16, - "triggered": 0, - "enabled": true - } - ], "detail": { "function": 0, "command": 7, "header_type": 1, "secondary_bus": 6, - "irq": 16, "prog_if": 0 }, "driver": "pcieport", + "driver_module": "pcieportdrv", "drivers": [ "pcieport" ], + "driver_modules": [ + "pcieportdrv" + ], "module_alias": "pci:v00008086d000015D3sv00002222sd00001111bc06sc04i00" }, { @@ -760,26 +733,21 @@ "model": "Intel PCI bridge", "sysfs_id": "/devices/pci0000:00/0000:00:1d.0", "sysfs_bus_id": "0000:00:1d.0", - "resources": [ - { - "type": "irq", - "base": 122, - "triggered": 0, - "enabled": true - } - ], "detail": { "function": 0, "command": 1031, "header_type": 1, "secondary_bus": 5, - "irq": 122, "prog_if": 0 }, "driver": "pcieport", + "driver_module": "pcieportdrv", "drivers": [ "pcieport" ], + "driver_modules": [ + "pcieportdrv" + ], "module_alias": "pci:v00008086d00009D18sv000017AAsd0000225Cbc06sc04i00" }, { @@ -837,26 +805,21 @@ "model": "Intel PCI bridge", "sysfs_id": "/devices/pci0000:00/0000:00:1c.4", "sysfs_bus_id": "0000:00:1c.4", - "resources": [ - { - "type": "irq", - "base": 121, - "triggered": 0, - "enabled": true - } - ], "detail": { "function": 4, "command": 1031, "header_type": 1, "secondary_bus": 4, - "irq": 121, "prog_if": 0 }, "driver": "pcieport", + "driver_module": "pcieportdrv", "drivers": [ "pcieport" ], + "driver_modules": [ + "pcieportdrv" + ], "module_alias": "pci:v00008086d00009D14sv000017AAsd0000225Cbc06sc04i00" }, { @@ -914,33 +877,28 @@ "model": "Intel PCI bridge", "sysfs_id": "/devices/pci0000:00/0000:00:1d.0/0000:05:00.0/0000:06:02.0", "sysfs_bus_id": "0000:06:02.0", - "resources": [ - { - "type": "irq", - "base": 125, - "triggered": 0, - "enabled": true - } - ], "detail": { "function": 0, "command": 1030, "header_type": 1, "secondary_bus": 59, - "irq": 125, "prog_if": 0 }, "driver": "pcieport", + "driver_module": "pcieportdrv", "drivers": [ "pcieport" ], + "driver_modules": [ + "pcieportdrv" + ], "module_alias": "pci:v00008086d000015D3sv00002222sd00001111bc06sc04i00" } ], "camera": [ { - "index": 40, - "attached_to": 44, + "index": 39, + "attached_to": 43, "class_list": [ "camera", "usb" @@ -1040,8 +998,8 @@ "module_alias": "usb:v5986p2115d5420dcEFdsc02dp01ic0Eisc02ip00in01" }, { - "index": 46, - "attached_to": 44, + "index": 44, + "attached_to": 43, "class_list": [ "camera", "usb" @@ -1145,6 +1103,7 @@ { "architecture": "x86_64", "vendor_name": "GenuineIntel", + "model_name": "Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz", "family": 6, "model": 142, "stepping": 10, @@ -1279,23 +1238,28 @@ "srbds", "mmio_stale_data", "retbleed", - "gds" + "gds", + "vmscape" + ], + "power_management": [ + "" ], "bogo": 3600, "cache": 6144, "units": 16, + "page_size": 4096, "physical_id": 0, "siblings": 8, "cores": 4, - "fpu": true, - "fpu_exception": true, + "fpu": false, + "fpu_exception": false, "cpuid_level": 22, "write_protect": false, "clflush_size": 64, "cache_alignment": 64, "address_sizes": { - "physical": 39, - "virtual": 48 + "physical": "0x27", + "virtual": "0x30" } } ], @@ -1349,13 +1313,6 @@ "sysfs_id": "/class/block/nvme0n1", "sysfs_bus_id": "nvme0", "sysfs_device_link": "/devices/pci0000:00/0000:00:1c.4/0000:04:00.0/nvme/nvme0", - "unix_device_name": "/dev/nvme0n1", - "unix_device_number": { - "type": 98, - "major": 259, - "minor": 0, - "range": 0 - }, "unix_device_names": [ "/dev/disk/by-id/nvme-LENSE20256GMSP34MEAT2TA_1204748913815", "/dev/disk/by-id/nvme-LENSE20256GMSP34MEAT2TA_1204748913815_1", @@ -1369,7 +1326,7 @@ "cylinders": 244198, "heads": 64, "sectors": 32, - "size": 0, + "size": "0x0", "geo_type": "logical" }, { @@ -1390,22 +1347,11 @@ }, { "index": 38, - "attached_to": 33, + "attached_to": 0, "class_list": [ "disk", - "usb", - "scsi", "block_device" ], - "bus_type": { - "hex": "0084", - "name": "SCSI", - "value": 132 - }, - "slot": { - "bus": 0, - "number": 0 - }, "base_class": { "hex": "0106", "name": "Mass Storage Device", @@ -1416,67 +1362,21 @@ "name": "Disk", "value": 0 }, - "vendor": { - "hex": "0bda", - "name": "Generic-", - "value": 3034 - }, - "device": { - "hex": "0328", - "name": "SD/MMC CRW", - "value": 808 - }, - "revision": { - "hex": "0000", - "name": "1.00", - "value": 0 - }, - "serial": "2012062914345300", - "model": "Generic SD/MMC CRW", - "sysfs_id": "/class/block/sda", - "sysfs_bus_id": "0:0:0:0", - "sysfs_device_link": "/devices/pci0000:00/0000:00:14.0/usb2/2-3/2-3:1.0/host0/target0:0:0/0:0:0:0", - "unix_device_name": "/dev/sda", - "unix_device_number": { - "type": 98, - "major": 8, - "minor": 0, - "range": 16 - }, + "model": "Disk", + "sysfs_id": "/class/block/zram0", "unix_device_names": [ - "/dev/disk/by-id/usb-Generic-_SD_MMC_CRW_28203008282014000-0:0", - "/dev/disk/by-path/pci-0000:00:14.0-usb-0:3:1.0-scsi-0:0:0:0", - "/dev/disk/by-path/pci-0000:00:14.0-usbv3-0:3:1.0-scsi-0:0:0:0", - "/dev/sda" + "/dev/disk/by-label/zram0", + "/dev/disk/by-uuid/22842fef-9562-4ab2-9265-59e4f1f5d3f3", + "/dev/zram0" ], - "unix_device_name2": "/dev/sg0", - "unix_device_number2": { - "type": 99, - "major": 21, - "minor": 0, - "range": 1 - }, "resources": [ { - "type": "disk_geo", - "cylinders": 1024, - "heads": 0, - "sectors": 62, - "size": 0, - "geo_type": "logical" + "type": "size", + "unit": "sectors", + "value_1": 986368, + "value_2": 4096 } - ], - "driver": "usb-storage", - "driver_module": "usb_storage", - "drivers": [ - "sd", - "usb-storage" - ], - "driver_modules": [ - "sd_mod", - "usb_storage" - ], - "module_alias": "usb:v0BDAp0328d2908dc00dsc00dp00ic08isc06ip50in00" + ] } ], "graphics_card": [ @@ -1542,36 +1442,6 @@ "range": 64, "enabled": true, "access": "read_write" - }, - { - "type": "irq", - "base": 127, - "triggered": 0, - "enabled": true - }, - { - "type": "mem", - "base": 204547817472, - "range": 268435456, - "enabled": true, - "access": "read_only", - "prefetch": "no" - }, - { - "type": "mem", - "base": 206057766912, - "range": 16777216, - "enabled": true, - "access": "read_write", - "prefetch": "no" - }, - { - "type": "mem", - "base": 786432, - "range": 131072, - "enabled": false, - "access": "read_write", - "prefetch": "no" } ], "detail": { @@ -1579,7 +1449,6 @@ "command": 1031, "header_type": 0, "secondary_bus": 0, - "irq": 127, "prog_if": 0 }, "driver": "i915", @@ -1595,7 +1464,7 @@ ], "hub": [ { - "index": 41, + "index": 40, "attached_to": 12, "class_list": [ "usb", @@ -1617,7 +1486,7 @@ }, "vendor": { "hex": "1d6b", - "name": "Linux 6.12.23 xhci-hcd", + "name": "Linux 6.12.64 xhci-hcd", "value": 7531 }, "device": { @@ -1631,7 +1500,7 @@ "value": 0 }, "serial": "0000:3b:00.0", - "model": "Linux 6.12.23 xhci-hcd xHCI Host Controller", + "model": "Linux 6.12.64 xhci-hcd xHCI Host Controller", "sysfs_id": "/devices/pci0000:00/0000:00:1d.0/0000:05:00.0/0000:06:02.0/0000:3b:00.0/usb3/3-0:1.0", "sysfs_bus_id": "3-0:1.0", "resources": [ @@ -1672,13 +1541,17 @@ }, "hotplug": "usb", "driver": "hub", + "driver_module": "usbcore", "drivers": [ "hub" ], + "driver_modules": [ + "usbcore" + ], "module_alias": "usb:v1D6Bp0002d0612dc09dsc00dp01ic09isc00ip00in00" }, { - "index": 43, + "index": 42, "attached_to": 12, "class_list": [ "usb", @@ -1700,7 +1573,7 @@ }, "vendor": { "hex": "1d6b", - "name": "Linux 6.12.23 xhci-hcd", + "name": "Linux 6.12.64 xhci-hcd", "value": 7531 }, "device": { @@ -1714,7 +1587,7 @@ "value": 0 }, "serial": "0000:3b:00.0", - "model": "Linux 6.12.23 xhci-hcd xHCI Host Controller", + "model": "Linux 6.12.64 xhci-hcd xHCI Host Controller", "sysfs_id": "/devices/pci0000:00/0000:00:1d.0/0000:05:00.0/0000:06:02.0/0000:3b:00.0/usb4/4-0:1.0", "sysfs_bus_id": "4-0:1.0", "detail": { @@ -1745,13 +1618,17 @@ }, "hotplug": "usb", "driver": "hub", + "driver_module": "usbcore", "drivers": [ "hub" ], + "driver_modules": [ + "usbcore" + ], "module_alias": "usb:v1D6Bp0003d0612dc09dsc00dp03ic09isc00ip00in00" }, { - "index": 44, + "index": 43, "attached_to": 33, "class_list": [ "usb", @@ -1773,7 +1650,7 @@ }, "vendor": { "hex": "1d6b", - "name": "Linux 6.12.23 xhci-hcd", + "name": "Linux 6.12.64 xhci-hcd", "value": 7531 }, "device": { @@ -1787,7 +1664,7 @@ "value": 0 }, "serial": "0000:00:14.0", - "model": "Linux 6.12.23 xhci-hcd xHCI Host Controller", + "model": "Linux 6.12.64 xhci-hcd xHCI Host Controller", "sysfs_id": "/devices/pci0000:00/0000:00:14.0/usb1/1-0:1.0", "sysfs_bus_id": "1-0:1.0", "resources": [ @@ -1828,13 +1705,17 @@ }, "hotplug": "usb", "driver": "hub", + "driver_module": "usbcore", "drivers": [ "hub" ], + "driver_modules": [ + "usbcore" + ], "module_alias": "usb:v1D6Bp0002d0612dc09dsc00dp01ic09isc00ip00in00" }, { - "index": 48, + "index": 46, "attached_to": 33, "class_list": [ "usb", @@ -1856,7 +1737,7 @@ }, "vendor": { "hex": "1d6b", - "name": "Linux 6.12.23 xhci-hcd", + "name": "Linux 6.12.64 xhci-hcd", "value": 7531 }, "device": { @@ -1870,7 +1751,7 @@ "value": 0 }, "serial": "0000:00:14.0", - "model": "Linux 6.12.23 xhci-hcd xHCI Host Controller", + "model": "Linux 6.12.64 xhci-hcd xHCI Host Controller", "sysfs_id": "/devices/pci0000:00/0000:00:14.0/usb2/2-0:1.0", "sysfs_bus_id": "2-0:1.0", "detail": { @@ -1901,9 +1782,13 @@ }, "hotplug": "usb", "driver": "hub", + "driver_module": "usbcore", "drivers": [ "hub" ], + "driver_modules": [ + "usbcore" + ], "module_alias": "usb:v1D6Bp0003d0612dc09dsc00dp03ic09isc00ip00in00" } ], @@ -1927,14 +1812,6 @@ "model": "Main Memory", "resources": [ { - "type": "mem", - "base": 0, - "range": 8080396288, - "enabled": true, - "access": "read_write", - "prefetch": "unknown" - }, - { "type": "phys_mem", "range": 8053063680 } @@ -2021,7 +1898,7 @@ ], "mouse": [ { - "index": 52, + "index": 51, "attached_to": 0, "bus_type": { "hex": "0008", @@ -2046,7 +1923,7 @@ "hex": "0000", "value": 0 }, - "sysfs_id": "/devices/pci0000:00/0000:00:1f.4/i2c-6/6-002c/rmi4-00/input/input9", + "sysfs_id": "/devices/pci0000:00/0000:00:1f.4/i2c-6/6-002c/rmi4-00/input/input14", "unix_device_names": [ "/dev/input/event12", "/dev/input/ + handler" @@ -2106,32 +1983,17 @@ "model": "Intel WLAN controller", "sysfs_id": "/devices/pci0000:00/0000:00:1c.0/0000:02:00.0", "sysfs_bus_id": "0000:02:00.0", - "unix_device_name": "wlp2s0", "unix_device_names": [ - "wlp2s0" + "wlan0" ], "resources": [ { "type": "hwaddr", - "address": 51 - }, - { - "type": "irq", - "base": 171, - "triggered": 0, - "enabled": true - }, - { - "type": "mem", - "base": 3995074560, - "range": 8192, - "enabled": true, - "access": "read_write", - "prefetch": "no" + "address": 100 }, { "type": "phwaddr", - "address": 51 + "address": 100 }, { "type": "wlan", @@ -2222,7 +2084,6 @@ "command": 1030, "header_type": 0, "secondary_bus": 0, - "irq": 171, "prog_if": 0 }, "driver": "iwlwifi", @@ -2285,7 +2146,6 @@ "model": "Intel Ethernet controller", "sysfs_id": "/devices/pci0000:00/0000:00:1f.6", "sysfs_bus_id": "0000:00:1f.6", - "unix_device_name": "enp0s31f6", "unix_device_names": [ "enp0s31f6" ], @@ -2295,20 +2155,6 @@ "address": 56 }, { - "type": "irq", - "base": 170, - "triggered": 0, - "enabled": true - }, - { - "type": "mem", - "base": 3996123136, - "range": 131072, - "enabled": true, - "access": "read_write", - "prefetch": "no" - }, - { "type": "phwaddr", "address": 56 } @@ -2318,7 +2164,6 @@ "command": 1030, "header_type": 0, "secondary_bus": 0, - "irq": 170, "prog_if": 0 }, "driver": "e1000e", @@ -2334,8 +2179,8 @@ ], "network_interface": [ { - "index": 49, - "attached_to": 17, + "index": 47, + "attached_to": 29, "class_list": [ "network_interface" ], @@ -2350,34 +2195,33 @@ "value": 1 }, "model": "Ethernet network interface", - "sysfs_id": "/class/net/wlp2s0", - "sysfs_device_link": "/devices/pci0000:00/0000:00:1c.0/0000:02:00.0", - "unix_device_name": "wlp2s0", + "sysfs_id": "/class/net/enp0s31f6", + "sysfs_device_link": "/devices/pci0000:00/0000:00:1f.6", "unix_device_names": [ - "wlp2s0" + "enp0s31f6" ], "resources": [ { "type": "hwaddr", - "address": 51 + "address": 56 }, { "type": "phwaddr", - "address": 51 + "address": 56 } ], - "driver": "iwlwifi", - "driver_module": "iwlwifi", + "driver": "e1000e", + "driver_module": "e1000e", "drivers": [ - "iwlwifi" + "e1000e" ], "driver_modules": [ - "iwlwifi" + "e1000e" ] }, { - "index": 50, - "attached_to": 0, + "index": 49, + "attached_to": 17, "class_list": [ "network_interface" ], @@ -2387,20 +2231,38 @@ "value": 263 }, "sub_class": { - "hex": "0000", - "name": "Loopback", - "value": 0 + "hex": "000a", + "name": "WLAN", + "value": 10 }, - "model": "Loopback network interface", - "sysfs_id": "/class/net/lo", - "unix_device_name": "lo", + "model": "WLAN network interface", + "sysfs_id": "/class/net/wlan0", + "sysfs_device_link": "/devices/pci0000:00/0000:00:1c.0/0000:02:00.0", "unix_device_names": [ - "lo" + "wlan0" + ], + "resources": [ + { + "type": "hwaddr", + "address": 100 + }, + { + "type": "phwaddr", + "address": 100 + } + ], + "driver": "iwlwifi", + "driver_module": "iwlwifi", + "drivers": [ + "iwlwifi" + ], + "driver_modules": [ + "iwlwifi" ] }, { - "index": 51, - "attached_to": 29, + "index": 50, + "attached_to": 0, "class_list": [ "network_interface" ], @@ -2410,34 +2272,14 @@ "value": 263 }, "sub_class": { - "hex": "0001", - "name": "Ethernet", - "value": 1 + "hex": "0000", + "name": "Loopback", + "value": 0 }, - "model": "Ethernet network interface", - "sysfs_id": "/class/net/enp0s31f6", - "sysfs_device_link": "/devices/pci0000:00/0000:00:1f.6", - "unix_device_name": "enp0s31f6", + "model": "Loopback network interface", + "sysfs_id": "/class/net/lo", "unix_device_names": [ - "enp0s31f6" - ], - "resources": [ - { - "type": "hwaddr", - "address": 56 - }, - { - "type": "phwaddr", - "address": 56 - } - ], - "driver": "e1000e", - "driver_module": "e1000e", - "drivers": [ - "e1000e" - ], - "driver_modules": [ - "e1000e" + "lo" ] } ], @@ -2492,22 +2334,11 @@ "model": "Intel Memory controller", "sysfs_id": "/devices/pci0000:00/0000:00:1f.2", "sysfs_bus_id": "0000:00:1f.2", - "resources": [ - { - "type": "mem", - "base": 3996254208, - "range": 16384, - "enabled": false, - "access": "read_write", - "prefetch": "no" - } - ], "detail": { "function": 2, "command": 0, "header_type": 0, "secondary_bus": 0, - "irq": 0, "prog_if": 0 }, "module_alias": "pci:v00008086d00009D21sv000017AAsd0000225Cbc05sc80i00" @@ -2558,28 +2389,11 @@ "model": "Intel System peripheral", "sysfs_id": "/devices/pci0000:00/0000:00:08.0", "sysfs_bus_id": "0000:00:08.0", - "resources": [ - { - "type": "irq", - "base": 255, - "triggered": 0, - "enabled": true - }, - { - "type": "mem", - "base": 206074736640, - "range": 4096, - "enabled": false, - "access": "read_write", - "prefetch": "no" - } - ], "detail": { "function": 0, "command": 0, "header_type": 0, "secondary_bus": 0, - "irq": 255, "prog_if": 0 }, "module_alias": "pci:v00008086d00001911sv000017AAsd0000225Cbc08sc80i00" @@ -2634,28 +2448,11 @@ "model": "Intel Signal processing controller", "sysfs_id": "/devices/pci0000:00/0000:00:04.0", "sysfs_bus_id": "0000:00:04.0", - "resources": [ - { - "type": "irq", - "base": 16, - "triggered": 0, - "enabled": true - }, - { - "type": "mem", - "base": 206074675200, - "range": 32768, - "enabled": true, - "access": "read_write", - "prefetch": "no" - } - ], "detail": { "function": 0, "command": 2, "header_type": 0, "secondary_bus": 0, - "irq": 16, "prog_if": 0 }, "driver": "proc_thermal", @@ -2718,28 +2515,11 @@ "model": "Intel Communication controller", "sysfs_id": "/devices/pci0000:00/0000:00:16.0", "sysfs_bus_id": "0000:00:16.0", - "resources": [ - { - "type": "irq", - "base": 136, - "triggered": 0, - "enabled": true - }, - { - "type": "mem", - "base": 206074728448, - "range": 4096, - "enabled": true, - "access": "read_write", - "prefetch": "no" - } - ], "detail": { "function": 0, "command": 1030, "header_type": 0, "secondary_bus": 0, - "irq": 136, "prog_if": 0 }, "driver": "mei_me", @@ -2802,36 +2582,11 @@ "model": "Intel System peripheral", "sysfs_id": "/devices/pci0000:00/0000:00:1d.0/0000:05:00.0/0000:06:00.0/0000:07:00.0", "sysfs_bus_id": "0000:07:00.0", - "resources": [ - { - "type": "irq", - "base": 16, - "triggered": 0, - "enabled": true - }, - { - "type": "mem", - "base": 3992977408, - "range": 262144, - "enabled": true, - "access": "read_write", - "prefetch": "no" - }, - { - "type": "mem", - "base": 3993239552, - "range": 4096, - "enabled": true, - "access": "read_write", - "prefetch": "no" - } - ], "detail": { "function": 0, "command": 1030, "header_type": 0, "secondary_bus": 0, - "irq": 16, "prog_if": 0 }, "driver": "thunderbolt", @@ -2894,28 +2649,11 @@ "model": "Intel Signal processing controller", "sysfs_id": "/devices/pci0000:00/0000:00:14.2", "sysfs_bus_id": "0000:00:14.2", - "resources": [ - { - "type": "irq", - "base": 18, - "triggered": 0, - "enabled": true - }, - { - "type": "mem", - "base": 206074732544, - "range": 4096, - "enabled": true, - "access": "read_write", - "prefetch": "no" - } - ], "detail": { "function": 2, "command": 2, "header_type": 0, "secondary_bus": 0, - "irq": 18, "prog_if": 0 }, "driver": "intel_pch_thermal", @@ -2985,20 +2723,6 @@ "range": 32, "enabled": true, "access": "read_write" - }, - { - "type": "irq", - "base": 16, - "triggered": 0, - "enabled": true - }, - { - "type": "mem", - "base": 206074724352, - "range": 256, - "enabled": true, - "access": "read_write", - "prefetch": "no" } ], "detail": { @@ -3006,7 +2730,6 @@ "command": 3, "header_type": 0, "secondary_bus": 0, - "irq": 16, "prog_if": 0 }, "driver": "i801_smbus", @@ -3074,36 +2797,11 @@ "model": "Intel Multimedia controller", "sysfs_id": "/devices/pci0000:00/0000:00:1f.3", "sysfs_bus_id": "0000:00:1f.3", - "resources": [ - { - "type": "irq", - "base": 172, - "triggered": 0, - "enabled": true - }, - { - "type": "mem", - "base": 206074544128, - "range": 65536, - "enabled": true, - "access": "read_write", - "prefetch": "no" - }, - { - "type": "mem", - "base": 206074707968, - "range": 16384, - "enabled": true, - "access": "read_write", - "prefetch": "no" - } - ], "detail": { "function": 3, "command": 1030, "header_type": 0, "secondary_bus": 0, - "irq": 172, "prog_if": 128 }, "driver": "snd_hda_intel", @@ -3166,28 +2864,11 @@ "model": "Mass storage controller", "sysfs_id": "/devices/pci0000:00/0000:00:1c.4/0000:04:00.0", "sysfs_bus_id": "0000:04:00.0", - "resources": [ - { - "type": "irq", - "base": 16, - "triggered": 0, - "enabled": true - }, - { - "type": "mem", - "base": 3994025984, - "range": 16384, - "enabled": true, - "access": "read_write", - "prefetch": "no" - } - ], "detail": { "function": 0, "command": 1030, "header_type": 0, "secondary_bus": 0, - "irq": 16, "prog_if": 2 }, "driver": "nvme", @@ -3204,90 +2885,6 @@ "system": { "form_factor": "laptop" }, - "usb": [ - { - "index": 39, - "attached_to": 44, - "class_list": [ - "usb", - "unknown" - ], - "bus_type": { - "hex": "0086", - "name": "USB", - "value": 134 - }, - "slot": { - "bus": 0, - "number": 0 - }, - "base_class": { - "hex": "0000", - "name": "Unclassified device", - "value": 0 - }, - "sub_class": { - "hex": "0000", - "name": "Unclassified device", - "value": 0 - }, - "vendor": { - "hex": "06cb", - "value": 1739 - }, - "device": { - "hex": "009a", - "value": 154 - }, - "revision": { - "hex": "0000", - "name": "1.64", - "value": 0 - }, - "serial": "4a76b8863642", - "model": "Unclassified device", - "sysfs_id": "/devices/pci0000:00/0000:00:14.0/usb1/1-9/1-9:1.0", - "sysfs_bus_id": "1-9:1.0", - "resources": [ - { - "type": "baud", - "speed": 12000000, - "bits": 0, - "stop_bits": 0, - "parity": 0, - "handshake": 0 - } - ], - "detail": { - "device_class": { - "hex": "00ff", - "name": "vendor_spec", - "value": 255 - }, - "device_subclass": { - "hex": "0010", - "name": "audio_video", - "value": 16 - }, - "device_protocol": 255, - "interface_class": { - "hex": "00ff", - "name": "vendor_spec", - "value": 255 - }, - "interface_subclass": { - "hex": "0000", - "name": "per_interface", - "value": 0 - }, - "interface_protocol": 0, - "interface_number": 0, - "interface_alternate_setting": 0 - }, - "hotplug": "usb", - "module_alias": "usb:v06CBp009Ad0164dcFFdsc10dpFFicFFisc00ip00in00" - } - ], "usb_controller": [ { "index": 12, @@ -3343,28 +2940,11 @@ "model": "Intel USB Controller", "sysfs_id": "/devices/pci0000:00/0000:00:1d.0/0000:05:00.0/0000:06:02.0/0000:3b:00.0", "sysfs_bus_id": "0000:3b:00.0", - "resources": [ - { - "type": "irq", - "base": 137, - "triggered": 0, - "enabled": true - }, - { - "type": "mem", - "base": 3622830080, - "range": 65536, - "enabled": true, - "access": "read_write", - "prefetch": "no" - } - ], "detail": { "function": 0, "command": 1030, "header_type": 0, "secondary_bus": 0, - "irq": 137, "prog_if": 48 }, "driver": "xhci_hcd", @@ -3431,28 +3011,11 @@ "model": "Intel USB Controller", "sysfs_id": "/devices/pci0000:00/0000:00:14.0", "sysfs_bus_id": "0000:00:14.0", - "resources": [ - { - "type": "irq", - "base": 128, - "triggered": 0, - "enabled": true - }, - { - "type": "mem", - "base": 206074609664, - "range": 65536, - "enabled": true, - "access": "read_write", - "prefetch": "no" - } - ], "detail": { "function": 0, "command": 1030, "header_type": 0, "secondary_bus": 0, - "irq": 128, "prog_if": 48 }, "driver": "xhci_hcd", @@ -3636,38 +3199,40 @@ ] } ], - "chassis": { - "handle": 14, - "manufacturer": "LENOVO", - "version": "None", - "chassis_type": { - "hex": "000a", - "name": "Notebook", - "value": 10 - }, - "lock_present": false, - "bootup_state": { - "hex": "0002", - "name": "Unknown", - "value": 2 - }, - "power_state": { - "hex": "0002", - "name": "Unknown", - "value": 2 - }, - "thermal_state": { - "hex": "0002", - "name": "Unknown", - "value": 2 - }, - "security_state": { - "hex": "0002", - "name": "Unknown", - "value": 2 - }, - "oem": "0x0" - }, + "chassis": [ + { + "handle": 14, + "manufacturer": "LENOVO", + "version": "None", + "chassis_type": { + "hex": "000a", + "name": "Notebook", + "value": 10 + }, + "lock_present": false, + "bootup_state": { + "hex": "0002", + "name": "Unknown", + "value": 2 + }, + "power_state": { + "hex": "0002", + "name": "Unknown", + "value": 2 + }, + "thermal_state": { + "hex": "0002", + "name": "Unknown", + "value": 2 + }, + "security_state": { + "hex": "0002", + "name": "Unknown", + "value": 2 + }, + "oem": "0x0" + } + ], "config": { "handle": 34 }, @@ -3736,7 +3301,7 @@ "name": "None", "value": 3 }, - "max_size": 8388608, + "max_size": "0x800000", "error_handle": 65534, "slots": 2 } @@ -3745,8 +3310,8 @@ { "handle": 6, "array_handle": 3, - "start_address": 0, - "end_address": 8589934592, + "start_address": "0x0", + "end_address": "0x200000000", "part_width": 2 } ], @@ -3825,8 +3390,8 @@ "value": 2 }, "syndrome": 0, - "array_address": 2147483648, - "device_address": 2147483648, + "array_address": "0x80000000", + "device_address": "0x80000000", "range": 2147483648 } ], @@ -4069,4 +3634,4 @@ } } } -}
\ No newline at end of file +} diff --git a/hosts/mercury/nixos.nix b/hosts/mercury/nixos.nix index 558ae60..dcdd8c6 100644 --- a/hosts/mercury/nixos.nix +++ b/hosts/mercury/nixos.nix @@ -12,10 +12,13 @@ inputs.lanzaboote.nixosModules.lanzaboote ]; - systemd.services.systemd-udev-settle.enable = false; - networking.interfaces.wlp2s0.useDHCP = false; + services.syncthing = { + enable = true; + user = "collin"; + dataDir = "/home/collin/.local/syncthing"; + }; - services.sshd.enable = true; + services.printing.enable = true; facter.reportPath = ./facter.json; @@ -25,6 +28,4 @@ allowedUDPPorts = [445]; allowedTCPPorts = [8000]; }; - - system.stateVersion = "25.05"; } diff --git a/hosts/mercury/wallpapers/abstract-swirls.jpg b/hosts/mercury/wallpapers/abstract-swirls.jpg Binary files differnew file mode 100644 index 0000000..0948796 --- /dev/null +++ b/hosts/mercury/wallpapers/abstract-swirls.jpg diff --git a/hosts/mercury/wallpaper.jpg b/hosts/mercury/wallpapers/astronaut.jpg Binary files differindex 039afcc..039afcc 100644 --- a/hosts/mercury/wallpaper.jpg +++ b/hosts/mercury/wallpapers/astronaut.jpg diff --git a/hosts/mercury/hintergrund2.png b/hosts/mercury/wallpapers/hintergrund2.png Binary files differindex 6cf9a8f..6cf9a8f 100644 --- a/hosts/mercury/hintergrund2.png +++ b/hosts/mercury/wallpapers/hintergrund2.png diff --git a/hosts/mercury/riverboats.png b/hosts/mercury/wallpapers/riverboats.png Binary files differindex c390ca7..c390ca7 100644 --- a/hosts/mercury/riverboats.png +++ b/hosts/mercury/wallpapers/riverboats.png diff --git a/lib/lib.nix b/lib/lib.nix index 00cc334..56f0dfd 100644 --- a/lib/lib.nix +++ b/lib/lib.nix @@ -32,15 +32,21 @@ let config, }: let inherit (lib) mkOption mkEnableOption; - mkProgramOption = name: { - enable = mkEnableOption "whether to enable ${name}"; - theme = mkOption { + + mkThemeOption = name: + mkOption { + description = "Pre-made theme for ${name}"; type = lib.types.enum ["catppuccin" "adwaita" "kanagawa"]; default = config.collinux.theme; + defaultText = "config.collinux.theme"; }; + + mkProgramOption = name: { + enable = mkEnableOption "whether to enable ${name}"; + theme = mkThemeOption name; }; in { - inherit mkProgramOption; + inherit mkProgramOption mkThemeOption; }; in { inherit globimport; diff --git a/lib/nix-furnace/mkSystem.nix b/lib/nix-furnace/mkSystem.nix index 85f952c..2766082 100644 --- a/lib/nix-furnace/mkSystem.nix +++ b/lib/nix-furnace/mkSystem.nix @@ -4,6 +4,32 @@ let listModules = getSubdirs ../../modules; + nixosModules = hostname: + [ + ../../modules/options.nix + ../../hosts/${hostname}/config.nix + (lazyImport ../../hosts/${hostname}/nixos.nix) + ] + ++ (listModules + |> (builtins.map (modName: [ + (lazyImport ../../modules/${modName}/options.nix) + (lazyImport ../../modules/${modName}/nixos/default.nix) + ])) + |> my-lib.flatten); + + hjemModules = hostname: + [ + ../../modules/options.nix + ../../hosts/${hostname}/config.nix + (lazyImport ../../hosts/${hostname}/hjem.nix) + ] + ++ (listModules + |> (builtins.map (modName: [ + (lazyImport ../../modules/${modName}/options.nix) + (lazyImport ../../modules/${modName}/hjem/default.nix) + ])) + |> my-lib.flatten); + mkNixosSystem = { inputs, hostname, @@ -17,20 +43,7 @@ let ../../hosts/${hostname}/config.nix # Nixos-sided modules - { - imports = - [ - ../../modules/options.nix - ../../hosts/${hostname}/config.nix - (lazyImport ../../hosts/${hostname}/nixos.nix) - ] - ++ (listModules - |> (builtins.map (modName: [ - (lazyImport ../../modules/${modName}/options.nix) - (lazyImport ../../modules/${modName}/nixos/default.nix) - ])) - |> my-lib.flatten); - } + {imports = nixosModules hostname;} # Hjem-sided modules { @@ -38,18 +51,7 @@ let inputs.hjem.nixosModules.hjem ]; hjem = { - extraModules = - [ - ../../modules/options.nix - ../../hosts/${hostname}/config.nix - (lazyImport ../../hosts/${hostname}/hjem.nix) - ] - ++ (listModules - |> (builtins.map (modName: [ - (lazyImport ../../modules/${modName}/options.nix) - (lazyImport ../../modules/${modName}/hjem/default.nix) - ])) - |> my-lib.flatten); + extraModules = hjemModules hostname; specialArgs = {inherit inputs my-lib;}; users.${username} = { enable = true; @@ -60,6 +62,32 @@ let } ]; }; + + genDocs = { + lib, + pkgs, + inputs, + hostname, + ... + }: let + eval = lib.evalModules { + modules = listModules |> (builtins.map (m: (lazyImport ../../modules/${m}/options.nix))); + specialArgs = { + inherit my-lib pkgs; + }; + check = false; + }; + + optionsDoc = pkgs.nixosOptionsDoc { + inherit (eval) options; + }; + in + pkgs.runCommand "options-doc.md" { + buildInputs = [pkgs.pandoc]; + } '' + mkdir -p $out + cat ${optionsDoc.optionsCommonMark} | pandoc -t html -o - | tee $out/index.html + ''; in { - inherit mkNixosSystem; + inherit mkNixosSystem genDocs; } diff --git a/modules/boot/nixos/default.nix b/modules/boot/nixos/default.nix index 026226b..49cca5e 100644 --- a/modules/boot/nixos/default.nix +++ b/modules/boot/nixos/default.nix @@ -26,6 +26,37 @@ in { efi.canTouchEfiVariables = true; timeout = cfg.timeout; # hold space to show boot menu }; + + # from hardened.nix + blacklistedKernelModules = [ + # Obscure network protocols + "ax25" + "netrom" + "rose" + + # Old or rare or insufficiently audited filesystems + "adfs" + "affs" + "bfs" + "befs" + "cramfs" + "efs" + # "erofs" # necessary for system.etc.overlay + "exofs" + "freevxfs" + "f2fs" + "hfs" + "hpfs" + "jfs" + "minix" + "nilfs2" + "ntfs" + "omfs" + "qnx4" + "qnx6" + "sysv" + "ufs" + ]; } // (lib.optionalAttrs cfg.secureBoot.enable { lanzaboote = { @@ -34,14 +65,17 @@ in { }; }); - system.etc.overlay.enable = true; + system.etc.overlay = { + enable = true; + mutable = true; # would love this to be false, but we're not there yet + }; system.nixos-init.enable = true; - environment.systemPackages = - ( - if cfg.secureBoot.enable - then [pkgs.sbctl] - else [] - ) - ++ [pkgs.efibootmgr]; + # store journald logs in memory + services.journald.extraConfig = '' + Storage=volatile + RuntimeMaxUse=100M + ''; + + environment.systemPackages = [pkgs.efibootmgr] ++ lib.optional cfg.secureBoot.enable pkgs.sbctl; } diff --git a/modules/boot/options.nix b/modules/boot/options.nix index 2f670f9..9e85570 100644 --- a/modules/boot/options.nix +++ b/modules/boot/options.nix @@ -1,9 +1,11 @@ { + my-lib, config, lib, ... }: let - inherit (lib) mkOption mkEnableOption types; + inherit (lib) mkOption mkEnableOption; + inherit (my-lib.options {inherit lib config;}) mkThemeOption; in { options = { collinux.boot = { @@ -15,10 +17,7 @@ in { }; plymouth = { enable = mkEnableOption "plymouth bootsplash"; - theme = mkOption { - type = types.enum ["catppuccin" "adwaita"]; - default = config.collinux.theme; - }; + theme = mkThemeOption "plymouth"; }; secureBoot.enable = mkEnableOption "lanzaboote"; }; diff --git a/modules/desktop/hjem/programs/firefox.nix b/modules/desktop/hjem/programs/firefox.nix index b5ea433..2078e3c 100644 --- a/modules/desktop/hjem/programs/firefox.nix +++ b/modules/desktop/hjem/programs/firefox.nix @@ -27,6 +27,8 @@ in }; }; + ".mozilla/firefox/collin/user.js".source = "${inputs.betterfox}/user.js"; + ".mozilla/firefox/collin/chrome/userChrome.css".text = mkCssHacks ( # (lib.optional (cfg.theme == "adwaita") "window_control_placeholder_support") ++ [ diff --git a/modules/desktop/hjem/wm/fuzzel.nix b/modules/desktop/hjem/wm/fuzzel.nix index 7d61255..f9a9edb 100644 --- a/modules/desktop/hjem/wm/fuzzel.nix +++ b/modules/desktop/hjem/wm/fuzzel.nix @@ -8,34 +8,38 @@ settings = { main = { - prompt = ""; - dpi-aware = false; + prompt = builtins.fromJSON ''"\u200B"''; # https://discourse.nixos.org/t/how-can-i-put-an-nonprintable-character-in-a-nix-expression/47750/7 - font = "Iosevka Nerd Font"; - line-height = 25; + font = "Iosevka Nerd Font:size=9"; + use-bold = true; + line-height = 16; lines = 10; - width = 30; + width = 20; - horizontal-pad = 8; - vertical-pad = 8; + anchor = "bottom-right"; + + horizontal-pad = 0; + vertical-pad = 0; }; border = { radius = 0; width = 3; }; - colors = with config.collinux.palette; { - background = "${base00}99"; - border = "ffffff00"; - input = base05; - match = base13; - placeholder = base03; - text = base01; - prompt = base01; + colors = with config.collinux.palette; let + transparent = "#ffffff00"; + in { + background = transparent; + border = transparent; + input = transparent; + match = "#${base13}ff"; + placeholder = "#${base03}ff"; + text = "#${base04}ff"; + prompt = "#${base05}ff"; - selection = "${base01}5a"; - selection-match = base13; - selection-text = base05; + selection = transparent; + selection-match = "#${base13}ff"; + selection-text = "#${base05}ff"; }; }; in diff --git a/modules/desktop/nixos/fonts.nix b/modules/desktop/nixos/fonts.nix index 3f10d92..5ac17ec 100644 --- a/modules/desktop/nixos/fonts.nix +++ b/modules/desktop/nixos/fonts.nix @@ -1,8 +1,7 @@ {pkgs, ...}: { fonts = { enableDefaultPackages = false; - # fontDir.enable = true; fontconfig.enable = true; - packages = [pkgs.nerd-fonts.iosevka pkgs.ibm-plex]; # for terminal (blackbox or foot) + packages = [pkgs.nerd-fonts.iosevka pkgs.ibm-plex]; # for terminal (blackbox or foot or ghostty) }; } diff --git a/modules/desktop/nixos/greeters/greetd.nix b/modules/desktop/nixos/greeters/greetd.nix index b612c86..02af31f 100644 --- a/modules/desktop/nixos/greeters/greetd.nix +++ b/modules/desktop/nixos/greeters/greetd.nix @@ -1,19 +1,35 @@ { + pkgs, config, lib, ... }: let cfg = config.collinux.desktop.greetd; + + session = + if cfg.cosmic-greeter.enable + then { + command = "${pkgs.cosmic-greeter}/bin/cosmic-greeter-start"; + user = config.collinux.user.name; + } + else if cfg.autologin.enable + then { + user = config.collinux.user.name; + command = with config.collinux.desktop; + if (wm.sway.enable && !gnome.enable && !wm.niri.enable) + then lib.getExe pkgs.sway + else if (wm.niri.enable && !gnome.enable && !wm.sway.enable) + then "${pkgs.niri}/bin/niri-session" + else null; + } + else {}; in lib.mkIf cfg.enable { services.greetd = { enable = true; - settings = rec { - initial_session = { - command = cfg.command; - user = config.collinux.user.name; - }; - default_session = initial_session; + settings = { + initial_session = session; + default_session = session; }; }; } diff --git a/modules/desktop/options.nix b/modules/desktop/options.nix index 1067d0b..a4ba38d 100644 --- a/modules/desktop/options.nix +++ b/modules/desktop/options.nix @@ -6,7 +6,7 @@ ... }: let inherit (lib) mkOption mkEnableOption types; - inherit (my-lib.options {inherit lib config;}) mkProgramOption; + inherit (my-lib.options {inherit lib config;}) mkProgramOption mkThemeOption; in { options = { collinux.desktop = { @@ -17,21 +17,13 @@ in { wallpaper_cmd = mkOption { type = types.str; default = "${lib.getExe pkgs.wbg} -s ${config.collinux.desktop.wallpaper}"; + internal = true; }; greetd = { enable = mkEnableOption "greetd greeter"; - command = mkOption { - type = lib.types.str; - default = let - cfg = config.collinux.desktop; - in - if (cfg.wm.sway.enable && !cfg.gnome.enable && !cfg.wm.niri.enable) - then lib.getExe pkgs.sway - else if (cfg.wm.niri.enable && !cfg.gnome.enable && !cfg.wm.sway.enable) - then "${pkgs.niri}/bin/niri-session" - else null; - }; + autologin.enable = mkEnableOption "autologin"; + cosmic-greeter.enable = mkEnableOption "cosmic-greeter"; }; gdm.enable = mkEnableOption "gdm display manager"; @@ -40,7 +32,6 @@ in { niri.enable = mkEnableOption "niri"; components = { - # waybar = mkProgramOption "waybar"; dunst = mkProgramOption "dunst"; fuzzel = mkProgramOption "fuzzel"; }; @@ -49,54 +40,67 @@ in { gtk = { enable = mkEnableOption "gtk theming"; - theme = mkOption { - type = types.enum ["catppuccin" "adwaita" "kanagawa"]; - default = config.collinux.theme; - }; - cursor_data = { - package = mkOption { - type = lib.types.package; - default = - if (config.collinux.desktop.gtk.theme == "catppuccin") - then pkgs.catppuccin-cursors.mochaDark - else if (config.collinux.desktop.gtk.theme == "adwaita") - then pkgs.vanilla-dmz - else null; - }; - name = mkOption { - type = lib.types.str; - default = - if (config.collinux.desktop.gtk.theme == "catppuccin") - then "catppuccin-mocha-dark-cursors" - else if (config.collinux.desktop.gtk.theme == "adwaita") - then "Vanilla-DMZ" - else null; + theme = mkThemeOption "gtk"; + + cursor_data = mkOption { + internal = true; + type = lib.types.submodule { + options = { + package = mkOption { + internal = true; + type = lib.types.package; + }; + name = mkOption { + internal = true; + type = lib.types.str; + }; + }; }; + default = + if config.collinux.desktop.gtk.theme == "catppuccin" + then { + name = "catppuccin-mocha-dark-cursors"; + package = pkgs.catppuccin-cursors.mochaDark; + } + else if config.collinux.gtk.theme == "adwaita" + then { + name = "Vanilla-DMZ"; + package = pkgs.vanilla-dmz; + } + else null; }; - theme_data = { - package = mkOption { - type = lib.types.package; - default = - if (config.collinux.desktop.gtk.theme == "catppuccin") - then - (pkgs.catppuccin-gtk.override { - variant = "mocha"; - accents = ["blue"]; - size = "standard"; - }) - else if (config.collinux.desktop.gtk.theme == "adwaita") - then pkgs.adw-gtk3 - else ""; - }; - name = mkOption { - type = lib.types.str; - default = - if (config.collinux.desktop.gtk.theme == "catppuccin") - then "catppuccin-mocha-blue-standard" - else if (config.collinux.desktop.gtk.theme == "adwaita") - then "adw-gtk3" - else ""; + + theme_data = mkOption { + internal = true; + type = lib.types.submodule { + options = { + package = mkOption { + internal = true; + type = lib.types.package; + }; + name = mkOption { + internal = true; + type = lib.types.str; + }; + }; }; + + default = + if config.collinux.desktop.gtk.theme == "catppuccin" + then { + package = pkgs.catppuccin-gtk.override { + variant = "mocha"; + accents = ["blue"]; + size = "standard"; + }; + name = "catppuccin-mocha-blue-standard"; + } + else if config.collinux.desktop.gtk.theme == "adwaita" + then { + package = pkgs.adw-gtk3; + name = "adw-gtk3"; + } + else null; }; }; @@ -106,11 +110,9 @@ in { profileName = mkOption { type = types.str; default = config.collinux.user.name; + internal = true; }; - theme = mkOption { - type = types.enum ["none" "catppuccin" "adwaita" "kanagawa"]; - default = config.collinux.theme; - }; + theme = mkThemeOption "firefox"; extensions.zotero.enable = mkOption { description = "install Zotero Connector for Firefox"; default = config.collinux.desktop.programs.research.enable; @@ -122,7 +124,7 @@ in { ghostty.enable = mkEnableOption "ghostty"; alacritty.enable = mkEnableOption "alacritty"; - research.enable = mkEnableOption "zathura, Xournal++, Zotero, Zotero Connector"; + research.enable = mkEnableOption "zathura, Xournal++, Zotero"; }; }; }; @@ -133,6 +135,10 @@ in { assertion = with config.collinux.desktop; !(gdm.enable && greetd.enable); message = "Can't enable gdm and greetd at the same time"; } + { + assertion = with config.collinux.desktop.greetd; enable && !(autologin.enable && cosmic-greeter.enable); + message = "Can't use autologin and cosmic-greeter at the same time"; + } ]; }; } diff --git a/modules/nix/nixos/default.nix b/modules/nix/nixos/default.nix index 7116371..c817859 100644 --- a/modules/nix/nixos/default.nix +++ b/modules/nix/nixos/default.nix @@ -1,12 +1,9 @@ { - inputs, config, pkgs, ... }: { nix = { - # package = inputs.determinate.packages.${pkgs.system}.default; - gc.automatic = false; # use nh cleaner instead # Make builds run with low priority so my system stays responsive @@ -27,9 +24,12 @@ programs.nh = { enable = true; - flake = "/home/collin/nixos"; + flake = "/home/${config.collinux.user.name}/nixos"; clean.enable = true; }; - hjem.users."${config.collinux.user.name}".packages = [pkgs.cached-nix-shell]; + environment.systemPackages = [pkgs.cached-nix-shell]; + + nixpkgs.hostPlatform = "x86_64-linux"; + system.stateVersion = "25.05"; } diff --git a/modules/options.nix b/modules/options.nix index 65de32e..8ecf1d7 100644 --- a/modules/options.nix +++ b/modules/options.nix @@ -7,15 +7,18 @@ in { options = { collinux.theme = mkOption { + description = "System-wide theme"; type = types.enum ["catppuccin" "adwaita" "kanagawa"]; }; collinux.palette = let colorOption = lib.mkOption { type = lib.types.strMatching "^([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$"; + internal = true; }; in lib.mkOption { + internal = true; type = lib.types.submodule { options = { base00 = colorOption; diff --git a/modules/secrets/options.nix b/modules/secrets/options.nix index de15f50..fa53d6f 100644 --- a/modules/secrets/options.nix +++ b/modules/secrets/options.nix @@ -3,25 +3,33 @@ in { options = { collinux.secrets = lib.mkOption { + description = "Atribute set of secrets"; type = lib.types.attrsOf ( lib.types.submodule ({config, ...}: { options = { name = mkOption { type = lib.types.str; default = config._module.args.name; + internal = true; + }; + file = mkOption { + description = "Name of the file in the /run/secrets.d"; + type = lib.types.path; }; - file = mkOption {type = lib.types.path;}; mode = mkOption { + description = "Permissions mode of the decrypted secret in a format understood by chmod"; type = lib.types.str; default = "0400"; }; owner = mkOption { + description = "Owner of the decrypted secret file"; type = lib.types.str; default = "0"; }; path = mkOption { type = lib.types.str; default = "/run/secrets.d/${config.name}"; + description = "Path where the decrypted secret is installed"; }; }; }) diff --git a/modules/services/nixos/audio.nix b/modules/services/nixos/audio.nix index 93f8289..8f2f23e 100644 --- a/modules/services/nixos/audio.nix +++ b/modules/services/nixos/audio.nix @@ -12,9 +12,10 @@ in enable = true; wireplumber.enable = true; alsa.enable = true; - - pulse.enable = cfg.pulse.enable; + pulse.enable = false; }; + boot.blacklistedKernelModules = ["snd_seq_dummy"]; # remove extraneous alsa midi devices + environment.systemPackages = [pkgs.pwvucontrol]; } diff --git a/modules/services/nixos/bluetooth.nix b/modules/services/nixos/bluetooth.nix index a86b5b3..bdcaa00 100644 --- a/modules/services/nixos/bluetooth.nix +++ b/modules/services/nixos/bluetooth.nix @@ -12,6 +12,18 @@ in powerOnBoot = true; }; + # hardening (down to 2.1 OK) + systemd.services."bluetooth".serviceConfig = { + IPAddressDeny = "any"; + ProtectHostname = true; + ProtectKernelTunables = lib.mkForce true; + ProtectKernelLogs = true; + ProtectKernelModules = lib.mkForce true; + RestrictAddressFamilies = ["AF_UNIX" "AF_BLUETOOTH"]; + ProtectClock = true; + ProcSubset = "pid"; + }; + environment.systemPackages = [ (lib.mkIf cfg.blueman.enable pkgs.blueman) (lib.mkIf cfg.bluetuith.enable pkgs.bluetuith) diff --git a/modules/services/nixos/networking/default.nix b/modules/services/nixos/networking/default.nix index 2667849..9fa56da 100644 --- a/modules/services/nixos/networking/default.nix +++ b/modules/services/nixos/networking/default.nix @@ -3,24 +3,8 @@ ./iwd.nix ./networkmanager.nix ./networkd.nix + ./resolved.nix ]; networking.firewall.enable = true; - - # DNS - services.resolved = { - enable = true; - dnsovertls = "opportunistic"; - fallbackDns = [ - "9.9.9.9#dns.quad9.net" - "149.112.112.112#dns.quad9.net" - ]; - - # disable extra stuff - llmnr = "false"; - extraConfig = "MulticastDNS=no"; - }; - networking.resolvconf.enable = false; - - systemd.network.wait-online.enable = false; } diff --git a/modules/services/nixos/networking/networkd.nix b/modules/services/nixos/networking/networkd.nix index 9a11129..920b93f 100644 --- a/modules/services/nixos/networking/networkd.nix +++ b/modules/services/nixos/networking/networkd.nix @@ -25,6 +25,13 @@ in systemd.network = { enable = true; + + wait-online = { + enable = true; + ignoredInterfaces = ["docker0"]; + anyInterface = true; + }; + networks."11-static-lan" = { name = "wl*"; diff --git a/modules/services/nixos/networking/resolved.nix b/modules/services/nixos/networking/resolved.nix new file mode 100644 index 0000000..b552095 --- /dev/null +++ b/modules/services/nixos/networking/resolved.nix @@ -0,0 +1,17 @@ +{ + networking.resolvconf.enable = false; + + services.resolved = { + enable = true; + dnsovertls = "opportunistic"; + dnssec = "allow-downgrade"; + fallbackDns = [ + "9.9.9.9#dns.quad9.net" + "149.112.112.112#dns.quad9.net" + ]; + + # disable extra stuff + llmnr = "false"; + extraConfig = "MulticastDNS=no"; + }; +} diff --git a/modules/services/nixos/selfhost/adguard.nix b/modules/services/nixos/selfhost/adguard.nix index c5e93ee..69fb8a4 100644 --- a/modules/services/nixos/selfhost/adguard.nix +++ b/modules/services/nixos/selfhost/adguard.nix @@ -32,16 +32,16 @@ in DNSStubListener=no ''; - services.caddy = lib.mkIf config.collinux.services.selfhost.caddy.enable { + services.tailscale.extraSetFlags = lib.optional config.collinux.services.networking.tailscale.enable "--accept-dns=false"; # would create an infinite loop of dns lookups + + services.caddy = lib.mkIf cfg.caddy.enable { virtualHosts.${cfg.root_url}.extraConfig = '' ${ - if config.collinux.services.networking.tailscale.enable - then "bind tailscale/adguard" + if cfg.caddy.bind_tailscale + then "bind tailscale/${cfg.service_name}" else "" } - reverse_proxy localhost:${toString cfg.port} + reverse_proxy ${cfg.bind_host}:${toString cfg.port} ''; }; - - services.tailscale.extraSetFlags = lib.optional config.collinux.services.networking.tailscale.enable "--accept-dns=false"; # would create an infinite loop of dns lookups } diff --git a/modules/services/nixos/selfhost/default.nix b/modules/services/nixos/selfhost/default.nix index 876586d..de1078b 100644 --- a/modules/services/nixos/selfhost/default.nix +++ b/modules/services/nixos/selfhost/default.nix @@ -2,6 +2,7 @@ imports = [ ./adguard.nix ./forgejo.nix + ./headscale.nix ./caddy.nix ]; } diff --git a/modules/services/nixos/selfhost/forgejo.nix b/modules/services/nixos/selfhost/forgejo.nix index b1a6095..4571dca 100644 --- a/modules/services/nixos/selfhost/forgejo.nix +++ b/modules/services/nixos/selfhost/forgejo.nix @@ -8,7 +8,7 @@ in lib.mkIf cfg.enable { services.forgejo = { enable = true; - database.type = "postgres"; + database.type = "sqlite3"; settings = { server = { DOMAIN = "localhost"; @@ -36,14 +36,19 @@ in }; }; - services.caddy = lib.mkIf config.collinux.services.selfhost.caddy.enable { + systemd.services."forgejo" = lib.mkIf config.collinux.services.networking.networkd.enable { + after = lib.mkAfter ["network-online.target"]; + wants = lib.mkAfter ["network-online.target"]; + }; + + services.caddy = lib.mkIf cfg.caddy.enable { virtualHosts.${cfg.root_url}.extraConfig = '' ${ - if config.collinux.services.networking.tailscale.enable - then "bind tailscale/forgejo" + if cfg.caddy.bind_tailscale + then "bind tailscale/${cfg.service_name}" else "" } - reverse_proxy localhost:${toString cfg.port} + reverse_proxy ${cfg.bind_host}:${toString cfg.port} ''; }; } diff --git a/modules/services/nixos/selfhost/headscale.nix b/modules/services/nixos/selfhost/headscale.nix new file mode 100644 index 0000000..2bdcca1 --- /dev/null +++ b/modules/services/nixos/selfhost/headscale.nix @@ -0,0 +1,75 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.collinux.services.selfhost.headscale; + + acl_file = (pkgs.formats.json {}).generate "acl.json" { + ssh = [ + { + src = ["collin@"]; + dst = ["collin@"]; + users = ["autogroup:nonroot" "root"]; + action = "accept"; + } + ]; + }; +in + lib.mkIf cfg.enable { + services.headscale = { + enable = true; + address = cfg.bind_host; + port = cfg.port; + settings = { + server_url = "https://${cfg.root_url}"; + + database.type = "sqlite"; + + dns = { + magic_dns = true; + base_domain = "collinux.tailnet"; + override_local_dns = true; + nameservers.global = ["9.9.9.9" "149.112.112.112" "2620:fe::fe" "2620:fe::9"]; + }; + + policy.path = "${acl_file}"; + + prefixes = { + "v4" = "100.100.0.0/16"; + allocation = "random"; + }; + + # leave tls for caddy to worry about + tls_cert_path = null; + tls_key_path = null; + + logtail.enabled = false; + }; + }; + + # make sure headscale can start before tailscale + systemd.services."headscale" = lib.mkIf config.collinux.services.networking.tailscale.enable { + after = lib.mkForce ["network.target"]; + before = lib.mkForce ["headscale.target"]; + wants = lib.mkForce ["network.target" "headscale.target"]; + }; + + systemd.targets."headscale" = { + description = "Target represents headscale is running. started by headscale.service"; + }; + + environment.systemPackages = [pkgs.headscale]; + + services.caddy = lib.mkIf cfg.caddy.enable { + virtualHosts.${cfg.root_url}.extraConfig = '' + ${ + if cfg.caddy.bind_tailscale + then "bind tailscale/${cfg.service_name}" + else "" + } + reverse_proxy ${cfg.bind_host}:${toString cfg.port} + ''; + }; + } diff --git a/modules/services/nixos/ssh.nix b/modules/services/nixos/ssh.nix index 2867d10..cfe7883 100644 --- a/modules/services/nixos/ssh.nix +++ b/modules/services/nixos/ssh.nix @@ -8,18 +8,32 @@ in { config = lib.mkIf cfg.enable { services.openssh = { enable = true; + openFirewall = false; hostKeys = [ { path = "/etc/ssh/ssh_host_ed25519_key"; type = "ed25519"; } ]; + + listenAddresses = [ + { + addr = cfg.bind_host; + port = 22; + } + ]; + settings = { PermitRootLogin = "prohibit-password"; PasswordAuthentication = false; }; }; + systemd.services."openssh" = lib.mkIf config.collinux.services.networking.networkd.enable { + after = lib.mkAfter ["network-online.target"]; + wants = lib.mkAfter ["network-online.target"]; + }; + services.tailscale.extraSetFlags = lib.optional config.services.tailscale.enable "--ssh=true"; }; } diff --git a/modules/services/nixos/tailscale.nix b/modules/services/nixos/tailscale.nix index f39fc27..50e35d3 100644 --- a/modules/services/nixos/tailscale.nix +++ b/modules/services/nixos/tailscale.nix @@ -18,5 +18,17 @@ in allowedUDPPorts = [config.services.tailscale.port]; }; + # don't start tailscale until after headscale starts + systemd.services."tailscaled" = + if config.collinux.services.selfhost.headscale.enable + then { + wants = lib.mkForce ["network.target" "headscale.target"]; + after = lib.mkForce ["network.target" "headscale.target"]; + } + else { + wants = lib.mkForce ["network.target"]; + after = lib.mkForce ["network.target"]; + }; + environment.systemPackages = [pkgs.tailscale]; } diff --git a/modules/services/options.nix b/modules/services/options.nix index e87ecb3..085895e 100644 --- a/modules/services/options.nix +++ b/modules/services/options.nix @@ -17,27 +17,48 @@ in { networkmanager.enable = mkEnableOption "heavier wifi daemon"; networkd = { - enable = mkEnableOption "set static IP (systemd-networkd)"; - ssid = mkOption {type = lib.types.str;}; - pskFile = mkOption {type = lib.types.str;}; + enable = mkEnableOption "use systemd-networkd"; + ssid = mkOption { + description = "SSID for this network"; + type = lib.types.str; + }; + pskFile = mkOption { + description = "Absolute path to a file containing the pre-shared key for this network"; + type = lib.types.str; + example = "/run/secrets.d/wifi-psk"; + }; static = lib.mkOption { + description = "Set a static IP address for this device on this network. Set to null to use DHCP"; type = lib.types.nullOr (lib.types.submodule { options = { - ip = mkOption {type = ip_addr_cidr;}; - gateway = mkOption {type = ip_addr;}; + ip = mkOption { + description = "IP address"; + type = ip_addr_cidr; + }; + gateway = mkOption { + description = "default gateway"; + type = ip_addr; + }; }; }); default = null; }; }; + tailscale.enable = mkEnableOption "tailscale"; - sshd.enable = mkEnableOption "OpenSSH server"; - }; - audio = { - enable = mkEnableOption "pipewire + wireplumber"; - pulse.enable = mkEnableOption "pipewire-pulse"; + sshd = { + enable = mkEnableOption "OpenSSH server"; + bind_host = mkOption { + description = "The IP address on which OpenSSH will listen for incomming connections. The default, `0.0.0.0`, means 'all interfaces'"; + type = ip_addr; + default = "0.0.0.0"; + }; + }; }; + + audio.enable = mkEnableOption "pipewire and wireplumber"; + bluetooth = { enable = mkEnableOption "bluetooth"; blueman.enable = mkEnableOption "graphical bluetooth manager"; @@ -48,27 +69,33 @@ in { selfhostOptions = { service_name, default_port ? null, - ... }: { - enable = mkEnableOption ""; + enable = mkEnableOption "${service_name} selfhosted service"; + + service_name = mkOption { + type = lib.types.str; + internal = true; + }; + bind_host = mkOption { + description = "The IP address on which ${service_name} will listen for incoming connections. The default, `0.0.0.0`, means 'all interfaces'"; type = ip_addr; - default = - if config.collinux.services.networking.tailscale.enable - then "100.69.160.89" - else "0.0.0.0"; + default = "0.0.0.0"; }; port = mkOption { + description = "The port on which ${service_name} will listen for incomming connections"; type = lib.types.port; default = default_port; }; root_url = mkOption { - type = lib.types.str; - default = - if config.collinux.services.networking.tailscale.enable - then "https://${service_name}.tail7cca06.ts.net" - else null; + description = "The final url that this service will be hosted on. Required for caddy, otherwise optional"; + type = lib.types.nullOr lib.types.str; + }; + + caddy = { + enable = mkEnableOption "Automatically create caddy configurations for this service"; + bind_tailscale = mkEnableOption "Bind the service to ${service_name}.{tailnet}"; }; }; in { @@ -76,14 +103,23 @@ in { service_name = "adguard"; default_port = 8001; }; + forgejo = selfhostOptions { service_name = "forgejo"; default_port = 8010; }; + + headscale = selfhostOptions { + service_name = "headscale"; + default_port = 8080; + }; + caddy = { enable = mkEnableOption "caddy https server"; envFile = mkOption { + description = "Absolute path to file that contains environment variables for caddy operations"; type = lib.types.str; + example = "/run/secrets.d/caddy-env"; }; }; }; @@ -94,7 +130,7 @@ in { assertions = [ { assertion = with config.collinux.services.networking; (iwd.enable && !networkmanager.enable && !networkd.enable) || (!iwd.enable && networkmanager.enable && !networkd.enable) || (!iwd.enable && !networkmanager.enable && networkd.enable); - message = "only one networking method (iwd, networkmanager, static) can be active"; + message = "only one networking method (iwd, networkmanager, networkd) can be active"; } { assertion = with config.collinux.services.networking; !(wireguard.enable && tailscale.enable); diff --git a/modules/terminal/hjem/programs/tmux.nix b/modules/terminal/hjem/programs/tmux.nix index 8525569..2c87212 100644 --- a/modules/terminal/hjem/programs/tmux.nix +++ b/modules/terminal/hjem/programs/tmux.nix @@ -16,8 +16,8 @@ in { enable = true; theme = { - bg = config.collinux.palette.base01; - bg_dark = config.collinux.palette.base00; + bg = "#${config.collinux.palette.base00}"; + bg_dark = "#${config.collinux.palette.base01}"; }; keys.leader = [ diff --git a/modules/terminal/options.nix b/modules/terminal/options.nix index 25e0eb4..8207be3 100644 --- a/modules/terminal/options.nix +++ b/modules/terminal/options.nix @@ -6,7 +6,7 @@ ... }: let inherit (lib) mkOption mkEnableOption types; - inherit (my-lib.options {inherit lib config;}) mkProgramOption; + inherit (my-lib.options {inherit lib config;}) mkProgramOption mkThemeOption; in { options = { collinux.terminal = { @@ -37,10 +37,11 @@ in { git = { enable = mkEnableOption "git"; userName = mkOption { + description = "Public name uses for git"; type = types.str; - default = config.collinux.user.name; }; userEmail = mkOption { + description = "Public email used for git"; type = types.str; }; installKey = mkEnableOption "automatically install github authentication key"; @@ -48,10 +49,7 @@ in { helix = { enable = mkEnableOption "helix text editor"; - theme = mkOption { - type = lib.types.enum ["catppuccin" "adwaita" "kanagawa"]; - default = config.collinux.theme; - }; + theme = mkThemeOption "helix"; hardMode = mkOption { type = types.bool; description = "Disable arrow keys and mouse"; diff --git a/modules/user/nixos/default.nix b/modules/user/nixos/default.nix index b14e52d..0b0ae41 100644 --- a/modules/user/nixos/default.nix +++ b/modules/user/nixos/default.nix @@ -1,13 +1,12 @@ { config, - hostname, lib, ... }: let cfg = config.collinux.user; in { users = { - mutableUsers = true; + mutableUsers = true; # system passwords stored mutably users."${cfg.name}" = { isNormalUser = true; diff --git a/modules/user/options.nix b/modules/user/options.nix index 1024494..d805bf9 100644 --- a/modules/user/options.nix +++ b/modules/user/options.nix @@ -4,9 +4,11 @@ in { options = { collinux.user = { name = mkOption { + description = "Name for the sole user of this system"; type = types.str; }; isAdmin = mkOption { + description = "Whether this user is an admin"; type = types.bool; default = true; }; diff --git a/secrets.nix b/secrets.nix index 1bcca44..d95f27a 100644 --- a/secrets.nix +++ b/secrets.nix @@ -5,6 +5,7 @@ let ganymede = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINlr+53UmlGVP1blkdNl6NFqn1w2umFJyjH1EVUPKIy9"; in { "caddy-env.age".publicKeys = [ganymede]; + "tsnsrv-authkey.age".publicKeys = [ganymede mercury]; "williams-psk.age".publicKeys = [ganymede]; "github-ssh-key.age".publicKeys = [mercury jupiter]; |
