diff --git a/modules/home/discord/default.nix b/modules/home/discord/default.nix index f9892df..bfa5d40 100644 --- a/modules/home/discord/default.nix +++ b/modules/home/discord/default.nix @@ -1,6 +1,8 @@ { config, lib, pkgs, ... }: let cfg = config.my.home.discord; + + jsonFormat = pkgs.formats.json { }; in { options.my.home.discord = with lib; { @@ -10,15 +12,14 @@ in }; config = lib.mkIf cfg.enable { - programs.discord = { - enable = true; + home.packages = with pkgs; [ + cfg.package + ]; - inherit (cfg) package; - - settings = { + xdg.configFile."discord/settings.json".source = + jsonFormat.generate "discord.json" { # Do not keep me from using the app just to force an update SKIP_HOST_UPDATE = true; }; - }; }; } diff --git a/pkgs/diff-flake/diff-flake b/pkgs/diff-flake/diff-flake index f9290b9..a2a3513 100755 --- a/pkgs/diff-flake/diff-flake +++ b/pkgs/diff-flake/diff-flake @@ -24,15 +24,11 @@ current_system() { nix eval --raw --impure --expr 'builtins.currentSystem' } -add_darwin() { - FLAKE_OUTPUTS+=("darwinConfigurations.\"$1\".config.system.build.toplevel") -} - add_home() { FLAKE_OUTPUTS+=("homeConfigurations.\"$1\".activationPackage") } -add_nixos() { +add_host() { FLAKE_OUTPUTS+=("nixosConfigurations.\"$1\".config.system.build.toplevel") } @@ -41,10 +37,6 @@ add_shell() { FLAKE_OUTPUTS+=("devShells.\"$(current_system)\".\"$1\".inputDerivation") } -add_system() { - FLAKE_OUTPUTS+=("systemConfigs.\"$1\".config.system.build.toplevel") -} - usage() { print_err "Usage: $0 [option]... [-- [nix build option]...]" print_err "" @@ -62,15 +54,11 @@ usage() { print_err " -p, --previous-rev" print_err " which git revision should be considered the 'previous' state," print_err " defaults to HEAD~" - print_err " --darwin [name]" - print_err " specify the name of a nix-darwin output configuration whose" - print_err " closure should be diffed, can be used multiple times" - print_err " if no host name is given, defaults to current hostname" print_err " --home [name]" print_err " specify the name of a home-manager output configuration whose" print_err " closure should be diffed, can be used multiple times" print_err " if no configuration name is given, defaults to current username" - print_err " --nixos [name]" + print_err " --host [name]" print_err " specify the name of a NixOS output configuration whose" print_err " closure should be diffed, can be used multiple times" print_err " if no host name is given, defaults to current hostname" @@ -78,10 +66,6 @@ usage() { print_err " specify a specific devShell configuration name whose closure" print_err " should be diffed, can be used multiple times" print_err " if no name is given, defaults to 'default'" - print_err " --system [name]" - print_err " specify the name of a system-manager output configuration whose" - print_err " closure should be diffed, can be used multiple times" - print_err " if no host name is given, defaults to current hostname" print_err "" print_err "when no flake outputs are specified, automatically queries for" print_err "all NixOS configurations, and devShells for current system" @@ -117,14 +101,6 @@ parse_args() { PREVIOUS_REV="$(git rev-parse "$1")" shift ;; - --darwin) - if [ $# -gt 0 ] && ! is_option "$1"; then - add_darwin "$1" - shift - else - add_darwin "$(hostname)" - fi - ;; --home) if [ $# -gt 0 ] && ! is_option "$1"; then add_home "$1" @@ -133,12 +109,12 @@ parse_args() { add_home "$USER" fi ;; - --nixos) + --host) if [ $# -gt 0 ] && ! is_option "$1"; then - add_nixos "$1" + add_host "$1" shift else - add_nixos "$(hostname)" + add_host "$(hostname)" fi ;; --shell) @@ -149,14 +125,6 @@ parse_args() { add_shell "default" fi ;; - --system) - if [ $# -gt 0 ] && ! is_option "$1"; then - add_system "$1" - shift - else - add_system "$(hostname)" - fi - ;; --) NIX_BUILD_ARGS=("$@") break @@ -170,12 +138,6 @@ parse_args() { done } -list_darwin_configurations() { - nix eval '.#darwinConfigurations' \ - --apply 'attrs: with builtins; concatStringsSep "\n" (attrNames attrs)' \ - --raw -} - list_home_configurations() { nix eval '.#homeConfigurations' \ --apply 'attrs: with builtins; concatStringsSep "\n" (attrNames attrs)' \ @@ -194,12 +156,6 @@ list_dev_shells() { --raw } -list_system_configurations() { - nix eval '.#systemConfigs' \ - --apply 'attrs: with builtins; concatStringsSep "\n" (attrNames attrs)' \ - --raw -} - diff_output() { local PREV NEW PREV="$(mktemp --dry-run)" @@ -219,21 +175,15 @@ diff_output() { parse_args "$@" if [ "${#FLAKE_OUTPUTS[@]}" -eq 0 ]; then - for darwin in $(list_darwin_configurations); do - add_darwin "$darwin" - done for home in $(list_home_configurations); do add_home "$home" done - for nixos in $(list_nixos_configurations); do - add_nixos "$nixos" + for host in $(list_nixos_configurations); do + add_host "$host" done for shell in $(list_dev_shells); do add_shell "$shell" done - for system in $(list_system_configurations); do - add_system "$system" - done fi for out in "${FLAKE_OUTPUTS[@]}"; do