refactor: move scripts into nixpkgs via packageOverrides

This commit is contained in:
Nydragon 2024-06-30 16:34:47 +02:00
parent f586de1cb1
commit f3c7e2b6c4
No known key found for this signature in database
GPG key ID: 14AA30A865EA1209
11 changed files with 117 additions and 114 deletions

View file

@ -20,8 +20,16 @@
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
config.allowUnfree = true;
overlays = [ overlays.calibre ]; overlays = [ overlays.calibre ];
config = {
allowUnfree = true;
packageOverrides = pkgs: {
custom = {
scripts = import ./home/scripts { inherit pkgs; };
};
};
};
}; };
lib = nixpkgs.lib; lib = nixpkgs.lib;

View file

@ -1,8 +1,2 @@
# This file contains default settings used across different systems # This file contains default settings used across different systems
{ { }
programs.nix-index = {
enable = true;
enableFishIntegration = true;
enableBashIntegration = true;
};
}

View file

@ -12,6 +12,7 @@
sd = ''cd "$(dirname "$HOME/$(env --chdir ~ fzf)")"''; sd = ''cd "$(dirname "$HOME/$(env --chdir ~ fzf)")"'';
mkdir = "mkdir --parent"; mkdir = "mkdir --parent";
cp = "cp -i"; cp = "cp -i";
mv = "mv -i";
}; };
functions = functions =
let let

View file

@ -19,7 +19,6 @@
# Formatter # Formatter
python311Packages.black # Python formatter python311Packages.black # Python formatter
#rPackages.styler # R formatter
clang-tools clang-tools
nodePackages_latest.prettier # JSON, JS, TS formatter nodePackages_latest.prettier # JSON, JS, TS formatter
yamlfmt # YAML formatter yamlfmt # YAML formatter
@ -27,6 +26,7 @@
rustfmt # Rust formatter rustfmt # Rust formatter
shfmt # Shell, Bash etc. shfmt # Shell, Bash etc.
nixfmt-rfc-style nixfmt-rfc-style
stylua # lua formatter
# Misc # Misc
ripgrep ripgrep

View file

@ -15,9 +15,6 @@
wayland.windowManager.sway = wayland.windowManager.sway =
let let
screenshot = (import ../scripts { inherit pkgs; }).screenshot;
set-background = (import ../scripts { inherit pkgs; }).set-background;
homeDirectory = config.home.homeDirectory; homeDirectory = config.home.homeDirectory;
term = "${pkgs.alacritty}/bin/alacritty"; term = "${pkgs.alacritty}/bin/alacritty";
filemanager = "${pkgs.gnome.nautilus}/bin/nautilus"; filemanager = "${pkgs.gnome.nautilus}/bin/nautilus";
@ -93,8 +90,8 @@
"--locked XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; "--locked XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"--locked XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next"; "--locked XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
"--locked XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous"; "--locked XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
"Print" = "exec ${screenshot}/bin/screenshot"; "Print" = "exec ${pkgs.custom.scripts.screenshot}/bin/screenshot";
"${mod}+u" = "exec ${screenshot}/bin/screenshot"; "${mod}+u" = "exec ${pkgs.custom.scripts.screenshot}/bin/screenshot";
#: Workspace movement {{{ #: Workspace movement {{{
"--input-device=${inputs.kb.builtin} ${mod}+ampersand" = "workspace number 1"; "--input-device=${inputs.kb.builtin} ${mod}+ampersand" = "workspace number 1";
"--input-device=${inputs.kb.builtin} ${mod}+eacute" = "workspace number 2"; "--input-device=${inputs.kb.builtin} ${mod}+eacute" = "workspace number 2";
@ -127,7 +124,7 @@
{ command = "${pkgs.kdeconnect}/bin/kdeconnect-indicator"; } { command = "${pkgs.kdeconnect}/bin/kdeconnect-indicator"; }
{ command = "${pkgs.protonmail-bridge-gui}/bin/protonmail-bridge-gui --no-window"; } { command = "${pkgs.protonmail-bridge-gui}/bin/protonmail-bridge-gui --no-window"; }
{ {
command = "${set-background}/bin/set-background -f ${wallpaper}"; command = "${pkgs.custom.scripts.set-background}/bin/set-background -f ${wallpaper}";
always = true; always = true;
} }
{ {

View file

@ -13,6 +13,7 @@
../../modules ../../modules
./home.nix ./home.nix
]; ];
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;

View file

@ -33,10 +33,7 @@
stateVersion = config.system.stateVersion; stateVersion = config.system.stateVersion;
inherit username; inherit username;
packages = packages = with pkgs; [
let
scripts = import ../../home/scripts/list.nix { inherit pkgs; };
programs = with pkgs; [
keepassxc keepassxc
kdeconnect kdeconnect
nextcloud-client nextcloud-client
@ -59,6 +56,7 @@
signal-desktop signal-desktop
calibre calibre
alacritty alacritty
tagger
# proprietary # proprietary
obsidian obsidian
@ -76,9 +74,8 @@
fd fd
ripgrep ripgrep
custom.scripts.nixedit
]; ];
in
programs ++ scripts;
}; };
}; };
} }

View file

@ -38,9 +38,7 @@
stateVersion = config.system.stateVersion; stateVersion = config.system.stateVersion;
inherit username; inherit username;
packages = packages = with pkgs; [
let
pk = with pkgs; [
digikam digikam
fragments fragments
element-desktop element-desktop
@ -76,14 +74,10 @@
fd fd
ripgrep ripgrep
swaybg swaybg
custom.scripts.screenshot
custom.scripts.set-background
]; ];
scripts = with import ../../home/scripts { inherit pkgs; }; [
screenshot
set-background
nixedit
];
in
scripts ++ pk;
}; };
}; };
} }

View file

@ -1,7 +1,9 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
fonts = with pkgs; { fonts = {
packages = [ enableDefaultPackages = true;
fontDir.enable = true;
packages = with pkgs; [
(nerdfonts.override { fonts = [ "Noto" ]; }) (nerdfonts.override { fonts = [ "Noto" ]; })
d2coding d2coding
jigmo jigmo

View file

@ -1,5 +1,6 @@
{ {
home-manager = { home-manager = {
backupFileExtension = "backup"; backupFileExtension = "backup";
useGlobalPkgs = true;
}; };
} }

View file

@ -29,16 +29,24 @@ lib.mkIf config.programs.firefox.enable {
AutofillCreditCardEnabled = false; AutofillCreditCardEnabled = false;
AutofillAddressEnabled = false; AutofillAddressEnabled = false;
# Check about:support for extension/add-on ID strings. # Check about:support for extension/add-on ID strings.
ExtensionSettings = { # WARNING: Does not seem to install extension, i.e useless
"uBlock0@raymondhill.net" = { ExtensionSettings =
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; let
installation_mode = "normal_install"; extension = shortId: uuid: {
}; name = uuid;
"firefox-translations-addon@mozilla.org" = { value = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/firefox-translations/latest.xpi"; install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi";
installation_mode = "normal_install"; installation_mode = "force_installed";
}; };
}; };
in
builtins.listToAttrs [
(extension "ublock-origin" "uBlock0@raymondhill.net")
(extension "firefox-translations" "firefox-translations-addon@mozilla.org")
(extension "private-relay" "private-relay@firefox.com")
(extension "decentraleyes" "jid1-BoFifL9Vbdl2zQ@jetpack")
(extension "duckduckgo-for-firefox" "ddg@search.mozilla.org")
];
FirefoxHome = { FirefoxHome = {
Search = true; Search = true;
TopSites = false; TopSites = false;