From b77b6cfaf4b39da959894e892702230fae905695 Mon Sep 17 00:00:00 2001 From: Alex Davies Date: Sat, 18 May 2024 18:40:15 -0300 Subject: [PATCH] Initial work on home manager --- flake.lock | 8 +++--- flake.nix | 2 +- home-manager/home.nix | 62 ++++++++++++++++++++++++++++++++++++----- nixos/configuration.nix | 8 ++++++ nixos/kde-desktop.nix | 4 +++ 5 files changed, 72 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 55ae5f8..45b1ba4 100644 --- a/flake.lock +++ b/flake.lock @@ -105,16 +105,16 @@ ] }, "locked": { - "lastModified": 1685599623, - "narHash": "sha256-Tob4CMOVHue0D3RzguDBCtUmX5ji2PsdbQDbIOIKvsc=", + "lastModified": 1715930644, + "narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=", "owner": "nix-community", "repo": "home-manager", - "rev": "93db05480c0c0f30382d3e80779e8386dcb4f9dd", + "rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-23.05", + "ref": "master", "repo": "home-manager", "type": "github" } diff --git a/flake.nix b/flake.nix index a7e0875..f01466a 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,7 @@ # Also see the 'unstable-packages' overlay at 'overlays/default.nix'. # Home manager - home-manager.url = "github:nix-community/home-manager/release-23.05"; + home-manager.url = "github:nix-community/home-manager/master"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; ros.url = "github:lopsided98/nix-ros-overlay"; diff --git a/home-manager/home.nix b/home-manager/home.nix index eedacc2..8e578d9 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -47,19 +47,67 @@ }; }; - # TODO: Set your username home = { - username = "your-username"; - homeDirectory = "/home/your-username"; + username = "traverseda"; + homeDirectory = "/home/traverseda"; }; - # Add stuff for your user as you see fit: - # programs.neovim.enable = true; - # home.packages = with pkgs; [ steam ]; + programs.git = { + enable = true; + userName = "Alex Davies"; + userEmail = "traverse.da@gmail.com"; + extraConfig = { + core = { + editor = "vim"; # Set default editor for Git + }; + color = { + ui = "auto"; # Enable colored output in the terminal + }; + push = { + default = "simple"; # Default push behavior to 'simple' + }; + pull = { + rebase = "false"; # Avoid rebasing by default on pull + }; + credential = { + helper = "cache --timeout=3600"; # Cache credentials for 1 hour (3600 seconds) + }; + }; + }; + + programs.neovim = { + enable = true; + defaultEditor = true; + viAlias = true; + vimAlias = true; + vimdiffAlias = true; + plugins = with pkgs.vimPlugins; [ + nvim-lspconfig + nvim-treesitter.withAllGrammars + vim-bufferline + tokyonight-nvim + { + plugin = which-key-nvim; + } + ]; + }; + + programs.ssh = { + enable = true; # Enable SSH module + extraConfig = '' + Host * + ControlMaster auto + ControlPath ~/.ssh/sockets/%r@%h-%p + ControlPersist 600 + ''; + }; + + home.packages = with pkgs; [ + pkgs.ripgrep + ]; # Enable home-manager and git programs.home-manager.enable = true; - programs.git.enable = true; # Nicely reload system units when changing configs systemd.user.startServices = "sd-switch"; diff --git a/nixos/configuration.nix b/nixos/configuration.nix index c00d703..7e0bf95 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -15,6 +15,7 @@ # Import your generated (nixos-generate-config) hardware configuration ./hardware/${hostname}.nix + inputs.home-manager.nixosModules.home-manager ]; nixpkgs = { @@ -111,6 +112,13 @@ }; }; + home-manager = { + extraSpecialArgs = { inherit inputs outputs; }; + users = { + traverseda = import ../home-manager/home.nix; + }; + }; + # This setups a SSH server. Very important if you're setting up a headless system. # Feel free to remove if you don't need it. services.openssh = { diff --git a/nixos/kde-desktop.nix b/nixos/kde-desktop.nix index 82e3168..8807a96 100644 --- a/nixos/kde-desktop.nix +++ b/nixos/kde-desktop.nix @@ -22,6 +22,7 @@ services.fprintd.enable = true; services.printing.enable = true; + programs.kdeconnect.enable = true; environment.systemPackages = with pkgs; [ pkgs.krfb @@ -38,6 +39,8 @@ pkgs.nextcloud-client ]; +programs.dconf.enable = true; + programs.firefox = { enable = true; policies = { @@ -55,6 +58,7 @@ DontCheckDefaultBrowser = true; Preferences = { "widget.use-xdg-desktop-portal.file-picker" = 1; + "widget.use-xdg-desktop-portal.mime-handler" = 1; }; ExtensionSettings = { "*".installation_mode = "allowed";