From e4e1cfd3d63bd9feb78c018977a4c3dbb773ce0a Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Tue, 19 Sep 2023 16:03:41 +0200 Subject: [PATCH 1/4] zsh: add agdsn config and comma --- flake.lock | 33 +++++++++++++++++++++++++++------ flake.nix | 5 ++++- modules/zsh.nix | 16 +++++++++------- 3 files changed, 40 insertions(+), 14 deletions(-) diff --git a/flake.lock b/flake.lock index 1270286..1d2715a 100644 --- a/flake.lock +++ b/flake.lock @@ -78,6 +78,26 @@ "type": "github" } }, + "nix-index-database": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1694921880, + "narHash": "sha256-yU36cs5UdzhTwsM9bUWUz43N//ELzQ1ro69C07pU/8E=", + "owner": "nix-community", + "repo": "nix-index-database", + "rev": "9d2bcc47110b3b6217dfebd6761ba20bc78aedf2", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-index-database", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1694937365, @@ -96,11 +116,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1693675694, - "narHash": "sha256-2pIOyQwGyy2FtFAUIb8YeKVmOCcPOTVphbAvmshudLE=", + "lastModified": 1694908564, + "narHash": "sha256-ducA98AuWWJu5oUElIzN24Q22WlO8bOfixGzBgzYdVc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5601118d39ca9105f8e7b39d4c221d3388c0419d", + "rev": "596611941a74be176b98aeba9328aa9d01b8b322", "type": "github" }, "original": { @@ -136,6 +156,7 @@ "inputs": { "course-management": "course-management", "kpp": "kpp", + "nix-index-database": "nix-index-database", "nixpkgs": "nixpkgs", "sops-nix": "sops-nix" } @@ -148,11 +169,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1694495315, - "narHash": "sha256-sZEYXs9T1NVHZSSbMqBEtEm2PGa7dEDcx0ttQkArORc=", + "lastModified": 1695101768, + "narHash": "sha256-1/j5/348l2+yxQUfkJCUpA6cDefS3H7V94kawk9uuRc=", "owner": "Mic92", "repo": "sops-nix", - "rev": "ea208e55f8742fdcc0986b256bdfa8986f5e4415", + "rev": "4356a5a0c12c9dc1b6bdde0631c7600d9377ed8b", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 9f0c453..b906f62 100755 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,8 @@ nixpkgs.url = github:nixos/nixpkgs/nixos-23.05; sops-nix.url = github:Mic92/sops-nix; sops-nix.inputs.nixpkgs.follows = "nixpkgs"; + nix-index-database.url = "github:nix-community/nix-index-database"; + nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; kpp.url = "github:fsr/kpp"; kpp.inputs.nixpkgs.follows = "nixpkgs"; course-management = { @@ -10,7 +12,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = { self, nixpkgs, sops-nix, kpp, course-management, ... }@inputs: + outputs = { self, nixpkgs, sops-nix, nix-index-database, kpp, course-management, ... }@inputs: { packages."x86_64-linux".quitte = self.nixosConfigurations.quitte.config.system.build.toplevel; packages."x86_64-linux".default = self.packages."x86_64-linux".quitte; @@ -23,6 +25,7 @@ modules = [ inputs.sops-nix.nixosModules.sops inputs.kpp.nixosModules.default + inputs.nix-index-database.nixosModules.nix-index course-management.nixosModules.default ./hosts/quitte/configuration.nix ./modules/bacula.nix diff --git a/modules/zsh.nix b/modules/zsh.nix index bb3ac04..a28b030 100644 --- a/modules/zsh.nix +++ b/modules/zsh.nix @@ -1,5 +1,7 @@ { pkgs, ... }: { + programs.command-not-found.enable = false; + programs.nix-index-database.comma.enable = true; environment.systemPackages = with pkgs; [ # fzf bat @@ -7,7 +9,6 @@ ]; users.defaultUserShell = pkgs.zsh; programs.fzf = { - fuzzyCompletion = true; keybindings = true; }; programs.zsh = { @@ -25,12 +26,13 @@ highlightStyle = "fg=#00bbbb,bold"; }; - shellInit = - '' - source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh - - zsh-newuser-install () {} - ''; + shellInit = '' + zsh-newuser-install () {} + ''; + interactiveShellInit = '' + source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh + source ${pkgs.agdsn-zsh-config}/etc/zsh/zshrc + ''; }; } From dc65c4c5c7c5024a0fa31efd0ea3653f76473109 Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Tue, 19 Sep 2023 20:30:30 +0200 Subject: [PATCH 2/4] don't use zsh as the default shell --- modules/zsh.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/zsh.nix b/modules/zsh.nix index a28b030..1d94b3c 100644 --- a/modules/zsh.nix +++ b/modules/zsh.nix @@ -7,7 +7,6 @@ bat duf ]; - users.defaultUserShell = pkgs.zsh; programs.fzf = { keybindings = true; }; From 0197610e3f5284f9b0bbebe4245859e2f87a457e Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Tue, 19 Sep 2023 20:44:11 +0200 Subject: [PATCH 3/4] fix promptinit --- modules/zsh.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/zsh.nix b/modules/zsh.nix index 1d94b3c..5e8c337 100644 --- a/modules/zsh.nix +++ b/modules/zsh.nix @@ -32,6 +32,9 @@ source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh source ${pkgs.agdsn-zsh-config}/etc/zsh/zshrc ''; + promptInit = '' + prompt_hw_setup + ''; }; } From 06ec7d6e322ab25c11036fc0274c5b3512f3597c Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Tue, 19 Sep 2023 21:08:53 +0200 Subject: [PATCH 4/4] fix double promptinit --- modules/zsh.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/zsh.nix b/modules/zsh.nix index 5e8c337..3aafd18 100644 --- a/modules/zsh.nix +++ b/modules/zsh.nix @@ -32,9 +32,7 @@ source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh source ${pkgs.agdsn-zsh-config}/etc/zsh/zshrc ''; - promptInit = '' - prompt_hw_setup - ''; + promptInit = ""; }; }