From 055b557c33cb845e47d0883e71d2f96f4fbe986a Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Sat, 3 Jun 2023 07:46:37 +0100 Subject: [PATCH] Misc tidying, set zsh as default shell for root user --- Vanguard.nix | 2 +- common.nix | 74 +++++++++++++++---------------------------- home/default.nix | 5 +-- home/env/bash.nix | 8 +---- home/env/fish.nix | 5 +-- home/env/keychain.nix | 2 +- home/env/zsh.nix | 5 --- 7 files changed, 32 insertions(+), 69 deletions(-) diff --git a/Vanguard.nix b/Vanguard.nix index 0454f602..a6b52b47 100644 --- a/Vanguard.nix +++ b/Vanguard.nix @@ -24,7 +24,7 @@ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII1tJFdbiyJApuVZFvo9E9kjlBwvXZeySqVuS2qGdxha tux@monarch" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINI1dWlS16Keil0MGPWmMsBzx8F9ylfz+fRwxUr8/tZ/ ion" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGAcvAQ8W71Bn8pdMYst1hoVCmVJ+0h4HBlJzu1C6dwy xenia@Northstar" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDI44C35I2x9tqzeZDmIpbzmGJWXfATn/Wp5KzVRdlCi root@debian" + # "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDI44C35I2x9tqzeZDmIpbzmGJWXfATn/Wp5KzVRdlCi root@debian" ]; }; home-manager.users.xenia = import ./home/Vanguard/xenia.nix; diff --git a/common.nix b/common.nix index b5d9f17f..37740e5a 100644 --- a/common.nix +++ b/common.nix @@ -1,55 +1,31 @@ -{pkgs, ...}: { - nix.settings.experimental-features = ["nix-command" "flakes"]; - # Allow unfree packages +{...}: { + nix = { + settings.experimental-features = ["nix-command" "flakes"]; + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 7d"; + }; + extraOptions = '' + keep-outputs = true + keep-derivations = true + ''; + }; nixpkgs.config.allowUnfree = true; - - # Home manager integration with NixOS - home-manager.useUserPackages = false; - home-manager.useGlobalPkgs = true; - - # Enable networking + home-manager = { + useUserPackages = false; + useGlobalPkgs = true; + }; networking.networkmanager.enable = true; - - # Enable power-profiles - services.power-profiles-daemon.enable = true; - - services.flatpak.enable = true; + services = { + power-profiles-daemon.enable = true; + flatpak.enable = true; + }; virtualisation.podman.enable = true; - programs.nix-ld = { - enable = true; - libraries = with pkgs; [ - stdenv.cc.cc - zlib - fuse3 - icu - openssl - curl - expat - ]; - }; - fonts.fontconfig.enable = true; - programs.ssh.startAgent = true; - programs.fish.enable = true; - programs.zsh = { - enable = true; - enableCompletion = true; - autosuggestions = { - enable = true; - }; - syntaxHighlighting = { - enable = true; - }; + programs = { + ssh.startAgent = true; + fish.enable = true; + zsh.enable = true; }; - - nix.gc = { - automatic = true; - dates = "daily"; - options = "--delete-older-than 7d"; - }; - - nix.extraOptions = '' - keep-outputs = true - keep-derivations = true - ''; } diff --git a/home/default.nix b/home/default.nix index 84c46ab5..828a7510 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,9 +1,10 @@ -{...}: let +{pkgs, ...}: let home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; in { imports = [(import "${home-manager}/nixos")]; + users.users.root.shell = pkgs.zsh; home-manager.users.root = { - imports = [./env ./ssh ./git]; + imports = [./env/readline.nix ./env/starship.nix ./env/zsh.nix]; home.username = "root"; home.homeDirectory = "/root"; home.stateVersion = "22.11"; diff --git a/home/env/bash.nix b/home/env/bash.nix index 9c751187..93d6f316 100644 --- a/home/env/bash.nix +++ b/home/env/bash.nix @@ -1,11 +1,5 @@ {...}: { - programs.bash = { - enable = true; - shellAliases = { - lg = "lazygit"; - nixos-update = "sudo git -C /etc/nixos/config pull && sudo nixos-rebuild switch"; - }; - }; + programs.bash.enable = true; programs.keychain.enableBashIntegration = true; programs.starship.enableBashIntegration = true; } diff --git a/home/env/fish.nix b/home/env/fish.nix index 54666cbb..f85972a2 100644 --- a/home/env/fish.nix +++ b/home/env/fish.nix @@ -1,10 +1,7 @@ {pkgs, ...}: { programs.fish = { enable = true; - shellAbbrs = { - lg = "lazygit"; - nixos-update = "sudo git -C /etc/nixos/config pull && sudo nixos-rebuild switch"; - }; + shellAbbrs = {lg = "lazygit";}; plugins = [ { name = "tokyonight"; diff --git a/home/env/keychain.nix b/home/env/keychain.nix index 2428d440..aed8f11e 100644 --- a/home/env/keychain.nix +++ b/home/env/keychain.nix @@ -1,7 +1,7 @@ {...}: { programs.keychain = { enable = true; - extraFlags = ["--quiet" "--noask" "--ignore-missing"]; + extraFlags = ["--quiet" "--ignore-missing"]; keys = ["id_rsa" "id_ed25519"]; enableXsessionIntegration = true; }; diff --git a/home/env/zsh.nix b/home/env/zsh.nix index b572c1ff..a9c1c229 100644 --- a/home/env/zsh.nix +++ b/home/env/zsh.nix @@ -8,11 +8,6 @@ autocd = true; dotDir = ".config/zsh"; historySubstringSearch.enable = true; - shellAliases = { - ll = "ls -l"; - lg = "lazygit"; - nixos-update = "sudo git -C /etc/nixos/config pull && sudo nixos-rebuild switch"; - }; history.path = "${config.xdg.dataHome}/zsh/history"; }; programs.keychain.enableZshIntegration = true;