From 41de43403a0a483049ec68bd1ba106e6ab164d06 Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Wed, 9 Jul 2025 16:01:49 -0500 Subject: [PATCH] sam: Add home-manager This also imports most of the home-manager config from oscar. --- sam/configuration.nix | 77 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 74 insertions(+), 3 deletions(-) diff --git a/sam/configuration.nix b/sam/configuration.nix index a7f33a0..356127c 100644 --- a/sam/configuration.nix +++ b/sam/configuration.nix @@ -4,6 +4,7 @@ imports = [ ./hardware-configuration.nix + (import "${builtins.fetchTarball https://github.com/nix-community/home-manager/archive/release-25.05.tar.gz}/nixos") ]; # https://discourse.nixos.org/t/github-strategies-for-configuration-nix/1983/14 @@ -64,16 +65,86 @@ isNormalUser = true; description = "Chandler Swift"; extraGroups = [ "networkmanager" "wheel" "docker"]; - packages = with pkgs; [ + }; + home-manager.users.chandler = { pkgs, ... }: { + home.packages = with pkgs; [ kdePackages.kate ]; + + programs.bash = { + enable = true; + historyControl = [ "ignoredups" "ignorespace" ]; + }; + + programs.direnv = { + enable = true; + enableBashIntegration = true; + nix-direnv.enable = true; + }; + + programs.git = { + enable = true; + userEmail = "chandler@chandlerswift.com"; + userName = "Chandler Swift"; + lfs.enable = true; + # TODO: delta or diff-so-fancy or difftastic + extraConfig = { + init.defaultBranch = "main"; + pull.ff = "only"; + url."https://aur.archlinux.org/".insteadOf = "aur:"; + url."ssh://aur@aur.archlinux.org/".pushInsteadOf = "aur:"; + url."ssh://git@github.com/ChandlerSwift/".insteadOf = "gh:"; + url."ssh://forgejo@bert/chandlerswift/".insteadOf = "forgejo:"; + push.autoSetupRemote = true; + rebase.autosquash = true; + rebase.autostash = true; + fetch.parallel = 0; # "some reasonable default" + }; + ignores = [ + "*.kate-swp" + "*.swp" + "*~" + "\\#*\\#" + "venv" + ".direnv" + ]; + hooks = { + pre-commit = ../git-pre-commit-hook; + }; + signing.signByDefault = true; + signing.key = null; # "let GnuPG decide what signing key to use depending on commit's author" + }; + + programs.ssh = { + enable = true; + addKeysToAgent = "yes"; + includes = [ + "config.d/*" + ]; + }; + + programs.firefox.enable = true; + + programs.chromium = { + enable = true; + extensions = [ + { id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; } # ublock origin + ]; + }; + + programs.atuin = { + enable = true; + flags = [ + "--disable-up-arrow" + ]; + }; + + home.stateVersion = "25.05"; }; services.displayManager.autoLogin.enable = true; services.displayManager.autoLogin.user = "chandler"; - programs.firefox.enable = true; - virtualisation.docker.enable = true; environment.systemPackages = with pkgs; [