diff --git a/README.md b/README.md new file mode 100644 index 0000000..eb8928f --- /dev/null +++ b/README.md @@ -0,0 +1,85 @@ +
+ Avatar + Nix logo + + # adam0's infrastructure + + NixOS and Home Manager flake for my system and user environment. + + [![Repo Size](https://img.shields.io/github/repo-size/adam01110/infra?style=flat-square&label=repo%20size&labelColor=504945&color=3c3836)](https://github.com/adam01110/infra) +
+ [![NixOS](https://img.shields.io/badge/NixOS-unstable-458588?style=flat-square&labelColor=504945&logo=nixos&logoColor=ebdbb2)](https://nixos.org) + [![Flakes](https://img.shields.io/badge/Nix-flakes-689d6a?style=flat-square&labelColor=504945&logo=nixos&logoColor=ebdbb2)](https://nixos.wiki/wiki/Flakes) + [![Home Manager](https://img.shields.io/badge/Home%20Manager-modules-b16286?style=flat-square&labelColor=504945&logo=nixos&logoColor=ebdbb2)](https://github.com/nix-community/home-manager) + [![Stylix](https://img.shields.io/badge/Stylix-theming-8f3f71?style=flat-square&labelColor=504945&logo=nixos&logoColor=ebdbb2)](https://github.com/danth/stylix) + [![SOPS Nix](https://img.shields.io/badge/SOPS%20Nix-secrets-fe8019?style=flat-square&labelColor=504945&logo=nixos&logoColor=ebdbb2)](https://github.com/Mic92/sops-nix) + [![Disko](https://img.shields.io/badge/Disko-storage-98971a?style=flat-square&labelColor=504945&logo=nixos&logoColor=ebdbb2)](https://github.com/nix-community/disko) + + [Overview](#overview) - [Layout](#layout) - [Usage](#usage) - [Secrets](#secrets) - [Customization](#customization) - [Tooling](#tooling) +
+ +This repository contains my NixOS and Home Manager setup. It uses `flake-parts`, `flake-file`, and `import-tree` to expose NixOS modules, Home Manager modules, overlays, packages, Disko layouts, and development tooling from `modules/`. + +## Overview + +- Public flake outputs are generated from `modules/` through `inputs.import-tree ./modules`. +- NixOS modules live under `modules/nix`, `modules/services`, `modules/profiles`, and top-level module files such as `modules/users.nix`. +- Home Manager modules live under `modules/programs`, `modules/desktop`, and shared profile modules. +- Desktop modules cover `Hyprland`, `UWSM`, `tuigreet`, `Noctalia Shell`, `Stylix`, XDG portals, MIME defaults, and TUI/GUI integration. +- Local packages, preview helpers, adapters, and overlays live under `modules/pkgs`. Shared helpers live under `lib/`. + +## Layout + +| Path | Purpose | +| --- | --- | +| `assets/` | README images, user avatar, and shared static assets | +| `lib/` | Small helper libraries for environment, MIME, Hyprland, Stylix, Starship, and Yazi config | +| `modules/desktop/` | Hyprland, Noctalia, UWSM, greetd, XDG, clipboard, tablet, and desktop integration modules | +| `modules/development/` | Dev shell and treefmt configuration | +| `modules/nix/` | Core flake, Nix, Home Manager, SOPS, kernel, firmware, and input wiring | +| `modules/pkgs/` | Local packages and package overlays | +| `modules/profiles/` | Shared system and Home Manager profiles, partitioning, locale, theming, and tuning | +| `modules/programs/` | CLI, TUI, GUI, Git, GPG, SSH, GTK, Java, and Nix-LD modules | +| `modules/services/` | NixOS service modules for audio, networking, power, storage, containers, and system tuning | +| `vars.nix` | Shared identity, Git metadata, locale, and regional defaults | + +## Usage + +From the repository root: + +```bash +# Enter the development shell +nix develop + +# Format and lint the repository +nix fmt + +# Regenerate flake.nix after changing flake-file inputs +nix run .#write-flake +``` + +## Secrets + +- Runtime secrets are kept outside this public repo in the private `adam01110/secrets` flake input. +- Recipient rules live in `.sops.yaml` for one user PGP key and three host Age keys. +- SOPS Nix is shared between NixOS and Home Manager through `modules/nix/sops.nix`. + +Edit flow for the private secrets repository: + +```bash +sops secrets.yaml +``` + +## Customization + +- Edit shared identity, locale, and Git metadata in `vars.nix`. +- Add NixOS behavior through `modules/nix`, `modules/services`, and `modules/profiles`. +- Add user-facing tools through `modules/programs` and `modules/desktop`. +- Add local packages and overlays under `modules/pkgs`. + +## Tooling + +- `treefmt-nix` wires `alejandra`, `deadnix`, `statix`, `nixf-diagnose`, `keep-sorted`, `shellcheck`, `shfmt`, `stylua`, `rumdl-format`, and `yamllint`. +- `flake-file` owns the generated root `flake.nix`; update inputs in modules and regenerate with `nix run .#write-flake`. +- `import-tree` auto-discovers the module tree so most new modules only need to export the relevant flake attributes. +- The default dev shell currently provides `sops` and `tokei`. diff --git a/modules/desktop/hyprland/gestures.nix b/modules/desktop/hyprland/gestures.nix index 2f5d08d..6c8cd1f 100644 --- a/modules/desktop/hyprland/gestures.nix +++ b/modules/desktop/hyprland/gestures.nix @@ -3,6 +3,7 @@ # keep-sorted start config, lib, + self, # keep-sorted end ... }: let @@ -23,6 +24,13 @@ cfg = config.programs.nixhypr.touch.enable; in { + imports = [ + # keep-sorted start + noctalia + overzicht + # keep-sorted end + ]; + options.programs.nixhypr.touch.enable = mkEnableOption "Enable touch-specific configuration"; config = mkIf cfg { diff --git a/modules/desktop/hyprland/keybinds/applications.nix b/modules/desktop/hyprland/keybinds/applications.nix index 134b179..704f598 100644 --- a/modules/desktop/hyprland/keybinds/applications.nix +++ b/modules/desktop/hyprland/keybinds/applications.nix @@ -20,8 +20,10 @@ _: { in { imports = with self.modules.homeManager; [ # keep-sorted start + discord ghostty noctalia + zen # keep-sorted end ]; diff --git a/modules/desktop/hyprland/keybinds/system.nix b/modules/desktop/hyprland/keybinds/system.nix index 9272acd..f62e432 100644 --- a/modules/desktop/hyprland/keybinds/system.nix +++ b/modules/desktop/hyprland/keybinds/system.nix @@ -3,6 +3,7 @@ _: { # keep-sorted start config, lib, + self, # keep-sorted end ... }: let @@ -20,7 +21,7 @@ _: { overzicht = "${getExe config.programs.overzicht.package} ipc call"; # keep-sorted end in { - imports = [ + imports = [ # keep-sorted start noctalia overzicht diff --git a/modules/desktop/noctalia/bar.nix b/modules/desktop/noctalia/bar.nix index 7bdf540..f9fb001 100644 --- a/modules/desktop/noctalia/bar.nix +++ b/modules/desktop/noctalia/bar.nix @@ -1,4 +1,4 @@ -{ +{self, ...}: { flake.modules.homeManager.noctalia = { # keep-sorted start config, @@ -9,10 +9,14 @@ }: let inherit (lib) optional; + # keep-sorted start + cfgBattery = config.programs.noctalia-shell.battery.enable; cfgBluetooth = osConfig.capabilities.bluetooth; cfgGpu = config.programs.noctalia-shell.systemMonitor.enableGpu; - cfgBattery = config.programs.noctalia-shell.battery.enable; + # keep-sorted end in { + imports = [self.modules.homeManager.wiremix]; + programs.noctalia-shell.settings.bar = { # keep-sorted start backgroundOpacity = 1; @@ -127,7 +131,6 @@ } ] ++ [{id = "KeepAwake";}] - # Show the plugin battery widget when enabled. ++ (optional cfgBattery {id = "plugin:battery-monitor-plus";}) ++ [ {id = "plugin:github-feed";} diff --git a/modules/desktop/noctalia/general.nix b/modules/desktop/noctalia/general.nix index 9c11823..4554775 100644 --- a/modules/desktop/noctalia/general.nix +++ b/modules/desktop/noctalia/general.nix @@ -1,5 +1,7 @@ -{ +{self, ...}: { flake.modules.homeManager.noctalia = {config, ...}: { + imports = [self.modules.homeManager.hyprland]; + programs.noctalia-shell.settings.general = let # Use sharp corners (no rounding) for consistent design. radius = 0; diff --git a/modules/desktop/noctalia/plugins.nix b/modules/desktop/noctalia/plugins.nix index 6114318..0dfb0b7 100644 --- a/modules/desktop/noctalia/plugins.nix +++ b/modules/desktop/noctalia/plugins.nix @@ -27,6 +27,7 @@ # keep-sorted start generic.vars homeManager.sops + homeManager.xdgDirs # keep-sorted end ]; diff --git a/modules/desktop/noctalia/systemmonitor.nix b/modules/desktop/noctalia/systemmonitor.nix index 3655c28..e128891 100644 --- a/modules/desktop/noctalia/systemmonitor.nix +++ b/modules/desktop/noctalia/systemmonitor.nix @@ -1,4 +1,4 @@ -{ +{self, ...}: { flake.modules.homeManager.noctalia = { # keep-sorted start config, @@ -10,6 +10,13 @@ cfgGpu = config.programs.noctalia-shell.systemMonitor.enableGpu; in { + imports = with self.modules.homeManager; [ + # keep-sorted start + btop + xdgTerminal + # keep-sorted end + ]; + # Expose a GPU toggle for Noctalia system monitor widgets. options.programs.noctalia-shell.systemMonitor.enableGpu = mkEnableOption "Enable dGPU monitoring and GPU temperature widgets."; diff --git a/modules/desktop/noctalia/theme.nix b/modules/desktop/noctalia/theme.nix index 46c181c..e8c6d88 100644 --- a/modules/desktop/noctalia/theme.nix +++ b/modules/desktop/noctalia/theme.nix @@ -1,4 +1,4 @@ -{ +{self, ...}: { flake.modules.homeManager.noctalia = { # keep-sorted start config, @@ -9,6 +9,8 @@ inherit (lib) mkForce; colors = config.lib.stylix.colors.withHashtag; in { + imports = [self.modules.homeManager.stylixBase]; + stylix.targets.noctalia-shell.colors.override.withHashtag = with colors; { # keep-sorted start base05 = base06; diff --git a/modules/desktop/noctalia/wallpaper.nix b/modules/desktop/noctalia/wallpaper.nix index 28ad520..691e9c2 100644 --- a/modules/desktop/noctalia/wallpaper.nix +++ b/modules/desktop/noctalia/wallpaper.nix @@ -1,7 +1,9 @@ -{ +{self, ...}: { flake.modules.homeManager.noctalia = {config, ...}: let picturesDir = config.xdg.userDirs.pictures; in { + imports = [self.modules.homeManager.xdgDirs]; + # Wallpaper directory and rotation settings. programs.noctalia-shell.settings.wallpaper = { # keep-sorted start block=yes diff --git a/modules/desktop/xdg/portal.nix b/modules/desktop/xdg/portal.nix index 20264f9..d95773b 100644 --- a/modules/desktop/xdg/portal.nix +++ b/modules/desktop/xdg/portal.nix @@ -16,7 +16,12 @@ inherit (lib) getExe; inherit ((import "${inputs.hyprland}/nix/lib.nix" lib)) toHyprlang; in { - imports = [self.modules.homeManager.hyprland]; + imports = with self.modules.homeManager; [ + # keep-sorted start + hyprland + xdgTerminal + # keep-sorted end + ]; xdg.configFile = { "xdg-desktop-portal-termfilechooser/config".text = let diff --git a/modules/nix/home-manager.nix b/modules/nix/home-manager.nix index 7769473..c7771ea 100644 --- a/modules/nix/home-manager.nix +++ b/modules/nix/home-manager.nix @@ -24,7 +24,12 @@ }: let inherit (vars) username; in { - imports = [inputs.home-manager.nixosModules.home-manager]; + imports = [ + # keep-sorted start + inputs.home-manager.nixosModules.home-manager + self.modules.generic.vars + # keep-sorted end + ]; home-manager = { useGlobalPkgs = true; diff --git a/modules/profiles/common/timezone.nix b/modules/profiles/common/timezone.nix index b585343..5600ded 100644 --- a/modules/profiles/common/timezone.nix +++ b/modules/profiles/common/timezone.nix @@ -16,9 +16,9 @@ # keep-sorted end ; - cfgTimezone = config.optServices.timezone; + cfgTimezone = config.services.timezone; in { - options.optServices.timezone = mkOption { + options.services.timezone = mkOption { description = '' Configure the system time zone or enable automatic adjustment. Set to a time zone string (for example "Europe/Amsterdam") to use a fixed time zone, diff --git a/modules/profiles/partitioning/default.nix b/modules/profiles/partitioning/default.nix index c7b8adf..8406572 100644 --- a/modules/profiles/partitioning/default.nix +++ b/modules/profiles/partitioning/default.nix @@ -1,5 +1,19 @@ {inputs, ...}: { - flake.modules.nixos.disko = { + flake.modules.nixos.disko = {lib, ...}: let + inherit + (lib) + # keep-sorted start + mkOption + types + # keep-sorted end + ; + in { imports = [inputs.disko.nixosModules.disko]; + + options.disko.disk = mkOption { + type = types.str; + example = "/dev/nvme0n1"; + description = "Disk device to use for the selected disko layout."; + }; }; } diff --git a/modules/profiles/partitioning/ext4.nix b/modules/profiles/partitioning/ext4.nix index 443a91a..f0c3261 100644 --- a/modules/profiles/partitioning/ext4.nix +++ b/modules/profiles/partitioning/ext4.nix @@ -6,12 +6,12 @@ imports = [inputs.disko.flakeModules.disko]; - flake.diskoConfigurations.ext4 = { + flake.diskoConfigurations.ext4 = disk: { disko.devices = { disk = { main = { type = "disk"; - device = "/dev/nvme0n1"; + device = disk; content = { type = "gpt"; partitions = { @@ -38,12 +38,8 @@ mountpoint = "/"; mountOptions = [ # #keep-sorted start - "commit=8" - "data=writeback" "defaults" "errors=remount-ro" - "fast_commit" - "journal_async_commit" "noatime" # keep-sorted end ]; diff --git a/modules/profiles/personal.nix b/modules/profiles/personal.nix index da09d8b..0c4e10a 100644 --- a/modules/profiles/personal.nix +++ b/modules/profiles/personal.nix @@ -1,5 +1,5 @@ {self, ...}: { - flake.modules.nixos.personal = { + flake.modules.nixos.personal = {config, ...}: { imports = (with self.modules.nixos; [ # keep-sorted start @@ -21,7 +21,7 @@ ]) ++ [self.modules.generic.determinate]; - disko.devices = self.diskoConfigurations.ext4.disko.devices; + disko.devices = (self.diskoConfigurations.ext4 config.disko.disk).disko.devices; }; flake.modules.homeManager.personal = { diff --git a/modules/programs/git.nix b/modules/programs/git.nix index f9f163e..79ab7fe 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -27,7 +27,7 @@ colors = osConfig.lib.stylix.colors.withHashtag; in { - imports = with self.mdoules; [ + imports = with self.modules; [ # keep-sorted start generic.vars homeManager.sops diff --git a/modules/programs/gui/discord/plugins/communication.nix b/modules/programs/gui/discord/plugins/communication.nix index 776e702..ee3b124 100644 --- a/modules/programs/gui/discord/plugins/communication.nix +++ b/modules/programs/gui/discord/plugins/communication.nix @@ -6,7 +6,12 @@ # keep-sorted end ... }: { - imports = [self.modules.homeManager.stylixPersonal]; + imports = with self.modules; [ + # keep-sorted start + generic.vars + homeManager.stylixPersonal + # keep-sorted end + ]; programs.nixcord.config.plugins = { # keep-sorted start block=yes newline_separated=yes diff --git a/modules/programs/gui/zen/preferences.nix b/modules/programs/gui/zen/preferences.nix index ca34ba9..c359f6d 100644 --- a/modules/programs/gui/zen/preferences.nix +++ b/modules/programs/gui/zen/preferences.nix @@ -21,23 +21,24 @@ in { imports = [self.modules.generic.vars]; - options.zen-browser = { - # keep-sorted start block=yes newline_separated=yes - commit-space = mkOption { - description = "Memory threshold (in MiB) at which tabs are unloaded when available commit space is low"; + options.programs.zen-browser.profiles = mkOption { + type = types.attrsOf (types.submodule { + options.preferences = { + # keep-sorted start block=yes newline_separated=yes + commitSpace = mkOption { + description = "Memory threshold (in MiB) at which tabs are unloaded when available commit space is low"; - type = types.int; - }; + type = types.int; + }; - travel.enable = mkEnableOption "Enable travel specific preferences."; - # keep-sorted end + travel.enable = mkEnableOption "Enable travel specific preferences."; + # keep-sorted end + }; + }); }; config.programs.zen-browser.profiles.default.settings = let - # keep-sorted start - cfgCommitSpace = config.zen-browser.commit-space; - cfgTravel = config.zen-browser.travel.enable; - # keep-sorted end + cfg = config.programs.zen-browser.profiles.default.preferences; flattenSettings = prefix: concatMapAttrs (name: value: let @@ -78,7 +79,7 @@ # keep-sorted end # keep-sorted start - low_commit_space_threshold_mb = cfgCommitSpace; + low_commit_space_threshold_mb = cfg.commitSpace; low_commit_space_threshold_percent = 20; # keep-sorted end @@ -399,7 +400,7 @@ network = { # keep-sorted start - captive-portal-service.enabled = cfgTravel; + captive-portal-service.enabled = cfg.travel.enable; connectivity-service.enabled = false; # keep-sorted end diff --git a/modules/programs/tui/btop.nix b/modules/programs/tui/btop.nix index 3f1f559..272506d 100644 --- a/modules/programs/tui/btop.nix +++ b/modules/programs/tui/btop.nix @@ -9,7 +9,7 @@ }: let inherit (lib) mkOption types; - inherit (config.btop) gpuBackends; + inherit (config.programs.btop) gpuBackends; hasCuda = lib.elem "cuda" gpuBackends; hasRocm = lib.elem "rocm" gpuBackends; @@ -27,7 +27,7 @@ then pkgs.btop-rocm else pkgs.btop; in { - options.btop.gpuBackends = mkOption { + options.programs.btop.gpuBackends = mkOption { description = "Select GPU backends to enable in btop."; type = types.listOf ( diff --git a/modules/programs/tui/fzf.nix b/modules/programs/tui/fzf.nix index 89c7ee9..7f37334 100644 --- a/modules/programs/tui/fzf.nix +++ b/modules/programs/tui/fzf.nix @@ -1,7 +1,9 @@ -{ +{self, ...}: { flake.modules.homeManager.fzf = {lib, ...}: let inherit (lib) mkForce; in { + imports = [self.modules.homeManager.stylixBase]; + programs.fzf = let enableShellIntegration = false; in { diff --git a/modules/programs/tui/neovim/components/bufferline.nix b/modules/programs/tui/neovim/components/bufferline.nix index a08a171..9604282 100644 --- a/modules/programs/tui/neovim/components/bufferline.nix +++ b/modules/programs/tui/neovim/components/bufferline.nix @@ -12,7 +12,7 @@ imports = [self.modules.homeManager.stylixBase]; # keep-sorted start block=yes newline_separated=yes - nvf.luaConfigPreSnippets = [ + programs.nvf.settings.vim.luaConfigPreSnippets = [ '' function _G.LCB(bufnr, clicks, button, modifiers) if button ~= "l" then diff --git a/modules/programs/tui/neovim/components/dashboard.nix b/modules/programs/tui/neovim/components/dashboard.nix index 2200ef2..1c39b43 100644 --- a/modules/programs/tui/neovim/components/dashboard.nix +++ b/modules/programs/tui/neovim/components/dashboard.nix @@ -16,7 +16,7 @@ # keep-sorted start block=yes newline_separated=yes # Capture dashboard metrics once so the footer can read cached values. - nvf.luaConfigPreSnippets = [ + programs.nvf.settings.vim.luaConfigPreSnippets = [ # Cache startup timing and plugin counts after the UI attaches. '' vim.g.snacks_dashboard_start_ns = vim.uv.hrtime() diff --git a/modules/programs/tui/neovim/components/notify.nix b/modules/programs/tui/neovim/components/notify.nix index 57ea41b..1af1443 100644 --- a/modules/programs/tui/neovim/components/notify.nix +++ b/modules/programs/tui/neovim/components/notify.nix @@ -7,7 +7,7 @@ ... }: let inherit (lib.generators) mkLuaInline; - inherit (config.nvf) borderType; + inherit (config.programs.nvf.settings.vim.ui) borderType; in { programs.nvf.settings.vim.notify.nvim-notify = { enable = true; diff --git a/modules/programs/tui/neovim/components/telescope.nix b/modules/programs/tui/neovim/components/telescope.nix index cfd83f5..4bfb3fa 100644 --- a/modules/programs/tui/neovim/components/telescope.nix +++ b/modules/programs/tui/neovim/components/telescope.nix @@ -10,7 +10,7 @@ in { imports = [self.modules.homeManager.stylixBase]; - nvf.luaConfigPreSnippets = [ + programs.nvf.settings.vim.luaConfigPreSnippets = [ # Install Telescope as the global vim.ui.select provider after UI startup. '' vim.api.nvim_create_autocmd("User", { diff --git a/modules/programs/tui/neovim/components/yazi.nix b/modules/programs/tui/neovim/components/yazi.nix index 7fbe770..89b3345 100644 --- a/modules/programs/tui/neovim/components/yazi.nix +++ b/modules/programs/tui/neovim/components/yazi.nix @@ -10,7 +10,7 @@ change_neovim_cwd_on_close = true; open_for_directories = true; open_multiple_tabs = true; - yazi_floating_window_border = config.nvf.borderType; + yazi_floating_window_border = config.programs.nvf.settings.vim.ui.borderType; # keep-sorted end }; }; diff --git a/modules/programs/tui/neovim/default.nix b/modules/programs/tui/neovim/default.nix index 79ef35e..2fc4545 100644 --- a/modules/programs/tui/neovim/default.nix +++ b/modules/programs/tui/neovim/default.nix @@ -41,7 +41,7 @@ # keep-sorted end ; - cfg = config.nvf; + cfg = config.programs.nvf.settings.vim; in { imports = [inputs.nvf.homeManagerModules.default] @@ -52,19 +52,19 @@ # keep-sorted end ]); - options.nvf = { + options.programs.nvf.settings.vim = { # keep-sorted start block=yes newline_separated=yes - borderType = mkOption { - type = types.str; - default = "single"; - description = "Border style for Neovim floating UI."; - }; - luaConfigPreSnippets = mkOption { type = types.listOf types.lines; default = []; description = "Lua snippets concatenated into nvf's luaConfigPre."; }; + + ui.borderType = mkOption { + type = types.str; + default = "single"; + description = "Border style for Neovim floating UI."; + }; # keep-sorted end }; diff --git a/modules/programs/tui/neovim/ui.nix b/modules/programs/tui/neovim/ui.nix index bb77092..eb54526 100644 --- a/modules/programs/tui/neovim/ui.nix +++ b/modules/programs/tui/neovim/ui.nix @@ -1,7 +1,7 @@ { flake.modules.homeManager.neovim = {config, ...}: { programs.nvf.settings.vim = let - inherit (config.nvf) borderType; + inherit (config.programs.nvf.settings.vim.ui) borderType; in { # keep-sorted start block=yes newline_separated=yes ui = { diff --git a/modules/programs/tui/nvtop.nix b/modules/programs/tui/nvtop.nix index 84fe1c9..4857e4d 100644 --- a/modules/programs/tui/nvtop.nix +++ b/modules/programs/tui/nvtop.nix @@ -31,7 +31,7 @@ # keep-sorted end ]; in { - options.nvtop.types = mkOption { + options.programs.nvtop.types = mkOption { description = "Choose which GPU types to monitor with nvtop."; type = types.listOf (types.enum gpuTypes); @@ -40,7 +40,7 @@ # Override enables multiple gpu backends in single nvtop instance. config.home.packages = let - selectedTypes = config.nvtop.types; + selectedTypes = config.programs.nvtop.types; in if selectedTypes == [] then [] diff --git a/modules/programs/tui/television/channels.nix b/modules/programs/tui/television/channels.nix index 3070401..81566b7 100644 --- a/modules/programs/tui/television/channels.nix +++ b/modules/programs/tui/television/channels.nix @@ -1,4 +1,4 @@ -{ +{self, ...}: { flake.modules.homeManager.television = { # keep-sorted start config, @@ -6,6 +6,14 @@ # keep-sorted end ... }: { + imports = with self.modules.homeManager; [ + # keep-sorted start + bat + eza + zoxide + # keep-sorted end + ]; + programs.television.package = pkgs.television.withPackages ( _: # Bundle tools that channel commands shell out to. diff --git a/modules/programs/tui/television/channels/files.nix b/modules/programs/tui/television/channels/files.nix index c038af9..ccb0f49 100644 --- a/modules/programs/tui/television/channels/files.nix +++ b/modules/programs/tui/television/channels/files.nix @@ -1,4 +1,4 @@ -{ +{self, ...}: { flake.modules.homeManager.television = { # keep-sorted start config, @@ -11,6 +11,8 @@ fd = getExe config.programs.fd.package; in { + imports = [self.modules.homeManager.fd]; + programs.television.channels.files = { # keep-sorted start block=yes newline_separated=yes actions.edit = { diff --git a/modules/programs/tui/television/channels/zoxide.nix b/modules/programs/tui/television/channels/zoxide.nix index 0519c48..704708e 100644 --- a/modules/programs/tui/television/channels/zoxide.nix +++ b/modules/programs/tui/television/channels/zoxide.nix @@ -1,4 +1,4 @@ -{ +{self, ...}: { flake.modules.homeManager.television = { # keep-sorted start config, @@ -24,6 +24,13 @@ # keep-sorted end ; in { + imports = with self.modules.homeManager; [ + # keep-sorted start + eza + zoxide + # keep-sorted end + ]; + programs.television.channels.zoxide = let zoxide = getExe config.programs.zoxide.package; in { diff --git a/modules/programs/tui/yazi/plugins.nix b/modules/programs/tui/yazi/plugins.nix index 152f109..fe012b7 100644 --- a/modules/programs/tui/yazi/plugins.nix +++ b/modules/programs/tui/yazi/plugins.nix @@ -9,7 +9,15 @@ }: let inherit (pkgs.lib.generators) mkLuaInline; in { - imports = [self.modules.homeManager.nur]; + imports = with self.modules.homeManager; [ + # keep-sorted start + bat + fd + nur + ripgrep + television + # keep-sorted end + ]; programs.yazi = { package = pkgs.yazi.override { diff --git a/modules/services/geoclue.nix b/modules/services/geoclue.nix index 3cf0adc..b187a8b 100644 --- a/modules/services/geoclue.nix +++ b/modules/services/geoclue.nix @@ -1,7 +1,9 @@ -{ +{self, ...}: { flake.modules.nixos.geoclue = {config, ...}: let cfgWifi = config.capabilities.wifi; in { + imports = [self.modules.nixos.capabilities]; + services.geoclue2 = { enable = true; diff --git a/modules/services/podman.nix b/modules/services/podman.nix index 333319a..47823ca 100644 --- a/modules/services/podman.nix +++ b/modules/services/podman.nix @@ -1,46 +1,21 @@ {self, ...}: { flake.modules.nixos.podman = { # keep-sorted start - config, - lib, pkgs, vars, # keep-sorted end ... }: let - inherit - (lib) - # keep-sorted start - mkEnableOption - mkIf - # keep-sorted end - ; inherit (vars) username; - - cfgAutoPrune = config.optServices.podman.autoPrune.enable; in { imports = [self.modules.generic.vars]; - options.optServices.podman.autoPrune.enable = mkEnableOption "Enable podman auto-prune."; - virtualisation = { podman = { # Enable podman service and tooling. enable = true; # Expose docker-compatible socket for tooling that expects dockerd. dockerSocket.enable = true; - - # Clean up unused images/containers regularly. - autoPrune = mkIf cfgAutoPrune { - enable = true; - - flags = [ - # keep-sorted start - "--all" - "--force" - # keep-sorted end - ]; - }; }; # Disable the podman compose warning about external command execution. diff --git a/modules/users.nix b/modules/users.nix index 282d066..e3b026e 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -15,7 +15,12 @@ # keep-sorted end ; in { - imports = [self.modules.nixos.sops]; + imports = with self.modules; [ + # keep-sorted start + generic.vars + nixos.sops + # keep-sorted end + ]; # Ensure the user account can be created with a password managed by sops-nix. sops.secrets.user_password.neededForUsers = true; diff --git a/todo-stats.sh b/todo-stats.sh deleted file mode 100755 index 19786d1..0000000 --- a/todo-stats.sh +++ /dev/null @@ -1,178 +0,0 @@ -#!/usr/bin/env sh - -set -eu - -todo_file=${1:-todo.md} - -if [ ! -f "$todo_file" ]; then - printf 'todo file not found: %s\n' "$todo_file" >&2 - exit 1 -fi - -awk ' - function pct(part, whole) { - return whole == 0 ? 0 : part * 100 / whole - } - - function bar(done_count, removed_count, todo_count, width, total_count, done_cells, removed_cells, todo_cells, i, out) { - total_count = done_count + removed_count + todo_count - - if (total_count == 0) { - return sprintf("%*s", width, "") - } - - done_cells = int((done_count * width / total_count) + 0.5) - removed_cells = int((removed_count * width / total_count) + 0.5) - - if (removed_count > 0 && removed_cells == 0) { - removed_cells = 1 - } - - if (done_cells + removed_cells > width) { - done_cells = width - removed_cells - } - - todo_cells = width - done_cells - removed_cells - out = "" - - for (i = 1; i <= done_cells; i++) { - out = out "█" - } - - for (i = 1; i <= removed_cells; i++) { - out = out "░" - } - - for (i = 1; i <= todo_cells; i++) { - out = out "." - } - - return out - } - - function simple_bar(part, whole, width, fill, filled, i, out) { - filled = whole == 0 ? 0 : int((part * width / whole) + 0.5) - out = "" - - for (i = 1; i <= width; i++) { - out = out (i <= filled ? fill : " ") - } - - return out - } - - function print_stat(label, count, whole, fill) { - printf "%-11s %4d %6.1f%% [%s]\n", label ":", count, pct(count, whole), simple_bar(count, whole, 28, fill) - } - - function section_total(i) { - return section_todo[i] + section_done[i] + section_removed[i] - } - - function trim_heading(line) { - sub(/^#+[[:space:]]+/, "", line) - return line - } - - function fit(text, width) { - return length(text) <= width ? text : substr(text, 1, width - 3) "..." - } - - function in_new_files() { - return subsection == "New files" - } - - /^###[[:space:]]+/ { - subsection = trim_heading($0) - next - } - - /^##[[:space:]]+/ { - section = trim_heading($0) - subsection = "" - if (!(section in seen)) { - seen[section] = 1 - sections[++section_count] = section - } - next - } - - /^- \[ \]/ { - if (in_new_files()) { - new_todo++ - next - } - - todo++ - section_todo[section]++ - } - - /^- \[[xX]\]/ { - if (in_new_files()) { - new_done++ - next - } - - done++ - section_done[section]++ - } - - /^- \[-\]/ { - if (in_new_files()) { - new_removed++ - next - } - - removed++ - section_removed[section]++ - } - - END { - total = todo + done + removed - active = todo + done - new_total = new_todo + new_done + new_removed - new_active = new_todo + new_done - - if (total + new_total == 0) { - print "No todo entries found." - exit - } - - print "==============================================" - printf "Todo summary: %s\n", FILENAME - print "==============================================" - printf "Progress %6.1f%% [%s]\n", pct(done, active), bar(done, removed, todo, 28) - printf "Remaining %6.1f%% [%s]\n", pct(todo, active), simple_bar(todo, active, 28, ".") - print "Legend: █ done, ░ removed, . to do" - print "----------------------------------------------" - print_stat("To do", todo, total, ".") - print_stat("Done", done, total, "█") - print_stat("Removed", removed, total, "░") - print "----------------------------------------------" - printf "Active: %4d\n", active - printf "Total: %4d\n", total - - if (new_total > 0) { - print "" - printf "New files: %4d (excluded from progress)\n", new_total - } - - if (section_count > 0) { - print "" - print "Section progress" - print "----------------------------------------------" - - for (i = 1; i <= section_count; i++) { - name = sections[i] - subtotal = section_total(name) - - if (subtotal == 0) { - continue - } - - section_active = section_todo[name] + section_done[name] - printf "%-28s %6.1f%% [%s] %3d/%-3d\n", fit(name, 28), pct(section_done[name], section_active), bar(section_done[name], section_removed[name], section_todo[name], 12), section_done[name], section_active - } - } - } -' "$todo_file" diff --git a/todo.md b/todo.md deleted file mode 100644 index 7963589..0000000 --- a/todo.md +++ /dev/null @@ -1,627 +0,0 @@ -# Repo Migration Todo - -## Root - -- [x] .envrc -- [x] .gitignore -- [-] .luarc.json -- [x] .sops.yaml -- [x] AGENTS.md -- [x] LICENSE -- [ ] README.md -- [-] THIRD_PARTY_NOTICES.md -- [x] face.png (moved to assets/face.png) -- [-] flake.lock -- [-] flake.nix -- [x] vars.nix - -## .github/ - -- [-] dependabot.yml - -## .github/workflows/ - -- [-] ci.yml - -## flake/ - -- [x] devshell.nix -- [ ] nixos.nix -- [x] treefmt.nix - -## keys/users/ - -- [x] adam0.asc - -## libs/ - -(moved to lib/) - -- [-] attr-paths.nix -- [x] default.nix -- [x] env.nix -- [-] files.nix -- [x] mime.nix -- [x] starship.nix -- [x] stylix.nix - -## modules/home/ - -- [x] git.nix -- [x] gpg.nix -- [x] home.nix -- [x] sops.nix (moved to modules/nix/sops.nix) -- [x] ssh.nix - -## modules/home/cli/ - -(moved to modules/programs/cli) - -- [x] bat.nix -- [x] bonsai.nix -- [x] cpond.nix -- [x] direnv.nix -- [x] eza.nix (moved to eza/default.nix) -- [x] fd.nix -- [x] gh.nix -- [x] npm.nix -- [x] nys.nix -- [x] other.nix -- [x] pipes.nix -- [x] rumdl.nix -- [-] systeroid.nix -- [x] tlrc.nix -- [x] zoxide.nix - -### New files - -- [x] ripgrep.nix -- [x] bun.nix -- [x] speedtest.nix -- [x] eza/theme.nix -- [x] eh.nix -- [x] gitfetch.nix -- [x] nix-index.nix -- [x] onefetch.nix -- [x] ouch.nix -- [x] sshfs.nix - -## modules/home/cli/fastfetch/ - -(moved to modules/programs/cli) - -- [x] default.nix -- [x] logo.png (moved to assets/nix.png) - -## modules/home/cli/fish/ - -(moved to modules/programs/cli/fish) - -- [-] abbreviations.nix -- [x] aliases.nix -- [x] default.nix (removed fzfish) -- [x] plugins.nix (removed fzfish) - -## modules/home/cli/fish/functions/ - -(moved to modules/programs/cli/fish) - -- [x] fish_greeting.nix - -## modules/home/cli/fish/functions/archive/ - -- [-] 7z.nix -- [-] rar.nix -- [-] tar.nix -- [-] un7z.nix -- [-] unrar.nix -- [-] untar.nix -- [-] unzip.nix -- [-] zip.nix - -## modules/home/cli/ripgrep-all/ - -- [x] adapters.nix -- [x] default.nix - -## modules/home/cli/ripgrep-all/adapters/ - -- [x] gron.nix -- [x] other.nix - -## modules/home/cli/starship/ - -- [x] build.nix -- [x] container.nix -- [x] default.nix -- [x] disabled.nix -- [x] format.nix -- [x] general.nix -- [x] git.nix -- [x] languages.nix -- [x] runtimes.nix - -## modules/home/desktop/ - -- [x] default.nix (moved into cliphist module) -- [x] mangohud.nix -- [x] overzicht.nix - -### New files - -- [x] cliphist.nix -- [x] uwsm.nix - -## modules/home/desktop/hyprland/ - -- [x] appearance.nix -- [x] default.nix -- [x] general.nix -- [x] gestures.nix -- [x] keybinds.nix -- [-] monitors.nix -- [x] plugins.nix -- [x] rules.nix - -## modules/home/desktop/noctalia/ - -- [x] audio.nix -- [x] bar.nix -- [x] brightness.nix -- [x] calendar.nix -- [x] controlcenter.nix -- [x] default.nix -- [x] delobotomize.nix -- [x] dock.nix -- [x] general.nix -- [x] hooks.nix -- [x] idle.nix -- [x] launcher.nix -- [x] location.nix -- [x] network.nix -- [x] notifications.nix -- [x] plugins.nix -- [x] sessionmenu.nix -- [x] systemmonitor.nix -- [x] ui.nix -- [x] wallpaper.nix - -### New files - -- [x] theme.nix - -## modules/home/desktop/noctalia/patches/ - -- [x] noctalia-launcher-ipc.patch -- [x] noctalia-location-override.patch -- [x] noctalia-settings-fallback.patch - -## modules/home/desktop/stylix/ - -- [x] default.nix -- [x] delta.nix -- [x] disabled.nix -- [x] discord.nix -- [x] eza.nix -- [x] gtk.nix -- [x] hyprcursor.nix -- [x] noctalia.nix -- [x] opencode.nix -- [x] other.nix -- [x] overzicht.nix -- [x] spotify.nix -- [x] television.nix - -## modules/home/desktop/xdg/ - -- [x] applications.nix -- [x] autostart.nix (moved into the specific application modules) -- [x] cleanup.nix -- [x] default.nix (split into multiple files) -- [x] portal.nix -- [x] terminal.nix - -### New files - -- [x] dirs.nix -- [x] polkit.nix - -## modules/home/desktop/xdg/applications/ - -- [x] audio.nix -- [x] code.nix -- [x] document-viewers.nix -- [x] files.nix -- [x] image-editors.nix -- [x] image-viewers.nix -- [x] protocols.nix -- [x] video.nix - -## modules/home/gui/ - -- [x] lutris.nix -- [x] onlyoffice.nix -- [x] other.nix (split into multiple files and modules for each application, and removed helium, obsidian, krita) -- [x] prism.nix -- [x] sober.nix -- [x] spotify.nix -- [x] zaread.nix -- [x] zathura.nix - -### New files - -- [x] aseprite.nix -- [x] beeper.nix -- [x] bitwarden.nix -- [x] bleachbit.nix -- [x] crosspipe.nix -- [x] decibels.nix -- [x] flatseal.nix -- [x] gimp.nix -- [x] heroic.nix -- [x] loupe.nix -- [x] mcpelauncher.nix -- [x] proton.nix -- [x] showtime.nix -- [x] upscayl.nix -- [x] warehouse.nix - -## modules/home/gui/discord/ - -- [x] default.nix -- [x] autostart.nix -- [x] settings.nix - -## modules/home/gui/discord/plugins/ - -- [x] communication.nix -- [x] core.nix -- [x] integrations.nix -- [x] interface.nix -- [x] media.nix -- [x] social.nix - -## modules/home/gui/discord/themes/ - -- [x] snippets.css -- [x] system24.css - -### New files - -- [x] default.nix - -## modules/home/gui/ghostty/ - -- [-] cursor.glsl -- [x] default.nix -- [x] keybinds.nix -- [x] settings.nix - -### patches/ - -- [x] cursor-tail-local-settings.patch - -## modules/home/gui/zen/ - -(moved to modules/programs/gui/zen) - -- [x] chrome.nix -- [x] default.nix -- [x] extensions.nix -- [x] mods.nix -- [x] policies.nix -- [x] preferences.nix -- [x] search.nix -- [x] spaces.nix - -## modules/home/services/ - -- [x] flatpak.nix - -## modules/home/tui/ - -(moved to modules/programs/tui) - -- [x] atuin.nix -- [x] bluetui.nix -- [x] btop.nix -- [x] cava.nix -- [x] fzf.nix -- [x] impala.nix -- [-] kmon.nix -- [x] nvtop.nix -- [x] other.nix (renamed to opencubicplayer.nix) -- [-] oxicord.nix -- [-] spotify-player.nix -- [x] wiremix.nix - -## modules/home/tui/neovim/ - -- [x] default.nix -- [x] keymap.nix -- [x] settings.nix -- [x] ui.nix - -## modules/home/tui/neovim/components/ - -- [x] autocomplete.nix -- [x] biscuits.nix -- [x] breadcrumbs.nix -- [x] bufferline.nix -- [x] cheatsheet.nix -- [x] dashboard.nix -- [x] dim.nix -- [x] git.nix -- [x] hardtime.nix -- [x] highlight.nix -- [x] indent.nix -- [x] notify.nix -- [x] presence.nix -- [x] profiler.nix -- [x] scroll.nix -- [x] scrollbar.nix -- [x] session.nix -- [x] statusline.nix -- [x] telescope.nix -- [x] yazi.nix - -## modules/home/tui/neovim/languages/ - -- [x] css.nix -- [x] default.nix -- [x] lua.nix -- [x] markdown.nix -- [x] nix.nix -- [x] other.nix -- [x] python.nix -- [x] rust.nix -- [x] toml.nix -- [x] typescript.nix - -### New files - -- [x] docker.nix - -## modules/home/tui/opencode/ - -- [x] default.nix -- [x] env.nix -- [x] formatter.nix -- [x] instructions.md -- [x] lsp.nix -- [x] mcp-wrappers.nix -- [x] plugins.nix -- [x] settings.nix - -### New files - -- [x] theme.nix - -## modules/home/tui/opencode/skills/ - -- [x] create-readme.md -- [x] default.nix -- [x] find-skills.md -- [x] nvf-config.md -- [x] uncodixfy.md - -## modules/home/tui/opencode/skills/lazy-mcp/ - -- [x] context7.md -- [x] github.md -- [x] grep-app.md - -## modules/home/tui/opencode/skills/nix/ - -- [x] debug.md -- [x] index.md -- [x] search.md - -## modules/home/tui/television/ - -- [x] channels.nix -- [x] default.nix -- [x] nix-search.nix -- [x] settings.nix - -### New files - -- [x] theme.nix - -## modules/home/tui/television/channels/ - -- [x] channels.nix -- [x] files.nix -- [x] man.nix -- [x] text.nix -- [x] tldr.nix -- [x] trash.nix -- [x] zoxide.nix - -## modules/home/tui/yazi/ - -- [x] default.nix -- [x] init.lua -- [x] keymap.nix -- [x] plugins.nix -- [x] settings.nix -- [x] theme.nix - -## modules/home/tui/yazi/plugins/ - -- [x] faster-piper.nix -- [x] mediainfo.nix -- [x] mount.nix -- [x] preview-cbz.nix -- [x] preview-epub.nix -- [x] preview-git.nix -- [x] recycle-bin.nix -- [x] relative-motions.nix -- [x] restore.nix -- [x] smart-enter.nix -- [x] smart-paste.nix -- [x] spot-audio.nix -- [x] spot-cbz.nix -- [x] spot-image.nix -- [x] spot-video.nix -- [x] tv.nix -- [x] ucp.nix - -## modules/hosts/desktop/ - -- [ ] default.nix -- [ ] hardware.nix -- [ ] home.nix - -## modules/hosts/laptop/ - -- [ ] default.nix -- [ ] hardware.nix -- [ ] home.nix - -## modules/hosts/vm/ - -- [ ] default.nix -- [ ] hardware.nix -- [ ] home.nix - -## modules/system/ - -- [x] default.nix -- [x] disk.nix -- [x] locale.nix (moved to modules/profiles/locale.nix) -- [x] nix.nix -- [x] slim.nix (moved to modules/profiles/slim.nix) -- [x] sops.nix (moved to modules/nix/sops.nix) -- [x] tweaks.nix (moved to modules/profiles/tweaks.nix) -- [x] user.nix - -## modules/system/cli/ - -(moved to modules/programs/cli) - -- [x] man.nix -- [x] nh.nix -- [x] other.nix (renamed to bandwhich.nix) -- [x] sudo-rs.nix - -## modules/system/desktop/ - -(moved to modules/desktop) - -- [x] hyprland.nix (merged into hyprland/default.nix) -- [x] stylix.nix -- [x] tablet.nix -- [x] tuigreet.nix -- [x] xdg-portal.nix - -## modules/system/gui/ - -(moved to modules/programs/gui) - -- [x] lsfg.nix -- [x] other.nix (split into services/printing.nix and gui/seahorse.nix) -- [x] steam.nix -- [x] virt-manager.nix - -### New files - -- [x] seahorse.nix - -## modules/system/services/ - -(moved to modules/services) - -- [x] ananicy.nix -- [x] avahi.nix -- [x] bluetooth.nix -- [x] geoclue.nix -- [x] gnome-keyring.nix -- [x] gvfs.nix -- [x] locate.nix -- [x] logind.nix (moved to modules/profiles/common/lidswitch.nix) -- [x] network.nix (split wifi up into sepperate wifi module) -- [x] other.nix (split up into multiple files) -- [x] pipewire.nix -- [x] podman.nix -- [x] printing.nix -- [x] scx.nix -- [-] ssh.nix -- [x] timesyncd.nix -- [x] timezone.nix (moved to modules/profiles/common/timezone.nix) -- [x] tlp.nix -- [x] zram.nix - -### New files - -- [x] bpftune.nix -- [x] evolution-data-server.nix -- [x] libinput.nix -- [x] power-profiles-daemon.nix -- [x] udisks2.nix -- [x] upower.nix -- [x] wifi.nix - -## overlays/ - -- [x] _inputs.nix -- [-] default.nix -- [x] envfs.nix (moved into the envfs module) -- [x] external-pkgs.nix -- [x] hyprland-plugins.nix -- [-] pkgs.nix -- [-] superhtml.nix -- [-] zaread.nix - -## pkgs/ - -- [x] default.nix -- [x] lutris.nix -- [x] nocheatsheet-nvim.nix -- [x] telescope-all-recent-nvim.nix -- [x] zaread.nix - -## pkgs/scripts/ - -- [x] performant-mode.nix -- [x] systemd-status-preview.nix -- [x] text-preview.nix - -## pkgs/scripts/ripgrep-all-adapters/ - -(moved to modules/pkgs/ripgrep-all-adapters) - -- [x] djvutorga-adapter.nix -- [x] pptx2md-adapter.nix - -## modules/ - -- [x] capabilities.nix -- [x] shell-abbreviations.nix - -## modules/nix/ - -- [x] dendritic.nix -- [x] determinate.nix -- [x] home-manager.nix -- [x] lib.nix -- [x] nur.nix -- [x] vars.nix - -## modules/profiles/ - -- [x] personal.nix - -## modules/pkgs/ - -- [x] os-age.nix - -### preview/ - -- [x] man.nix -- [x] systemd-status.nix (moved from pkgs/scripts/systemd-status-preview.nix) -- [x] text.nix (moved from pkgs/scripts/text-preview.nix) - -## secrets/ - -- [x] secrets.yaml