From ae3fa667bda75f11881c9209dc67226f98bcfd95 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Thu, 17 Sep 2026 11:05:45 +0200 Subject: Add cross-platform Nix flake bootstrap Adds a flake providing shared modules for NixOS and standalone home-manager, a copyable NixOS host template, and the OpenSpec tooling/change scaffolding used to plan this work. --- modules/home/cli-tools.nix | 12 ++++++++++++ modules/home/default.nix | 8 ++++++++ modules/home/editor.nix | 7 +++++++ modules/home/git.nix | 9 +++++++++ modules/home/shell.nix | 14 ++++++++++++++ modules/nixos/common.nix | 23 +++++++++++++++++++++++ 6 files changed, 73 insertions(+) create mode 100644 modules/home/cli-tools.nix create mode 100644 modules/home/default.nix create mode 100644 modules/home/editor.nix create mode 100644 modules/home/git.nix create mode 100644 modules/home/shell.nix create mode 100644 modules/nixos/common.nix (limited to 'modules') diff --git a/modules/home/cli-tools.nix b/modules/home/cli-tools.nix new file mode 100644 index 0000000..c489e1c --- /dev/null +++ b/modules/home/cli-tools.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + ripgrep + fd + bat + eza + jq + fzf + tree + ]; +} diff --git a/modules/home/default.nix b/modules/home/default.nix new file mode 100644 index 0000000..206a0ad --- /dev/null +++ b/modules/home/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./git.nix + ./shell.nix + ./editor.nix + ./cli-tools.nix + ]; +} diff --git a/modules/home/editor.nix b/modules/home/editor.nix new file mode 100644 index 0000000..b687552 --- /dev/null +++ b/modules/home/editor.nix @@ -0,0 +1,7 @@ +{ + programs.neovim = { + enable = true; + defaultEditor = true; + vimAlias = true; + }; +} diff --git a/modules/home/git.nix b/modules/home/git.nix new file mode 100644 index 0000000..4eab076 --- /dev/null +++ b/modules/home/git.nix @@ -0,0 +1,9 @@ +{ + programs.git = { + enable = true; + extraConfig = { + init.defaultBranch = "main"; + pull.rebase = true; + }; + }; +} diff --git a/modules/home/shell.nix b/modules/home/shell.nix new file mode 100644 index 0000000..406206c --- /dev/null +++ b/modules/home/shell.nix @@ -0,0 +1,14 @@ +{ + programs.zsh = { + enable = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + }; + + programs.starship.enable = true; + + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; +} diff --git a/modules/nixos/common.nix b/modules/nixos/common.nix new file mode 100644 index 0000000..5427414 --- /dev/null +++ b/modules/nixos/common.nix @@ -0,0 +1,23 @@ +{ pkgs, lib, ... }: +{ + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + + # Per-host configuration.nix can override either of these without + # conflicting, since they're set with mkDefault here. + time.timeZone = lib.mkDefault "Etc/UTC"; + i18n.defaultLocale = lib.mkDefault "en_US.UTF-8"; + + programs.zsh.enable = true; + + users.users.tom = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + shell = pkgs.zsh; + }; +} -- cgit v1.3