From 7ecbb69ff816f78861976bba6abb1e8d226e5879 Mon Sep 17 00:00:00 2001 From: oddlama Date: Mon, 8 May 2023 14:49:28 +0200 Subject: [PATCH] chore: remove last uses of `with lib` --- users/common/default.nix | 6 +----- users/common/fish.nix | 9 ++++----- users/common/modules/uid.nix | 7 +++---- users/common/zsh/default.nix | 11 +++++------ users/myuser/default.nix | 5 ++--- users/root/default.nix | 3 +-- 6 files changed, 16 insertions(+), 25 deletions(-) diff --git a/users/common/default.nix b/users/common/default.nix index d72298a..12d1aeb 100644 --- a/users/common/default.nix +++ b/users/common/default.nix @@ -1,8 +1,4 @@ -{ - pkgs, - stateVersion, - ... -}: { +{pkgs, ...}: { imports = [ ./modules/uid.nix diff --git a/users/common/fish.nix b/users/common/fish.nix index 1bfa5c0..99418b3 100644 --- a/users/common/fish.nix +++ b/users/common/fish.nix @@ -2,19 +2,18 @@ lib, pkgs, ... -}: -with lib; { +}: { # FIXME: ctrl-del not working # FIXME: DEL also deletes to the left :( # FIXME: ignore certain history entries (" .*", ...) programs.fish = { enable = true; - interactiveShellInit = mkMerge [ - (mkBefore '' + interactiveShellInit = lib.mkMerge [ + (lib.mkBefore '' set -g ATUIN_NOBIND true set -g fish_greeting '') - (mkAfter '' + (lib.mkAfter '' bind \cr _atuin_search atuin gen-completions --shell fish | source diff --git a/users/common/modules/uid.nix b/users/common/modules/uid.nix index 4bd9697..d3edd03 100644 --- a/users/common/modules/uid.nix +++ b/users/common/modules/uid.nix @@ -2,11 +2,10 @@ config, lib, ... -}: -with lib; { +}: { options = { - home.uid = mkOption { - type = types.int; + home.uid = lib.mkOption { + type = lib.types.int; example = 1000; description = "The user's uid."; }; diff --git a/users/common/zsh/default.nix b/users/common/zsh/default.nix index 39c4d08..fc67003 100644 --- a/users/common/zsh/default.nix +++ b/users/common/zsh/default.nix @@ -2,8 +2,7 @@ lib, pkgs, ... -}: -with lib; { +}: { programs.zsh = { enable = true; envExtra = '' @@ -15,11 +14,11 @@ with lib; { save = 0; size = 0; }; - initExtra = mkMerge [ - (mkBefore '' + initExtra = lib.mkMerge [ + (lib.mkBefore '' unset HISTFILE '') - (mkAfter ('' + (lib.mkAfter ('' function atuin-prefix-search() { local out if out=$(${pkgs.sqlite}/bin/sqlite3 -readonly ~/.local/share/atuin/history.db \ @@ -31,7 +30,7 @@ with lib; { fi }; zle -N atuin-prefix-search '' - + readFile ./zshrc)) + + lib.readFile ./zshrc)) ]; plugins = [ { diff --git a/users/myuser/default.nix b/users/myuser/default.nix index 81efee2..8c912e8 100644 --- a/users/myuser/default.nix +++ b/users/myuser/default.nix @@ -5,8 +5,7 @@ secrets, stateVersion, ... -}: -with lib; let +}: let inherit (secrets) myuser; in { users.groups.${myuser}.gid = config.users.users.${myuser}.uid; @@ -17,7 +16,7 @@ in { group = myuser; extraGroups = ["wheel" "input" "video"] - ++ optionals config.sound.enable ["audio"]; + ++ lib.optionals config.sound.enable ["audio"]; isNormalUser = true; shell = pkgs.zsh; }; diff --git a/users/root/default.nix b/users/root/default.nix index 029bcc2..a342de0 100644 --- a/users/root/default.nix +++ b/users/root/default.nix @@ -4,8 +4,7 @@ pkgs, stateVersion, ... -}: -with lib; { +}: { users.users.root = { hashedPassword = "$6$EBo/CaxB.dQoq2W8$lo2b5vKgJlLPdGGhEqa08q3Irf1Zd1PcFBCwJOrG8lqjwbABkn1DEhrMh1P3ezwnww2HusUBuZGDSMa4nvSQg1"; openssh.authorizedKeys.keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA5Uq+CDy5Pmt3If5M6d8K/Q7HArU6sZ7sgoj3T521Wm"];