From 878fffd90091b6c8b01648d52c886debb9d5adfc Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 17 May 2024 10:54:53 +0100 Subject: [PATCH] fixed sam home zsh issue --- home/common/core/default.nix | 3 ++- home/common/core/zsh.nix | 23 +++++++++++++++++++++++ home/fileserver.nix | 5 +++-- home/media.nix | 5 +++-- home/nixdev.nix | 6 +++--- home/users/admin/default.nix | 22 ---------------------- home/users/media/default.nix | 21 --------------------- home/users/sam/default.nix | 23 ----------------------- hosts/common/core/default.nix | 1 + hosts/common/core/locale.nix | 8 ++++++++ hosts/common/users/media/default.nix | 2 +- hosts/common/users/sam/default.nix | 18 ------------------ hosts/fileserver/default.nix | 7 ------- hosts/media/default.nix | 25 ++++++++++++++++++------- hosts/nixdev/default.nix | 7 ------- 15 files changed, 62 insertions(+), 114 deletions(-) create mode 100644 home/common/core/zsh.nix create mode 100644 hosts/common/core/locale.nix diff --git a/home/common/core/default.nix b/home/common/core/default.nix index 2645f98..48a1333 100644 --- a/home/common/core/default.nix +++ b/home/common/core/default.nix @@ -1,5 +1,6 @@ -{ pkgs, ... }: +{ config, lib, pkgs, outputs, ... }: { imports = [ + ./zsh.nix ] ; } diff --git a/home/common/core/zsh.nix b/home/common/core/zsh.nix new file mode 100644 index 0000000..67e5dd6 --- /dev/null +++ b/home/common/core/zsh.nix @@ -0,0 +1,23 @@ +{ pkgs, config, ... }: { + + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + + shellAliases = { + ll = "ls -l"; + }; + history.size = 10000; + history.path = "${config.xdg.dataHome}/zsh/history"; + + initExtra = '' + bindkey -v + bindkey "^H" backward-delete-char + bindkey "^?" backward-delete-char + set -o vi + export TERM=xterm + ''; + }; +} diff --git a/home/fileserver.nix b/home/fileserver.nix index 436f780..2151435 100644 --- a/home/fileserver.nix +++ b/home/fileserver.nix @@ -5,12 +5,13 @@ ... }: { imports = [ + # Import users + ./users/admin + ./common/core ./common/optional/sops.nix # Import optional ./common/optional/git.nix - # Import users - ./users/admin ]; diff --git a/home/media.nix b/home/media.nix index a443ef7..a95e303 100644 --- a/home/media.nix +++ b/home/media.nix @@ -5,13 +5,14 @@ ... }: { imports = [ + # Import users + ./users/media + ./common/core ./common/optional/sops.nix # Import optional ./common/optional/git.nix - # Import users - ./users/media ]; } diff --git a/home/nixdev.nix b/home/nixdev.nix index 945b98b..0ba30ad 100644 --- a/home/nixdev.nix +++ b/home/nixdev.nix @@ -5,6 +5,9 @@ ... }: { imports = [ + # Import users + ./users/sam + ./common/core ./common/optional/desktop/hyprland ./common/optional/desktop/waybar.nix @@ -12,9 +15,6 @@ # Import optional ./common/optional/git.nix - - # Import users - ./users/sam ]; # ------ diff --git a/home/users/admin/default.nix b/home/users/admin/default.nix index f03360f..ea751ef 100644 --- a/home/users/admin/default.nix +++ b/home/users/admin/default.nix @@ -11,28 +11,6 @@ home.packages = [ ]; - programs.zsh = { - enable = true; - enableCompletion = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - - shellAliases = { - ll = "ls -l"; - }; - history.size = 10000; - history.path = "${config.xdg.dataHome}/zsh/history"; - - initExtra = '' - bindkey -v - bindkey "^H" backward-delete-char - bindkey "^?" backward-delete-char - set -o vi - export TERM=xterm - ''; - }; - - home.file = { }; diff --git a/home/users/media/default.nix b/home/users/media/default.nix index ae40986..6100c2a 100644 --- a/home/users/media/default.nix +++ b/home/users/media/default.nix @@ -12,27 +12,6 @@ home.packages = [ ]; - programs.zsh = { - enable = true; - enableCompletion = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - - shellAliases = { - ll = "ls -l"; - }; - history.size = 10000; - history.path = "${config.xdg.dataHome}/zsh/history"; - - initExtra = '' - bindkey -v - bindkey "^H" backward-delete-char - bindkey "^?" backward-delete-char - set -o vi - export TERM=xterm - ''; - }; - home.file = { }; diff --git a/home/users/sam/default.nix b/home/users/sam/default.nix index f776b90..9c3eaac 100644 --- a/home/users/sam/default.nix +++ b/home/users/sam/default.nix @@ -16,29 +16,7 @@ pkgs.xfce.thunar #pkgs.age ]; - - programs.zsh = { - enable = true; - enableCompletion = true; - programs.zsh.autosuggestion.enable = true; - syntaxHighlighting.enable = true; - shellAliases = { - ll = "ls -l"; - }; - history.size = 10000; - history.path = "${config.xdg.dataHome}/zsh/history"; - - initExtra = '' - bindkey -v - bindkey "^H" backward-delete-char - bindkey "^?" backward-delete-char - set -o vi - export TERM=xterm - ''; - }; - - home.file = { ".icons/bibata".source = "${pkgs.bibata-cursors}/share/icons/Bibata-Modern-Classic"; }; @@ -71,6 +49,5 @@ IMAGE_EDITOR=""; }; - programs.home-manager.enable = true; } diff --git a/hosts/common/core/default.nix b/hosts/common/core/default.nix index e0013fb..874f876 100644 --- a/hosts/common/core/default.nix +++ b/hosts/common/core/default.nix @@ -1,6 +1,7 @@ {pkgs, ...}: { imports = [ ./sops.nix + ./locale.nix ]; environment.systemPackages = [ diff --git a/hosts/common/core/locale.nix b/hosts/common/core/locale.nix new file mode 100644 index 0000000..2b0b451 --- /dev/null +++ b/hosts/common/core/locale.nix @@ -0,0 +1,8 @@ +{ + i18n.defaultLocale = "en_GB.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "uk"; + useXkbConfig = false; + }; +} diff --git a/hosts/common/users/media/default.nix b/hosts/common/users/media/default.nix index 79a5ed9..ebd0a86 100644 --- a/hosts/common/users/media/default.nix +++ b/hosts/common/users/media/default.nix @@ -20,7 +20,7 @@ in programs.zsh.enable = true; programs.fuse.userAllowOther = true; - #home-manager.users.sam = + home-manager = { extraSpecialArgs = { inherit inputs; }; users = { diff --git a/hosts/common/users/sam/default.nix b/hosts/common/users/sam/default.nix index 5030f0b..9782693 100644 --- a/hosts/common/users/sam/default.nix +++ b/hosts/common/users/sam/default.nix @@ -22,24 +22,6 @@ in programs.zsh.enable = true; - fileSystems."/persist".neededForBoot = true; - environment.persistence."/persist" = { - hideMounts = true; - directories = [ - "/etc/nixos" - "/var/log" - "/var/lib/nixos" - "/var/lib/systemd/coredump" - "/etc/NetworkManager/system-connections" - ]; - users.media = { - directories = [ - "keep" - ".ssh" - ]; - }; - }; - home-manager = { extraSpecialArgs = { inherit inputs; }; users = { diff --git a/hosts/fileserver/default.nix b/hosts/fileserver/default.nix index ce0d9c9..929ba79 100644 --- a/hosts/fileserver/default.nix +++ b/hosts/fileserver/default.nix @@ -41,13 +41,6 @@ time.timeZone = "Europe/London"; - i18n.defaultLocale = "en_GB.UTF-8"; - console = { - font = "Lat2-Terminus16"; - keyMap = "uk"; - useXkbConfig = false; - }; - programs.gnupg.agent = { enable = true; enableSSHSupport = true; diff --git a/hosts/media/default.nix b/hosts/media/default.nix index 30f6588..7444f7e 100644 --- a/hosts/media/default.nix +++ b/hosts/media/default.nix @@ -29,6 +29,24 @@ }; }; + fileSystems."/persist".neededForBoot = true; + environment.persistence."/persist" = { + hideMounts = true; + directories = [ + "/etc/nixos" + "/var/log" + "/var/lib/nixos" + "/var/lib/systemd/coredump" + "/etc/NetworkManager/system-connections" + ]; + users.media = { + directories = [ + "keep" + ".ssh" + ]; + }; + }; + boot = { loader = { systemd-boot.enable = true; @@ -37,13 +55,6 @@ }; }; - i18n.defaultLocale = "en_GB.UTF-8"; - console = { - font = "Lat2-Terminus16"; - keyMap = "uk"; - useXkbConfig = false; - }; - networking = { hostName = "media"; networkmanager.enable = true; diff --git a/hosts/nixdev/default.nix b/hosts/nixdev/default.nix index b0178e9..f45fd70 100644 --- a/hosts/nixdev/default.nix +++ b/hosts/nixdev/default.nix @@ -42,13 +42,6 @@ time.timeZone = "Europe/London"; - i18n.defaultLocale = "en_GB.UTF-8"; - console = { - font = "Lat2-Terminus16"; - keyMap = "uk"; - useXkbConfig = false; - }; - services.printing.enable = true; services.libinput.enable = true;