From f07af1a6dcca138c3e2577fad17ed9e2bf16b1e9 Mon Sep 17 00:00:00 2001 From: Oshgnacknak Date: Sat, 6 Sep 2025 19:12:35 +0200 Subject: [PATCH] flake --- flake.nix | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f9bd103 --- /dev/null +++ b/flake.nix @@ -0,0 +1,62 @@ +{ + description = "OSHs dotfiles"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + home-manager.url = "github:nix-community/home-manager/release-24.05"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = { self, nixpkgs, home-manager, ... }: + let + system = builtins.currentSystem; + username = builtins.getEnv "USER"; + homeDir = builtins.getEnv "HOME"; + pkgs = import nixpkgs { inherit system; }; + in { + homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + modules = [ + { + home.username = username; + home.homeDirectory = homeDir; + # Only manage what you explicitly turn on below + # (this keeps you from overriding distro-level things) + programs.git = { + enable = true; + userName = "Oshgnacknak"; + userEmail = "osh@oshgnacknak.de"; + }; + + # Put extra packages in the *user* profile (not system) + home.packages = with pkgs; [ + ripgrep + fd + tmux + nvim + ]; + + # Example: link dotfiles without forcing overwrite + # (fails safely if a file already exists) + home.file.".tmux.conf".source = ./_tmux.conf; + + xdg.configFile."nvim" = { + source = ./_config/nvim; + recursive = true; + force = true; + }; + + # Environment variables only for this user/session + home.sessionVariables = { + EDITOR = "nvim"; + }; + + # Good HM hygiene + xdg.enable = true; + home.stateVersion = "24.05"; + } + ]; + }; + }; +} +