home.nix (3823B)
1 # This is your home-manager configuration file 2 # Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) 3 { 4 inputs, 5 outputs, 6 lib, 7 config, 8 pkgs, 9 nixpkgs-unstable, 10 ... 11 }: { 12 # You can import other home-manager modules here 13 imports = [ 14 # If you want to use modules your own flake exports (from modules/home-manager): 15 # outputs.homeManagerModules.example 16 17 # Or modules exported from other flakes (such as nix-colors): 18 # inputs.nix-colors.homeManagerModules.default 19 20 # You can also split up your configuration and import pieces of it here: 21 # ./nvim.nix 22 ]; 23 24 nixpkgs = { 25 # You can add overlays here 26 overlays = [ 27 # Add overlays your own flake exports (from overlays and pkgs dir): 28 outputs.overlays.additions 29 outputs.overlays.modifications 30 outputs.overlays.unstable-packages 31 32 # You can also add overlays exported from other flakes: 33 # neovim-nightly-overlay.overlays.default 34 35 # Or define it inline, for example: 36 # (final: prev: { 37 # hi = final.hello.overrideAttrs (oldAttrs: { 38 # patches = [ ./change-hello-to-hi.patch ]; 39 # }); 40 # }) 41 (self: super: { 42 lsd = nixpkgs-unstable.legacyPackages.aarch64-linux.lsd; 43 }) 44 ]; 45 # Configure your nixpkgs instance 46 config = { 47 # Disable if you don't want unfree packages 48 allowUnfree = true; 49 # Workaround for https://github.com/nix-community/home-manager/issues/2942 50 allowUnfreePredicate = _: true; 51 }; 52 }; 53 home = { 54 username = "marcel"; 55 homeDirectory = "/home/marcel"; 56 }; 57 58 # Add stuff for your user as you see fit: 59 # programs.neovim.enable = true; 60 # home.packages = with pkgs; [ steam ]; 61 62 home.file.".ssh/allowed_signers".text = '' 63 * ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHeAYFhGNeDKYsb9qQx6V6OzWTr4M7Gue3Eka2Y3I56b marcel@worker-1 64 * ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHeAYFhGNeDKYsb9qQx6V6OzWTr4M7Gue3Eka2Y3I56b marcel@worker-2 65 ''; 66 67 # Enable home-manager and git 68 programs = { 69 home-manager.enable = true; 70 k9s.enable = true; 71 less.enable = true; 72 ssh = { 73 enable = true; 74 }; 75 76 git = { 77 enable = true; 78 userName = "MTRNord"; 79 userEmail = "support@nordgedanken.dev"; 80 81 extraConfig = { 82 # Sign all commits using ssh key 83 commit.gpgsign = true; 84 gpg.format = "ssh"; 85 gpg.ssh.allowedSignersFile = "~/.ssh/allowed_signers"; 86 user.signingkey = "~/.ssh/id_ed25519.pub"; 87 }; 88 }; 89 90 zsh = { 91 enable = true; 92 shellAliases = { 93 update = "cd /etc/nixos/nixos && git pull && sudo nixos-rebuild switch --flake .#$(hostname) && home-manager switch --flake .#marcel@$(hostname)"; 94 rebuild-draupnir-yara = "cd /home/marcel/Draupnir && git stash && git pull && git stash pop && yarn describe-version && podman buildx build --tag git.nordgedanken.dev/kubernetes/gitops/gnuxie/draupnir:yara --platform linux/arm64 . && podman push git.nordgedanken.dev/kubernetes/gitops/gnuxie/draupnir:yara"; 95 }; 96 history = { 97 size = 10000; 98 path = "${config.xdg.dataHome}/zsh/history"; 99 }; 100 oh-my-zsh = { 101 enable = true; 102 plugins = ["git" "thefuck"]; 103 theme = "robbyrussell"; 104 }; 105 }; 106 107 lsd = { 108 enable = true; 109 enableAliases = true; 110 settings = { 111 classic = false; 112 blocks = [ 113 "permission" 114 "user" 115 "group" 116 "size" 117 "git" 118 "date" 119 "name" 120 ]; 121 total-size = true; 122 header = true; 123 }; 124 }; 125 }; 126 127 # Nicely reload system units when changing configs 128 systemd.user.startServices = "sd-switch"; 129 130 # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion 131 home.stateVersion = "23.05"; 132 }