diff --git a/Makefile b/Makefile index bb7c7513..d71e76e5 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,10 @@ CONFIG_DIR := $(if $(XDG_CONFIG_HOME), $(XDG_CONFIG_HOME), $(HOME)/.config) SSH_DIR := $(HOME)/.ssh -THEMES_DIR := $(HOME)/.themes CONFIG_ITEMS := $(wildcard config/*) CONFIG_TARGETS := $(CONFIG_ITEMS:config/%=$(CONFIG_DIR)/%) SSH_ITEMS := $(wildcard ssh/*) SSH_TARGETS := $(SSH_ITEMS:ssh/%=$(SSH_DIR)/%) -THEMES_ITEMS := $(wildcard themes/*) -THEMES_TARGETS := $(THEMES_ITEMS:themes/%=$(THEMES_DIR)/%) LAZY_REPO := https://github.com/folke/lazy.nvim.git PYENV_DIR := $(if $(PYENV_ROOT), $(PYENV_ROOT), $(HOME)/.pyenv) @@ -21,32 +18,18 @@ all: default install clean: for link in $(CONFIG_TARGETS); do rm "$$link"; done for link in $(SSH_TARGETS); do rm "$$link"; done - for link in $(THEMES_TARGETS); do rm "$$link"; done rm -rf $(LAZY_DIR) - rm $(HOME)/.profile - rm $(HOME)/.inputrc - rm $(HOME)/.bashrc - rm $(HOME)/.zshrc - rmdir $(HOME)/.ssh/sockets -check: - echo "Placeholder" +directories: $(CONFIG_DIR) $(SSH_DIR) -directories: $(CONFIG_DIR) $(SSH_DIR) $(THEMES_DIR) $(HOME)/.ssh/sockets $(HOME)/.local/bin - -$(CONFIG_DIR) $(SSH_DIR) $(THEMES_DIR) $(HOME)/.ssh/sockets $(HOME)/.local/bin: +$(CONFIG_DIR) $(SSH_DIR): mkdir -p $@ -link: $(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.profile $(HOME)/.inputrc $(HOME)/.bashrc $(HOME)/.zshrc +link: $(CONFIG_TARGETS) $(HOME)/.ssh/config.d $(CONFIG_TARGETS): $(CONFIG_DIR)/%: config/% -$(SSH_TARGETS): $(SSH_DIR)/%: ssh/% -$(THEMES_TARGETS): $(THEMES_DIR)/%: themes/% -$(HOME)/.profile: $(HOME)/%: % -$(HOME)/.inputrc: $(HOME)/%: % -$(HOME)/.bashrc: $(HOME)/%: % -$(HOME)/.zshrc: $(HOME)/%: % -$(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.profile $(HOME)/.inputrc $(HOME)/.bashrc $(HOME)/.zshrc: +$(SSH_DIR)/config.d: $(SSH_DIR)/%: ssh/% +$(CONFIG_TARGETS) $(SSH_DIR)/config.d: ln -s $(PWD)/$? $@ install: $(LAZY_DIR) diff --git a/config/lazygit/config.yml b/config/lazygit/config.yml deleted file mode 100644 index 45a7ae8f..00000000 --- a/config/lazygit/config.yml +++ /dev/null @@ -1,26 +0,0 @@ -gui: - showFileTree: true - showCommandLog: false - showIcons: true -theme: - lightTheme: false - activeBorderColor: - - "#a6da95" # Green - - bold - inactiveBorderColor: - - "#cad3f5" # Text - optionsTextColor: - - "#8aadf4" # Blue - selectedLineBgColor: - - "#363a4f" # Surface0 - selectedRangeBgColor: - - "#363a4f" # Surface0 - cherryPickedCommitBgColor: - - "#8bd5ca" # Teal - cherryPickedCommitFgColor: - - "#8aadf4" # Blue - unstagedChangesColor: - - red # Red -promptToReturnFromSubprocess: false -# to exit immediately if run outside of the Git repository -notARepository: "quit" diff --git a/nixos/H0615-elitherl-home.nix b/nixos/H0615-elitherl-home.nix new file mode 100644 index 00000000..b2115325 --- /dev/null +++ b/nixos/H0615-elitherl-home.nix @@ -0,0 +1,25 @@ +{ pkgs, ... }: { + imports = [ + ./home/common.nix + ./home/dev.nix + ./home/nomachine.nix + ./home/python310.nix + ]; + # Home Manager needs a bit of information about you and the + # paths it should manage. + home.username = "elitherl"; + home.homeDirectory = "/home/elitherl"; + + nixpkgs.config.allowUnfree = true; + + home.packages = with pkgs; [ + microsoft-edge + bitwarden + ]; + + programs.git = { + userEmail = "evie.litherland-smith@ukaea.uk"; + }; + + home.stateVersion = "22.11"; +} diff --git a/nixos/H0615-elitherl.nix b/nixos/H0615-elitherl.nix new file mode 100644 index 00000000..1a0c3c32 --- /dev/null +++ b/nixos/H0615-elitherl.nix @@ -0,0 +1,118 @@ +{ config, pkgs, ... }: + +let + home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; +in + +{ + imports = [ + ./common.nix + ./packages.nix + (import "${home-manager}/nixos") + ]; + + networking.hostName = "H0615"; # Define your hostname. + + # Enable networking + networking.networkmanager.enable = true; + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Set your time zone. + time.timeZone = "Europe/London"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_GB.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_GB.UTF-8"; + LC_IDENTIFICATION = "en_GB.UTF-8"; + LC_MEASUREMENT = "en_GB.UTF-8"; + LC_MONETARY = "en_GB.UTF-8"; + LC_NAME = "en_GB.UTF-8"; + LC_NUMERIC = "en_GB.UTF-8"; + LC_PAPER = "en_GB.UTF-8"; + LC_TELEPHONE = "en_GB.UTF-8"; + LC_TIME = "en_GB.UTF-8"; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the KDE Plasma Desktop Environment. + services.xserver.displayManager.sddm.enable = true; + services.xserver.desktopManager.plasma5.enable = true; + + # Configure keymap in X11 + services.xserver = { + layout = "gb"; + xkbVariant = ""; + }; + + # Configure console keymap + console.keyMap = "uk"; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.elitherl = { + isNormalUser = true; + description = "Evie Litherland-Smith"; + extraGroups = [ "networkmanager" "wheel" ]; + }; + + # Enable automatic login for the user. + services.xserver.displayManager.autoLogin.enable = true; + services.xserver.displayManager.autoLogin.user = "elitherl"; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # Set up home manager for user + home-manager.users.elitherl = import ./H0615-elitherl-home.nix; + home-manager.useUserPackages = false; + home-manager.useGlobalPkgs = false; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ 22 ]; + # networking.firewall.allowedUDPPorts = [ 22 ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "22.11"; # Did you read the comment? + + system.autoUpgrade = { + enable = true; + }; + +} diff --git a/nixos/home/common.nix b/nixos/home/common.nix index 515c092c..e319697d 100644 --- a/nixos/home/common.nix +++ b/nixos/home/common.nix @@ -2,6 +2,20 @@ { programs.home-manager.enable = true; + programs.ssh = { + enable = true; + includes = [ "config.d/*" ]; + forwardAgent = true; + serverAliveInterval = 15; + serverAliveCountMax = 3; + controlMaster = "auto"; + controlPersist = "5s"; + }; + programs.git = { + enable = true; + userName = "Evie Litherland-Smith"; + userEmail = "evie.litherland-smith@ukaea.uk"; + }; home.packages = with pkgs; [ wezterm diff --git a/nixos/home/dev.nix b/nixos/home/dev.nix index 4747d8d0..1c273194 100644 --- a/nixos/home/dev.nix +++ b/nixos/home/dev.nix @@ -8,7 +8,33 @@ home.packages = with pkgs; [ git gcc + gnumake lazygit direnv ]; + + programs.lazygit = { + enable = true; + settings = { + gui = { + showFileTree = true; + showCommandLog = false; + showIcons = true; + theme = { + lightTheme = false; + activeBorderColor = ["#a6da95" "bold"]; + inactiveBorderColor = ["#cad3f5"]; + optionsTextColor = ["#8aadf4"]; + selectedLineBgColor = ["#363a4f"]; + selectedRangeBgColor = ["#363a4f"]; + cherryPickedCommitBgColor = ["#8bd5ca"]; + cherryPickedCommitFgColor = ["#8aadf4"]; + unstagedChangesColor = ["red"]; + }; + }; + update.method = "never"; + promptToReturnFromSubprocess = false; + notARepository = "quit"; + }; + }; } diff --git a/nixos/home/neovim.nix b/nixos/home/neovim.nix index 7d877b93..b03a06da 100644 --- a/nixos/home/neovim.nix +++ b/nixos/home/neovim.nix @@ -3,6 +3,8 @@ { home.packages = with pkgs; [ neovim + gnumake + gcc python310Packages.pynvim fzf ripgrep diff --git a/nixos/home/nomachine.nix b/nixos/home/nomachine.nix new file mode 100644 index 00000000..07d37059 --- /dev/null +++ b/nixos/home/nomachine.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ + nomachine-client + ]; +} diff --git a/nixos/packages.nix b/nixos/packages.nix index 3bacbd75..6b9a73c7 100644 --- a/nixos/packages.nix +++ b/nixos/packages.nix @@ -1,5 +1,7 @@ { config, pkgs, ... }: { - environment.systemPackages = with pkgs; []; + environment.systemPackages = with pkgs; [ + home-manager + ]; } diff --git a/ssh/config b/ssh/config deleted file mode 100644 index d7f08cda..00000000 --- a/ssh/config +++ /dev/null @@ -1,14 +0,0 @@ -# vim: ft=sshconfig - -Include config.d/* - -Host * - User elitherl - AddKeysToAgent yes - IdentityFile ~/.ssh/id_ed25519 - ServerAliveInterval 15 - ServerAliveCountMax 3 - ControlMaster auto - ControlPath ~/.ssh/sockets/%r@%h:%p - ControlPersist 5s - ForwardX11Timeout 0