commit f8062095c70df0ef06a032e99f93c06dc5fa7e11
parent 8a2c27dfcc1ad6e122174edd4ade7f48977f9942
Author: Leah (ctucx) <git@ctu.cx>
Date: Wed, 20 Mar 2024 12:30:47 +0100
parent 8a2c27dfcc1ad6e122174edd4ade7f48977f9942
Author: Leah (ctucx) <git@ctu.cx>
Date: Wed, 20 Mar 2024 12:30:47 +0100
configurations/common: refactor programs
21 files changed, 63 insertions(+), 64 deletions(-)
diff --git a/configurations/common/programs/bash.nix b/configurations/common/programs/bash.nix @@ -1,20 +1,22 @@ { config, pkgs, lib, ... }: let - cfg = config.ctucxConfig.bash; + cfg = config.ctucxConfig.programs.bash; in { options = { - ctucxConfig.bash = { + ctucxConfig.programs.bash = { enable = lib.mkEnableOption "bash"; }; }; config = lib.mkIf cfg.enable { - ctucxConfig.starship.enable = true; - ctucxConfig.mcfly.enable = true; - ctucxConfig.eza.enable = true; + ctucxConfig.programs = { + starship.enable = true; + mcfly.enable = true; + eza.enable = true; + }; home-manager.users.leah = { programs = {
diff --git a/configurations/common/programs/default.nix b/configurations/common/programs/default.nix @@ -24,21 +24,22 @@ ./phockup.nix ./texlive.nix ./password-store.nix + ./bitwarden-cli.nix ./scripts.nix ]; ctucxConfig.bash.enable = lib.mkDefault true; - ctucxConfig.shellUtilities.enable = lib.mkDefault true; - ctucxConfig.networkUtilities.enable = lib.mkDefault true; + ctucxConfig.programs.shellUtilities.enable = lib.mkDefault true; + ctucxConfig.programs.networkUtilities.enable = lib.mkDefault true; - ctucxConfig.htop.enable = lib.mkDefault true; - ctucxConfig.tmux.enable = lib.mkDefault true; - ctucxConfig.micro.enable = lib.mkDefault true; + ctucxConfig.programs.htop.enable = lib.mkDefault true; + ctucxConfig.programs.tmux.enable = lib.mkDefault true; + ctucxConfig.programs.micro.enable = lib.mkDefault true; - ctucxConfig.git.enable = lib.mkDefault true; - ctucxConfig.gpg.enable = lib.mkDefault true; - ctucxConfig.ssh.enable = lib.mkDefault true; + ctucxConfig.programs.git.enable = lib.mkDefault true; + ctucxConfig.programs.gpg.enable = lib.mkDefault true; + ctucxConfig.programs.ssh.enable = lib.mkDefault true; }
diff --git a/configurations/common/programs/eza.nix b/configurations/common/programs/eza.nix @@ -1,12 +1,12 @@ { config, pkgs, lib, ... }: let - cfg = config.ctucxConfig.eza; + cfg = config.ctucxConfig.programs.eza; in { options = { - ctucxConfig.eza = { + ctucxConfig.programs.eza = { enable = lib.mkEnableOption "eza"; }; };
diff --git a/configurations/common/programs/git.nix b/configurations/common/programs/git.nix @@ -1,12 +1,12 @@ { config, pkgs, lib, ... }: let - cfg = config.ctucxConfig.git; + cfg = config.ctucxConfig.programs.git; in { options = { - ctucxConfig.git = { + ctucxConfig.programs.git = { enable = lib.mkEnableOption "git"; }; }; @@ -41,6 +41,7 @@ in { extraConfig = { features.manyFiles = true; pull.rebase = false; + "url \"git@git.ctu.cx:\"".insteadOf = "https://git.ctu.cx/"; }; }; };
diff --git a/configurations/common/programs/gpg.nix b/configurations/common/programs/gpg.nix @@ -1,12 +1,12 @@ { config, pkgs, lib, ... }: let - cfg = config.ctucxConfig.gpg; + cfg = config.ctucxConfig.programs.gpg; in { options = { - ctucxConfig.gpg = { + ctucxConfig.programs.gpg = { enable = lib.mkEnableOption "gpg"; }; }; @@ -39,14 +39,14 @@ in { }; wayland.windowManager.sway.extraConfig = '' - exec_always 'gpgconf --kill gpg-agent' + exec_always 'gpgconf --kill gpg-agent' ''; programs = { gpg = { enable = true; - mutableTrust = false; - mutableKeys = false; + mutableTrust = true; + mutableKeys = true; publicKeys = [ @@ -56,12 +56,6 @@ in { source = "${pkgs.ctucx-website}/gpg_pubkey.asc"; } - # my second gpg key (ipad) - { - trust = "ultimate"; - source = "${pkgs.ctucx-website}/gpg_pubkey_ipad.asc"; - } - # f2k1de's key { trust = "full"; @@ -82,18 +76,19 @@ in { }; }; + bash.initExtra = '' + export GPG_TTY=$(tty) + export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + gpgconf --launch gpg-agent + ''; + + git = { signing = { key = "725B65F21DB1C2C4"; signByDefault = true; }; }; - - bash.initExtra = lib.mkIf pkgs.stdenv.isDarwin '' - export GPG_TTY=$(tty) - export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) - gpgconf --launch gpg-agent - ''; }; services = lib.mkIf pkgs.stdenv.isLinux {
diff --git a/configurations/common/programs/htop.nix b/configurations/common/programs/htop.nix @@ -1,12 +1,12 @@ { config, pkgs, lib, currentSystem, ... }: let - cfg = config.ctucxConfig.htop; + cfg = config.ctucxConfig.programs.htop; in { options = { - ctucxConfig.htop = { + ctucxConfig.programs.htop = { enable = lib.mkEnableOption "htop"; }; };
diff --git a/configurations/common/programs/mcfly.nix b/configurations/common/programs/mcfly.nix @@ -1,12 +1,12 @@ { config, lib, ... }: let - cfg = config.ctucxConfig.mcfly; + cfg = config.ctucxConfig.programs.mcfly; in { options = { - ctucxConfig.mcfly = { + ctucxConfig.programs.mcfly = { enable = lib.mkEnableOption "mcfly"; }; };
diff --git a/configurations/common/programs/micro.nix b/configurations/common/programs/micro.nix @@ -1,12 +1,12 @@ { config, pkgs, lib, ... }: let - cfg = config.ctucxConfig.micro; + cfg = config.ctucxConfig.programs.micro; in { options = { - ctucxConfig.micro = { + ctucxConfig.programs.micro = { enable = lib.mkEnableOption "micro"; }; };
diff --git a/configurations/common/programs/networkUtilities.nix b/configurations/common/programs/networkUtilities.nix @@ -1,12 +1,12 @@ { config, pkgs, lib, ... }: let - cfg = config.ctucxConfig.networkUtilities; + cfg = config.ctucxConfig.programs.networkUtilities; in { options = { - ctucxConfig.networkUtilities = { + ctucxConfig.programs.networkUtilities = { enable = lib.mkEnableOption "some networking related utilities"; }; };
diff --git a/configurations/common/programs/ocrmypdf.nix b/configurations/common/programs/ocrmypdf.nix @@ -1,12 +1,12 @@ { config, pkgs, lib, ... }: let - cfg = config.ctucxConfig.ocrmypdf; + cfg = config.ctucxConfig.programs.ocrmypdf; in { options = { - ctucxConfig.ocrmypdf = { + ctucxConfig.programs.ocrmypdf = { enable = lib.mkEnableOption "OCRmyPDF"; }; };
diff --git a/configurations/common/programs/password-store.nix b/configurations/common/programs/password-store.nix @@ -1,12 +1,12 @@ { config, pkgs, lib, ... }: let - cfg = config.ctucxConfig.password-store; + cfg = config.ctucxConfig.programs.password-store; in { options = { - ctucxConfig.password-store = { + ctucxConfig.programs.password-store = { enable = lib.mkEnableOption "passwordStore"; }; };
diff --git a/configurations/common/programs/phockup.nix b/configurations/common/programs/phockup.nix @@ -1,12 +1,12 @@ { config, pkgs, lib, ... }: let - cfg = config.ctucxConfig.phockup; + cfg = config.ctucxConfig.programs.phockup; in { options = { - ctucxConfig.phockup = { + ctucxConfig.programs.phockup = { enable = lib.mkEnableOption "phockup"; }; };
diff --git a/configurations/common/programs/shellUtilities.nix b/configurations/common/programs/shellUtilities.nix @@ -1,12 +1,12 @@ { config, inputs, currentSystem, pkgs, lib, ... }: let - cfg = config.ctucxConfig.shellUtilities; + cfg = config.ctucxConfig.programs.shellUtilities; in { options = { - ctucxConfig.shellUtilities = { + ctucxConfig.programs.shellUtilities = { enable = lib.mkEnableOption "basic shell utilities"; }; };
diff --git a/configurations/common/programs/ssh.nix b/configurations/common/programs/ssh.nix @@ -1,12 +1,12 @@ { config, lib, ... }: let - cfg = config.ctucxConfig.ssh; + cfg = config.ctucxConfig.programs.ssh; in { options = { - ctucxConfig.ssh = { + ctucxConfig.programs.ssh = { enable = lib.mkEnableOption "ssh"; }; };
diff --git a/configurations/common/programs/starship.nix b/configurations/common/programs/starship.nix @@ -1,12 +1,12 @@ { config, lib, ... }: let - cfg = config.ctucxConfig.starship; + cfg = config.ctucxConfig.programs.starship; in { options = { - ctucxConfig.starship = { + ctucxConfig.programs.starship = { enable = lib.mkEnableOption "starship"; }; };
diff --git a/configurations/common/programs/texlive.nix b/configurations/common/programs/texlive.nix @@ -1,12 +1,12 @@ { config, pkgs, lib, ... }: let - cfg = config.ctucxConfig.texlive; + cfg = config.ctucxConfig.programs.texlive; in { options = { - ctucxConfig.texlive = { + ctucxConfig.programs.texlive = { enable = lib.mkEnableOption "texlive full"; }; };
diff --git a/configurations/common/programs/tmux.nix b/configurations/common/programs/tmux.nix @@ -1,12 +1,12 @@ { config, lib, ... }: let - cfg = config.ctucxConfig.tmux; + cfg = config.ctucxConfig.programs.tmux; in { options = { - ctucxConfig.tmux = { + ctucxConfig.programs.tmux = { enable = lib.mkEnableOption "tmux"; }; };
diff --git a/configurations/common/programs/yt-dlp.nix b/configurations/common/programs/yt-dlp.nix @@ -1,12 +1,12 @@ { config, pkgs, lib, ... }: let - cfg = config.ctucxConfig.yt-dlp; + cfg = config.ctucxConfig.programs.yt-dlp; in { options = { - ctucxConfig.yt-dlp = { + ctucxConfig.programs.yt-dlp = { enable = lib.mkEnableOption "yt-dlp"; }; };
diff --git a/configurations/darwin/default.nix b/configurations/darwin/default.nix @@ -20,7 +20,7 @@ ./programs ]; - ctucxConfig = { + ctucxConfig.programs = { password-store.enable = true; texlive.enable = true; yt-dlp.enable = true;
diff --git a/machines/briefkasten/configuration.nix b/machines/briefkasten/configuration.nix @@ -187,8 +187,8 @@ }; ctucxConfig = { - yt-dlp.enable = true; - ocrmypdf.enable = true; + programs.yt-dlp.enable = true; + programs.ocrmypdf.enable = true; }; system.stateVersion = "22.11"; # Did you read the comment?
diff --git a/machines/briefkasten/syncthing.nix b/machines/briefkasten/syncthing.nix @@ -17,7 +17,7 @@ let in { - ctucxConfig.syncthing.enable = true; + ctucxConfig.services.syncthing.enable = true; age.secrets = lib.mapAttrs' ( name: path: lib.nameValuePair "restic-syncthing-${name}" {