From 331c1b5d81567af8db59cadc762076bb1088c82b Mon Sep 17 00:00:00 2001 From: Kristian Krsnik Date: Mon, 25 Sep 2023 01:29:53 +0200 Subject: [PATCH] removed unneeded 'config' --- common/bash.nix | 2 +- common/direnv.nix | 2 +- common/firefox.nix | 2 +- common/fonts.nix | 10 ++- common/git.nix | 4 +- common/gnome.nix | 158 ++++++++++++++++++++--------------------- common/gpg.nix | 43 ++++++----- common/mpv.nix | 2 +- common/packages.nix | 4 +- common/thunderbird.nix | 2 +- common/vscode.nix | 2 +- laptop/default.nix | 6 +- pc/default.nix | 6 +- 13 files changed, 120 insertions(+), 123 deletions(-) diff --git a/common/bash.nix b/common/bash.nix index 2e1355a..7759a80 100644 --- a/common/bash.nix +++ b/common/bash.nix @@ -1,5 +1,5 @@ {...}: { - config.programs.bash = { + programs.bash = { enable = true; initExtra = '' diff --git a/common/direnv.nix b/common/direnv.nix index 186d69e..174527a 100644 --- a/common/direnv.nix +++ b/common/direnv.nix @@ -1,5 +1,5 @@ {...}: { - config.programs.direnv = { + programs.direnv = { enable = true; nix-direnv.enable = true; diff --git a/common/firefox.nix b/common/firefox.nix index 6b36fb7..45e74d0 100644 --- a/common/firefox.nix +++ b/common/firefox.nix @@ -1,5 +1,5 @@ {config, ...}: { - config.programs.firefox = { + programs.firefox = { enable = true; profiles.kristian = { diff --git a/common/fonts.nix b/common/fonts.nix index 31b820d..7c32aaa 100644 --- a/common/fonts.nix +++ b/common/fonts.nix @@ -1,9 +1,7 @@ {pkgs, ...}: { - config = { - fonts.fontconfig.enable = true; + fonts.fontconfig.enable = true; - home.packages = with pkgs; [ - nerdfonts - ]; - }; + home.packages = with pkgs; [ + nerdfonts + ]; } diff --git a/common/git.nix b/common/git.nix index d1007fb..e490a47 100644 --- a/common/git.nix +++ b/common/git.nix @@ -1,13 +1,15 @@ {...}: { - config.programs.git = rec { + programs.git = rec { enable = true; userName = "Kristian Krsnik"; userEmail = "git@krsnik.at"; + signing = { key = userEmail; signByDefault = true; }; + extraConfig = { init.defaultBranch = "main"; }; diff --git a/common/gnome.nix b/common/gnome.nix index 926feab..7212a08 100644 --- a/common/gnome.nix +++ b/common/gnome.nix @@ -3,99 +3,97 @@ wallpaper, ... }: { - config = { - home.packages = with pkgs.gnomeExtensions; [ - quick-settings-audio-panel - tray-icons-reloaded - espresso - pano - ]; + home.packages = with pkgs.gnomeExtensions; [ + quick-settings-audio-panel + tray-icons-reloaded + espresso + pano + ]; - dconf.settings = { - # Use `dconf watch /` to track stateful changes you are doing, then set them here. - "org/gnome/shell" = { - disable-user-extensions = false; - enabled-extensions = [ - "quick-settings-audio-panel@rayzeq.github.io" - "places-menu@gnome-shell-extensions.gcampax.github.com" - "launch-new-instance@gnome-shell-extensions.gcampax.github.com" - "trayIconsReloaded@selfmade.pl" - "espresso@coadmunkee.github.com" - "pano@elhan.io" - ]; - }; + dconf.settings = { + # Use `dconf watch /` to track stateful changes you are doing, then set them here. + "org/gnome/shell" = { + disable-user-extensions = false; + enabled-extensions = [ + "quick-settings-audio-panel@rayzeq.github.io" + "places-menu@gnome-shell-extensions.gcampax.github.com" + "launch-new-instance@gnome-shell-extensions.gcampax.github.com" + "trayIconsReloaded@selfmade.pl" + "espresso@coadmunkee.github.com" + "pano@elhan.io" + ]; + }; - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - gtk-theme = "Adwaita-dark"; - }; + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + gtk-theme = "Adwaita-dark"; + }; - "org/gnome/desktop/background" = let - width = 3840; - height = 2160; - in { - picture-uri = "file://${wallpaper.override { - preset = "nord-snow-aurora"; - inherit width; - inherit height; - }}/share/wallpapers/nixos-wallpaper.png"; + "org/gnome/desktop/background" = let + width = 3840; + height = 2160; + in { + picture-uri = "file://${wallpaper.override { + preset = "nord-snow-aurora"; + inherit width; + inherit height; + }}/share/wallpapers/nixos-wallpaper.png"; - picture-uri-dark = "file://${wallpaper.override { - preset = "nord-night-aurora"; - inherit width; - inherit height; - }}/share/wallpapers/nixos-wallpaper.png"; - }; + picture-uri-dark = "file://${wallpaper.override { + preset = "nord-night-aurora"; + inherit width; + inherit height; + }}/share/wallpapers/nixos-wallpaper.png"; + }; - "org/gnome/desktop/wm/keybindings" = { - switch-to-workspace-left = ["1"]; - switch-to-workspace-right = ["2"]; - move-to-workspace-left = ["1"]; - move-to-workspace-right = ["2"]; - }; + "org/gnome/desktop/wm/keybindings" = { + switch-to-workspace-left = ["1"]; + switch-to-workspace-right = ["2"]; + move-to-workspace-left = ["1"]; + move-to-workspace-right = ["2"]; + }; - "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { - binding = "a"; - command = "kgx"; - name = "Console"; - }; + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { + binding = "a"; + command = "kgx"; + name = "Console"; + }; - "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = { - binding = "f"; - command = "nautilus"; - name = "File Manager"; - }; + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = { + binding = "f"; + command = "nautilus"; + name = "File Manager"; + }; - "org/gnome/settings-daemon/plugins/media-keys" = { - custom-keybindings = [ - "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" - "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/" - ]; - }; + "org/gnome/settings-daemon/plugins/media-keys" = { + custom-keybindings = [ + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/" + ]; + }; - "org/gnome/mutter" = { - edge-tiling = true; - dynamic-workspaces = true; - }; + "org/gnome/mutter" = { + edge-tiling = true; + dynamic-workspaces = true; + }; - "org/gnome/Console" = { - theme = "auto"; - }; + "org/gnome/Console" = { + theme = "auto"; + }; - "org/gnome/simple-scan" = { - text-dpi = 300; - }; + "org/gnome/simple-scan" = { + text-dpi = 300; + }; - "org/gnome/shell/extensions/pano" = { - play-audio-on-copy = false; - # This solves the stuttering issue for me. - # https://github.com/oae/gnome-shell-pano/issues/79 - send-notification-on-copy = false; - }; + "org/gnome/shell/extensions/pano" = { + play-audio-on-copy = false; + # This solves the stuttering issue for me. + # https://github.com/oae/gnome-shell-pano/issues/79 + send-notification-on-copy = false; + }; - "org/gnome/shell/extensions/espresso" = { - show-notifications = false; - }; + "org/gnome/shell/extensions/espresso" = { + show-notifications = false; }; }; } diff --git a/common/gpg.nix b/common/gpg.nix index 8abdc58..a825ebc 100644 --- a/common/gpg.nix +++ b/common/gpg.nix @@ -1,29 +1,28 @@ {...}: { - config = { - programs.gpg.enable = true; - services.gpg-agent = { - enable = true; + programs.gpg.enable = true; - enableSshSupport = true; - sshKeys = ["A0B5D579ECACC45C51B2B38E317D346182083CD8"]; + services.gpg-agent = { + enable = true; - # The amount of time a key is kept in the cache before it is removed. - # The timer is reset after each use within that window. - defaultCacheTtl = 86400; # 1 Day - defaultCacheTtlSsh = 86400; # 1 Day + enableSshSupport = true; + sshKeys = ["A0B5D579ECACC45C51B2B38E317D346182083CD8"]; - # The maximum amount after which the passphrase has to be retyped, - # even if the key is still cached. - maxCacheTtl = 86400; # 1 Day - maxCacheTtlSsh = 86400; # 1 Day - }; + # The amount of time a key is kept in the cache before it is removed. + # The timer is reset after each use within that window. + defaultCacheTtl = 86400; # 1 Day + defaultCacheTtlSsh = 86400; # 1 Day - # Disable gnome-keyring-ssh for gpg-agent to work - # https://github.com/NixOS/nixpkgs/issues/101616 - xdg.configFile."autostart/gnome-keyring-ssh.desktop".text = '' - [Desktop Entry] - Type=Application - Hidden=true - ''; + # The maximum amount after which the passphrase has to be retyped, + # even if the key is still cached. + maxCacheTtl = 86400; # 1 Day + maxCacheTtlSsh = 86400; # 1 Day }; + + # Disable gnome-keyring-ssh for gpg-agent to work + # https://github.com/NixOS/nixpkgs/issues/101616 + xdg.configFile."autostart/gnome-keyring-ssh.desktop".text = '' + [Desktop Entry] + Type=Application + Hidden=true + ''; } diff --git a/common/mpv.nix b/common/mpv.nix index 451e82a..65cb7af 100644 --- a/common/mpv.nix +++ b/common/mpv.nix @@ -1,5 +1,5 @@ {...}: { - config.programs.mpv = { + programs.mpv = { enable = true; bindings = let volume-step = "5"; diff --git a/common/packages.nix b/common/packages.nix index 448b05a..23eebc5 100644 --- a/common/packages.nix +++ b/common/packages.nix @@ -3,7 +3,7 @@ lib, ... }: { - config.nixpkgs.config = { + nixpkgs.config = { allowUnfree = false; allowUnfreePredicate = pkg: @@ -15,7 +15,7 @@ ]; }; - config.home.packages = with pkgs; [ + home.packages = with pkgs; [ # Basic utils unzip magic-wormhole diff --git a/common/thunderbird.nix b/common/thunderbird.nix index 7e900be..5c17097 100644 --- a/common/thunderbird.nix +++ b/common/thunderbird.nix @@ -1,5 +1,5 @@ {...}: { - config.programs.thunderbird = { + programs.thunderbird = { enable = true; profiles.kristian = { diff --git a/common/vscode.nix b/common/vscode.nix index e760f43..5471a2e 100644 --- a/common/vscode.nix +++ b/common/vscode.nix @@ -1,5 +1,5 @@ {pkgs, ...}: { - config.programs.vscode = { + programs.vscode = { enable = true; enableUpdateCheck = false; diff --git a/laptop/default.nix b/laptop/default.nix index 6d956cf..26ce054 100644 --- a/laptop/default.nix +++ b/laptop/default.nix @@ -1,11 +1,11 @@ {...}: { - config.targets.genericLinux.enable = false; + targets.genericLinux.enable = false; - config.programs.bash.shellAliases = { + programs.bash.shellAliases = { hms = "home-manager switch --flake $HOME/.config/home-manager#laptop"; }; - config.dconf.settings = { + dconf.settings = { "org/gnome/settings-daemon/plugins/power" = { sleep-inactive-ac-type = "suspend"; power-button-action = "hibernate"; diff --git a/pc/default.nix b/pc/default.nix index 7df1845..e2e4504 100644 --- a/pc/default.nix +++ b/pc/default.nix @@ -1,11 +1,11 @@ {...}: { - config.targets.genericLinux.enable = false; + targets.genericLinux.enable = false; - config.programs.bash.shellAliases = { + programs.bash.shellAliases = { hms = "home-manager switch --flake $HOME/.config/home-manager#pc"; }; - config.dconf.settings = { + dconf.settings = { "org/gnome/settings-daemon/plugins/power" = { sleep-inactive-ac-type = "nothing"; # Automatic suspend/hibernation creates a suspend/hibernation loop power-button-action = "suspend";